logo = "home.php?m=dashboard&p=dashboard"; $this->bg_wrapper = ""; $this->title = "Open Game Panel"; $this->charset = "utf-8"; $this->refreshTime = DEFAULT_REFRESH_TIME; } function __destruct() { } function menu(){} function printView($cleared = false, $dataType = "html") { global $db, $OGPLangPre; if ( is_object($db) && array_key_exists( "OGPDatabase", class_parents($db) ) ) { $panel_settings = $db->getSettings(); } // Our global CSS goes first so that themes can override $this->header_code = '' . "\n"; $path = ""; if ( isset($_SESSION['users_theme']) && !empty($_SESSION['users_theme']) && is_dir( 'themes/'.$_SESSION['users_theme'] ) && is_file( 'themes/'.$_SESSION['users_theme'].'/layout.html') ) { $path = 'themes/'.$_SESSION['users_theme'].'/'; } // Using default theme if there is not one selected. else if ( !isset($panel_settings['theme']) ) { $path = 'themes/Revolution/'; } else if ( is_dir( 'themes/'.$panel_settings['theme'] ) && is_file( 'themes/'.$panel_settings['theme'].'/layout.html') ) { $path = 'themes/'.$panel_settings['theme'].'/'; } // In case the theme that was selected is invalid print error and use default. else { $path = 'themes/Revolution/'; } $page = file_get_contents($path.'layout.html'); @$top = file_get_contents($path.'top.html'); @$bottom = file_get_contents($path.'bottom.html'); @$topbody = file_get_contents($path.'topbody.html'); @$botbody = file_get_contents($path.'botbody.html'); if ( isset($panel_settings['logo_link']) && !empty($panel_settings['logo_link'])) $this->logo = $panel_settings['logo_link']; if ( isset($panel_settings['bg_wrapper']) && !empty($panel_settings['bg_wrapper'])) $this->bg_wrapper = $panel_settings['bg_wrapper']; if ( isset($panel_settings['charset']) && !empty($panel_settings['charset'])) { $this->charset = $panel_settings['charset']; ini_set('default_charset', $panel_settings['charset']); } if ( isset($panel_settings['time_zone']) && !empty($panel_settings['time_zone'])) { $this->time_zone = $panel_settings['time_zone']; ini_set('date.timezone', $panel_settings['time_zone']); } if ( isset($panel_settings['panel_name']) && !empty($panel_settings['panel_name'])) $this->title = $panel_settings['panel_name']; if ( isset($panel_settings['header_code']) && !empty($panel_settings['header_code'])) $this->header_code .= $panel_settings['header_code']."\n"; $module = isset($_GET['m']) ? $_GET['m'] : ""; $subpage = isset($_GET['p']) ? $_GET['p'] : $module; $fc = array( $path . MODULES . $module."/".$subpage.".css", $path . MODULES . $module."/".$module.".css", MODULES . $module."/".$subpage.".css", MODULES . $module."/".$module.".css" ); foreach($fc as $file_check){ if(file_exists($file_check)){ $this->header_code .= "\n"; break; } } $module_name = isset($_GET['m']) ? get_lang($_GET['m']) : ""; $page_name = isset($_GET['p']) ? get_lang($_GET['p']) : ""; $title = $page_name == "" ? $module_name : "$module_name - $page_name"; $title = str_replace("_", " ", $title); $this->title = $title == "" ? $this->title : $this->title . " [$title]"; // Include jQuery, jQuery UI, and our global CSS file in the header code $this->header_code .= '' . "\n"; $this->header_code .= '' . "\n"; // Include magnific popup $this->header_code .= '' . "\n"; $this->header_code .= '' . "\n"; // Include tablesorter, table collapse, and quick search $this->header_code .= '' . "\n"; $this->header_code .= '' . "\n"; $this->header_code .= '' . "\n"; // Dump defined constants to json (for language javascript) $jsonStrConsts = getOGPLangConstantsJSON(); if($jsonStrConsts !== false){ $this->header_code .= '' . "\n"; } // Include our global JS $this->header_code .= '' . "\n"; $fc = array( $path . MODULES . $module."/".$subpage.".js", $path . MODULES . $module."/".$module.".js" ); foreach($fc as $file_check){ if(file_exists($file_check)){ $this->header_code .= "\n"; break; } } $buffer = ob_get_contents(); ob_end_clean(); if ( !empty($this->refreshUrl) ) { if ( $panel_settings['page_auto_refresh'] == "1" ) { $topbody .= "