public function actionPassenger() { $pageModel = StaticPages::model()->byPageId(StaticPages::PASSENGER)->find(); $this->pageTitle .= ' - ' . $pageModel->getTitle(); $this->breadcrumbs = array('Головна' => $this->createUrl('site/index'), $pageModel->getTitle()); $this->render('passenger', array('pageModel' => $pageModel)); }
public function actionTrain() { $pageModel = StaticPages::model()->byPageId(StaticPages::TICKETS_TRAIN)->find(); $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('index'), $pageModel->getTitle()); $this->render('train', array('pageModel' => $pageModel)); }
public function actionResort() { $pageModel = StaticPages::model()->byPageId(StaticPages::WEATHER_RESORT)->find(); $this->pageTitle .= ' - ' . $pageModel->getTitle(); /** @var $cs CClientScript */ Yii::app()->getClientScript()->registerMetaTag($pageModel->getMetaDescription(), 'description')->registerMetaTag($pageModel->getMetaKeyWords(), 'keywords'); $this->breadcrumbs = array('Погода на карті світу' => $this->createUrl('index'), 'Погода на курортах'); $this->render('resort', array('pageModel' => $pageModel)); }
public function actionHealth() { $pageModel = StaticPages::model()->byPageId(StaticPages::TOURS_HEALTH)->find(); $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'), $pageModel->getTitle()); $this->render('health', array('pageModel' => $pageModel, 'toursModels' => ToursHealthCatalog::model()->with('tours')->findAll())); }
public function actionDelete() { if (StaticPages::model()->deleteByPk($_GET['id'])) { Yii::app()->user->setFlash("success", "Удалено"); $this->redirect($this->createUrl("index")); } else { Yii::app()->user->setFlash("danger", "Ошибка удаления"); $this->redirect($this->createUrl("index")); } }
public function actionIndex() { /** @var $pageModel StaticPages */ $pageModel = StaticPages::model()->byPageId(StaticPages::EMBASSIES)->find(); $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'), $pageModel->getTitle()); $countriesWithVisa = Embassies::model()->findAllByAttributes(array('catalog_id' => Embassies::WITH_VISA)); $countriesWithoutVisa = Embassies::model()->findAllByAttributes(array('catalog_id' => Embassies::WITHOUT_VISA)); $this->render('index', array('pageModel' => $pageModel, 'countriesWithVisa' => $countriesWithVisa, 'countriesWithoutVisa' => $countriesWithoutVisa)); }
function actionIndex() { $base = StaticPages::model()->find('type=1'); if ($base) { $this->genMeta($base); $this->breadcrumbs[] = array('title' => $base->header, 'url' => "/" . $base->alias); $this->current = 1; $this->render("index", array('base_model' => $base)); } else { throw new CHttpException(404, Yii::t('app', 'Page not found')); } }
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 actionIndex($year = NULL) { $pageModel = StaticPages::model()->byPageId(StaticPages::MEDIA)->find(); $this->pageTitle .= ' - ' . $pageModel->getTitle(); /** @var $cs CClientScript */ Yii::app()->getClientScript()->registerMetaTag($pageModel->getMetaDescription(), 'description')->registerMetaTag($pageModel->getMetaKeyWords(), 'keywords'); /** @var $dataProvider CDataProvider */ $dataProvider = Media::model()->frontendSearch($year); $models = $dataProvider->getData(); /** @var $pagination CPagination */ $pagination = $dataProvider->getPagination(); $this->breadcrumbs = array('Головна' => $this->createUrl('site/index'), 'Фото та відео'); $this->render('index', array('pageModel' => $pageModel, 'models' => $models, 'archiveYears' => Media::getYearsForArchive(), 'pagination' => $pagination)); }
private function toparent($parent = 0) { $page = StaticPages::model()->findByPk($parent); if ($page) { $url = array($page->alias); if ($page->parent != 0) { return array_merge($url, $this->toparent($page->parent)); } else { return $url; } } else { throw new CHttpException(503); } }
function getTree($id, $level, $alias) { $base = StaticPages::model()->findAll('parent=' . $id); if (count($base) > 0) { $s_text = ''; for ($i = 0; $i < $level; $i++) { $s_text .= "|—"; } foreach ($base as $item) { if ($item->iscat == 0) { echo '<tr><td>' . $s_text . '<a href="' . Yii::app()->createUrl("/core/static/edit", array("id" => $item->id)) . '">' . $item->header . '</a> <span style="color:gray">(<a href="' . Yii::app()->params['frontendUrl'] . '/' . $item->id . '-' . urlencode($item->alias) . '" target="_blank" style="color:gray">открыть на сайте</a>)</span></td>'; } else { echo '<tr><td>' . $s_text . '<a href="' . Yii::app()->createUrl("/core/static/edit", array("id" => $item->id)) . '" style="color:#000">' . $item->header . '</a></td>'; } if ($item->candelete == 0) { echo '<td><a href="' . Yii::app()->createUrl("/core/static/delete", array("id" => $item->id)) . '" onClick="return confirm(\'Are you sure you want to delete this page?\\nAll children of a parent to change the item up.\');">Удалить</a></td>'; } else { echo '<td></td>'; } echo ' </tr> '; getTree($item->id, $level + 1, $alias . "/" . $item->alias); } } }
public static function staticContent($key) { $model = StaticPages::model()->findByAttributes(array('title' => trim($key))); if (is_null($model)) { } else { echo $model->content; } }
public function actions() { return array('index' => array('class' => 'application.actions.backend.ListAction', 'model' => new StaticPages('search'), 'listHeaders' => StaticPages::getHeadersForListGrid(), 'primaryField' => 'page_id', 'view' => 'list', 'partialView' => '_list', 'widgetWrapperId' => 'pageHolder', 'widgetFormId' => 'table-form', 'pageTitle' => _('Статичні сторінки'), 'listTitle' => _('Перелік сторінок')), 'edit' => array('class' => 'application.actions.backend.UpdateAction', 'model' => StaticPages::model()->findByAttributes(array('page_id' => getParam('id'))), 'view' => 'add-edit', 'formView' => '_form', 'pageTitle' => _('Редагування статичної сторінки'), 'formId' => StaticPages::FORM_ID, 'formAction' => '', 'redirectUrl' => $this->createUrl('index'))); }
?> <form action="" method="post" enctype="multipart/form-data"> <ul class="nav nav-tabs"> <li class="active"><a href="#home" data-toggle="tab"><i class="icon-home"></i>Основное</a></li> <li><a href="#seo" data-toggle="tab"><i class="icon-cog"></i>SEO</a></li> </ul> <div class="tab-content"> <div class="tab-pane active" id="home"> <div class="row"> <div class="col-md-3"> <label>Родитель:</label> <?php if ($base_model->candelete != 1) { echo CHtml::dropDownList('StaticPages[parent]', $base_model->parent, StaticPages::model()->getArrayDropDown($base_model->id), array("class" => "form-control")); } else { echo 'Корень'; } ?> </div> <div class="col-md-3"> <label>Это категория?</label> <?php echo CHtml::dropDownList('StaticPages[iscat]', $base_model->iscat, array(0 => 'No', 1 => 'Yes'), array("class" => "form-control")); ?> </div> <div class="col-md-3"> <label>URL:</label> <?php if ($base_model->candelete != 1) {
public function actionBanned() { if (!Yii::app()->user->isGuest) { $this->redirect('index'); } $pageModel = StaticPages::model()->byPageId(StaticPages::ACCOUNT_BANNED)->find(); $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('index'), 'Кабінет'); $this->setModel(new ContactForm()); if (isPostOrAjaxRequest()) { $this->setAjaxResponseSuccessMessage('Ваше повідомлення надіслане!'); $this->process(); } $this->render('banned', array('formModel' => $this->getModel(), 'pageModel' => $pageModel)); }