コード例 #1
0
 /**
  * Определяет тип блока
  *
  * @param   string  $sName - Название блока
  * @param   string|null $sDir - Путь до блока (определяется само для плагинов, если передать параметр 'plugin'=>'myplugin')
  * @return  string  ('block','template','undefined')
  * @throws  Exception
  */
 protected function DefineTypeBlock($sName, $sDir = null)
 {
     if ($sDir) {
         // * Если найден шаблон вида block.name.tpl то считаем что тип 'block'
         if (is_file(ACE::FilePath($sDir . '/blocks/block.' . $sName . '.tpl'))) {
             return 'block';
         }
         // * Если найден шаблон по имени блока то считаем его простым шаблоном
         if (is_file(ACE::FilePath($sDir . '/' . $sName))) {
             return 'template';
         }
     }
     return parent::DefineTypeBlock($sName, $sDir);
 }
コード例 #2
0
ファイル: Viewer.class.php プロジェクト: olegverstka/kprf.dev
 public function MakePaging($iCount, $iCurrentPage, $iCountPerPage, $iCountPageLine, $sBaseUrl, $aGetParamsList = array())
 {
     $nCategoryId = intval(getRequest('category_id', 'get', 0));
     if ($nCategoryId && !isset($aGetParamsList['category_id'])) {
         $aGetParamsList['category_id'] = $nCategoryId;
     }
     return parent::MakePaging($iCount, $iCurrentPage, $iCountPerPage, $iCountPageLine, $sBaseUrl, $aGetParamsList);
 }