예제 #1
0
 /**
  * Основной метод, выполняющий построение контроллера для просмотра постов.
  * Контроллер может быть отображен в двух случаях: 
  * 1. На странице с просмотром всех постов
  * 2. На странице с рубрикой
  * 
  * @return ShowcasesControllerPanel
  */
 private function getScPanel($postType, Rubric $rubric = null)
 {
     $key = $postType . '-' . ($rubric ? $rubric->getIdent() : '');
     if (!$this->CACHE->has($key)) {
         $plugins[] = $this->getBaseControllerIdents();
         if ($rubric) {
             $plugins[] = Mappings::RUBRIC_2_SCCONTROLLERS($postType)->getMappedEntitys($rubric->getIdent());
         }
         $insts = $this->getUserAcessibleClassInsts(to_array_expand($plugins));
         $ctxt = new ShowcasesControllerCtxt($rubric);
         $result = array();
         /** @var ShowcasesControllerItem */
         foreach ($insts as $ident => $inst) {
             $inst->doProcess($ctxt);
             $result[$ident] = $inst;
         }
         $this->CACHE->set($key, new ShowcasesControllerPanel($result));
     }
     return $this->CACHE->get($key);
 }
예제 #2
0
/**
 * Склеивает элементы массива в строку, предварительно его развернув
 * echo concat(array('a', 'b', 'c', array(1, 2, 3), 'x', 'yz'), '|');
 * выводит: a|b|c|1|2|3|x|yz
 */
function concat($words, $glue = ' ', $takeTotallyEmpty = false)
{
    return implode($glue, to_array_expand($words, $takeTotallyEmpty));
}
예제 #3
0
 /**
  * Все доступные фильтры
  */
 public static function allPossibleFilters()
 {
     $FILTER[] = null;
     $FILTER[] = DirItemFilter::getFilters();
     $FILTER[] = PsConst::getExts();
     return array_unique(to_array_expand($FILTER, true));
 }
예제 #4
0
파일: PsImg.php 프로젝트: ilivanoff/www
 /**
  * Все допустимые расширения картинок
  * Array (jpg, jpeg, gif, png) 
  */
 public static function EXTS()
 {
     return is_array(self::$EXTS) ? self::$EXTS : (self::$EXTS = to_array_expand(self::$TYPE2EXT));
 }