当前位置: 首页>>代码示例>>PHP>>正文


PHP CMS::getCMSPages方法代码示例

本文整理汇总了PHP中CMS::getCMSPages方法的典型用法代码示例。如果您正苦于以下问题:PHP CMS::getCMSPages方法的具体用法?PHP CMS::getCMSPages怎么用?PHP CMS::getCMSPages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMS的用法示例。


在下文中一共展示了CMS::getCMSPages方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: install

 public function install()
 {
     if (!parent::install() || !$this->registerHooks() || !BlockCMSModel::createTables() || !Configuration::updateValue('FOOTER_CMS', '') || !Configuration::updateValue('FOOTER_BLOCK_ACTIVATION', 1) || !Configuration::updateValue('FOOTER_POWEREDBY', 1)) {
         return false;
     }
     // Install fixtures for blockcms
     $default = Db::getInstance()->insert('cms_block', array('id_cms_category' => 1, 'location' => 0, 'position' => 0));
     if (!$default) {
         return false;
     }
     $result = true;
     $id_cms_block = Db::getInstance()->Insert_ID();
     $shops = Shop::getShops(true, null, true);
     foreach ($shops as $shop) {
         $result &= Db::getInstance()->insert('cms_block_shop', array('id_cms_block' => $id_cms_block, 'id_shop' => $shop));
     }
     $languages = Language::getLanguages(false);
     foreach ($languages as $lang) {
         $result &= Db::getInstance()->insert('cms_block_lang', array('id_cms_block' => $id_cms_block, 'id_lang' => $lang['id_lang'], 'name' => $this->l('Information')));
     }
     $pages = CMS::getCMSPages(null, 1);
     foreach ($pages as $cms) {
         $result &= Db::getInstance()->insert('cms_block_page', array('id_cms_block' => $id_cms_block, 'id_cms' => $cms['id_cms'], 'is_category' => 0));
     }
     return $result;
 }
开发者ID:jicheng17,项目名称:pengwine,代码行数:26,代码来源:blockcms.php

示例2: install

 public function install()
 {
     if (!parent::install() || !$this->registerHook('leftColumn') || !$this->registerHook('rightColumn') || !$this->registerHook('header') || !$this->registerHook('footer') || !$this->registerHook('actionObjectCmsUpdateAfter') || !$this->registerHook('actionObjectCmsDeleteAfter') || !$this->registerHook('actionShopDataDuplication') || !$this->registerHook('actionAdminStoresControllerUpdate_optionsAfter') || !BlockCMSModel::createTables() || !Configuration::updateValue('FOOTER_CMS', '') || !Configuration::updateValue('FOOTER_BLOCK_ACTIVATION', 1) || !Configuration::updateValue('FOOTER_POWEREDBY', 1) || !Configuration::updateValue('FOOTER_PRICE-DROP', 1) || !Configuration::updateValue('FOOTER_NEW-PRODUCTS', 1) || !Configuration::updateValue('FOOTER_BEST-SALES', 1) || !Configuration::updateValue('FOOTER_CONTACT', 1) || !Configuration::updateValue('FOOTER_SITEMAP', 1)) {
         return false;
     }
     $this->_clearCache('blockcms.tpl');
     // Install fixtures for blockcms
     $default = Db::getInstance()->insert('cms_block', array('id_cms_category' => 1, 'location' => 0, 'position' => 0));
     if (!$default) {
         return false;
     }
     $result = true;
     $id_cms_block = Db::getInstance()->Insert_ID();
     $shops = Shop::getShops(true, null, true);
     foreach ($shops as $shop) {
         $result &= Db::getInstance()->insert('cms_block_shop', array('id_cms_block' => $id_cms_block, 'id_shop' => $shop));
     }
     $languages = Language::getLanguages(false);
     foreach ($languages as $lang) {
         $result &= Db::getInstance()->insert('cms_block_lang', array('id_cms_block' => $id_cms_block, 'id_lang' => $lang['id_lang'], 'name' => $this->l('Information')));
     }
     $pages = CMS::getCMSPages(null, 1);
     foreach ($pages as $cms) {
         $result &= Db::getInstance()->insert('cms_block_page', array('id_cms_block' => $id_cms_block, 'id_cms' => $cms['id_cms'], 'is_category' => 0));
     }
     return $result;
 }
开发者ID:pacxs,项目名称:pacxscom,代码行数:27,代码来源:blockcms.php

