• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CMS类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __construct

 public function __construct($data = array())
 {
     parent::__construct();
     $this->entityType = 'bundle';
     if (!empty($data['id'])) {
         $CMS = new CMS();
         $this->id = $data['id'];
         $this->populate_object($CMS->get_entity_data($this));
     }
     $this->populate_object($data);
 }
开发者ID:jerwarren,项目名称:digital-publishing-tools-for-wordpress,代码行数:11,代码来源:dpsfa-product-bundle.php


示例2: addInDB

 public function addInDB()
 {
     $cms = new CMS();
     foreach (Language::getLanguages() as $lang) {
         $cms->meta_title[$lang['id_lang']] = $this->title;
         $cms->meta_description[$lang['id_lang']] = $this->title;
         $cms->meta_keywords[$lang['id_lang']] = '';
         $cms->content[$lang['id_lang']] = $this->content;
         $cms->link_rewrite[$lang['id_lang']] = pSQL(preg_replace('/-(-)+/', '', preg_replace('/([^a-z\\-])+/', '', str_replace(' ', '-', Tools::strtolower($this->title)))));
     }
     $cms->id_cms_category = 1;
     $cms->indexation = 1;
     $cms->active = 1;
     $cms->add();
 }
开发者ID:remsrock,项目名称:mailperformance,代码行数:15,代码来源:AddCmsPage.class.php


