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


PHP CMSCategory::recurseCMSCategory方法代码示例

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


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

示例1: renderForm

 public function renderForm()
 {
     $this->display = 'edit';
     $this->toolbar_btn['save-and-preview'] = array('href' => '#', 'desc' => $this->l('Save and preview'));
     $this->initToolbar();
     if (!$this->loadObject(true)) {
         return;
     }
     $categories = CMSCategory::getCategories($this->context->language->id, false);
     $html_categories = CMSCategory::recurseCMSCategory($categories, $categories[0][1], 1, $this->getFieldValue($this->object, 'id_cms_category'), 1);
     $this->fields_form = array('tinymce' => true, 'legend' => array('title' => $this->l('CMS Page'), 'image' => '../img/admin/tab-categories.gif'), 'input' => array(array('type' => 'select_category', 'label' => $this->l('CMS Category'), 'name' => 'id_cms_category', 'options' => array('html' => $html_categories)), array('type' => 'text', 'label' => $this->l('Meta title:'), 'name' => 'meta_title', 'id' => 'name', 'lang' => true, 'required' => true, 'class' => 'copy2friendlyUrl', 'hint' => $this->l('Invalid characters:') . ' <>;=#{}', 'size' => 50), array('type' => 'text', 'label' => $this->l('Meta description'), 'name' => 'meta_description', 'lang' => true, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}', 'size' => 70), array('type' => 'tags', 'label' => $this->l('Meta keywords'), 'name' => 'meta_keywords', 'lang' => true, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}', 'size' => 70, 'desc' => $this->l('To add "tags" click in the field, write something, then press "Enter"')), array('type' => 'text', 'label' => $this->l('Friendly URL'), 'name' => 'link_rewrite', 'required' => true, 'lang' => true, 'hint' => $this->l('Only letters and the minus (-) character are allowed')), array('type' => 'textarea', 'label' => $this->l('Page content'), 'name' => 'content', 'autoload_rte' => true, 'lang' => true, 'rows' => 5, 'cols' => 40, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'radio', 'label' => $this->l('Displayed:'), 'name' => 'active', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled'))))), 'submit' => array('title' => $this->l('   Save   '), 'class' => 'button'));
     if (Shop::isFeatureActive()) {
         $this->fields_form['input'][] = array('type' => 'shop', 'label' => $this->l('Shop association:'), 'name' => 'checkBoxShopAsso');
     }
     $this->tpl_form_vars = array('active' => $this->object->active);
     return parent::renderForm();
 }
开发者ID:jicheng17,项目名称:vipinsg,代码行数:17,代码来源:AdminCmsController.php

示例2: renderForm

 public function renderForm()
 {
     if (!$this->loadObject(true)) {
         return;
     }
     $checkVersion = version_compare(_PS_VERSION_, '1.6');
     $this->isPS6 = false;
     if ($checkVersion >= 0) {
         $this->isPS6 = true;
     }
     if (Validate::isLoadedObject($this->object)) {
         $this->display = 'edit';
     } else {
         $this->display = 'add';
     }
     if (!$this->isPS6) {
         //ps5
         $this->toolbar_btn['save-and-preview'] = array('href' => '#', 'desc' => $this->l('Save and preview'));
         $this->toolbar_btn['save-and-stay'] = array('short' => 'SaveAndStay', 'href' => '#', 'desc' => $this->l('Save and stay'));
     }
     $this->initToolbar();
     if ($this->isPS6) {
         //ps6
         $this->initPageHeaderToolbar();
     }
     $categories = CMSCategory::getCategories($this->context->language->id, false);
     $html_categories = CMSCategory::recurseCMSCategory($categories, $categories[0][1], 1, $this->getFieldValue($this->object, 'id_cms_category'), 1);
     $galleries = $this->getSliders();
     $this->fields_form = array('tinymce' => true, 'legend' => array('title' => $this->l('CMS Page'), 'image' => '../img/admin/tab-categories.gif', 'icon' => 'icon-folder-close'), 'input' => array(array('type' => 'select_category', 'label' => $this->l('CMS Category'), 'name' => 'id_cms_category', 'options' => array('html' => $html_categories)), array('type' => 'text', 'label' => $this->l('Meta title:'), 'name' => 'meta_title', 'id' => 'name', 'lang' => true, 'required' => true, 'class' => 'copy2friendlyUrl copyMeta2friendlyURL', 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'select_category', 'label' => $this->l('Slider'), 'name' => 'proslider', 'empty_message' => $this->l('None'), 'options' => array('html' => $galleries)), array('type' => 'text', 'label' => $this->l('Meta description'), 'name' => 'meta_description', 'lang' => true, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'tags', 'label' => $this->l('Meta keywords'), 'name' => 'meta_keywords', 'lang' => true, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}', 'desc' => $this->l('To add "tags" click in the field, write something, and then press "Enter."')), array('type' => 'text', 'label' => $this->l('Friendly URL'), 'name' => 'link_rewrite', 'required' => true, 'lang' => true, 'hint' => $this->l('Only letters and the minus (-) character are allowed')), array('type' => 'textarea', 'label' => $this->l('Page content'), 'name' => 'content', 'autoload_rte' => true, 'lang' => true, 'rows' => 5, 'cols' => 40, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => $this->isPS6 ? 'switch' : 'hidden', 'label' => $this->l('Indexation by search engines'), 'name' => 'indexation', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'indexation_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'indexation_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => $this->isPS6 ? 'switch' : 'radio', 'label' => $this->l('Displayed:'), 'name' => 'active', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled'))))), 'submit' => array('title' => $this->l('Save'), 'class' => 'button btn btn-default'));
     if ($this->isPS6) {
         $this->fields_form['buttons'] = array('save_and_preview' => array('name' => 'viewcms', 'type' => 'submit', 'title' => $this->l('Save and preview'), 'class' => 'btn btn-default pull-right', 'icon' => 'process-icon-preview'));
     }
     $this->fields_form['submit'] = array('title' => $this->l('Save'), 'class' => 'button btn btn-default pull-right');
     if (Shop::isFeatureActive()) {
         $this->fields_form['input'][] = array('type' => 'shop', 'label' => $this->l('Shop association:'), 'name' => 'checkBoxShopAsso');
     }
     if ($this->isPS6) {
         if (Validate::isLoadedObject($this->object)) {
             $this->context->smarty->assign('url_prev', $this->getPreviewUrl($this->object));
         }
     }
     $this->tpl_form_vars = array('active' => $this->object->active, 'PS_ALLOW_ACCENTED_CHARS_URL', (int) Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL'));
     return adminController::renderForm();
 }
