Esempio n. 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);
 }
Esempio n. 2
0
 /** @return CssSprite */
 public static function getSprite($item)
 {
     return CssSprite::inst($item);
 }
Esempio n. 3
0
 /** @return CssSprite */
 public function getSprite($ident)
 {
     return $this->isSpritable() ? CssSprite::inst($this->getFoldedEntity($ident)) : null;
 }
function smarty_function_linkup_sprite($params, Smarty_Internal_Template &$smarty)
{
    echo PsHtml::linkCss(CssSprite::inst($params['name'])->getCssDi());
}