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


PHP Model::getModuleSetting方法代码示例

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


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

示例1: parse

 /**
  * Parse
  */
 private function parse()
 {
     // get list of recent products
     $numItems = FrontendModel::getModuleSetting('Catalog', 'recent_products_full_num_items', 3);
     $recentProducts = FrontendCatalogModel::getAll($numItems);
     $this->tpl->assign('widgetCatalogRecentProducts', $recentProducts);
 }
开发者ID:Comsa-Veurne,项目名称:modules,代码行数:10,代码来源:RecentProducts.php

示例2: getData

 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     // requested page
     $requestedPage = $this->URL->getParameter('page', 'int', 1);
     // set URL and limit
     $this->pagination['url'] = FrontendNavigation::getURLForBlock('catalog');
     $this->pagination['limit'] = FrontendModel::getModuleSetting('catalog', 'overview_num_items', 10);
     // populate count fields in pagination
     $this->pagination['num_items'] = FrontendCatalogModel::getAllCount();
     $this->pagination['num_pages'] = (int) ceil($this->pagination['num_items'] / $this->pagination['limit']);
     // num pages is always equal to at least 1
     if ($this->pagination['num_pages'] == 0) {
         $this->pagination['num_pages'] = 1;
     }
     // redirect if the request page doesn't exist
     if ($requestedPage > $this->pagination['num_pages'] || $requestedPage < 1) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // populate calculated fields in pagination
     $this->pagination['requested_page'] = $requestedPage;
     $this->pagination['offset'] = $this->pagination['requested_page'] * $this->pagination['limit'] - $this->pagination['limit'];
     // get all categories
     $this->categories = FrontendCatalogModel::getAllCategories();
     // get tree of all categories
     $this->categoriesTree = FrontendCatalogModel::getCategoriesTree();
     // get all products
     $this->products = FrontendCatalogModel::getAll($this->pagination['limit'], $this->pagination['offset']);
 }
开发者ID:Comsa-Veurne,项目名称:modules,代码行数:31,代码来源:Index.php

示例3: validateForm

 /**
  * Validate the form
  */
 protected function validateForm()
 {
     if ($this->frm->isSubmitted()) {
         $fields = $this->frm->getFields();
         if ($fields['email']->isEmail(FL::err('EmailIsInvalid'))) {
         }
         if (FrontendMailengineModel::isSubscribed($fields['email']->getValue())) {
             $fields['email']->addError(FL::err('AlreadySubscribed'));
         }
         if ($this->frm->isCorrect()) {
             //--Subscribe
             $id = FrontendMailengineModel::subscribe($fields['email']->getValue());
             //--Get the default group
             $defaultGroup = FrontendModel::getModuleSetting($this->module, 'default_group');
             if ($defaultGroup > 0) {
                 $data = array();
                 $data['user_id'] = $id;
                 $data['group_id'] = $defaultGroup;
                 //--Add user to group
                 FrontendMailengineModel::insertUserToGroup($data);
             }
             // redirect
             $this->redirect(FrontendNavigation::getURLForBlock('Mailengine', 'MailengineSubscribe') . '?sent=true#subscribe');
         }
     }
     $this->frm->parse($this->tpl);
 }
开发者ID:Comsa-Veurne,项目名称:modules,代码行数:30,代码来源:MailengineSubscribe.php

示例4: getData

 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     $parameter_count = count($this->URL->getParameters(false));
     if ($parameter_count <= 0) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // get category
     $this->category = FrontendAgendaModel::getCategory($this->URL->getParameter($parameter_count - 1));
     if (empty($this->category)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // requested page
     $requestedPage = $this->URL->getParameter('page', 'int', 1);
     // set URL and limit
     $this->pagination['url'] = FrontendNavigation::getURLForBlock('Agenda', 'Category') . '/' . $this->category['url'];
     $this->pagination['limit'] = FrontendModel::getModuleSetting('Agenda', 'overview_num_items', 10);
     // populate count fields in pagination
     $this->pagination['num_items'] = FrontendAgendaModel::getCategoryCount($this->category['id']);
     $this->pagination['num_pages'] = (int) ceil($this->pagination['num_items'] / $this->pagination['limit']);
     // num pages is always equal to at least 1
     if ($this->pagination['num_pages'] == 0) {
         $this->pagination['num_pages'] = 1;
     }
     // redirect if the request page doesn't exist
     if ($requestedPage > $this->pagination['num_pages'] || $requestedPage < 1) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // populate calculated fields in pagination
     $this->pagination['requested_page'] = $requestedPage;
     $this->pagination['offset'] = $this->pagination['requested_page'] * $this->pagination['limit'] - $this->pagination['limit'];
     // timestamps
     // @todo SET CORRECT TIMES
     $startTimestamp = strtotime('last Monday 00:59', time());
     // first day of the week
     $endTimestamp = strtotime("next Monday 0:59", time());
     // last day of the week
     // get items
     $this->items = FrontendAgendaModel::getAllByCategory($this->category['id'], $this->pagination['limit'], $this->pagination['offset'], $startTimestamp, $endTimestamp);
     // sort dates
     usort($this->items, "self::cmpValues");
 }
