示例#1
0
 public function actionChildrenShow($key, $id)
 {
     $pageModel = ToursChildren::model()->with('catalog')->findByPk($id);
     $this->pageTitle .= ' - Тури для дітей - ' . $pageModel->getTitle();
     /** @var $cs CClientScript */
     Yii::app()->getClientScript()->registerMetaTag($pageModel->getMetaDescription(), 'description')->registerMetaTag($pageModel->getMetaKeyWords(), 'keywords');
     $this->breadcrumbs = array('Головна' => $this->createUrl('site/index'), 'Тури для дітей' => $this->createUrl('children'), $pageModel->getCatalog()->getValue());
     $this->render('show', array('pageModel' => $pageModel));
 }
 public function actions()
 {
     $catalogModel = new ToursChildrenCatalog();
     // catalog articles list
     $catalogId = getParam('catalog_id', NULL);
     $articleModel = new ToursChildren('search');
     $articleModel->catalog_id = $catalogId;
     $articleModel->loadFilters();
     // Catalog Article Form
     $newCatalogArticleModel = new ToursChildren();
     $newCatalogArticleModel->catalog_id = $catalogId;
     $createNewCatalogArticleUrl = $this->createUrl('addArticle', array('catalog_id' => $articleModel->catalog_id));
     $articleRedirectAfter = $this->createUrl('articles', array('catalog_id' => $articleModel->catalog_id));
     return array('index' => array('class' => 'application.actions.backend.ListAction', 'model' => $catalogModel, 'listHeaders' => ToursChildrenCatalog::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' => $catalogModel, 'view' => 'add-edit', 'formView' => '_form', 'pageTitle' => _('Нова країна'), 'formId' => ToursChildrenCatalog::FORM_ID, 'formAction' => '', 'isMultilingual' => FALSE, 'redirectUrl' => $this->createUrl('index')), 'edit' => array('class' => 'application.actions.backend.UpdateAction', 'model' => ToursChildrenCatalog::model()->findByPk(getParam('id')), 'view' => 'add-edit', 'formView' => '_form', 'pageTitle' => _('Редагування країни'), 'formId' => ToursChildrenCatalog::FORM_ID, 'formAction' => '', 'isMultilingual' => FALSE), 'delete' => array('class' => 'application.actions.backend.DeleteAction', 'model' => new TestCatalog(), 'deleteCriteria' => 'id = :catalogId', 'deleteParams' => array(':catalogId' => getParam('id')), 'nonAjaxRedirect' => $this->createUrl('index'), 'isMultilingual' => FALSE), 'articles' => array('class' => 'application.actions.backend.ListAction', 'model' => $articleModel, 'listHeaders' => ToursChildren::getHeadersForListGrid(), 'listFilters' => ToursChildren::getFiltersForListGrid(), 'primaryField' => 'id', 'view' => 'articles', 'partialView' => '_articles', 'widgetWrapperId' => 'pageHolder', 'widgetFormId' => 'table-form', 'pageTitle' => _('Test catalog articles'), 'listTitle' => _('Test catalog articles list'), 'groupingCheckboxName' => static::GROUP_IDS_VARIABLE, 'actionCreateUrl' => $createNewCatalogArticleUrl), 'addArticle' => array('class' => 'application.actions.backend.CreateAction', 'model' => $newCatalogArticleModel, 'view' => 'add-edit-article', 'formView' => '_form-article', 'pageTitle' => _('Новий тур'), 'formId' => ToursChildren::FORM_ID, 'formAction' => '', 'isMultilingual' => FALSE, 'redirectUrl' => $articleRedirectAfter, 'imageUploadHandlerUrl' => $this->createUrl('uploadImageHandler'), 'innerLinks' => Embassies::getInnerLinks('embassies', 'show')), 'editArticle' => array('class' => 'application.actions.backend.UpdateAction', 'model' => ToursChildren::model()->findByPk(getParam('id')), 'view' => 'add-edit-article', 'formView' => '_form-article', 'pageTitle' => _('Редагування туру'), 'formId' => ToursChildren::FORM_ID, 'formAction' => '', 'isMultilingual' => FALSE, 'imageUploadHandlerUrl' => $this->createUrl('uploadImageHandler'), 'innerLinks' => Embassies::getInnerLinks('embassies', 'show')), 'deleteArticle' => array('class' => 'application.actions.backend.DeleteAction', 'model' => new ToursChildren(), 'deleteCriteria' => 'id = :articleId', 'deleteParams' => array(':articleId' => getParam('id')), 'nonAjaxRedirect' => $articleRedirectAfter, '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' => 'ToursChildren'), 'uploadImageHandler' => array('class' => 'application.actions.backend.UploadImageAction'));
 }