mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 10:22:18 +00:00
This commit is contained in:
+29
-20
@@ -27,8 +27,15 @@ require_once('../include/sprache.class.php');
|
||||
require_once('../include/gruppe.class.php');
|
||||
require_once('../include/xsdformprinter/xsdformprinter.php');
|
||||
require_once('../include/organisationseinheit.class.php');
|
||||
require_once('../include/benutzerberechtigung.class.php');
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(!$rechte->isBerechtigt('basis/cms'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
@@ -49,19 +56,33 @@ $user = get_uid();
|
||||
{
|
||||
mode : "textareas",
|
||||
theme : "advanced",
|
||||
file_browser_callback: "FHCFileBrowser"
|
||||
file_browser_callback: "FHCFileBrowser",
|
||||
|
||||
plugins : "spellchecker,pagebreak,style,layer,table,advhr,advimage,advlink,inlinepopups,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras",
|
||||
|
||||
// Theme options
|
||||
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontsizeselect",
|
||||
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,|,forecolor,backcolor",
|
||||
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,|,print,|,ltr,rtl,|,fullscreen",
|
||||
//theme_advanced_buttons4 : "insertfile,insertimage",
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "center",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
theme_advanced_resizing : true,
|
||||
|
||||
}
|
||||
);
|
||||
function FHCFileBrowser(field_name, url, type, win)
|
||||
{
|
||||
cmsURL = "<?php echo APP_ROOT;?>cms/tinymce_dms.php?type"+type;
|
||||
cmsURL = "<?php echo APP_ROOT;?>cms/tinymce_dms.php?type="+type;
|
||||
tinyMCE.activeEditor.windowManager.open({
|
||||
file: cmsURL,
|
||||
title : "FHComplete File Browser",
|
||||
width: 420,
|
||||
heigth: 400,
|
||||
width: 550,
|
||||
height: 550,
|
||||
resizable: "yes",
|
||||
close_previous: "no",
|
||||
scrollbars: "yes",
|
||||
popup_css : false
|
||||
},{
|
||||
window: win,
|
||||
@@ -70,20 +91,6 @@ $user = get_uid();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
ul
|
||||
{
|
||||
padding-left: 20px;
|
||||
}
|
||||
li
|
||||
{
|
||||
padding-left: 0px;
|
||||
}
|
||||
.marked
|
||||
{
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -169,12 +176,14 @@ if(isset($_GET['method']))
|
||||
$titel = $_POST['titel'];
|
||||
$oe_kurzbz=$_POST['oe_kurzbz'];
|
||||
$sichtbar=isset($_POST['sichtbar']);
|
||||
$template_kurzbz = $_POST['template_kurzbz'];
|
||||
|
||||
if($content->getContent($content_id, $sprache, $version))
|
||||
{
|
||||
$content->titel = $titel;
|
||||
$content->oe_kurzbz = $oe_kurzbz;
|
||||
$content->sichtbar = $sichtbar;
|
||||
$content->template_kurzbz = $template_kurzbz;
|
||||
$content->updateamum=date('Y-m-d H:i:s');
|
||||
$content->updatevon=$user;
|
||||
|
||||
@@ -337,7 +346,7 @@ function print_childs()
|
||||
$content = new content();
|
||||
$content->getChilds($content_id);
|
||||
|
||||
echo 'Die Mitglieder der folgenden Gruppen dürfen die Seite ansehen:<br><br>';
|
||||
echo 'Folgende Einträge sind diesem Untergeordnet:<br><br>';
|
||||
echo '
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
@@ -527,7 +536,7 @@ function print_content()
|
||||
$template = new template();
|
||||
$template->load($content->template_kurzbz);
|
||||
|
||||
$xfp = new XSDFormPrinter\XSDFormPrinter();
|
||||
$xfp = new XSDFormPrinter();
|
||||
$xfp->getparams='?content_id='.$content_id.'&sprache='.$sprache.'&version='.$version.'&action=content';
|
||||
$xfp->output($template->xsd,$content->content);
|
||||
echo '</div>';
|
||||
|
||||
+151
-17
@@ -20,6 +20,7 @@
|
||||
* Karl Burkhart <karl.burkhart@technikum-wien.at>.
|
||||
*/
|
||||
require_once('../config/cis.config.inc.php');
|
||||
require_once('../include/functions.inc.php');
|
||||
require_once('../include/dms.class.php');
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
@@ -27,7 +28,9 @@ require_once('../include/dms.class.php');
|
||||
<head>
|
||||
<title>FHComplete Document Management System</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link rel="stylesheet" href="../skin/fhcomplete.css" type="text/css">
|
||||
<link rel="stylesheet" href="../skin/style.css.php" type="text/css">
|
||||
<script type="text/javascript" src="../include/js/jquery.js"></script>
|
||||
<script type="text/javascript" src="../include/tiny_mce/tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript">
|
||||
var FileBrowserDialog={
|
||||
@@ -55,46 +58,177 @@ require_once('../include/dms.class.php');
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCEPopup.onInit.add(FileBrowserDialog.init, FileBrowserDialog);
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#divupload').hide();
|
||||
});
|
||||
|
||||
function upload(id, name)
|
||||
{
|
||||
$('#divupload').show();
|
||||
|
||||
if(typeof(id)!='undefined')
|
||||
{
|
||||
$('#dms_id').val(id);
|
||||
$('#ueberschrift').html('Neue Version von '+name);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#dms_id').val('');
|
||||
$('#ueberschrift').html('Neue Datei:');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
$kategorie_kurzbz = isset($_GET['kategorie_kurzbz'])?$_GET['kategorie_kurzbz']:'';
|
||||
$user = get_uid();
|
||||
$kategorie_kurzbz = isset($_REQUEST['kategorie_kurzbz'])?$_REQUEST['kategorie_kurzbz']:'';
|
||||
$mimetypes = array(
|
||||
'application/pdf'=>'pdf.ico',
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'=>'word2007.jpg',
|
||||
'application/vnd.openxmlformats-officedocument.presentationml.presentation'=>'x-office-presentation.png',
|
||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'=>'excel.gif',
|
||||
'application/vnd.oasis.opendocument.text'=>'openoffice0.jpg',
|
||||
'application/msword'=>'dotpic.gif',
|
||||
'application/zip'=>'zippic.jpg',
|
||||
|
||||
);
|
||||
|
||||
|
||||
if(isset($_POST['fileupload']))
|
||||
{
|
||||
$dms_id = $_POST['dms_id'];
|
||||
|
||||
$filename = uniqid();
|
||||
$uploadfile = DMS_PATH.$filename;
|
||||
|
||||
if(move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile))
|
||||
{
|
||||
$dms = new dms();
|
||||
|
||||
if($dms_id!='')
|
||||
{
|
||||
if(!$dms->load($dms_id))
|
||||
{
|
||||
die($dms->errormsg);
|
||||
}
|
||||
$dms->version=$dms->version+1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$dms->version='0';
|
||||
}
|
||||
|
||||
$dms->insertamum=date('Y-m-d H:i:s');
|
||||
$dms->insertvon = $user;
|
||||
$dms->mimetype=$_FILES['userfile']['type'];
|
||||
$dms->filename = $filename;
|
||||
$dms->name = $_FILES['userfile']['name'];
|
||||
$dms->kategorie_kurzbz=$kategorie_kurzbz;
|
||||
|
||||
if($dms->save(true))
|
||||
{
|
||||
echo 'File wurde erfolgreich hochgeladen. Filename:'.$filename.' ID:'.$dms->dms_id;
|
||||
$dms_id=$dms->dms_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Fehler beim Speichern der Daten';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Fehler beim Hochladen der Datei';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo '<h1>Dokument Auswählen</h1>
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<td valign="top" nowrap>
|
||||
<b>Kategorie:</b><br>';
|
||||
//Kategorien anzeigen
|
||||
|
||||
$dms = new dms();
|
||||
$dms->getKategorie();
|
||||
foreach($dms->result as $row)
|
||||
{
|
||||
if($kategorie_kurzbz=='')
|
||||
$kategorie_kurzbz=$row->kategorie_kurzbz;
|
||||
echo '<a href="'.$_SERVER['PHP_SELF'].'?kategorie_kurzbz='.$row->kategorie_kurzbz.'">'.$row->bezeichnung.'</a><br>';
|
||||
if($kategorie_kurzbz==$row->kategorie_kurzbz)
|
||||
$class='class="marked"';
|
||||
else
|
||||
$class='';
|
||||
|
||||
echo '
|
||||
<a href="'.$_SERVER['PHP_SELF'].'?kategorie_kurzbz='.$row->kategorie_kurzbz.'" '.$class.'>';
|
||||
echo $row->bezeichnung.'</a><br>';
|
||||
}
|
||||
echo '</td><td valign="top">';
|
||||
echo '
|
||||
</td>
|
||||
<td valign="top">';
|
||||
|
||||
//Dokumente der Ausgewaehlten Kategorie laden und Anzeigen
|
||||
$dms = new dms();
|
||||
$dms->getDocuments($kategorie_kurzbz);
|
||||
$mimetypes=array('application/pdf'=>'pdf.ico',
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'=>'word2007.jpg',
|
||||
'application/vnd.openxmlformats-officedocument.presentationml.presentation'=>'x-office-presentation.png',
|
||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'=>'excel.gif',
|
||||
'application/zip'=>'zippic.jpg');
|
||||
|
||||
echo '
|
||||
<table>
|
||||
<tr>';
|
||||
$anzahl=0;
|
||||
foreach($dms->result as $row)
|
||||
{
|
||||
echo '<div style="border: 1px solid black; text-align: center;">';
|
||||
echo '<a href="#" onclick="FileBrowserDialog.mySubmit('.$row->dms_id.')" style="font-size: small">';
|
||||
if($anzahl>2)
|
||||
{
|
||||
echo "
|
||||
</tr>
|
||||
<tr>";
|
||||
$anzahl=0;
|
||||
}
|
||||
echo '
|
||||
<td>';
|
||||
echo '<a href="id://'.$row->dms_id.'/Auswahl" onclick="FileBrowserDialog.mySubmit('.$row->dms_id.'); return false;" style="font-size: small" title="'.$row->beschreibung.'">';
|
||||
echo '<center>';
|
||||
if(array_key_exists($row->mimetype,$mimetypes))
|
||||
echo '<img src="../skin/images/'.$mimetypes[$row->mimetype].'" style="max-width: 100px">';
|
||||
echo '<img src="../skin/images/'.$mimetypes[$row->mimetype].'" style="height: 15px">';
|
||||
else
|
||||
echo '<img src="dms.php?id='.$row->dms_id.'¬imeupdate" style="max-width: 100px">';
|
||||
echo '<br>'.$row->name.'</a>';
|
||||
echo '</div>';
|
||||
echo '<img src="dms.php?id='.$row->dms_id.'&notimeupdate" style="max-width: 100px">';
|
||||
|
||||
echo '<br>'.$row->name.'</a><br>';
|
||||
|
||||
//Upload einer neuen Version
|
||||
echo '<a href="id://'.$row->dms_id.'/Upload" onclick="return upload(\''.$row->dms_id.'\',\''.$row->name.'\')" style="font-size:small">Upload</a> ';
|
||||
echo '</center></td>';
|
||||
$anzahl++;
|
||||
}
|
||||
echo '</table>';
|
||||
echo '<br><a href="dms_upload.php" target="_blank">Neue Datei hochladen</a>';
|
||||
echo '
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<a href="#Upload" onclick="return upload()">Neue Datei hochladen</a>
|
||||
|
||||
<br><br>
|
||||
|
||||
<div id="divupload">
|
||||
<hr>
|
||||
<span id="ueberschrift"></span>
|
||||
<form action="'.$_SERVER['PHP_SELF'].'" method="POST" enctype="multipart/form-data">
|
||||
<input type="hidden" name="kategorie_kurzbz" id="kategorie_kurzbz" value="'.$kategorie_kurzbz.'">
|
||||
<input type="hidden" name="dms_id" id="dms_id" value="">
|
||||
<input type="file" name="userfile">
|
||||
<input type="submit" name="fileupload" value="Upload">
|
||||
</form>
|
||||
</div>';
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user