place all javascript into external file

This commit is contained in:
Uwe Steinmann 2016-03-16 12:41:17 +01:00
parent 86cdb4e2fa
commit 8a4e558f4b
2 changed files with 42 additions and 29 deletions

View File

@ -46,9 +46,20 @@ if($settings->_quota > 0) {
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'strictformcheck'=>$settings->_strictFormCheck, 'enablelargefileupload'=>$settings->_enableLargeFileUpload, 'enableadminrevapp'=>$settings->_enableAdminRevApp, 'enableownerrevapp'=>$settings->_enableOwnerRevApp, 'enableselfrevapp'=>$settings->_enableSelfRevApp, 'dropfolderdir'=>$settings->_dropFolderDir, 'workflowmode'=>$settings->_workflowMode, 'presetexpiration'=>$settings->_presetExpirationDate, 'sortusersinlist'=>$settings->_sortUsersInList, 'orderby'=>$settings->_sortFoldersDefault));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
if($view) {
$view->show();
$view->setParam('folder', $folder);
$view->setParam('strictformcheck', $settings->_strictFormCheck);
$view->setParam('enablelargefileupload', $settings->_enableLargeFileUpload);
$view->setParam('enableadminrevapp', $settings->_enableAdminRevApp);
$view->setParam('enableownerrevapp', $settings->_enableOwnerRevApp);
$view->setParam('enableselfrevapp', $settings->_enableSelfRevApp);
$view->setParam('dropfolderdir', $settings->_dropFolderDir);
$view->setParam('workflowmode', $settings->_workflowMode);
$view->setParam('presetexpiration', $settings->_presetExpirationDate);
$view->setParam('sortusersinlist', $settings->_sortUsersInList);
$view->setParam('orderby', $settings->_sortFoldersDefault);
$view($_GET);
exit;
}

View File

@ -31,29 +31,9 @@ require_once("class.Bootstrap.php");
*/
class SeedDMS_View_AddDocument extends SeedDMS_Bootstrap_Style {
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$folder = $this->params['folder'];
$enablelargefileupload = $this->params['enablelargefileupload'];
$enableadminrevapp = $this->params['enableadminrevapp'];
$enableownerrevapp = $this->params['enableownerrevapp'];
$enableselfrevapp = $this->params['enableselfrevapp'];
$strictformcheck = $this->params['strictformcheck'];
$dropfolderdir = $this->params['dropfolderdir'];
$workflowmode = $this->params['workflowmode'];
$presetexpiration = $this->params['presetexpiration'];
$sortusersinlist = $this->params['sortusersinlist'];
$orderby = $this->params['orderby'];
$folderid = $folder->getId();
$this->htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
$this->globalNavigation($folder);
$this->contentStart();
$this->pageNavigation($this->getFolderPathHTML($folder, true), "view_folder", $folder);
function js() { /* {{{ */
header('Content-Type: application/javascript; charset=UTF-8');
?>
<script language="JavaScript">
function checkForm()
{
msg = new Array();
@ -89,10 +69,32 @@ $(document).ready(function() {
$("#upload-file").clone().appendTo("#upload-files").removeAttr("id").children('div').children('input').val('');
});
});
</script>
<?php
$this->printKeywordChooserJs("form1");
$this->printDropFolderChooserJs("form1");
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$folder = $this->params['folder'];
$enablelargefileupload = $this->params['enablelargefileupload'];
$enableadminrevapp = $this->params['enableadminrevapp'];
$enableownerrevapp = $this->params['enableownerrevapp'];
$enableselfrevapp = $this->params['enableselfrevapp'];
$strictformcheck = $this->params['strictformcheck'];
$dropfolderdir = $this->params['dropfolderdir'];
$workflowmode = $this->params['workflowmode'];
$presetexpiration = $this->params['presetexpiration'];
$sortusersinlist = $this->params['sortusersinlist'];
$orderby = $this->params['orderby'];
$folderid = $folder->getId();
$this->htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
$this->globalNavigation($folder);
$this->contentStart();
$this->pageNavigation($this->getFolderPathHTML($folder, true), "view_folder", $folder);
$msg = getMLText("max_upload_size").": ".ini_get( "upload_max_filesize");
if($enablelargefileupload) {
$msg .= "<p>".sprintf(getMLText('link_alt_updatedocument'), "out.AddMultiDocument.php?folderid=".$folderid."&showtree=".showtree())."</p>";
@ -125,7 +127,7 @@ $(document).ready(function() {
</tr>
<tr>
<td><?php printMLText("keywords");?>:</td>
<td><?php $this->printKeywordChooser("form1");?></td>
<td><?php $this->printKeywordChooserHtml("form1");?></td>
</tr>
<tr>
<td><?php printMLText("categories")?>:</td>
@ -204,7 +206,7 @@ $(document).ready(function() {
<?php if($dropfolderdir) { ?>
<tr>
<td><?php printMLText("dropfolder_file");?>:</td>
<td><?php $this->printDropFolderChooser("form1");?></td>
<td><?php $this->printDropFolderChooserHtml("form1");?></td>
</tr>
<?php } ?>
<tr>