/** * Sitemap */ public function actionMap() { $tdata = Category::GetTree(true); $arrCustomPages = CustomPage::model()->activetabs()->findAll(); $arrProducts = array(); $this->render('map', array('tdata' => $tdata, 'arrProducts' => $arrProducts, 'arrCustomPages' => $arrCustomPages)); }
public function actionIndex() { $page = CustomPage::model()->findByPk(Yii::app()->request->getParam('id')); $user = Yii::app()->user; if ($page === null) { throw new CHttpException('404', Yii::t('CustomPagesModule.views_Error', 'Could not find requested page')); } if ($page->admin_only == 1 && !Yii::app()->user->isAdmin()) { throw new CHttpException(403, Yii::t('CustomPagesModule.views_Error', 'Access denied!')); } if ($page->visibility == CustomPage::VISIBILITY_MEMBER && Yii::app()->user->isGuest) { throw new CHttpException(403, Yii::t('CustomPagesModule.views_Error', 'Registered users only!')); } if ($page->navigation_class == CustomPage::NAV_CLASS_ACCOUNTNAV) { $this->subLayout = "application.modules_core.user.views.account._layout"; } if ($page->type == CustomPage::TYPE_HTML) { $this->render('html', array('html' => $page->content)); } elseif ($page->type == CustomPage::TYPE_IFRAME) { $this->render('iframe', array('url' => $page->content, 'navigationClass' => $page->navigation_class)); } elseif ($page->type == CustomPage::TYPE_PHP) { $this->render('php', array('php' => $page->content, 'user' => $user)); } elseif ($page->type == CustomPage::TYPE_LINK) { $this->redirect($page->content); } elseif ($page->type == CustomPage::TYPE_MARKDOWN) { $this->render('markdown', array('md' => $page->content, 'navigationClass' => $page->navigation_class)); } else { throw new CHttpException(500, Yii::t('CustomPagesModule.views_Error', 'Invalid page type!')); } }
public function parseUrl($manager, $request, $pathInfo, $rawPathInfo) { $pathInfo = urlencode($pathInfo); if (preg_match('/^[a-zA-Z0-9%()\\-_\\.]+$/', $pathInfo, $matches)) { if (!empty($matches)) { $objCategory = Category::LoadByRequestUrl($matches[0]); if ($objCategory instanceof Category) { $_GET['cat'] = $matches[0]; return 'search/browse'; } $objCustomPage = CustomPage::LoadByRequestUrl($matches[0]); if ($objCustomPage instanceof CustomPage) { $_GET['id'] = $objCustomPage->request_url; //Reserved keyword for contact us form if ($matches[0] == "contact-us") { return "custompage/contact"; } else { return "custompage/index"; } } else { return false; } } } return false; // this rule does not apply }
public function actionDelete() { $page = CustomPage::model()->findByPk(Yii::app()->request->getParam('id')); if ($page !== null) { $page->delete(); } $this->redirect(Yii::app()->createUrl('//custom_pages/admin')); }
public function uninstall() { foreach (CustomPage::model()->findAll() as $entry) { $entry->delete(); } Yii::app()->db->createCommand()->dropTable(CustomPage::model()->tableName()); return parent::uninstall(); }
public static function onAccountMenuInit($event) { foreach (CustomPage::model()->findAllByAttributes(array('navigation_class' => CustomPage::NAV_CLASS_ACCOUNTNAV)) as $page) { // Admin only if ($page->admin_only == 1 && !Yii::app()->user->isAdmin()) { continue; } $event->sender->addItem(array('label' => $page->title, 'url' => Yii::app()->createUrl('//custom_pages/view', array('id' => $page->id)), 'target' => $page->type == CustomPage::TYPE_LINK ? '_blank' : '', 'icon' => '<i class="fa ' . $page->icon . '"></i>', 'isActive' => Yii::app()->controller->module && Yii::app()->controller->module->id == 'custom_pages' && Yii::app()->controller->id == 'view' && Yii::app()->request->getParam('id') == $page->id, 'sortOrder' => $page->sort_order != '' ? $page->sort_order : 1000)); } }
public function disable() { if (parent::disable()) { foreach (CustomPage::model()->findAll() as $entry) { $entry->delete(); } return true; } return false; }
/** * Displays the contact page */ public function actionContact() { $model = CustomPage::LoadByRequestUrl('contact-us'); $this->pageTitle = $model->PageTitle; $this->pageDescription = $model->meta_description; $this->breadcrumbs = array($model->title => $model->RequestUrl); $this->layout = "//layouts/column" . $model->column_template; $ContactForm = new ContactForm(); if (isset($_POST['ContactForm'])) { $ContactForm->attributes = $_POST['ContactForm']; if ($ContactForm->validate()) { $objEmail = new EmailQueue(); if (!Yii::app()->user->isGuest) { $objCustomer = Customer::GetCurrent(); $objEmail->customer_id = $objCustomer->id; $ContactForm->fromName = $objCustomer->mainname; $ContactForm->fromEmail = $objCustomer->email; } $strHtmlBody = $this->renderPartial('/mail/_contactform', array('model' => $ContactForm), true); $strSubject = Yii::t('email', 'Contact Us:') . $ContactForm->contactSubject; $objEmail->htmlbody = $strHtmlBody; $objEmail->subject = $strSubject; $orderEmail = _xls_get_conf('ORDER_FROM', ''); $objEmail->to = empty($orderEmail) ? _xls_get_conf('EMAIL_FROM') : $orderEmail; $objHtml = new HtmlToText(); //If we get back false, it means conversion failed which 99.9% of the time means improper HTML. $strPlain = $objHtml->convert_html_to_text($strHtmlBody); if ($strPlain !== false) { $objEmail->plainbody = $strPlain; } if (!$objEmail->save()) { Yii::log("Error creating email " . print_r($objEmail, true) . " " . print_r($objEmail->getErrors(), true), 'error', 'application.' . __CLASS__ . "." . __FUNCTION__); } Yii::app()->user->setFlash('success', Yii::t('email', 'Message sent. Thank you for contacting us. We will respond to you as soon as possible.')); //Attempt to use an AJAX call to send the email. If it doesn't work, the Download process will catch it anyway. $jsScript = "\$.ajax({url:\"" . CController::createUrl('site/sendemail', array("id" => $objEmail->id)) . "\"});"; Yii::app()->clientScript->registerScript('sendemail', $jsScript, CClientScript::POS_READY); } else { Yii::app()->user->setFlash('error', Yii::t('cart', 'Please check your form for errors.')); if (YII_DEBUG) { Yii::app()->user->setFlash('error', print_r($ContactForm->getErrors(), true)); } } } if (!Yii::app()->user->isGuest) { $objCustomer = Customer::GetCurrent(); $ContactForm->fromName = $objCustomer->mainname; $ContactForm->fromEmail = $objCustomer->email; } $this->canonicalUrl = $model->canonicalUrl; $this->render('contact', array('ContactForm' => $ContactForm, 'model' => $model)); }
public function run() { //Load some information we'll use within the loops $intStockHandling = _xls_get_conf('INVENTORY_OUT_ALLOW_ADD', 0); $strQueryAddl = $intStockHandling == 0 ? " AND inventory_avail > 0" : ""; header("Content-Type: text/xml;charset=UTF-8"); $ret = ""; $strSiteDir = _xls_site_dir(); $canonicalUrl = Yii::app()->createCanonicalUrl("site/index"); $strSiteDir = $canonicalUrl; echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> '; // index page echo $this->sitemapXml($strSiteDir); // sitemap page echo $this->sitemapXml($strSiteDir . "sitemap.xml"); $categories = Category::model()->findAll(); foreach ($categories as $category) { $ret .= _sp("Generating URL for category ") . $category->label . "\n"; echo $this->sitemapXml($category->canonicalUrl, date("c", strtotime($category->modified)), 'weekly'); } $arrProducts = Yii::app()->db->createCommand('SELECT * FROM ' . Product::model()->tableName() . ' WHERE current=1 AND web=1 AND parent IS NULL ' . $strQueryAddl . ' ORDER BY id')->query(); while (($arrItem = $arrProducts->read()) !== false) { $objProduct = Product::model()->findByPk($arrItem['id']); echo $this->sitemapXml($objProduct->canonicalUrl, date("c", strtotime($objProduct->modified)), 'daily', $objProduct->featured ? '0.8' : '0.5'); } $criteria = new CDbCriteria(); $criteria->condition = 'tab_position > 0'; $criteria->order = 'tab_position'; $pages = CustomPage::model()->findAll($criteria); foreach ($pages as $page) { $ret .= _sp("Generating url for page ") . $page->title . "\n"; echo $this->sitemapXml($page->canonicalUrl, date("c", strtotime($page->modified)), 'weekly'); } echo '</urlset>' . "\n"; }
public function beforeValidate() { // Alias if ($this->alias) { $this->alias = makeAlias($this->alias); } else { $this->alias = makeAlias($this->title); } if ($this->isNewRecord) { // Check if we already have an alias with those parameters if (CustomPage::model()->exists('alias=:alias', array(':alias' => $this->alias))) { $this->addError('alias', at('There is already a page with that alias.')); } } else { // Check if we already have an alias with those parameters if (CustomPage::model()->exists('alias=:alias AND id!=:id', array(':id' => $this->id, ':alias' => $this->alias))) { $this->addError('alias', at('There is already a page with that alias.')); } } return parent::beforeValidate(); }
public function actionEdit() { // Retrieve the pageid we're looking to edit $id = Yii::app()->getRequest()->getQuery('id'); $model = CustomPage::model()->findByPk($id); if (!$model instanceof CustomPage) { Yii::app()->user->setFlash('error', "Invalid Custom Page"); $this->redirect($this->createUrl("custompage/index")); } Yii::log('POST: ' . print_r($_POST, true), 'info', 'application.' . __CLASS__ . "." . __FUNCTION__); if (_xls_get_conf('LANG_MENU')) { $langs = _xls_comma_to_array(_xls_get_conf('LANG_OPTIONS')); } else { $langs = array("en:English"); } if (isset($_POST['CustomPage'])) { $model->setPageData($_POST); $_POST['CustomPage']['page_data'] = $model->page_data; $model->attributes = $_POST['CustomPage']; if ($model->validate()) { if ($model->deleteMe) { $model->delete(); Yii::app()->user->setFlash('info', "Custom page has been deleted"); $this->redirect($this->createUrl("custompage/index")); } else { $model->request_url = _xls_seo_url($model->title); if (!$model->save()) { Yii::app()->user->setFlash('error', print_r($model->getErrors(), true)); } else { Yii::app()->user->setFlash('success', Yii::t('admin', 'Custom page updated on {time}.', array('{time}' => date("d F, Y h:i:sa")))); $this->beforeAction('edit'); //In case we renamed one and we want to update menu } } } } $this->render('edit', array('model' => $model)); }
public function actionIndex() { $page = CustomPage::model()->findByPk(Yii::app()->request->getParam('id')); if ($page === null) { throw new CHttpException('404', 'Could not find requested page'); } if ($page->admin_only == 1 && !Yii::app()->user->isAdmin()) { throw new CHttpException(403, 'Access denied!'); } if ($page->navigation_class == CustomPage::NAV_CLASS_ACCOUNTNAV) { $this->subLayout = "application.modules_core.user.views.account._layout"; } if ($page->type == CustomPage::TYPE_HTML) { $this->render('html', array('html' => $page->content)); } elseif ($page->type == CustomPage::TYPE_IFRAME) { $this->render('iframe', array('url' => $page->content, 'navigationClass' => $page->navigation_class)); } elseif ($page->type == CustomPage::TYPE_LINK) { $this->redirect($page->content); } elseif ($page->type == CustomPage::TYPE_MARKDOWN) { $this->render('markdown', array('md' => $page->content, 'navigationClass' => $page->navigation_class)); } else { throw new CHttpException('500', 'Invalid page type!'); } }
/** * Display our search results based on criteria. */ public function actionResults() { $strQ = Yii::app()->getRequest()->getQuery('q'); //If we passed a category as a request_url, translate here if (isset($_GET['cat'])) { $objCategory = Category::LoadByRequestUrl($_GET['cat']); if ($objCategory instanceof Category) { $_GET['cat'] = $objCategory->id; } } $formModel = new AdvancedSearchForm(); $formModel->attributes = $_GET; $strQ = str_replace(array('<', '>', '=', ';'), '', $strQ); //We have to run the query twice -- once to get total # for our paginator, then again with our current limits //Get our total qty first for pagination $objCommand = $this->BuildCommand($formModel, -1); //passing -1 as the limit triggers a count(*) query $numberOfRecords = $objCommand->queryScalar(); $pages = new CPagination(intval($numberOfRecords)); $pages->pageSize = Yii::app()->params['PRODUCTS_PER_PAGE']; $objCommand = $this->BuildCommand($formModel, $pages->pageSize, $pages->currentPage * $pages->pageSize); $rows = $objCommand->QueryAll(); //Convert rows to objects for our view layer so it's consistent $model = Product::model()->populateRecords($rows, false); $strCurrentUrl = $this->createAbsoluteUrl(Yii::app()->request->getPathInfo() . '?' . http_build_query($formModel->attributes)); $strBreadcrumbText = ''; if (empty($this->strBreadcrumbCat)) { $strBreadcrumbText = Yii::t('global', 'Searching for "{terms}"', array('{terms}' => $strQ)); } else { $strBreadcrumbText = Yii::t('global', 'Searching for "{terms}" in category "{category}"', array('{terms}' => $strQ, '{category}' => $this->strBreadcrumbCat)); } $this->breadcrumbs = array($strBreadcrumbText => $strCurrentUrl); if (isset($_GET['cpc'])) { //We have been sent over Custom Page Content $objCustomPage = CustomPage::model()->findByPk($_GET['cpc']); if ($objCustomPage) { $this->pageTitle = $objCustomPage->PageTitle; $this->pageDescription = $objCustomPage->meta_description; $this->pageImageUrl = ''; $this->breadcrumbs = array($objCustomPage->title => $objCustomPage->RequestUrl); $this->custom_page_content = $objCustomPage->page; $this->pageHeader = $objCustomPage->title; } } $this->returnUrl = $strCurrentUrl; $this->canonicalUrl = $strCurrentUrl; $host = Yii::app()->controller->getCanonicalHostName(); $parsedUrl = parse_url($this->canonicalUrl); if ($parsedUrl['host'] !== $host) { $this->canonicalUrl = str_replace($parsedUrl['host'], $host, $this->canonicalUrl); } $this->pageImageUrl = ""; $model = ProductGrid::createBookends($model); $this->render('grid', array('model' => $model, 'item_count' => $numberOfRecords, 'page_size' => Yii::app()->params['PRODUCTS_PER_PAGE'], 'items_count' => $numberOfRecords, 'pages' => $pages)); }
/** * Delete page action */ public function actionDelete() { // Check Access checkAccessThrowException('op_custompages_deletepages'); if (isset($_GET['id']) && ($model = CustomPage::model()->findByPk($_GET['id']))) { alog(at("Deleted Custom Page '{name}'.", array('{name}' => $model->title))); $model->delete(); fok(at('Page Deleted.')); $this->redirect(array('custompages/index')); } else { $this->redirect(array('custompages/index')); } }
/** * On build of the space sidebar widget, add the custom widgets if module is enabled, and any are available. * * @param type $event */ public static function onSpaceSidebarInit($event) { if (Yii::app()->moduleManager->isEnabled('custom_pages')) { foreach (CustomPage::model()->findAllByAttributes(array('type' => CustomPage::TYPE_WIDGET, 'widget_class' => CustomPage::WIDGET_SPACE)) as $page) { // Admin only or not public widget and double check type(?) if ($page->admin_only == 1 && !Yii::app()->user->isAdmin() || (string) $page->visibility == '0' && Yii::app()->user->isGuest && $page->type != CustomPage::TYPE_WIDGET) { continue; } $spaceTargets = $page->widget_targets != '' ? count($page->widget_targets) > 0 ? $page->widget_targets : false : false; $event->sender->addWidget('application.modules.custom_pages.widgets.CustomStackWidget', array('id' => $page->id, 'title' => $page->title, 'content' => $page->content, 'icon' => $page->icon, 'visibility' => $page->visibility, 'notemplate' => $page->widget_template, 'targets' => $spaceTargets), array('sortOrder' => $page->sort_order != '' ? $page->sort_order : 1000)); } } }
<?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>
<div class="span9"> <h3>Web Store category meta-data</h3> <div class="editinstructions"> <p><?php echo Yii::t('admin', 'Normally Meta Descriptions in HTML headers will be the category name unless overridden here. It is only necessary to enter a Meta Description for first tier categories, as lower tiers will pull from their parent unless set independently.'); ?> </p> <p><?php echo Yii::t('admin', 'Using a Custom Page will display the text above the product grid when viewing a category. Custom pages must be set for each category line, they are not inherited.'); ?> </p> </div> <?php $this->widget('bootstrap.widgets.TbGridView', array('id' => 'user-grid', 'itemsCssClass' => 'table-bordered', 'dataProvider' => $model->searchForMatch(), 'summaryText' => '', 'columns' => array(array('name' => 'request_url', 'header' => 'Web Store Category', 'headerHtmlOptions' => array('class' => 'span4')), array('name' => 'parent', 'header' => 'Tier', 'value' => '($data->parent==null ? "Primary" : "")', 'headerHtmlOptions' => array('class' => 'span1')), array('class' => 'editable.EditableColumn', 'name' => 'meta_description', 'headerHtmlOptions' => array('style' => 'span3'), 'editable' => array('url' => $this->createUrl('default/updateCategory'), 'placement' => 'left', 'options' => array('onblur' => 'submit'))), array('class' => 'editable.EditableColumn', 'name' => 'custom_page', 'headerHtmlOptions' => array('style' => 'span1'), 'editable' => array('url' => $this->createUrl('default/updateCategory'), 'type' => 'select', 'placement' => 'left', 'source' => array(null => 'None') + CHtml::listData(CustomPage::model()->findAll(), 'id', 'title'), 'options' => array('onblur' => 'submit', 'showbuttons' => false)))))); ?>
public static function GetTree() { $objRet = CustomPage::model()->blendedtabs()->findAll(); return self::getDataFormatted(self::parseTree($objRet, 0)); }
</option> <?php } ?> <?php } ?> </select> </div> <div class="form-group" id="visiblity_types"> <?php echo $form->labelEx($page, 'visibility'); ?> <?php echo $form->dropdownList($page, 'visibility', CustomPage::getVisiblityTypes(), array('class' => 'form-control', 'rows' => '5', 'placeholder' => Yii::t('CustomPagesModule.views_admin_edit', 'Visibility'))); ?> </div> <div class="form-group"> <div class="checkbox"> <label> <?php echo $form->checkBox($page, 'admin_only'); ?> <?php echo $page->getAttributeLabel('admin_only'); ?> </label> </div> </div>
<div id="menubar" class="col-sm-12"> <div class="navbar-collapse collapse"> <?php if (count(CustomPage::model()->toptabs()->findAll())) { $this->widget('zii.widgets.CMenu', array('id' => 'menutabs nav navbar-nav', 'itemCssClass' => ' mainMenuBtn ' . round(12 / count(CustomPage::model()->toptabs()->findAll())), 'items' => CustomPage::model()->toptabs()->findAll())); } ?> </div> <div id="searchentry" ==> <?php echo $this->renderPartial("/site/_search", array(), true); ?> </div> </div><!-- menubar --> <div class="clearfix"></div>
/** * Short Description. * * @param $strId * @return array */ public static function getAdminDropdownOptions($strId) { switch ($strId) { case 'VIEWSET': $arr = array(); $d = dir(YiiBase::getPathOfAlias('application')); while (false !== ($filename = $d->read())) { if (substr($filename, 0, 6) == "views-") { $strView = substr($filename, 6, 100); $arr[$strView] = ucfirst($strView); } } $d->close(); return $arr; case 'THEME': $arr = array(); $d = dir(YiiBase::getPathOfAlias('webroot') . "/themes"); while (false !== ($filename = $d->read())) { if ($filename[0] != ".") { $fnOptions = YiiBase::getPathOfAlias('webroot') . "/themes/" . $filename . "/config.xml"; if (file_exists($fnOptions)) { $strXml = file_get_contents($fnOptions); $oXML = new SimpleXMLElement($strXml); if ($oXML->viewset) { $arr[$filename] = $oXML->name; } } } } $d->close(); return $arr; case 'CHILD_THEME': $fnOptions = YiiBase::getPathOfAlias('webroot') . '/themes/' . _xls_get_conf('THEME') . '/config.xml'; $arr = array(); if (file_exists($fnOptions)) { $strXml = file_get_contents($fnOptions); // Parse xml for response values $oXML = new SimpleXMLElement($strXml); if ($oXML->themes) { foreach ($oXML->themes->theme as $item) { $arr[(string) $item->valuestring] = (string) $item->keystring; } } else { $arr['webstore'] = 'n/a'; } } else { $arr['webstore'] = 'config.xml missing'; } return $arr; break; case 'COUNTRY': return CHtml::listData(Country::model()->findAllByAttributes(array('active' => 1), array('order' => 'sort_order,country')), 'id', 'country'); case 'STATE': return array(0 => '') + CHtml::listData(State::model()->findAllByAttributes(array('active' => 1), array('order' => 'sort_order, state')), 'id', 'state'); case 'WEIGHT': return array('lb' => 'Pound', 'kg' => 'Kilogram'); case 'DIMENSION': return array('in' => 'Inch', 'cm' => 'Centimeter'); case 'ENCODING': return array('ISO-8859-1' => 'ISO-8859-1', 'ISO-8859-15' => 'ISO-8859-15', 'UTF-8' => 'UTF-8', 'cp1251' => 'cp1251', 'cp1252' => 'cp1252', 'KOI8-R' => 'KOI8-R', 'BIG5' => 'BIG5', 'GB2312' => 'GB2312', 'BIG5-HKSCS' => 'BIG5-HKSCS', 'Shift_JIS' => 'Shift_JIS', 'EUC-JP' => 'EUC-JP'); case 'TIMEZONE': $arr = _xls_timezones(); $arr = _xls_values_as_keys($arr); return $arr; case 'PRODUCT_SORT': return array("title" => _sp("Product Name"), "-id" => _sp("Most Recently Created"), "-modified" => _sp("Most Recently Updated"), "code" => _sp("Product Code"), "sell_web" => _sp("Price"), "-inventory_avail" => _sp("Most Inventory"), "description_short" => _sp("Short Description")); case 'ENABLE_FAMILIES': return array(0 => _sp("Off"), 1 => _sp("Bottom of Products Menu"), 2 => _sp("Top of Products Menu"), 3 => _sp("Blended into Products Menu")); case 'EMAIL_SMTP_SECURITY_MODE': return array(0 => _sp("Autodetect"), 1 => _sp("Force No Security"), 2 => _sp("Force SSL"), 3 => _sp("Force TLS")); case 'STORE_IMAGE_LOCATION': return array('DB' => 'Database', 'FS' => 'File System'); case 'CAPTCHA_REGISTRATION': return array(1 => _sp("ON for Everyone"), 0 => _sp("OFF for Everyone")); case 'CAPTCHA_CONTACTUS': return array(2 => _sp("ON for Everyone"), 1 => _sp("OFF for Logged-in Users"), 0 => _sp("OFF for Everyone")); case 'CAPTCHA_CHECKOUT': return array(2 => _sp("ON for Everyone"), 1 => _sp("OFF for Logged-in Users"), 0 => _sp("OFF for Everyone")); case 'CAPTCHA_STYLE': return array(0 => _sp("Google ReCAPTCHA"), 1 => _sp("Integrated Captcha (DEPRECATED)")); case 'CAPTCHA_THEME': return array('red' => _sp("Red"), 'white' => _sp("White"), 'blackglass' => _sp("Blackglass"), 'clean' => _sp("Clean")); case 'ENABLE_SLASHED_PRICES': return array(0 => _sp("Off"), 1 => _sp("Only on Details Page"), 2 => _sp("On Grid and Details Pages")); case 'IMAGE_FORMAT': return array('jpg' => "JPG", 'png' => "PNG"); case 'LOGGING': return array('error' => 'Error Logging', 'info' => 'Troubleshooting Logging', 'trace' => 'Ludicrous Logging'); case 'INVENTORY_OUT_ALLOW_ADD': return array(Product::InventoryAllowBackorders => _sp('Display and Allow backorders'), Product::InventoryDisplayNotOrder => _sp('Display but Do Not Allow ordering'), Product::InventoryMakeDisappear => _sp('Make product disappear')); case 'MATRIX_PRICE': return array(Product::HIGHEST_PRICE => _sp('Show Highest Price'), Product::PRICE_RANGE => _sp('Show Price Range'), Product::CLICK_FOR_PRICING => _sp('Show "Click for Pricing"'), Product::LOWEST_PRICE => _sp('Show Lowest Price'), Product::MASTER_PRICE => _sp('Show Master Item Price')); case 'SSL_NO_NEED_FORWARD': return array(1 => _sp('Only when going to Checkout'), 0 => _sp('At all times including browsing product pages')); case 'REQUIRE_ACCOUNT': return array(1 => _sp('without registering (default)'), 0 => _sp('only after creating an account')); case 'AFTER_ADD_CART': return array(0 => _sp('Stay on page'), 1 => _sp('Redirect to Edit Cart page')); case 'PRODUCTS_PER_ROW': return array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 6 => 6); case 'HOME_PAGE': $arr = array('*products' => _sp('Product grid')); if (Yii::app()->params['LIGHTSPEED_MT'] == '1') { if (Yii::app()->theme->info->showCustomIndexOption) { $arr['*index'] = _sp(Yii::app()->theme->info->name . ' home page'); } } else { if (Yii::app()->theme->info->showCustomIndexOption) { $arr['*index'] = _sp(Yii::app()->theme->info->name . ' home page'); } else { $arr['*index'] = _sp('site/index.php'); } } foreach (CustomPage::model()->findAll(array('order' => 'title')) as $item) { $arr[$item->page_key] = $item->title; } return $arr; //processors //processors case 'CEventPhoto': return CHtml::listData(Modules::model()->findAllByAttributes(array('category' => 'CEventPhoto'), array('order' => 'name')), 'module', 'name'); case 'PROCESSOR_RECOMMEND': return array('wsrecommend' => 'Default'); case 'PROCESSOR_MENU': return array('wsmenu' => 'Dropdown Menu'); case 'PROCESSOR_LANGMENU': return array('wslanglinks' => 'Language options as links', 'wslangdropdown' => 'Language options as dropdown', 'wslangflags' => 'Language options as flags'); case 'EMAIL_TEST': return array(1 => 'On', 0 => 'Off'); case 'AUTO_UPDATE_TRACK': return array(0 => 'Release Versions', 1 => 'Beta and Release Versions'); case 'IMAGE_ZOOM': return array('flyout' => 'Flyout', 'inside' => 'Inside'); default: return array(1 => 'On', 0 => 'Off'); } }
echo _xls_get_conf('STORE_ADDRESS1') . "<br>"; echo _xls_get_conf('STORE_ADDRESS2') . "<br>"; echo _xls_get_conf('EMAIL_FROM'); ?> </div> <div class="col-sm-6 right indentr"> <?php echo _xls_get_conf('STORE_HOURS') . "<br>"; echo _xls_get_conf('STORE_PHONE'); ?> </div> </div> <div class="row bottomtabs"> <?php foreach (CustomPage::model()->bottomtabs()->findAll() as $arrTab) { echo CHtml::link(Yii::t('global', $arrTab->title), $arrTab->Link, array('id' => $arrTab->request_url)) . ' / '; } echo CHtml::link(Yii::t('global', 'Sitemap'), $this->createUrl('site/map'), array('id' => 'site-map')); ?> </div> <div class="copyright"> © <?php echo Yii::t('global', 'Copyright'); ?> <?php echo date("Y"); ?> <?php echo _xls_get_conf('STORE_NAME'); ?>
} ?> <!-- Search --> <?php echo $this->renderPartial("/site/_search", array(), true); ?> </div> <?php if (Yii::app()->theme->info->showSeparateMobileMenu) { ?> <div id="menubar-md" class="visible-md hidden-lg"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <?php echo Yii::t('global', 'Menu'); ?> </a> <div class="nav-collapse collapse"> <?php $this->widget('zii.widgets.CMenu', array('items' => count(CustomPage::model()->toptabs()->findAll()) ? array_merge(CustomPage::model()->toptabs()->findAll(), $this->MenuTreeTop) : $this->MenuTreeTop, 'activeCssClass' => 'active', 'htmlOptions' => array('class' => 'nav'))); ?> </div> </div> <?php } ?> <div class="clearfix"></div>
<div class="panel-body"> <?php echo HHtml::link(Yii::t('CustomPagesModule.base', 'Create new Page'), $this->createUrl('edit'), array('class' => 'btn btn-primary')); ?> <p /> <p /> <?php if (count($pages) != 0) { ?> <?php $classes = CustomPage::getNavigationClasses(); $types = CustomPage::getPageTypes(); ?> <table class="table"> <tr> <th><?php echo Yii::t('CustomPagesModule.base', 'Title'); ?> </th> <th><?php echo Yii::t('CustomPagesModule.base', 'Navigation'); ?> </th> <th><?php echo Yii::t('CustomPagesModule.base', 'Type'); ?> </th>
/** * Build array combining product categories, families and Custom Pages. * * @return array */ public function getMenuTree() { $categoryTree = Category::GetTree(); $extraTopLevelItems = CustomPage::GetTree(); // Whether the families (aka. manufacturers) are displayed the product menu. // ENABLE_FAMILIES: // 0 => No families in the product menu. // 1 => Separate menu item at bottom of product menu. // 2 => Separate menu item at top of product menu. // 3 => Blended into the top level of the menu. // if (CPropertyValue::ensureInteger(Yii::app()->params['ENABLE_FAMILIES']) > 0) { $familyTree = Family::GetTree(); if (CPropertyValue::ensureInteger(Yii::app()->params['ENABLE_FAMILIES']) === 3) { $extraTopLevelItems += $familyTree; } } // The behaviour varies here because OnSite customers are able to // configure the menu_position of their categories. A more thorough // solution might modify the menu code to return the menu_position for // each menu item for sorting, however Categories should already be // sorted by menu_position. if (CPropertyValue::ensureInteger(Yii::app()->params['LIGHTSPEED_CLOUD']) !== 0) { // Retail: Sort the entire menu alphabetically. $objTree = $categoryTree + $extraTopLevelItems; ksort($objTree); } else { // OnSite: Only sort the extras alphabetically (categories are // already sorted by menu_position). ksort($extraTopLevelItems); $objTree = $categoryTree + $extraTopLevelItems; } if (CPropertyValue::ensureInteger(Yii::app()->params['ENABLE_FAMILIES']) === 1 || CPropertyValue::ensureInteger(Yii::app()->params['ENABLE_FAMILIES']) === 2) { $familyMenu['families_brands_menu'] = array('text' => CHtml::link(Yii::t('category', Yii::app()->params['ENABLE_FAMILIES_MENU_LABEL']), $this->createUrl("search/browse", array('brand' => '*'))), 'label' => Yii::t('category', Yii::app()->params['ENABLE_FAMILIES_MENU_LABEL']), 'link' => $this->createUrl("search/browse", array('brand' => '*')), 'url' => $this->createUrl("search/browse", array('brand' => '*')), 'id' => 0, 'child_count' => count($familyTree), 'hasChildren' => 1, 'children' => $familyTree, 'items' => $familyTree); if (CPropertyValue::ensureInteger(Yii::app()->params['ENABLE_FAMILIES']) === 1) { // The manufacturers menu is at the bottom. $objTree = $objTree + $familyMenu; } elseif (CPropertyValue::ensureInteger(Yii::app()->params['ENABLE_FAMILIES']) === 2) { // The manufacturers menu is at the top. $objTree = $familyMenu + $objTree; } } $this->_objFullTree = $objTree; return $this->_objFullTree; }
<div class="form-group" id="url_field"> <?php echo $form->labelEx($page, 'url'); ?> <?php echo $form->textField($page, 'url', array('class' => 'form-control', 'placeholder' => Yii::t('CustomPages.views_admin_edit', 'URL'))); ?> </div> <div class="form-group"> <?php echo $form->labelEx($page, 'navigation_class'); ?> <?php echo $form->dropdownList($page, 'navigation_class', CustomPage::getNavigationClasses(), array('class' => 'form-control', 'rows' => '5', 'placeholder' => Yii::t('CustomPages.views_admin_edit', 'Content'))); ?> </div> <div class="form-group"> <?php echo $form->labelEx($page, 'sort_order'); ?> <?php echo $form->textField($page, 'sort_order', array('class' => 'form-control', 'placeholder' => Yii::t('CustomPages.views_admin_edit', 'Sort Order'))); ?> <p class="help-block"><?php echo Yii::t('CustomPages.views_admin_edit', 'Default sort orders scheme: 100, 200, 300, ...'); ?> </p>