开发者ID:Comsa-Veurne,项目名称:modules,代码行数:44,代码来源:Category.php

示例5: unsubscribe

 /**
  * Subscribes email adres to list.
  *
  * @return bool
  * @param  string           $email  email.
  * @param  string[optional] $listId list id.
  */
 public static function unsubscribe($email, $listId = null)
 {
     // get mailchimp reference
     $mc = self::getMC();
     // if list_id = null get the setting for it
     if (!$listId) {
         $listId = FrontendModel::getModuleSetting('MailMotor', 'list');
     }
     // return list unsubcribe
     return (bool) $mc->listUnsubscribe($listId, $email, FrontendModel::getModuleSetting('MailMotor', 'delete_member'), FrontendModel::getModuleSetting('MailMotor', 'send_goodbye_email'), FrontendModel::getModuleSetting('MailMotor', 'send_notify_email'));
 }
开发者ID:WouterSioen,项目名称:fork-cms-module-mailmotor,代码行数:18,代码来源:Helper.php

示例6: getData

 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     $this->parameters = $this->URL->getParameters();
     $url = end($this->parameters);
     if ($url === null) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // get by URL
     $this->record = FrontendCatalogModel::getBrandFromUrl($url);
     if (empty($this->record)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // get products
     $this->products = FrontendCatalogModel::getAllByBrand($this->record['id']);
     // requested page
     $requestedPage = $this->URL->getParameter('page', 'int', 1);
     // set URL and limit
     $this->pagination['url'] = FrontendNavigation::getURLForBlock('catalog', 'category') . '/' . $this->record['url'];
     $this->pagination['limit'] = FrontendModel::getModuleSetting('catalog', 'overview_num_items', 10);
     // populate count fields in pagination
     $this->pagination['num_items'] = FrontendCatalogModel::getCategoryCount($this->record['id']);
     $this->pagination['num_pages'] = (int) ceil($this->pagination['num_items'] / $this->pagination['limit']);
     // num pages is always equal to at least 1
     if ($this->pagination['num_pages'] == 0) {
         $this->pagination['num_pages'] = 1;
     }
     // redirect if the request page doesn't exist
     if ($requestedPage > $this->pagination['num_pages'] || $requestedPage < 1) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // populate calculated fields in pagination
     $this->pagination['requested_page'] = $requestedPage;
     $this->pagination['offset'] = $this->pagination['requested_page'] * $this->pagination['limit'] - $this->pagination['limit'];
 }
开发者ID:Comsa-Veurne,项目名称:modules,代码行数:37,代码来源:Brand.php