示例3: renderForm

 public function renderForm()
 {
     $fields_form = array('form' => array('legend' => array('title' => $this->l('Homepage categories'), 'icon' => ''), 'input' => array(array('type' => 'cms_choice', 'label' => '', 'name' => 'cats')), 'submit' => array('name' => 'submitBlockshortcms', 'title' => $this->l('Save'))));
     $lang = $this->context->language;
     if ($selectedItems = Configuration::get('MOD_BLOCKHOMECMS_ITEMS')) {
         $selectedItems = explode(',', $selectedItems);
         foreach ($selectedItems as $index => $id_cms) {
             $selectedItems[$index] = new CMS($id_cms, $this->context->language->id);
         }
     } else {
         $selectedItems = null;
     }
     $helper = new HelperForm();
     $helper->show_toolbar = false;
     $helper->default_form_language = $lang->id;
     $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
     $helper->module = $this;
     $helper->identifier = 'id_blocklink';
     $helper->submit_action = 'submit';
     $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false) . '&configure=' . $this->name . '&tab_module=' . $this->tab . '&module_name=' . $this->name;
     $helper->token = Tools::getAdminTokenLite('AdminModules');
     $helper->fields_value = array('text' => 'text');
     $categories = current(CMSCategory::getCategories($this->context->language->id));
     $allCms = CMS::getCMSPages($this->context->language->id);
     $helper->tpl_vars = array('categories' => current(CMSCategory::getCategories($this->context->language->id)), 'allCms' => CMS::getCMSPages($this->context->language->id), 'selectedCms' => $selectedItems);
     return $helper->generateForm(array($fields_form));
 }
开发者ID:WhisperingTree,项目名称:etagerca,代码行数:27,代码来源:blockshortcms.php

示例4: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $parent_cat = new CMSCategory(1, $this->context->language->id);
     $this->context->smarty->assign('id_current_lang', $this->context->language->id);
     $this->context->smarty->assign('home_title', $parent_cat->name);
     $this->context->smarty->assign('cgv_id', Configuration::get('PS_CONDITIONS_CMS_ID'));
     if (isset($this->cms->id_cms_category) && $this->cms->id_cms_category) {
         $path = Tools::getFullPath($this->cms->id_cms_category, $this->cms->meta_title, 'CMS');
     } elseif (isset($this->cms_category->meta_title)) {
         $path = Tools::getFullPath(1, $this->cms_category->meta_title, 'CMS');
     }
     if ($this->assignCase == 1) {
         $this->context->smarty->assign(array('cms' => $this->cms, 'content_only' => (int) Tools::getValue('content_only'), 'path' => $path, 'body_classes' => array($this->php_self . '-' . $this->cms->id, $this->php_self . '-' . $this->cms->link_rewrite)));
         if ($this->cms->indexation == 0) {
             $this->context->smarty->assign('nobots', true);
         }
     } elseif ($this->assignCase == 2) {
         $this->context->smarty->assign(array('category' => $this->cms_category, 'cms_category' => $this->cms_category, 'sub_category' => $this->cms_category->getSubCategories($this->context->language->id), 'cms_pages' => CMS::getCMSPages($this->context->language->id, (int) $this->cms_category->id, true, (int) $this->context->shop->id), 'path' => $this->cms_category->id !== 1 ? Tools::getPath($this->cms_category->id, $this->cms_category->name, false, 'CMS') : '', 'body_classes' => array($this->php_self . '-' . $this->cms_category->id, $this->php_self . '-' . $this->cms_category->link_rewrite)));
     }
     $this->setTemplate(_PS_THEME_DIR_ . 'cms.tpl');
 }
开发者ID:ecssjapan,项目名称:guiding-you-afteropen,代码行数:26,代码来源:CmsController.php

示例5: list_pages

 public static function list_pages()
 {
     $context = Context::getContext();
     $table = new Cli\Table();
     $table->setHeaders(array('id', 'category', 'position', 'active', 'indexation', 'lang', 'title', 'rewrite', 'keywords'));
     //$pages = CMS::listCms($context->language->id);
     $pages = CMS::getCMSPages($context->language->id, null, false);
     foreach ($pages as $page) {
         $table->addRow(array($page['id_cms'], $page['id_cms_category'], $page['position'], $page['active'], $page['indexation'], Language::getIsoById($page['id_lang']), $page['meta_title'], $page['link_rewrite'], $page['meta_keywords']));
     }
     $table->display();
     return true;
 }
开发者ID:rodrisan,项目名称:ps-cli,代码行数:13,代码来源:cms.php

