示例#1
0
 /**
  * Parses the map and the objects for the nagvis-js frontend
  *
  * @return	String 	String with JS Code
  * @author 	Lars Michelsen <*****@*****.**>
  */
 public function parse()
 {
     // Initialize template system
     $TMPL = new FrontendTemplateSystem();
     $TMPLSYS = $TMPL->getTmplSys();
     $aData = array('pageTitle' => cfg('internal', 'title') . $this->sSubtitle, 'htmlBase' => cfg('paths', 'htmlbase'), 'htmlJs' => cfg('paths', 'htmljs'), 'htmlCss' => cfg('paths', 'htmlcss'), 'htmlTemplates' => path('html', 'global', 'templates'), 'bUseCompressedJs' => $this->checkJsCompressed(), 'customStylesheet' => $this->sCustomStylesheet, 'headerMenu' => $this->sHeaderMenu, 'content' => $this->sContent);
     // Build page based on the template file and the data array
     return $TMPLSYS->get($TMPL->getTmplFile(cfg('defaults', 'view_template'), 'index'), $aData);
 }
示例#2
0
 /**
  * Parses the information for json
  *
  * @return	String 	String with Html Code
  * @author 	Lars Michelsen <*****@*****.**>
  */
 public function parse()
 {
     global $_MAINCFG, $CORE;
     // Initialize template system
     $TMPL = new FrontendTemplateSystem();
     $TMPLSYS = $TMPL->getTmplSys();
     $USERCFG = new CoreUserCfg();
     $maps = cfg('index', 'showmaps') == 1 ? $CORE->getListMaps() : array();
     $rotations = cfg('index', 'showrotations') == 1 ? array_keys($CORE->getPermittedRotationPools()) : array();
     $aData = array('generalProperties' => $_MAINCFG->parseGeneralProperties(), 'workerProperties' => $_MAINCFG->parseWorkerProperties(), 'stateProperties' => json_encode($_MAINCFG->getStateWeightJS()), 'userProperties' => $USERCFG->doGetAsJson(), 'pageProperties' => json_encode($this->getProperties()), 'fileAges' => json_encode(array('maincfg' => $_MAINCFG->getConfigFileAge())), 'locales' => json_encode($CORE->getGeneralJSLocales()), 'rotation_names' => json_encode($rotations), 'map_names' => json_encode($maps));
     // Build page based on the template file and the data array
     return $TMPLSYS->get($TMPL->getTmplFile(cfg('defaults', 'view_template'), 'overview'), $aData);
 }
示例#3
0
 /**
  * Parses the map and the objects for the nagvis-js frontend
  *
  * @return	String 	String with JS Code
  * @author 	Lars Michelsen <*****@*****.**>
  */
 public function parse()
 {
     global $_MAINCFG, $CORE;
     // Initialize template system
     $TMPL = new FrontendTemplateSystem();
     $TMPLSYS = $TMPL->getTmplSys();
     $USERCFG = new CoreUserCfg();
     $this->MAPCFG = new GlobalMapCfg($this->name);
     $this->MAPCFG->readMapConfig(ONLY_GLOBAL, true, true, true);
     $aData = array('generalProperties' => $_MAINCFG->parseGeneralProperties(), 'workerProperties' => $_MAINCFG->parseWorkerProperties(), 'rotationProperties' => json_encode($this->aRotation), 'viewProperties' => $this->parseViewProperties(), 'stateProperties' => json_encode($_MAINCFG->getStateWeightJS()), 'pageProperties' => json_encode($this->MAPCFG->getMapProperties()), 'userProperties' => $USERCFG->doGetAsJson(), 'mapName' => $this->name, 'zoomFill' => $this->MAPCFG->getValue(0, 'zoom') == 'fill', 'fileAges' => json_encode(array('maincfg' => $_MAINCFG->getConfigFileAge(), $this->name => $this->MAPCFG->getFileModificationTime())), 'locales' => json_encode($CORE->getGeneralJSLocales()));
     // Build page based on the template file and the data array
     return $TMPLSYS->get($TMPL->getTmplFile(cfg('defaults', 'view_template'), 'map'), $aData);
 }