开发者ID:ac3gam3r,项目名称:Maxokraft,代码行数:44,代码来源:AdminCmsContent.php

示例3: renderForm

 public function renderForm()
 {
     if (!$this->loadObject(true)) {
         return;
     }
     if (Validate::isLoadedObject($this->object)) {
         $this->display = 'edit';
     } else {
         $this->display = 'add';
     }
     $this->initToolbar();
     $this->initPageHeaderToolbar();
     $categories = CMSCategory::getCategories($this->context->language->id, false);
     $html_categories = CMSCategory::recurseCMSCategory($categories, $categories[0][1], 1, $this->getFieldValue($this->object, 'id_cms_category'), 1);
     $this->fields_form = array('tinymce' => true, 'legend' => array('title' => $this->l('CMS Page'), 'icon' => 'icon-folder-close'), 'input' => array(array('type' => 'select_category', 'label' => $this->l('CMS Category'), 'name' => 'id_cms_category', 'options' => array('html' => $html_categories)), array('type' => 'text', 'label' => $this->l('Meta title'), 'name' => 'meta_title', 'id' => 'name', 'lang' => true, 'required' => true, 'class' => 'copyMeta2friendlyURL', 'hint' => $this->l('Invalid characters:') . ' &lt;&gt;;=#{}'), array('type' => 'text', 'label' => $this->l('Meta description'), 'name' => 'meta_description', 'lang' => true, 'hint' => $this->l('Invalid characters:') . ' &lt;&gt;;=#{}'), array('type' => 'tags', 'label' => $this->l('Meta keywords'), 'name' => 'meta_keywords', 'lang' => true, 'hint' => array($this->l('To add "tags" click in the field, write something, and then press "Enter."'), $this->l('Invalid characters:') . ' &lt;&gt;;=#{}')), array('type' => 'text', 'label' => $this->l('Friendly URL'), 'name' => 'link_rewrite', 'required' => true, 'lang' => true, 'hint' => $this->l('Only letters and the hyphen (-) character are allowed.')), array('type' => 'textarea', 'label' => $this->l('Page content'), 'name' => 'content', 'autoload_rte' => true, 'lang' => true, 'rows' => 5, 'cols' => 40, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'switch', 'label' => $this->l('Indexation by search engines'), 'name' => 'indexation', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'indexation_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'indexation_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'switch', 'label' => $this->l('Displayed'), 'name' => 'active', 'required' => false, 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled'))))), 'submit' => array('title' => $this->l('Save')), 'buttons' => array('save_and_preview' => array('name' => 'viewcms', 'type' => 'submit', 'title' => $this->l('Save and preview'), 'class' => 'btn btn-default pull-right', 'icon' => 'process-icon-preview')));
     if (Shop::isFeatureActive()) {
         $this->fields_form['input'][] = array('type' => 'shop', 'label' => $this->l('Shop association'), 'name' => 'checkBoxShopAsso');
     }
     $this->tpl_form_vars = array('active' => $this->object->active, 'PS_ALLOW_ACCENTED_CHARS_URL', (int) Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL'));
     return parent::renderForm();
 }
开发者ID:carloslastresDev,项目名称:HealthyTaiwan_UsingPrestaShop,代码行数:21,代码来源:AdminCmsController.php

示例4: displayForm

    public function displayForm($token = NULL)
    {
        global $currentIndex, $cookie;
        parent::displayForm();
        if (!($obj = $this->loadObject(true))) {
            return;
        }
        $active = $this->getFieldValue($obj, 'active');
        echo '
		<form action="' . $currentIndex . '&submitAdd' . $this->table . '=1&token=' . ($token != NULL ? $token : $this->token) . '" method="post" enctype="multipart/form-data">
		' . ($obj->id ? '<input type="hidden" name="id_' . $this->table . '" value="' . $obj->id . '" />' : '') . '
			<fieldset style="width:520px"><legend><img src="../img/admin/tab-categories.gif" />' . $this->l('CMS Category') . '</legend>
				<label>' . $this->l('Name:') . ' </label>
				<div class="margin-form translatable">';
        foreach ($this->_languages as $language) {
            echo '
					<div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;">
						<input type="text" style="width: 260px" name="name_' . $language['id_lang'] . '" id="name_' . $language['id_lang'] . '" value="' . htmlentities($this->getFieldValue($obj, 'name', (int) $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" ' . (!$obj->id ? ' onkeyup="copy2friendlyURL();"' : '') . ' /><sup> *</sup>
						<span class="hint" name="help_box">' . $this->l('Invalid characters:') . ' <>;=#{}<span class="hint-pointer">&nbsp;</span></span>
					</div>';
        }
        echo '	<p class="clear"></p>
				</div>
				<label>' . $this->l('Displayed:') . ' </label>
				<div class="margin-form">
					<input type="radio" name="active" id="active_on" value="1" ' . ($active ? 'checked="checked" ' : '') . '/>
					<label class="t" for="active_on"><img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
					<input type="radio" name="active" id="active_off" value="0" ' . (!$active ? 'checked="checked" ' : '') . '/>
					<label class="t" for="active_off"><img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
				</div>
				<label>' . $this->l('Parent CMS Category:') . ' </label>
				<div class="margin-form">
					<select name="id_parent">';
        $categories = CMSCategory::getCategories((int) $cookie->id_lang, false);
        CMSCategory::recurseCMSCategory($categories, $categories[0][1], 1, $this->getFieldValue($obj, 'id_parent'));
        echo '
					</select>
				</div>
				<label>' . $this->l('Description:') . ' </label>
				<div class="margin-form translatable">';
        foreach ($this->_languages as $language) {
            echo '
					<div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;">
						<textarea name="description_' . $language['id_lang'] . '" rows="5" cols="40">' . htmlentities($this->getFieldValue($obj, 'description', (int) $language['id_lang']), ENT_COMPAT, 'UTF-8') . '</textarea>
					</div>';
        }
        echo '	<p class="clear"></p>
				</div>
				<div class="clear"><br /></div>	
				<label>' . $this->l('Meta title:') . ' </label>
				<div class="margin-form translatable">';
        foreach ($this->_languages as $language) {
            echo '
					<div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;">
						<input type="text" name="meta_title_' . $language['id_lang'] . '" id="meta_title_' . $language['id_lang'] . '" value="' . htmlentities($this->getFieldValue($obj, 'meta_title', (int) $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" />
						<span class="hint" name="help_box">' . $this->l('Forbidden characters:') . ' <>;=#{}<span class="hint-pointer">&nbsp;</span></span>
					</div>';
        }
        echo '	<p class="clear"></p>
				</div>
				<label>' . $this->l('Meta description:') . ' </label>
				<div class="margin-form translatable">';
        foreach ($this->_languages as $language) {
            echo '<div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;">
						<input type="text" name="meta_description_' . $language['id_lang'] . '" id="meta_description_' . $language['id_lang'] . '" value="' . htmlentities($this->getFieldValue($obj, 'meta_description', (int) $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" />
						<span class="hint" name="help_box">' . $this->l('Forbidden characters:') . ' <>;=#{}<span class="hint-pointer">&nbsp;</span></span>
				</div>';
        }
        echo '	<p class="clear"></p>
				</div>
				<label>' . $this->l('Meta keywords:') . ' </label>
				<div class="margin-form translatable">';
        foreach ($this->_languages as $language) {
            echo '
					<div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;">
						<input type="text" name="meta_keywords_' . $language['id_lang'] . '" id="meta_keywords_' . $language['id_lang'] . '" value="' . htmlentities($this->getFieldValue($obj, 'meta_keywords', (int) $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" />
						<span class="hint" name="help_box">' . $this->l('Forbidden characters:') . ' <>;=#{}<span class="hint-pointer">&nbsp;</span></span>
					</div>';
        }
        echo '	<p class="clear"></p>
				</div>
				<label>' . $this->l('Friendly URL:') . ' </label>
				<div class="margin-form translatable">';
        foreach ($this->_languages as $language) {
            echo '<div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;">
						<input type="text" name="link_rewrite_' . $language['id_lang'] . '" id="link_rewrite_' . $language['id_lang'] . '" value="' . htmlentities($this->getFieldValue($obj, 'link_rewrite', (int) $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" onkeyup="this.value = str2url(this.value);" /><sup> *</sup>
						<span class="hint" name="help_box">' . $this->l('Only letters and the minus (-) character are allowed') . '<span class="hint-pointer">&nbsp;</span></span>
					</div>';
        }
        echo '	<p class="clear"></p>
				</div>
				
				<div class="margin-form">
					<input type="submit" value="' . $this->l('Save and back to parent CMS Category') . '" name="submitAdd' . $this->table . 'AndBackToParent" class="button" />
					&nbsp;<input type="submit" class="button" name="submitAdd' . $this->table . '" value="' . $this->l('Save') . '"/>
				</div>
				<div class="small"><sup>*</sup> ' . $this->l('Required field') . '</div>
			</fieldset>
		</form>
		<p class="clear"></p>';
//.........这里部分代码省略.........
开发者ID:greench,项目名称:prestashop,代码行数:101,代码来源:AdminCMSCategories.php

示例5: recurseCMSCategory

 public static function recurseCMSCategory($categories, $current, $id_cms_category = 1, $id_selected = 1, $is_html = 0)
 {
     $html = '<option value="' . $id_cms_category . '"' . ($id_selected == $id_cms_category ? ' selected="selected"' : '') . '>' . str_repeat('&nbsp;', $current['infos']['level_depth'] * 5) . CMSCategory::hideCMSCategoryPosition(stripslashes($current['infos']['name'])) . '</option>';
     if ($is_html == 0) {
         echo $html;
     }
     if (isset($categories[$id_cms_category])) {
         foreach (array_keys($categories[$id_cms_category]) as $key) {
             $html .= CMSCategory::recurseCMSCategory($categories, $categories[$id_cms_category][$key], $key, $id_selected, $is_html);
         }
     }
     return $html;
 }
开发者ID:NathanGiesbrecht,项目名称:PrestaShopAutomationFramework,代码行数:13,代码来源:CMSCategory.php

示例6: displayForm

    public function displayForm($isMainTab = true)
    {
        global $currentIndex, $cookie;
        parent::displayForm();
        $obj = $this->loadObject(true);
        $iso = Language::getIsoById((int) $cookie->id_lang);
        $divLangName = 'meta_title¤meta_description¤meta_keywords¤ccontent¤link_rewrite';
        echo '
		<form action="' . $currentIndex . '&submitAdd' . $this->table . '=1&token=' . Tools::getAdminTokenLite('AdminCMSContent') . '" method="post" name="cms" id="cms">
			' . ($obj->id ? '<input type="hidden" name="id_' . $this->table . '" value="' . $obj->id . '" />' : '') . '
			' . $this->_displayDraftWarning($obj->active) . '
			<fieldset><legend><img src="../img/admin/cms.gif" />' . $this->l('CMS page') . '</legend>';
        // META TITLE
        echo '<label>' . $this->l('CMS Category:') . ' </label>
				<div class="margin-form">
					<select name="id_cms_category">';
        $categories = CMSCategory::getCategories((int) $cookie->id_lang, false);
        CMSCategory::recurseCMSCategory($categories, $categories[0][1], 1, $this->getFieldValue($obj, 'id_cms_category'));
        echo '
					</select>
				</div>
				<label>' . $this->l('Meta title') . ' </label>
				<div class="margin-form">';
        foreach ($this->_languages as $language) {
            echo '	<div id="meta_title_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;">
						<input size="40" type="text" onkeyup="copyMeta2friendlyURL();" id="name_' . $language['id_lang'] . '" name="meta_title_' . $language['id_lang'] . '" value="' . htmlentities($this->getFieldValue($obj, 'meta_title', (int) $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" /><sup> *</sup>
					</div>';
        }
        $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'meta_title');
        echo '	</div><div class="clear space">&nbsp;</div>';
        // META DESCRIPTION
        echo '	<label>' . $this->l('Meta description') . ' </label>
				<div class="margin-form">';
        foreach ($this->_languages as $language) {
            echo '	<div id="meta_description_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;">
						<input size="50" type="text" name="meta_description_' . $language['id_lang'] . '" value="' . htmlentities($this->getFieldValue($obj, 'meta_description', (int) $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" />
					</div>';
        }
        $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'meta_description');
        echo '	</div><div class="clear space">&nbsp;</div>';
        // META KEYWORDS
        echo '	<label>' . $this->l('Meta keywords') . ' </label>
				<div class="margin-form">';
        foreach ($this->_languages as $language) {
            echo '	<div id="meta_keywords_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;">
						<input size="50" type="text" name="meta_keywords_' . $language['id_lang'] . '" value="' . htmlentities($this->getFieldValue($obj, 'meta_keywords', (int) $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" />
					</div>';
        }
        $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'meta_keywords');
        echo '	</div><div class="clear space">&nbsp;</div>';
        // LINK REWRITE
        echo '	<label>' . $this->l('Friendly URL') . ' </label>
				<div class="margin-form">';
        foreach ($this->_languages as $language) {
            echo '	<div id="link_rewrite_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;">
						<input size="30" type="text" id="input_link_rewrite_' . $language['id_lang'] . '" name="link_rewrite_' . $language['id_lang'] . '" onkeyup="this.value = str2url(this.value); updateFriendlyURL();" value="' . htmlentities($this->getFieldValue($obj, 'link_rewrite', (int) $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" /><sup> *</sup>
					</div>';
        }
        $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'link_rewrite');
        echo '	</div><div class="clear space">&nbsp;</div>';
        // CONTENT
        echo '	<label>' . $this->l('Page content') . ' </label>
				<div class="margin-form">';
        foreach ($this->_languages as $language) {
            echo '	<div id="ccontent_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . ';float: left;">
						<textarea class="rte" cols="80" rows="30" id="content_' . $language['id_lang'] . '" name="content_' . $language['id_lang'] . '">' . htmlentities(stripslashes($this->getFieldValue($obj, 'content', $language['id_lang'])), ENT_COMPAT, 'UTF-8') . '</textarea>
					</div>';
        }
        $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'ccontent');
        echo '	</div><div class="clear space">&nbsp;</div>
				<label>' . $this->l('Enable:') . ' </label>
				<div class="margin-form">
					<input type="radio" name="active" id="active_on" onclick="toggleDraftWarning(false);" value="1" ' . ($this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '') . '/>
					<label class="t" for="active_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
					<input type="radio" name="active" id="active_off" onclick="toggleDraftWarning(true);" value="0" ' . (!$this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '') . '/>
					<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
				</div>';
        // SUBMIT
        echo '	<div class="margin-form space">
					<input type="submit" value="' . $this->l('   Save   ') . '" name="submitAdd' . $this->table . '" class="button" />
				</div>
				<div class="small"><sup>*</sup> ' . $this->l('Required field') . '</div>
			</fieldset><br />
			' . $this->_displayDraftWarning($obj->active) . '
		</form>';
        // TinyMCE
        global $cookie;
        $iso = Language::getIsoById((int) $cookie->id_lang);
        $isoTinyMCE = file_exists(_PS_ROOT_DIR_ . '/js/tiny_mce/langs/' . $iso . '.js') ? $iso : 'en';
        $ad = dirname($_SERVER["PHP_SELF"]);
        echo '
			<script type="text/javascript">	
			var iso = \'' . $isoTinyMCE . '\' ;
			var pathCSS = \'' . _THEME_CSS_DIR_ . '\' ;
			var ad = \'' . $ad . '\' ;
			</script>
			<script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/tiny_mce/tiny_mce.js"></script>
			<script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/tinymce.inc.js"></script>';
    }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:99,代码来源:AdminCMS.php

