header_nocache() static public method

Set page not to use the cache
static public header_nocache ( )
Example #1
0
 /**
  * Show API header
  * in debug, it add body and some libs (essentialy to colorise markdown)
  * otherwise, it change only Content-Type of the page
  *
  * @param $html      (default false)
  * @param $title     (default '')
  **/
 protected function header($html = false, $title = "")
 {
     // Send UTF8 Headers
     $content_type = "application/json";
     if ($html) {
         $content_type = "text/html";
     }
     header("Content-Type: {$content_type}; charset=UTF-8");
     // Send extra expires header
     Html::header_nocache();
     if ($html) {
         if (empty($title)) {
             $title = $this->getTypeName();
         }
         Html::includeHeader($title);
         // Body with configured stuff
         echo "<body>";
         echo "<div id='page'>";
     }
 }
Example #2
0
-------------------------------------------------------------------------
Mreporting plugin for GLPI
Copyright (C) 2003-2011 by the mreporting Development Team.

https://forge.indepnet.net/projects/mreporting
-------------------------------------------------------------------------

LICENSE

This file is part of mreporting.

mreporting is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

mreporting is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with mreporting. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include "../../../inc/includes.php";
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
//use invisible iframe to prevent js error from protovis
echo "<iframe id='debug_ifr' src='../ajax/debug_content.php' \n   scrolling='no' style='width:100%;min-height:3500px;' marginWidth='0' marginHeight='0' \n   frameborder='0' border='0' cellspacing='0' />";
Html::ajaxFooter();
Example #3
0
 function includeCommonHtmlHeader($title = '')
 {
     global $CFG_GLPI, $PLUGIN_HOOKS, $LANG;
     // Send UTF8 Headers
     header("Content-Type: text/html; charset=UTF-8");
     // Send extra expires header
     Html::header_nocache();
     // Start the page
     echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n         \"http://www.w3.org/TR/html4/loose.dtd\">";
     echo "\n<html><head><title>GLPI - " . $title . "</title>";
     echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8 \" >";
     // Send extra expires header
     echo "<meta http-equiv=\"Expires\" content=\"Fri, Jun 12 1981 08:20:00 GMT\" >\n";
     echo "<meta http-equiv=\"Pragma\" content=\"no-cache\">\n";
     echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\">\n";
     // FAV & APPLE DEVICE ICON
     echo "<link rel='apple-touch-icon' type='image/png' href='" . $CFG_GLPI["root_doc"] . "/plugins/mobile/pics/apple-touch-icon.png' />";
     echo "<link rel='icon' type='image/png' href='" . $CFG_GLPI["root_doc"] . "/plugins/mobile/pics/favicon.png' />";
     // CSS link JQUERY MOBILE
     echo "<link rel='stylesheet'  href='" . $CFG_GLPI["root_doc"] . "/plugins/mobile/lib/jquery.mobile-1.0a4.1/jquery.mobile-1.0a4.1.css' type='text/css' media='screen' >\n";
     // CSS link MOBILE GLPI PLUGIN
     echo "<link rel='stylesheet'  href='" . $CFG_GLPI["root_doc"] . "/plugins/mobile/mobile.css' type='text/css' media='screen' >\n";
     // CSS link DATEBOX PLUGIN
     echo "<link rel='stylesheet' href='" . $CFG_GLPI["root_doc"] . "/plugins/mobile/lib/datebox/jquery.mobile.datebox.css' />\n";
     // LOAD JS JQUERY
     echo "<script type=\"text/javascript\" src='" . $CFG_GLPI["root_doc"] . "/plugins/mobile/lib/jquery-1.5.2.min.js'></script>\n";
     //busca Stevenes
     //echo "<script type=\"text/javascript\" src='".$CFG_GLPI["root_doc"]."/plugins/mobile/lib/busca.js'></script>";
     // EXTEND JQUERY MOBILE OPTIONS
     echo "<script type='text/javascript'>";
     echo "\$(document).bind('mobileinit', function(){\n";
     // DISABLE JQUERY MOBILE AJAX SUBMIT
     echo "\$.extend(  \$.mobile, { ajaxFormsEnabled: false });\n";
     // change back button text
     echo "\$.mobile.page.prototype.options.backBtnText = '" . $LANG['buttons'][13] . "';\n";
     //change loading message
     echo "\$.extend(  \$.mobile, { loadingMessage: '" . $LANG['common'][80] . "' });\n";
     if (navigatorDetect() == 'Android' && getOsVersion() < "3.0") {
         echo "\$.mobile.defaultTransition = 'none';\n";
     }
     //echo "alert($.mobile.nonHistorySelectors);";
     // disable history on data-rel navigation
     //echo "$.mobile.nonHistorySelectors = 'dialog][data-rel=navigation';\n";
     //reset type=date inputs to text
     //echo "$.mobile.page.prototype.options.degradeInputs.date = true;\n";
     echo "\$.mobile.selectmenu.prototype.options.nativeMenu = true;";
     if (nativeSelect()) {
         echo "\$.mobile.page.prototype.options.keepNative = 'select'";
     }
     echo "});\n";
     echo "</script>\n";
     // LOAD JS JQUERY MOBILE
     echo "<script type=\"text/javascript\" src='" . $CFG_GLPI["root_doc"] . "/plugins/mobile/lib/jquery.mobile-1.0a4.1/jquery.mobile-1.0a4.1.min.js'></script>\n";
     /*echo "<script type=\"text/javascript\" src='".
       $CFG_GLPI["root_doc"]."/plugins/mobile/lib/jquery.mobile-1.0a4.1/jquery.mobile-1.0a4.1.js'></script>\n";*/
     // LOAD DATEBOX PLUGIN (JS)
     echo "<script type=\"text/javascript\" src='" . $CFG_GLPI["root_doc"] . "/plugins/mobile/lib/datebox/jquery.mobile.datebox.js'></script>\n";
     //DOM READY
     echo "<script type='text/javascript'>";
     echo "\$(document).ready(function() {\n\n         //post screen resolution\n         \$.post('" . $CFG_GLPI["root_doc"] . "/plugins/mobile/lib/resolution.php', { width: \$(document).width(), height: \$(document).height() });\n\n         //INIT DATEBOX PLUGIN\n         \n         " . getDateBoxOptions() . "\n\n         \$('input[type=date], input[data-role=date]', this ).each(function() {\n            \$(this).datebox(opts);\n         });\n\n         \$('.ui-page').live('pagecreate', function() {\n            \$('input[type=date], input[data-role=date]', this ).each(function() {\n               \$(this).datebox(opts);\n            });\n         });\n\n      });\n";
     echo "</script>\n";
     // End of Head
     echo "</head>\n";
 }