Exemplo n.º 1
0
 static function isCurrentPage($sPageName)
 {
     try {
         $sCurrentPage = AnwActionPage::getCurrentPageName();
         if ($sPageName == $sCurrentPage) {
             AnwDebug::log("isCurrentPage (" . $sPageName . ") : YES (currently " . $sCurrentPage . ")");
             return true;
         }
         //check translations if page exists
         $oPage = new AnwPageByName($sCurrentPage);
         if ($oPage->exists()) {
             $aoPages = $oPage->getPageGroup()->getPages();
             foreach ($aoPages as $oPageTranslation) {
                 if ($oPageTranslation->getName() == $sPageName) {
                     AnwDebug::log("isCurrentPage (" . $sPageName . ") : YES (currently " . $sCurrentPage . ")");
                     return true;
                 }
             }
         }
     } catch (AnwException $e) {
     }
     AnwDebug::log("isCurrentPage (" . $sPageName . ") : NO (currently " . $sCurrentPage . ")");
     return false;
 }