示例#4
0
 /**
  * Parses the information in html format
  *
  * @return	String 	String with Html Code
  * @author 	Lars Michelsen <*****@*****.**>
  */
 public function parse()
 {
     global $AUTH, $AUTHORISATION;
     // Initialize template system
     $TMPL = new FrontendTemplateSystem();
     $TMPLSYS = $TMPL->getTmplSys();
     $userName = $AUTH->getUser();
     $userId = $AUTH->getUserId();
     $userRoles = $AUTHORISATION->getUserRoles($userId);
     $userPerms = $AUTHORISATION->parsePermissions();
     $aData = array('pageTitle' => cfg('internal', 'title') . ' &rsaquo; ' . l('supportInfo'), 'htmlBase' => cfg('paths', 'htmlbase'), 'htmlTemplates' => path('html', 'global', 'templates'), 'nagvisVersion' => CONST_VERSION, 'phpVersion' => PHP_VERSION, 'mysqlVersion' => shell_exec('mysql --version'), 'os' => shell_exec('uname -a'), 'serverSoftware' => $_SERVER['SERVER_SOFTWARE'], 'scriptFilename' => $_SERVER['SCRIPT_FILENAME'], 'scriptName' => $_SERVER['SCRIPT_NAME'], 'requestTime' => $_SERVER['REQUEST_TIME'] . ' (gmdate(): ' . gmdate('r', $_SERVER['REQUEST_TIME']) . ')', 'phpErrorReporting' => ini_get('error_reporting'), 'phpSafeMode' => ini_get('safe_mode') ? "yes" : "no", 'phpMaxExecTime' => ini_get('max_execution_time'), 'phpMemoryLimit' => ini_get('memory_limit'), 'phpLoadedExtensions' => implode(", ", get_loaded_extensions()), 'userAgent' => $_SERVER['HTTP_USER_AGENT'], 'logonModule' => cfg('global', 'logonmodule'), 'authModule' => cfg('global', 'authmodule'), 'authorisationModule' => cfg('global', 'authorisationmodule'), 'logonEnvVar' => cfg('global', 'logonenvvar'), 'logonEnvVal' => isset($_SERVER[cfg('global', 'logonenvvar')]) ? $_SERVER[cfg('global', 'logonenvvar')] : '', 'logonEnvCreateUser' => cfg('global', 'logonenvcreateuser'), 'logonEnvCreateRole' => cfg('global', 'logonenvcreaterole'), 'loggedIn' => $userName . ' (' . $userId . ')', 'userRoles' => json_encode($userRoles), 'userPerms' => json_encode($userPerms), 'userAuthModule' => $AUTH->getAuthModule(), 'userLogonModule' => $AUTH->getLogonModule(), 'userAuthTrusted' => $AUTH->authedTrusted() ? l("yes") : l("no"), 'compatJsonEncode' => !COMPAT_JSON_ENCODE ? l("yes") : l("no (compat mode, may lead to performance problems)"), 'compatJsonDecode' => !COMPAT_JSON_DECODE ? l("yes") : l("no (compat mode, may lead to performance problems)"));
     // Build page based on the template file and the data array
     return $TMPLSYS->get($TMPL->getTmplFile(cfg('defaults', 'view_template'), 'info'), $aData);
 }
示例#5
0
 /**
  * Parses the url and the objects for the nagvis-js frontend
  *
  * @return	String 	String with JS Code
  * @author 	Lars Michelsen <*****@*****.**>
  */
 public function parse()
 {
     global $_MAINCFG;
     // Initialize template system
     $TMPL = new FrontendTemplateSystem();
     $TMPLSYS = $TMPL->getTmplSys();
     $iframe = false;
     $url = $this->url;
     if (strpos($this->url, 'iframe:') === 0) {
         $iframe = true;
         $url = substr($this->url, 7);
     }
     $aData = array('generalProperties' => $_MAINCFG->parseGeneralProperties(), 'workerProperties' => $_MAINCFG->parseWorkerProperties(), 'rotationProperties' => json_encode($this->aRotation), 'pageProperties' => json_encode($this->getProperties()), 'iframe' => $iframe, 'url' => $url, 'fileAges' => json_encode(array('maincfg' => $_MAINCFG->getConfigFileAge())), 'locales' => json_encode(array()));
     // Build page based on the template file and the data array
     return $TMPLSYS->get($TMPL->getTmplFile(cfg('defaults', 'view_template'), 'url'), $aData);
 }
示例#6
0
 /**
  * Parses the information in html format
  *
  * @return	String 	String with Html Code
  * @author 	Lars Michelsen <*****@*****.**>
  */
 public function parse()
 {
     global $LOGIN_MSG, $_MAINCFG;
     // Initialize template system
     $TMPL = new FrontendTemplateSystem();
     $TMPLSYS = $TMPL->getTmplSys();
     $target = CoreRequestHandler::getRequestUri('');
     // Add the language to the target url when the user requested a specific language
     if (isset($_GET['lang']) && $_GET['lang'] != '' && strpos($target, 'lang=') === false) {
         if (strpos($target, '?') === false) {
             $target .= '?lang=' . $_GET['lang'];
         } else {
             $target .= '&lang=' . $_GET['lang'];
         }
     }
     $aData = array('generalProperties' => $_MAINCFG->parseGeneralProperties(), 'locales' => json_encode(array()), 'pageTitle' => cfg('internal', 'title') . ' &rsaquo; Log In', 'htmlBase' => cfg('paths', 'htmlbase'), 'htmlJs' => cfg('paths', 'htmljs'), 'htmlCss' => cfg('paths', 'htmlcss'), 'formTarget' => $target, 'htmlTemplates' => path('html', 'global', 'templates'), 'htmlImages' => cfg('paths', 'htmlimages'), 'maxPasswordLength' => AUTH_MAX_PASSWORD_LENGTH, 'maxUsernameLength' => AUTH_MAX_USERNAME_LENGTH, 'langName' => l('Name'), 'langPassword' => l('Password'), 'langLogin' => l('Login'), 'langTitleCookiesDisabled' => l('Cookies disabled'), 'langTextCookiesDisabled' => l('NagVis is unable to set a cookie in your browser. Please enable cookies for at least the NagVis host.'), 'loginMsg' => isset($LOGIN_MSG) && $LOGIN_MSG !== null ? $LOGIN_MSG->msg : '');
     // Build page based on the template file and the data array
     return $TMPLSYS->get($TMPL->getTmplFile(cfg('defaults', 'view_template'), 'login'), $aData);
 }