示例7: parse

 /**
  * Parse the page
  */
 protected function parse()
 {
     // build Facebook  OpenGraph data
     $this->header->addOpenGraphData('title', $this->record['meta_title'], true);
     $this->header->addOpenGraphData('type', 'article', true);
     $this->header->addOpenGraphData('url', SITE_URL . FrontendNavigation::getURLForBlock('agenda', 'detail') . '/' . $this->record['url'], true);
     $this->header->addOpenGraphData('site_name', FrontendModel::getModuleSetting('core', 'site_title_' . FRONTEND_LANGUAGE, SITE_DEFAULT_TITLE), true);
     $this->header->addOpenGraphData('description', $this->record['meta_title'], true);
     // add into breadcrumb
     $this->breadcrumb->addElement($this->record['meta_title']);
     // hide action title
     $this->tpl->assign('hideContentTitle', true);
     // show title linked with the meta title
     $this->tpl->assign('title', $this->record['title']);
     // set meta
     $this->header->setPageTitle($this->record['meta_title'], $this->record['meta_description_overwrite'] == 'Y');
     $this->header->addMetaDescription($this->record['meta_description'], $this->record['meta_description_overwrite'] == 'Y');
     $this->header->addMetaKeywords($this->record['meta_keywords'], $this->record['meta_keywords_overwrite'] == 'Y');
     // advanced SEO-attributes
     if (isset($this->record['meta_data']['seo_index'])) {
         $this->header->addMetaData(array('name' => 'robots', 'content' => $this->record['meta_data']['seo_index']));
     }
     if (isset($this->record['meta_data']['seo_follow'])) {
         $this->header->addMetaData(array('name' => 'robots', 'content' => $this->record['meta_data']['seo_follow']));
     }
     // add css
     $this->header->addCSS('/src/Frontend/Modules/' . $this->getModule() . '/Layout/Css/agenda.css');
     $this->tpl->assign("dateFormat", "d M");
     // assign item
     $this->tpl->assign('item', $this->record);
     // dates
     $this->tpl->assign('beginDate', $this->record['begin_date']);
     //$this->beginDate);
     $this->tpl->assign('endDate', $this->record['end_date']);
     //$this->endDate);
     // media
     //        $this->tpl->assign('images', $this->images);
     //        $this->tpl->assign('files', $this->files);
     //        $this->tpl->assign('videos', $this->videos);
     $this->tpl->assign('images', $this->record['images']);
     // parse the form
     $this->frm->parse($this->tpl);
     // some options
     if ($this->URL->getParameter('subscription', 'string') == 'moderation') {
         $this->tpl->assign('subscriptionIsInModeration', true);
     }
     if ($this->URL->getParameter('subscription', 'string') == 'true') {
         $this->tpl->assign('subscriptionIsAdded', true);
     }
     // location
     $location = array();
     if (!empty($this->record['name'])) {
         $location['name'] = $this->record['name'];
     }
     if (!empty($this->record['street'])) {
         $location['street'] = $this->record['street'];
     }
     if (!empty($this->record['number'])) {
         $location['number'] = $this->record['number'];
     }
     if (!empty($this->record['zip'])) {
         $location['zip'] = $this->record['zip'];
     }
     if (!empty($this->record['city'])) {
         $location['city'] = $this->record['city'];
     }
     // show google maps
     if ($this->record['google_maps'] == 'Y') {
         $this->addJSData('settings_' . $this->record['id'], $this->settings);
         $this->addJSData('items_' . $this->record['id'], array($this->record));
         $this->tpl->assign('location', $this->record);
         if (!empty($this->record)) {
             $this->tpl->assign('locationSet', true);
         }
         $this->tpl->assign('googlemaps', $this->record['google_maps']);
         if (!empty($this->record)) {
             $this->tpl->assign('googlemapsSet', true);
         }
         $this->tpl->assign('locationSettings', $this->settings);
         if (!empty($this->record)) {
             $this->tpl->assign('locationSettingsSet', true);
         }
     } else {
         $this->tpl->assign('location', $location);
         if (!empty($location)) {
             $this->tpl->assign('locationSet', true);
         }
         $this->tpl->assign('locationSettings', $this->settings);
         $this->tpl->assign('googlemaps', $this->record['google_maps']);
     }
 }
开发者ID:Comsa-Veurne,项目名称:modules,代码行数:94,代码来源:Detail.php

示例8: getData

 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     $this->parameters = $this->URL->getParameters();
     $url = end($this->parameters);
     if ($url === null) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // get by URL
     $this->record = FrontendCatalogModel::getCategory($url);
     if (empty($this->record)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // get subcategories
     $this->subcategories = FrontendCatalogModel::getAllCategories($this->record['id'], $this->record['url']);
     // get subcategories tree of parent
     $this->subcategoriesTree = FrontendCatalogModel::getCategoriesTree($this->record['id']);
     //--Get all the categories
     $this->categoriesTree = FrontendCatalogModel::getCategoriesTree(0, $this->record['id']);
     // get products
     $this->products = FrontendCatalogModel::getAllByCategory($this->record['id']);
     foreach ($this->products as &$product) {
         $product['image'] = FrontendMediaHelper::getFromModule('Catalog', $product['id'], 0, 1, 'product');
     }
     // requested page
     $requestedPage = $this->URL->getParameter('page', 'int', 1);
     // set URL and limit
     $this->pagination['url'] = FrontendNavigation::getURLForBlock('catalog', 'category') . '/' . $this->record['url'];
     $this->pagination['limit'] = FrontendModel::getModuleSetting('catalog', 'overview_num_items', 10);
     // populate count fields in pagination
     $this->pagination['num_items'] = FrontendCatalogModel::getCategoryCount($this->record['id']);
     $this->pagination['num_pages'] = (int) ceil($this->pagination['num_items'] / $this->pagination['limit']);
     // num pages is always equal to at least 1
     if ($this->pagination['num_pages'] == 0) {
         $this->pagination['num_pages'] = 1;
     }
     // redirect if the request page doesn't exist
     if ($requestedPage > $this->pagination['num_pages'] || $requestedPage < 1) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // populate calculated fields in pagination
     $this->pagination['requested_page'] = $requestedPage;
     $this->pagination['offset'] = $this->pagination['requested_page'] * $this->pagination['limit'] - $this->pagination['limit'];
 }
开发者ID:Comsa-Veurne,项目名称:modules,代码行数:46,代码来源:Category.php

示例9: getData

 /**
  * Gets the data
  */
 private function getData()
 {
     $this->email = \SpoonFilter::getPostValue('subscriber', null, '');
     $this->listID = (string) FrontendModel::getModuleSetting('Mailchimp', 'activeList');
 }
开发者ID:jessedobbelaere,项目名称:forkcms-mailchimp-module,代码行数:8,代码来源:Subscription.php


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