示例7: renderForm

 public function renderForm()
 {
     $this->display = 'edit';
     $this->initToolbar();
     if (!$this->loadObject(true)) {
         return;
     }
     $categories = CMSCategory::getCategories($this->context->language->id, false);
     $html_categories = CMSCategory::recurseCMSCategory($categories, $categories[0][1], 1, $this->getFieldValue($this->object, 'id_parent'), 1);
     $this->fields_form = array('legend' => array('title' => $this->l('CMS Category'), 'image' => '../img/admin/tab-categories.gif'), 'input' => array(array('type' => 'text', 'label' => $this->l('Name:'), 'name' => 'name', 'required' => true, 'lang' => true, 'class' => 'copy2friendlyUrl', 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'radio', 'label' => $this->l('Displayed:'), 'name' => 'active', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'select_category', 'label' => $this->l('Parent CMS Category:'), 'name' => 'id_parent', 'options' => array('html' => $html_categories)), array('type' => 'textarea', 'label' => $this->l('Description:'), 'name' => 'description', 'lang' => true, 'rows' => 5, 'cols' => 40, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'text', 'label' => $this->l('Meta title:'), 'name' => 'meta_title', 'lang' => true, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'text', 'label' => $this->l('Meta description:'), 'name' => 'meta_description', 'lang' => true, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'text', 'label' => $this->l('Meta keywords:'), 'name' => 'meta_keywords', 'lang' => true, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'text', 'label' => $this->l('Friendly URL:'), 'name' => 'link_rewrite', 'required' => true, 'lang' => true, 'hint' => $this->l('Only letters and the minus (-) character are allowed'))), 'submit' => array('title' => $this->l('Save'), 'class' => 'button'));
     $this->tpl_form_vars['PS_ALLOW_ACCENTED_CHARS_URL'] = (int) Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL');
     return parent::renderForm();
 }
