put javascript into separate file

This commit is contained in:
Uwe Steinmann 2016-01-28 13:37:16 +01:00
parent 3bc3739213
commit e7a6ebb8ce
2 changed files with 11 additions and 10 deletions

View File

@ -33,7 +33,7 @@ if(!trim($settings->_encryptionKey))
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'settings'=>$settings, 'currenttab'=>(isset($_GET['currenttab']) ? $_GET['currenttab'] : '')));
if($view) {
$view->show();
$view($_GET);
exit;
}

View File

@ -49,6 +49,16 @@ class SeedDMS_View_Settings extends SeedDMS_Bootstrap_Style {
}
} /* }}} */
function js() { /* {{{ */
?>
$(document).ready( function() {
$('#settingstab li a').click(function(event) {
$('#currenttab').val($(event.currentTarget).data('target').substring(1));
});
});
<?php
} /* }}} */
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
@ -62,15 +72,6 @@ class SeedDMS_View_Settings extends SeedDMS_Bootstrap_Style {
$this->contentHeading(getMLText("settings"));
?>
<script language="JavaScript">
$(document).ready( function() {
$('#settingstab li a').click(function(event) {
$('#currenttab').val($(event.currentTarget).data('target').substring(1));
});
});
</script>
<form action="../op/op.Settings.php" method="post" enctype="multipart/form-data" name="form0" >
<input type="hidden" name="action" value="saveSettings" />
<input type="hidden" id="currenttab" name="currenttab" value="<?php echo (isset($_POST['currenttab']) ? $_POST['currenttab'] : 'site' ); ?>" />