add new js file webrootjs which contains the http root

This commit is contained in:
Uwe Steinmann 2017-05-17 09:22:05 +02:00
parent 14d861dfda
commit 4eb3b5ed4d

View File

@ -144,6 +144,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
echo '<script src="../styles/'.$this->theme.'/datepicker/js/locales/bootstrap-datepicker.'.$lang.'.js"></script>'."\n";
echo '<script src="../styles/'.$this->theme.'/chosen/js/chosen.jquery.min.js"></script>'."\n";
echo '<script src="../styles/'.$this->theme.'/select2/js/select2.min.js"></script>'."\n";
echo '<script src="'.$this->params['absbaseprefix'].'out/out.'.$this->params['class'].'.php?action=webrootjs"></script>'."\n";
echo '<script src="../styles/'.$this->theme.'/application.js"></script>'."\n";
if(isset($this->params['user']) && $this->params['user']) {
$this->addFooterJS('checkTasks();');
@ -174,6 +175,12 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
echo "</body>\n</html>\n";
} /* }}} */
function webrootjs() { /* {{{ */
header('Content-Type: application/javascript');
echo "var seeddms_absbaseprefix=\"".$this->params['absbaseprefix']."\";\n";
echo "var seeddms_webroot=\"".$this->params['settings']->_httpRoot."\";\n";
} /* }}} */
function footerjs() { /* {{{ */
header('Content-Type: application/javascript');
if(file_exists($this->params['cachedir'].'/js/'.$_GET['hash'].'.js')) {