getTheme()->getId()); $hasBanner = false; foreach ($css as $record) { if ($record->getCssHeadId() == 'baner_swf') { $hasBanner = true; $banner = explode(',', $record->getCssContent()); $this->path = $banner[0]; $this->width = $banner[1]; $this->height = $banner[2]; break; } } if($hasBanner == false) return sfView::NONE; } /** * Wyświetlenie nagłówka edycji tematu graficznego */ public function executeEditThemeHead() { if(SF_ENVIRONMENT == 'edit') { $context = $this->getContext(); $user = $context->getUser(); $this->isAuthenticated = $user->isAuthenticated(); if($user->isAuthenticated()) { $c = new Criteria(); $c->add(sfGuardGroupPeer::NAME, 'admin'); $adminGroup = sfGuardGroupPeer::doSelectOne($c); $c = new Criteria(); $c->add(sfGuardUserGroupPeer::USER_ID, $user->getGuardUser()->getId()); $c->add(sfGuardUserGroupPeer::GROUP_ID, $adminGroup->getId()); $isAdmin = sfGuardUserGroupPeer::doCount($c); if(!$isAdmin) { $user->logoutUser(); $context->getController()->redirect('stUser/loginUser'); } } $theme = stTheme::getInstance($context)->getTheme(); $this->themeName = $theme->getTheme(); $themeColors = ThemeColorSchemePeer::doSelectByThemeId($theme->getId()); $this->selectColors = array(0 => '---'); $this->selectActiveColor = 0; foreach($themeColors as $color) { $this->selectColors[$color->getId()] = $color->getName(); if($color->getIsDefault() == 1) $this->selectActiveColor = $color->getId(); } } } /** * Wyświetlenie stopki edycji tematu graficznego */ public function executeEditThemeFoot() { $this->isAuthenticated = $this->getUser()->isAuthenticated(); } }