开发者ID:jicheng17,项目名称:pengwine,代码行数:13,代码来源:AdminCmsCategoriesController.php

示例8: renderForm

 public function renderForm()
 {
     $this->display = 'edit';
     $this->initToolbar();
     if (!$this->loadObject(true)) {
         return;
     }
     $categories = CMSCategory::getCategories($this->context->language->id, false);
     $html_categories = CMSCategory::recurseCMSCategory($categories, $categories[0][1], 1, $this->getFieldValue($this->object, 'id_parent'), 1);
     $this->fields_form = array('legend' => array('title' => $this->l('CMS Category'), 'icon' => 'icon-folder-close'), 'input' => array(array('type' => 'text', 'label' => $this->l('Name'), 'name' => 'name', 'required' => true, 'lang' => true, 'hint' => $this->l('Invalid characters:') . ' &lt;&gt;;=#{}'), array('type' => 'switch', 'label' => $this->l('Displayed'), 'name' => 'active', 'required' => false, 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'select_category', 'label' => $this->l('Parent CMS Category'), 'name' => 'id_parent', 'options' => array('html' => $html_categories)), array('type' => 'textarea', 'label' => $this->l('Description'), 'name' => 'description', 'lang' => true, 'rows' => 5, 'cols' => 40, 'hint' => $this->l('Invalid characters:') . ' &lt;&gt;;=#{}'), array('type' => 'text', 'label' => $this->l('Meta title'), 'name' => 'meta_title', 'lang' => true, 'hint' => $this->l('Invalid characters:') . ' &lt;&gt;;=#{}'), array('type' => 'text', 'label' => $this->l('Meta description'), 'name' => 'meta_description', 'lang' => true, 'hint' => $this->l('Invalid characters:') . ' &lt;&gt;;=#{}'), array('type' => 'text', 'label' => $this->l('Meta keywords'), 'name' => 'meta_keywords', 'lang' => true, 'hint' => $this->l('Invalid characters:') . ' &lt;&gt;;=#{}'), array('type' => 'text', 'label' => $this->l('Friendly URL'), 'name' => 'link_rewrite', 'required' => true, 'lang' => true, 'hint' => $this->l('Only letters and the minus (-) character are allowed.'))), 'submit' => array('title' => $this->l('Save')));
     if (Shop::isFeatureActive()) {
         $this->fields_form['input'][] = array('type' => 'shop', 'label' => $this->l('Shop association'), 'name' => 'checkBoxShopAsso');
     }
     $this->tpl_form_vars['PS_ALLOW_ACCENTED_CHARS_URL'] = (int) Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL');
     return parent::renderForm();
 }
