Ejemplo n.º 1
0
 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));
     }
 }