Beispiel #1
0
 public function buildContent()
 {
     $RQ = RequestArrayAdapter::inst();
     $mode = $RQ->str('mode', self::MODE_SPRITES_LIST);
     $name = $RQ->str('name');
     $navigation = AdminPageNavigation::inst();
     $sprites = CssSpritesManager::getAllDirsSptites();
     switch ($mode) {
         case self::MODE_SPRITE:
             if (!array_key_exists($name, $sprites)) {
                 $mode = self::MODE_SPRITES_LIST;
                 break;
             }
             $smartyParams['sprite'] = CssSprite::inst($name)->rebuild();
             break;
     }
     switch ($mode) {
         case self::MODE_SPRITES_LIST:
             $navigation->setCurrent('Список спрайтов');
             break;
         case self::MODE_SPRITE:
             $navigation->addPath(self::urlSpritesList(), 'Список спрайтов');
             $navigation->setCurrent($name);
             break;
     }
     $smartyParams['mode'] = $mode;
     $smartyParams['name'] = $name;
     $smartyParams['sprites'] = $sprites;
     return $this->getFoldedEntity()->fetchTpl($smartyParams);
 }