Exemple #1
0
 public function init()
 {
     $model = new SliderModel();
     $this->slides = $model->getSliderImages();
     $this->animations = array('lft', 'lfl', 'lfb', 'lfr');
     $this->coords = array(array('x' => rand(30, 300), 'y' => rand(10, 10)), array('x' => rand(50, 150), 'y' => rand(250, 240)), array('x' => rand(600, 800), 'y' => rand(10, 10)), array('x' => rand(500, 700), 'y' => rand(250, 240)));
     $this->propositions = Propositions::model()->limit(4)->findAllByAttributes(array('show_in_slider' => TRUE));
     parent::init();
 }
Exemple #2
0
 public function run()
 {
     $model = StaticPages::model()->cache(1000)->byPageId(StaticPages::TOURS_ABROAD)->find();
     $titleToursAbroad = $model->getTitle();
     $model = StaticPages::model()->cache(1000)->byPageId(StaticPages::TOURS_UKRAINE)->find();
     $titleToursUkraine = $model->getTitle();
     $model = StaticPages::model()->cache(1000)->byPageId(StaticPages::TOURS_HEALTH)->find();
     $titleToursHealth = $model->getTitle();
     $model = StaticPages::model()->cache(1000)->byPageId(StaticPages::TOURS_CHILDREN)->find();
     $titleToursChildren = $model->getTitle();
     $propositions = Propositions::model()->limit(4)->findAllByAttributes(array('show_in_slider' => TRUE));
     $this->render('tours', array('titleToursAbroad' => $titleToursAbroad, 'titleToursUkraine' => $titleToursUkraine, 'titleToursHealth' => $titleToursHealth, 'titleToursChildren' => $titleToursChildren, 'propositions' => $propositions));
 }
 public function actions()
 {
     $model = new Propositions();
     return array('index' => array('class' => 'application.actions.backend.ListAction', 'model' => $model, 'listHeaders' => Propositions::getHeadersForListGrid(), 'primaryField' => 'id', 'view' => 'list', 'partialView' => '_list', 'widgetWrapperId' => 'pageHolder', 'widgetFormId' => 'table-form', 'pageTitle' => _('Гарячі пропозиції'), 'listTitle' => _('Список пропозицій'), 'actionCreateUrl' => $this->createUrl('add'), 'groupingCheckboxName' => static::GROUP_IDS_VARIABLE), 'add' => array('class' => 'application.actions.backend.CreateAction', 'model' => $model, 'view' => 'add-edit', 'formView' => '_form', 'pageTitle' => _('Нова пропозиція'), 'formId' => Propositions::FORM_ID, 'formAction' => '', 'isMultilingual' => FALSE, 'redirectUrl' => $this->createUrl('index'), 'imageUploadHandlerUrl' => $this->createUrl('uploadImageHandler'), 'innerLinks' => Embassies::getInnerLinks('embassies', 'show')), 'edit' => array('class' => 'application.actions.backend.UpdateAction', 'model' => Propositions::model()->findByPk(getParam('id')), 'view' => 'add-edit', 'formView' => '_form', 'pageTitle' => _('Редагування пропозиції'), 'formId' => Propositions::FORM_ID, 'formAction' => '', 'isMultilingual' => FALSE, 'imageUploadHandlerUrl' => $this->createUrl('uploadImageHandler')), 'delete' => array('class' => 'application.actions.backend.DeleteAction', 'model' => new Propositions(), 'deleteCriteria' => 'id = :Id', 'deleteParams' => array(':Id' => getParam('id')), 'nonAjaxRedirect' => $this->createUrl('index'), 'isMultilingual' => FALSE), 'groupDeleteArticles' => array('class' => 'application.actions.backend.GroupDeleteAction', 'isMultilingual' => FALSE, 'redirectUrl' => $this->createUrl('index'), 'groupingCheckboxName' => self::GROUP_IDS_VARIABLE, 'flashSuccessMessage' => _('Статтю видалено!'), 'flashWarningNoItems' => _('Нічого не вибрано!'), 'primaryId' => 'id', 'tableModelClass' => 'Propositions'), 'uploadImageHandler' => array('class' => 'application.actions.backend.UploadImageAction'));
 }