开发者ID:ortegon000,项目名称:tienda,代码行数:16,代码来源:AdminCmsCategoriesController.php

示例9: _displayAddForm

    private function _displayAddForm()
    {
        global $currentIndex, $cookie;
        $defaultLanguage = (int) Configuration::get('PS_LANG_DEFAULT');
        $languages = Language::getLanguages(false);
        $divLangName = 'name';
        $cmsBlock = NULL;
        if (Tools::isSubmit('editBlockCMS') and Tools::getValue('id_cms_block')) {
            $cmsBlock = $this->getBlockCMS((int) Tools::getValue('id_cms_block'));
        }
        $this->_html .= '
		<script type="text/javascript" src="' . _PS_BASE_URL_ . __PS_BASE_URI__ . 'modules/' . $this->name . '/' . $this->name . '.js"></script>
		<script type="text/javascript">id_language = Number(' . $defaultLanguage . ');</script>
		<form method="POST" action="' . Tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']) . '">
		';
        if (Tools::getValue('id_cms_block')) {
            $this->_html .= '<input type="hidden" name="id_cms_block" value="' . (int) Tools::getValue('id_cms_block') . '" id="id_cms_block" />';
        }
        $this->_html .= '
		<fieldset>';
        if (Tools::isSubmit('addBlockCMS')) {
            $this->_html .= '<legend><img src="' . _PS_ADMIN_IMG_ . 'add.gif" alt="" /> ' . $this->l('New CMS block') . '</legend>';
        } elseif (Tools::isSubmit('editBlockCMS')) {
            $this->_html .= '<legend><img src="' . _PS_BASE_URL_ . __PS_BASE_URI__ . 'modules/' . $this->name . '/logo.gif" alt="" /> ' . $this->l('Edit CMS block') . '</legend>';
        }
        $this->_html .= '
			<label>' . $this->l('Name of block:') . '</label>
			<div class="margin-form">';
        foreach ($languages as $language) {
            $this->_html .= '
					<div id="name_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $defaultLanguage ? 'block' : 'none') . ';float: left;">
						<input type="text" name="block_name_' . $language['id_lang'] . '" id="block_name_' . $language['id_lang'] . '" size="30" value="' . (Tools::getValue('block_name_' . $language['id_lang']) ? Tools::getValue('block_name_' . $language['id_lang']) : (isset($cmsBlock['name'][$language['id_lang']]) ? $cmsBlock['name'][$language['id_lang']] : '')) . '" />
					</div>';
        }
        $this->_html .= $this->displayFlags($languages, $defaultLanguage, $divLangName, 'name', true);
        $this->_html .= '<p class="clear">' . $this->l('If you leave this field empty, the block name will use the category name') . '</p>
			</div><br />
			<label for="id_category">' . $this->l('Choose a CMS category:') . '</label>
			<div class="margin-form">
				<select name="id_category" id="id_category" onchange="CMSCategory_js($(this).val(), \'' . $this->secure_key . '\')">';
        $categories = CMSCategory::getCategories((int) $cookie->id_lang, false);
        $this->_html .= CMSCategory::recurseCMSCategory($categories, $categories[0][1], 1, $cmsBlock != NULL ? $cmsBlock[0]['id_cms_category'] : 1, 1);
        $this->_html .= '
				</select>
			</div><br />
			
			<label>' . $this->l('Location:') . '</label>
			<div class="margin-form">
				<select name="block_location" id="block_location">
					<option value="' . self::LEFT_COLUMN . '" ' . (($cmsBlock and $cmsBlock[0]['location'] == self::LEFT_COLUMN) ? 'selected="selected"' : '') . '>' . $this->l('Left') . '</option>
					<option value="' . self::RIGHT_COLUMN . '" ' . (($cmsBlock and $cmsBlock[0]['location'] == self::RIGHT_COLUMN) ? 'selected="selected"' : '') . '>' . $this->l('Right') . '</option>
				</select>
			</div>';
        $this->_html .= '
			<label for="PS_STORES_DISPLAY_CMS_on">' . $this->l('Display Stores:') . '</label>
			<div class="margin-form">
				<img src="../img/admin/enabled.gif" alt="Yes" title="Yes" />
		        <input type="radio" name="PS_STORES_DISPLAY_CMS" id="PS_STORES_DISPLAY_CMS_on" ' . (($cmsBlock and isset($cmsBlock[0]['display_store']) && $cmsBlock[0]['display_store'] == 0) ? '' : 'checked="checked" ') . 'value="1" />
			    <label class="t" for="PS_STORES_DISPLAY_CMS_on">' . $this->l('Yes') . '</label>
			    <img src="../img/admin/disabled.gif" alt="No" title="No" style="margin-left: 10px;" />
			    <input type="radio" name="PS_STORES_DISPLAY_CMS" id="PS_STORES_DISPLAY_CMS_off" ' . (($cmsBlock and isset($cmsBlock[0]['display_store']) && $cmsBlock[0]['display_store'] == 0) ? 'checked="checked" ' : '') . 'value="0" />
			    <label  class="t" for="PS_STORES_DISPLAY_CMS_off">' . $this->l('No') . '</label><br />' . $this->l('Display "our stores" at the end of the block') . '</div>';
        $this->_html .= '<div id="cms_subcategories"></div>
			<p class="center">
				<input type="submit" class="button" name="submitBlockCMS" value="' . $this->l('Save') . '" />
				<a class="button" style="position:relative; padding:3px 3px 4px 3px; top:1px" href="' . $currentIndex . '&configure=' . $this->name . '&token=' . Tools::getAdminTokenLite('AdminModules') . '">' . $this->l('Cancel') . '</a>
			</p>';
        $this->_html .= '
		</fieldset>
		</form>
		<script type="text/javascript">CMSCategory_js($(\'#id_category\').val(), \'' . $this->secure_key . '\')</script>';
    }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:72,代码来源:blockcms.php

示例10: fieldsetCmsCategory

 public function fieldsetCmsCategory($children = true)
 {
     $categories = CMSCategory::getCategories($this->context->language->id, false);
     $id_cms_category = 1;
     if (isset($this->object->id_cms_category)) {
         $id_cms_category = $this->object->id_cms_category;
     }
     $html_categories = CMSCategory::recurseCMSCategory($categories, $categories[0][1], 1, $id_cms_category, 1, false);
     $fields = array('legend' => array('title' => $this->l('Cms Category'), 'class' => 'fieldset-cms-category', 'image' => $this->getPstPictureUrl('cms_category.png', 'type')), 'input' => array(array('type' => 'select_html', 'label' => $this->l('CMS Category'), 'name' => 'id_cms_category', 'options' => array('html' => $html_categories))));
     if ($children) {
         $fields['input'][] = array('type' => 'radio', 'class' => 't', 'label' => $this->l('Display childs ? :'), 'container_class' => 'display_cms_cat_childs', 'required' => false, 'name' => 'display_cms_cat_childs', 'desc' => $this->l('Display all sub categories'), 'is_bool' => true, 'values' => array(array('id' => 'display_cms_cat_childs_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'display_cms_cat_childs_off', 'value' => 0, 'label' => $this->l('Disabled'))));
     }
     $this->fields_form[] = array('class' => 'cms_category box-hide', 'form' => $fields);
 }
开发者ID:simonbonjean,项目名称:PrestaSuperTool-Api,代码行数:14,代码来源:PstAdminController.php


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