public function GetGpxContent($ajax = false) { global $gp_admin_html; if (empty($this->show_admin_content)) { return; } $request_type = \gp\tool::RequestType(); if ($request_type == 'body') { echo $this->contentBuffer; return; } ob_start(); echo '<div id="gpx_content"><div id="admincontent">'; $this->AdminContentPanel(); $this->BreadCrumbs(); echo '<div id="admincontent_inner">'; echo $this->contentBuffer; echo '</div></div></div>'; $admin_content = ob_get_clean(); if (!$ajax) { $gp_admin_html .= '<div id="admincontainer" >' . $admin_content . '</div>'; return; } echo $admin_content; }
public static function RunOut() { global $page; $page->RunScript(); //prepare the admin content if (\gp\tool::LoggedIn()) { \gp\admin\Tools::AdminHtml(); } //decide how to send the content self::Prep(); switch (\gp\tool::RequestType()) { // <a data-cmd="admin_box"> case 'flush': self::Flush(); break; // remote request // file browser // remote request // file browser case 'body': \gp\tool::CheckTheme(); self::BodyAsHTML(); break; case 'admin': self::AdminHtml(); break; // <a data-cmd="gpajax"> // <a data-cmd="gpabox"> // <input data-cmd="gpabox"> // <a data-cmd="gpajax"> // <a data-cmd="gpabox"> // <input data-cmd="gpabox"> case 'json': \gp\tool::CheckTheme(); \gp\tool\Output\Ajax::Response(); break; case 'content': self::Content(); break; default: \gp\tool::CheckTheme(); self::Template(); break; } // if logged in, don't send 304 response if (\gp\tool::LoggedIn()) { //empty edit links if there isn't a layout if (!$page->gpLayout) { self::$editlinks = ''; } return; } // attempt to send 304 response if ($page->fileModTime > 0) { global $wbMessageBuffer; $len = strlen(self::$head_content) + strlen(self::$head_js) + ob_get_length(); if (count($wbMessageBuffer)) { $len += strlen(json_encode($wbMessageBuffer)); } \gp\tool::Send304(\gp\tool::GenEtag($page->fileModTime, $len)); } }
/** * Update layout information if needed * */ public static function LayoutInfo() { global $page, $gpLayouts, $get_all_gadgets_called; if (!\gp\tool\Output::$template_included) { return; } if (\gp\tool::RequestType() != 'template') { return; } $layout = $page->gpLayout; if (!isset($gpLayouts[$layout])) { return; } $layout_info =& $gpLayouts[$layout]; //template.php file not modified $template_file = realpath($page->theme_dir . '/template.php'); $template_mod = filemtime($template_file); if (isset($layout_info['template_mod']) && $layout_info['template_mod'] >= $template_mod) { return; } $contents = ob_get_contents(); //charset if (strpos($contents, 'charset=') !== false) { return; } //get just the head of the buffer to see if we need to add charset $pos = strpos($contents, '</head'); unset($layout_info['doctype']); if ($pos > 0) { $head = substr($contents, 0, $pos); $layout_info['doctype'] = self::DoctypeMeta($head); } $layout_info['all_gadgets'] = $get_all_gadgets_called; //save $layout_info['template_mod'] = $template_mod; \gp\admin\Tools::SavePagesPHP(); }
/** * Output the main admin toolbar * @static */ public static function GetAdminPanel() { global $page, $gpAdmin; //don't send the panel when it's a gpreq=json request if (!self::$show_toolbar) { return; } $reqtype = \gp\tool::RequestType(); if ($reqtype != 'template' && $reqtype != 'admin') { return; } $class = ''; $position = ''; if (\gp\tool::RequestType() != 'admin') { $position = ' style="top:' . max(-10, $gpAdmin['gpui_ty']) . 'px;left:' . max(-10, $gpAdmin['gpui_tx']) . 'px"'; if (isset($gpAdmin['gpui_cmpct']) && $gpAdmin['gpui_cmpct']) { $class = ' compact'; if ($gpAdmin['gpui_cmpct'] === 2) { $class = ' compact min'; } elseif ($gpAdmin['gpui_cmpct'] === 3) { $class = ' minb'; } } } $class = ' class="keep_viewable' . $class . '"'; echo "\n\n"; echo '<div id="simplepanel"' . $class . $position . '><div>'; //toolbar echo '<div class="toolbar">'; echo '<a class="toggle_panel" data-cmd="toggle_panel"></a>'; echo \gp\tool::Link('', '<i class="fa fa-home"></i>'); echo \gp\tool::Link('Admin', '<i class="fa fa-cog"></i>'); echo \gp\tool::Link('special_gpsearch', '<i class="fa fa-search"></i>', '', array('data-cmd' => 'gpabox')); echo '</div>'; self::AdminPanelLinks(true); echo '</div></div>'; //end simplepanel echo "\n\n"; self::AdminToolbar(); }