示例6: generateCMSPageData

 protected function generateCMSPageData()
 {
     $delimiter = ';';
     $line = array();
     $titles = array();
     $new_path = new Sampledatainstall();
     $id_lang = $this->use_lang;
     $f = fopen($new_path->sendPath() . 'output/cms_pages.vsc', 'w');
     foreach ($this->cms_pages_fields as $field => $array) {
         $titles[] = $array['label'];
     }
     fputcsv($f, $titles, $delimiter, '"');
     $cms_pages = CMS::getCMSPages($id_lang);
     foreach ($cms_pages as $cms_page) {
         $cms_p = new CMS($cms_page['id_cms'], $id_lang);
         foreach ($this->cms_pages_fields as $field => $array) {
             $line[$field] = property_exists('CMS', $field) && !is_array($cms_p->{$field}) && !Tools::isEmpty($cms_p->{$field}) ? $cms_p->{$field} : '';
         }
         if (!$line[$field]) {
             $line[$field] = '';
         }
         fputcsv($f, $line, $delimiter, '"');
     }
     fclose($f);
 }
开发者ID:evgrishin,项目名称:se1614,代码行数:25,代码来源:AdminSampleDataInstallExport.php

示例7: process

 public function process()
 {
     parent::process();
     $parent_cat = new CMSCategory(1, (int) self::$cookie->id_lang);
     self::$smarty->assign('id_current_lang', self::$cookie->id_lang);
     self::$smarty->assign('home_title', $parent_cat->name);
     self::$smarty->assign('cgv_id', Configuration::get('PS_CONDITIONS_CMS_ID'));
     if ($this->assignCase == 1) {
         self::$smarty->assign(array('cms' => $this->cms, 'content_only' => (int) Tools::getValue('content_only'), 'path' => (isset($this->cms->id_cms_category) and $this->cms->id_cms_category) ? Tools::getFullPath((int) $this->cms->id_cms_category, $this->cms->meta_title, 'CMS') : Tools::getFullPath(1, $this->cms->meta_title, 'CMS')));
     } elseif ($this->assignCase == 2) {
         self::$smarty->assign(array('category' => $this->cms_category, 'sub_category' => $this->cms_category->getSubCategories((int) self::$cookie->id_lang), 'cms_pages' => CMS::getCMSPages((int) self::$cookie->id_lang, (int) $this->cms_category->id), 'path' => $this->cms_category->id !== 1 ? Tools::getPath((int) $this->cms_category->id, $this->cms_category->name, false, 'CMS') : ''));
     }
 }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:13,代码来源:CMSController.php

示例8: getCMSPages

 private function getCMSPages()
 {
     if (empty(self::$_cms_pages)) {
         $result = CMS::getCMSPages($this->default_language_id, null, false);
         self::$_cms_pages[] = array('id_cms' => 0, 'name' => $this->l('-- Please select a CMS page --'));
         foreach ($result as $key => $row) {
             self::$_cms_pages[] = array('id_cms' => $row['id_cms'], 'name' => $row['meta_title']);
         }
     }
     return self::$_cms_pages;
 }
开发者ID:pomdev,项目名称:modules-1.6.0.9,代码行数:11,代码来源:eu_legal.php

示例9: getTemplateVarCategoryCms

 public function getTemplateVarCategoryCms()
 {
     $categoryCms = array();
     $categoryCms['cms_category'] = $this->objectPresenter->present($this->cms_category);
     $categoryCms['sub_categories'] = array();
     $categoryCms['cms_pages'] = array();
     foreach ($this->cms_category->getSubCategories($this->context->language->id) as $subCategory) {
         $categoryCms['sub_categories'][$subCategory['id_cms_category']] = $subCategory;
         $categoryCms['sub_categories'][$subCategory['id_cms_category']]['link'] = $this->context->link->getCMSCategoryLink($subCategory['id_cms_category'], $subCategory['link_rewrite']);
     }
     foreach (CMS::getCMSPages($this->context->language->id, (int) $this->cms_category->id, true, (int) $this->context->shop->id) as $cmsPages) {
         $categoryCms['cms_pages'][$cmsPages['id_cms']] = $cmsPages;
         $categoryCms['cms_pages'][$cmsPages['id_cms']]['link'] = $this->context->link->getCMSLink($cmsPages['id_cms'], $cmsPages['link_rewrite']);
     }
     return $categoryCms;
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:16,代码来源:CmsController.php


注:本文中的CMS::getCMSPages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。