Esempio n. 1
0
 /**
  * XML宣言を生成
  * IE6以外の場合のみ生成する
  * 
  * @param array $attrib
  * @return string XML宣言
  */
 function header($attrib = array())
 {
     $ua = @$_SERVER['HTTP_USER_AGENT'];
     if (!(ereg("Windows", $ua) && ereg("MSIE", $ua)) || ereg("MSIE 7", $ua)) {
         return parent::header($attrib);
     }
 }
 /**
  * Cria o snapshot na pasta que esta configurada
  *
  * @return boolean
  */
 public function generate()
 {
     $this->Menu = ClassRegistry::init("Cms.Menu");
     $aDados = $this->Menu->find('all');
     if (!$this->isUpToDate($aDados)) {
         App::import("Helper", "Xml");
         App::import("File");
         $oXml = new XmlHelper();
         $oXml->header();
         $oXml->serialize($aDados);
         $oFile = new File(Configure::read('Cms.CheckPoint.menus') . time() . ".xml", true, 0777);
         $oFile->append($oXml->header());
         $oFile->append("<menus>");
         $oFile->append($oXml->serialize($aDados));
         $oFile->append("</menus>");
         return true;
     }
     return false;
 }
Esempio n. 3
0
 /**
  * Uses the XML helper to return the proper header
  *
  * @return string XML header
  * @author Jose Diaz-Gonzalez
  **/
 public function header()
 {
     $xml = new XmlHelper();
     return $xml->header() . "\n";
 }