public function validateUnique($attribute) { if (is_null($this->id)) { $objExisting = CustomPage::LoadByKey($this->{$attribute}); if ($objExisting instanceof CustomPage) { $this->addError($attribute, Yii::t('yii', '{attribute} is already in use.', array('{attribute}' => $this->getAttributeLabel($attribute)))); } } }
/** * Default action. * * This is the default 'index' action that is invoked * when an action is not explicitly requested by users. * * @return void */ public function actionIndex() { $homePage = _xls_get_conf('HOME_PAGE', '*products'); switch ($homePage) { case "*index": if (Yii::app()->params['LIGHTSPEED_MT'] == '1') { if (Yii::app()->theme->info->showCustomIndexOption) { $this->render("/site/index"); } else { $this->forward("search/browse"); } } else { $this->render("/site/index"); } break; case "*products": $this->forward("search/browse"); break; default: //Custom Page $objCustomPage = CustomPage::LoadByKey($homePage); $productsGrid = null; $dataProvider = null; if (!$objCustomPage instanceof CustomPage) { _xls_404(); } $this->pageTitle = $objCustomPage->PageTitle; $this->pageDescription = $objCustomPage->meta_description; $this->pageImageUrl = ''; $this->breadcrumbs = array($objCustomPage->title => $objCustomPage->RequestUrl); if (CPropertyValue::ensureInteger($objCustomPage->product_display) === 2) { $productsGrid = new ProductGrid($objCustomPage->getProductGridCriteria()); } else { $dataProvider = $objCustomPage->taggedProducts(); } $this->canonicalUrl = $objCustomPage->canonicalUrl; $this->render('/custompage/index', array('model' => $objCustomPage, 'dataProvider' => $dataProvider, 'productsGrid' => $productsGrid)); break; } }
<?php echo $content; ?> </div> <footer> <?php echo CHtml::htmlButton(Yii::t('cart', 'Continue Shopping'), array('class' => 'button continue', 'value' => Yii::t('checkout', "See Shipping Options"), 'onClick' => "window.location.href=" . "'" . Yii::app()->createUrl('site/index') . "'")); ?> <p> <?php if (Yii::app()->params['ENABLE_SSL'] == 1) { echo CHtml::image(Yii::app()->params['umber_assets'] . '/images/lock.png', 'lock image ', array('height' => 14)) . CHtml::tag('strong', array(), 'Safe & Secure ') . Yii::t('cart', 'Bank-grade SSL encryption protects your purchase.'); } $objPrivacy = CustomPage::LoadByKey('privacy'); if ($objPrivacy instanceof CustomPage && $objPrivacy->tab_position !== 0) { echo ' ' . CHtml::link(Yii::t('cart', 'Privacy Policy'), $objPrivacy->Link, array('target' => '_blank')); } ?> </p> </footer> </section> </div> </div> <?php $this->endContent(); ?> <script>