示例3: duplicateProduct

 /**
  * Duplicate one product and return model
  *
  * @param ShopProduct $model
  * @return ShopProduct
  */
 public function duplicateProduct(ShopProduct $model)
 {
     $product = new ShopProduct(null);
     // Add "null" by PANIX
     $product->attributes = $model->attributes;
     $behaviors = $model->behaviors();
     foreach ($behaviors['TranslateBehavior']['translateAttributes'] as $attr) {
         $product->{$attr} = $model->{$attr};
     }
     $product->name .= $this->getSuffix();
     $product->seo_alias .= CMS::translit($this->getSuffix()) . '-' . time();
     if ($product->validate()) {
         if ($product->save(false, false)) {
             foreach ($this->duplicate as $feature) {
                 $method_name = 'copy' . ucfirst($feature);
                 if (method_exists($this, $method_name)) {
                     $this->{$method_name}($model, $product);
                 }
             }
             return $product;
         } else {
             die(__FUNCTION__ . ': Error save');
             return false;
         }
     } else {
         // print_r($product->getErrors());die;
     }
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:34,代码来源:SProductsDuplicator.php


示例4: displayMain

 public function displayMain()
 {
     global $smarty;
     $posts = $this->entity->getThisTags();
     $smarty->assign(array('posts' => CMS::resetCMS($posts['posts']), 'total' => $posts['total']));
     return $smarty->fetch('cms_list.tpl');
 }
开发者ID:yiuked,项目名称:tmcart,代码行数:7,代码来源:CMSCategoryView.php


示例5: __construct

 public function __construct()
 {
     global $cookie;
     $this->className = 'Configuration';
     $this->table = 'configuration';
     $max_upload = (int) ini_get('upload_max_filesize');
     $max_post = (int) ini_get('post_max_size');
     $upload_mb = min($max_upload, $max_post);
     $timezones = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT name FROM ' . _DB_PREFIX_ . 'timezone');
     $taxes[] = array('id' => 0, 'name' => $this->l('None'));
     foreach (Tax::getTaxes((int) $cookie->id_lang) as $tax) {
         $taxes[] = array('id' => $tax['id_tax'], 'name' => $tax['name']);
     }
     $order_process_type = array(array('value' => PS_ORDER_PROCESS_STANDARD, 'name' => $this->l('Standard (5 steps)')), array('value' => PS_ORDER_PROCESS_OPC, 'name' => $this->l('One page checkout')));
     $round_mode = array(array('value' => PS_ROUND_UP, 'name' => $this->l('superior')), array('value' => PS_ROUND_DOWN, 'name' => $this->l('inferior')), array('value' => PS_ROUND_HALF, 'name' => $this->l('classical')));
     $cms_tab = array(0 => array('id' => 0, 'name' => $this->l('None')));
     foreach (CMS::listCms($cookie->id_lang) as $cms_file) {
         $cms_tab[] = array('id' => $cms_file['id_cms'], 'name' => $cms_file['meta_title']);
     }
     $this->_fieldsGeneral = array('PS_SHOP_ENABLE' => array('title' => $this->l('Enable Shop'), 'desc' => $this->l('Activate or deactivate your shop. Deactivate your shop while you perform maintenance on it. Please note that the webservice will not be disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_MAINTENANCE_IP' => array('title' => $this->l('Maintenance IP'), 'desc' => $this->l('IP addresses allowed to access the Front Office even if shop is disabled. Use a comma to separate them (e.g., 42.24.4.2,127.0.0.1,99.98.97.96)'), 'validation' => 'isGenericName', 'type' => 'maintenance_ip', 'size' => 30, 'default' => ''), 'PS_SSL_ENABLED' => array('title' => $this->l('Enable SSL'), 'desc' => $this->l('If your hosting provider allows SSL, you can activate SSL encryption (https://) for customer account identification and order processing'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_COOKIE_CHECKIP' => array('title' => $this->l('Check IP on the cookie'), 'desc' => $this->l('Check the IP address of the cookie in order to avoid your cookie being stolen'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_COOKIE_LIFETIME_FO' => array('title' => $this->l('Lifetime of the Front Office cookie'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '480'), 'PS_COOKIE_LIFETIME_BO' => array('title' => $this->l('Lifetime of the Back Office cookie'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '480'), 'PS_TOKEN_ENABLE' => array('title' => $this->l('Increase Front Office security'), 'desc' => $this->l('Enable or disable token on the Front Office in order to improve PrestaShop security'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_HELPBOX' => array('title' => $this->l('Back Office help boxes'), 'desc' => $this->l('Enable yellow help boxes which are displayed under form fields in the Back Office'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_ORDER_PROCESS_TYPE' => array('title' => $this->l('Order process type'), 'desc' => $this->l('You can choose the order process type as either standard (5 steps) or One Page Checkout'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $order_process_type, 'identifier' => 'value'), 'PS_GUEST_CHECKOUT_ENABLED' => array('title' => $this->l('Enable guest checkout'), 'desc' => $this->l('Your guest can make an order without registering'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_CONDITIONS' => array('title' => $this->l('Terms of service'), 'desc' => $this->l('Require customers to accept or decline terms of service before processing the order'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'js' => array('on' => 'onchange="changeCMSActivationAuthorization()"', 'off' => 'onchange="changeCMSActivationAuthorization()"')), 'PS_CONDITIONS_CMS_ID' => array('title' => $this->l('Conditions of use of CMS page'), 'desc' => $this->l('Choose the Conditions of use of CMS page'), 'validation' => 'isInt', 'type' => 'select', 'list' => $cms_tab, 'identifier' => 'id', 'cast' => 'intval'), 'PS_GIFT_WRAPPING' => array('title' => $this->l('Offer gift-wrapping'), 'desc' => $this->l('Suggest gift-wrapping to customer and possibility of leaving a message'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_GIFT_WRAPPING_PRICE' => array('title' => $this->l('Gift-wrap pricing'), 'desc' => $this->l('Set a price for gift-wrapping'), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'price'), 'PS_GIFT_WRAPPING_TAX' => array('title' => $this->l('Gift-wrapping tax'), 'desc' => $this->l('Set a tax for gift-wrapping'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $taxes, 'identifier' => 'id'), 'PS_ATTACHMENT_MAXIMUM_SIZE' => array('title' => $this->l('Maximum attachment size'), 'desc' => $this->l('Set the maximum size of attached files (in Megabytes ).') . ' ' . $this->l('Maximum:') . ' ' . ((int) str_replace('M', '', ini_get('post_max_size')) > (int) str_replace('M', '', ini_get('upload_max_filesize')) ? ini_get('upload_max_filesize') : ini_get('post_max_size')), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '2'), 'PS_RECYCLABLE_PACK' => array('title' => $this->l('Offer recycled packaging'), 'desc' => $this->l('Suggest recycled packaging to customer'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_CART_FOLLOWING' => array('title' => $this->l('Save cart content and re-display it at login'), 'desc' => $this->l('Recall and display contents of shopping cart following customer login'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_PRICE_ROUND_MODE' => array('title' => $this->l('Round mode'), 'desc' => $this->l('You can choose how to round prices: always round superior; always round inferior, or classic rounding'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'), 'PRESTASTORE_LIVE' => array('title' => $this->l('Automatically check for module updates'), 'desc' => $this->l('New modules and updates are displayed on the modules page'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_HIDE_OPTIMIZATION_TIPS' => array('title' => $this->l('Hide optimization tips'), 'desc' => $this->l('Hide optimization tips on the back office homepage'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_DISPLAY_SUPPLIERS' => array('title' => $this->l('Display suppliers and manufacturers'), 'desc' => $this->l('Display manufacturers and suppliers list even if corresponding blocks are disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_FORCE_SMARTY_2' => array('title' => $this->l('Use Smarty 2 instead of 3'), 'desc' => $this->l('Enable if your theme is incompatible with Smarty 3 (you should update your theme, since Smarty 2 will be unsupported from PrestaShop v1.5)'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_LIMIT_UPLOAD_FILE_VALUE' => array('title' => $this->l('Limit upload file value'), 'desc' => $this->l('Define the limit upload for a downloadable product, this value has to be inferior or equal to your server\'s maximum upload file ') . sprintf('(%s MB).', $upload_mb), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'limit', 'default' => '1'), 'PS_LIMIT_UPLOAD_IMAGE_VALUE' => array('title' => $this->l('Limit upload image value'), 'desc' => $this->l('Define the limit upload for an image, this value has to be inferior or equal to your server\'s maximum upload file ') . sprintf('(%s MB).', $upload_mb), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'limit', 'default' => '1'));
     if (function_exists('date_default_timezone_set')) {
         $this->_fieldsGeneral['PS_TIMEZONE'] = array('title' => $this->l('Time Zone:'), 'validation' => 'isAnything', 'type' => 'select', 'list' => $timezones, 'identifier' => 'name');
     }
     // No HTTPS activation if you haven't already.
     if (!Tools::usingSecureMode() && !_PS_SSL_ENABLED_) {
         $this->_fieldsGeneral['PS_SSL_ENABLED']['type'] = 'disabled';
         $this->_fieldsGeneral['PS_SSL_ENABLED']['disabled'] = '<a href="https://' . Tools::getShopDomainSsl() . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">' . $this->l('Please click here to use HTTPS protocol before enabling SSL.') . '</a>';
     }
     parent::__construct();
 }
开发者ID:Evil1991,项目名称:PrestaShop-1.4,代码行数:30,代码来源:AdminPreferences.php


示例6: 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


示例7: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->check()) {
         return new RedirectResponse(url(\CMS::backendPath()));
     }
     return $next($request);
 }
开发者ID:BlueCatTAT,项目名称:kodicms-laravel,代码行数:14,代码来源:RedirectIfAuthenticated.php


示例8: getContent

    public function getContent()
    {
        $html = '
		<h2>' . $this->l('Payment logo.') . '</h2>
		';
        if (Tools::isSubmit('submitConfiguration')) {
            if (Validate::isUnsignedInt(Tools::getValue('id_cms'))) {
                Configuration::updateValue('PS_PAYMENT_LOGO_CMS_ID', (int) Tools::getValue('id_cms'));
                $this->_clearCache('blockpaymentlogo.tpl');
                $html .= $this->displayConfirmation($this->l('The settings have been updated.'));
            }
        }
        $cmss = CMS::listCms($this->context->language->id);
        if (!count($cmss)) {
            $html .= $this->displayError($this->l('No CMS page is available.'));
        } else {
            $html .= '
			<form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post">
				<fieldset>
					<legend><img src="' . $this->_path . '/logo.gif" alt="" /> ' . $this->l('Configure') . '</legend>
					<label>' . $this->l('Page CMS for link') . ':</label>
					<div class="margin-form">
						<select name="id_cms"><option value="0">(' . $this->l('Select a page') . ')</option>';
            foreach ($cmss as $cms) {
                $html .= '<option value="' . $cms['id_cms'] . '"' . (Configuration::get('PS_PAYMENT_LOGO_CMS_ID') == $cms['id_cms'] ? ' selected="selected"' : '') . '>' . $cms['meta_title'] . '</option>';
            }
            $html .= '</select>
					</div>
					<p class="center"><input class="button" type="submit" name="submitConfiguration" value="' . $this->l('Save settings') . '" /></p>
				</fieldset>
			</form>
			';
        }
        return $html;
    }
开发者ID:toufikadfab,项目名称:PrestaShop-1.5,代码行数:35,代码来源:blockpaymentlogo.php


示例9: 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


示例10: map

 /**
  * @param string $service
  * @param string $id
  * @param array $options
  * @return string
  */
 public function map($t, $service, $map_id, $name, $options = array(), $path_to_template = '../tao/views/helpers/maps')
 {
     if (!is_array($options)) {
         $options = (array) $options;
     }
     $json_string = json_encode($options);
     $lang = 'ru';
     if ($options['properties']['lang'] != null) {
         $lang = $options['properties']['lang'];
     }
     if ($service == null) {
         $service = 'google';
     }
     switch ($service) {
         case 'google':
             $t->use_script('https://maps.google.com/maps/api/js?sensor=false&language=' . $lang, array('type' => 'lib', 'weight' => -21));
             $t->use_script('http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/src/infobubble-compiled.js', array('type' => 'lib', 'weight' => -20));
             break;
         case 'yandex':
             $t->use_script('http://api-maps.yandex.ru/2.0/?load=package.full&lang=' . $lang, array('type' => 'lib', 'weight' => -21));
             break;
         default:
             return;
     }
     $t->use_script(CMS::stdfile_url('scripts/maps.js'), array('type' => 'lib', 'weight' => -19));
     return $t->partial($path_to_template, array('json_string' => $json_string, 'map' => $service . '_maps', 'name' => $name, 'map_id' => $map_id));
 }
开发者ID:techart,项目名称:tao,代码行数:33,代码来源:Maps.php


示例11: displayMain

 public function displayMain()
 {
     global $smarty;
     $posts = CMS::getCMS(true, 1, 20);
     $smarty->assign(array('posts' => $posts['cmss'], 'total' => $posts['total']));
     return $smarty->fetch('blog.tpl');
 }
开发者ID:yiuked,项目名称:tmcart,代码行数:7,代码来源:BlogView.php


示例12: delete_url

 public function delete_url($name)
 {
     if (trim($name) == '') {
         return '#';
     }
     return CMS::admin_path("vars/delete/id-{$name}/");
 }
开发者ID:techart,项目名称:tao,代码行数:7,代码来源:Mapper.php


示例13: getContent

    public function getContent()
    {
        global $cookie;
        $html = '
		<h2>' . $this->l('Payment logo') . '</h2>
		';
        if (Tools::isSubmit('submitConfiguration')) {
            if (Validate::isUnsignedInt(Tools::getValue('id_cms'))) {
                Configuration::updateValue('PS_PAYMENT_LOGO_CMS_ID', intval(Tools::getValue('id_cms')));
                $html .= $this->displayConfirmation($this->l('Settings are updated'));
            }
        }
        $cmss = CMS::listCms(intval($cookie->id_lang));
        if (!sizeof($cmss)) {
            $html .= $this->displayError($this->l('No CMS page is available'));
        } else {
            $html .= '
			<form action="' . $_SERVER['REQUEST_URI'] . '" method="post">
				<fieldset>
					<legend><img src="' . $this->_path . '/logo.gif" alt="" /> ' . $this->l('Configure') . '</legend>
					<label>' . $this->l('Page CMS for link') . ':</label>
					<div class="margin-form">
						<select name="id_cms">';
            foreach ($cmss as $cms) {
                $html .= '<option value="' . $cms['id_cms'] . '"' . (Configuration::get('PS_PAYMENT_LOGO_CMS_ID') == $cms['id_cms'] ? ' selected="selected"' : '') . '>' . $cms['meta_title'] . '</option>';
            }
            $html .= '</select>
					</div>
					<p class="center"><input class="button" type="submit" name="submitConfiguration" value="' . $this->l('Save settings') . '" /></p>
				</fieldset>
			</form>
			';
        }
        return $html;
    }
开发者ID:vincent,项目名称:theinvertebrates,代码行数:35,代码来源:blockpaymentlogo.php


示例14: authenticate

 public function authenticate()
 {
     $record = User::model()->with('group')->findByAttributes(array('login' => $this->username));
     if ($record === null) {
         $this->errorCode = self::ERROR_USERNAME_INVALID;
     } else {
         if ($record->banned === '1') {
             $this->errorCode = self::ERROR_PASSWORD_INVALID;
         } else {
             if ($record->password !== User::encodePassword($this->password)) {
                 $this->errorCode = self::ERROR_PASSWORD_INVALID;
             } else {
                 $this->_id = $record->id;
                 $this->_login = $record->login;
                 $record->last_login = date('Y-m-d H:i:s');
                 $record->login_ip = CMS::getip();
                 $record->save(false, false, false);
                 $this->setState('id', $record->id);
                 $this->setState('username', $record->login);
                 $this->setState('roles', $record->group->alias);
                 $this->errorCode = self::ERROR_NONE;
             }
         }
     }
     return !$this->errorCode;
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:26,代码来源:EngineUserIdentity.php


示例15: _prepareHook

 protected function _prepareHook($params)
 {
     $languages = Language::getLanguages(true, $this->context->shop->id);
     if (!count($languages)) {
         return false;
     }
     $link = new Link();
     if ((int) Configuration::get('PS_REWRITING_SETTINGS')) {
         $default_rewrite = array();
         if (Dispatcher::getInstance()->getController() == 'product' && ($id_product = (int) Tools::getValue('id_product'))) {
             $rewrite_infos = Product::getUrlRewriteInformations((int) $id_product);
             foreach ($rewrite_infos as $infos) {
                 $default_rewrite[$infos['id_lang']] = $link->getProductLink((int) $id_product, $infos['link_rewrite'], $infos['category_rewrite'], $infos['ean13'], (int) $infos['id_lang']);
             }
         }
         if (Dispatcher::getInstance()->getController() == 'category' && ($id_category = (int) Tools::getValue('id_category'))) {
             $rewrite_infos = Category::getUrlRewriteInformations((int) $id_category);
             foreach ($rewrite_infos as $infos) {
                 $default_rewrite[$infos['id_lang']] = $link->getCategoryLink((int) $id_category, $infos['link_rewrite'], $infos['id_lang']);
             }
         }
         if (Dispatcher::getInstance()->getController() == 'cms' && (($id_cms = (int) Tools::getValue('id_cms')) || ($id_cms_category = (int) Tools::getValue('id_cms_category')))) {
             $rewrite_infos = isset($id_cms) && !isset($id_cms_category) ? CMS::getUrlRewriteInformations($id_cms) : CMSCategory::getUrlRewriteInformations($id_cms_category);
             foreach ($rewrite_infos as $infos) {
                 $arr_link = isset($id_cms) && !isset($id_cms_category) ? $link->getCMSLink($id_cms, $infos['link_rewrite'], null, $infos['id_lang']) : $link->getCMSCategoryLink($id_cms_category, $infos['link_rewrite'], $infos['id_lang']);
                 $default_rewrite[$infos['id_lang']] = $arr_link;
             }
         }
         $this->smarty->assign('lang_rewrite_urls', $default_rewrite);
     }
     return true;
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:32,代码来源:blocklanguages.php


示例16: 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


示例17: afterFind

 public function afterFind()
 {
     parent::afterFind();
     if (CMS::time() >= strtotime($this->date_end)) {
         $this->switch = 0;
         $this->save(false);
     }
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:8,代码来源:BSAds.php


示例18: preview

 public function preview()
 {
     CMS::layout_view()->use_scripts('/tao/scripts/admin/vars/image.js');
     Core::load('CMS.Images');
     $url = CMS_Images::modified_image('./' . $this['image'], '150x150');
     $id = 'container-' . md5($this['image']);
     return "<span class='var-image-preview' data-image='{$url}' data-container='{$id}'>[Image]</span>";
 }
开发者ID:techart,项目名称:tao,代码行数:8,代码来源:Image.php


示例19: timeLink

 public static function timeLink($array, $key)
 {
     $tu = "";
     foreach ($array[$key] as $rw) {
         $tu .= $rw[0] . " <a target=_blank href=" . $rw[1] . ">" . CMS::truncate($rw[1], 20) . "</a><br>";
     }
     return $tu;
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:8,代码来源:StatsHelper.php


示例20: fill

 /** Fill collection with data */
 public function fill()
 {
     // Perform CMS request to get tours
     if (CMS::getMaterialsByStructures($this->structures, $this->collection, $this->entityName, $this->outerDBHandlers, array(), $this->innerDBHandlers)) {
         // Handle success result
     }
     return $this->collection;
 }
开发者ID:samsonos,项目名称:cms,代码行数:9,代码来源:Collection.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CMSCategory类代码示例发布时间:2022-05-23
下一篇:
PHP CLog类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap