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


PHP HelperForm::renderAssoShop方法代码示例

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


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

示例1: ajaxCallBackOffice


//.........这里部分代码省略.........
								if (categories[iteration])
								{
									category = $(\'#categories-treeview\').find(\'input[name="categoryBox[]"][value=\'+categories[iteration]+\']\');
								
									if (category.length)
									{
										if (category.parent().hasClass(\'expandable\'))
										{
											$(\'#\'+categories[iteration]+\' .hitarea\').click();
										}
										
										if (parseInt(categories[iteration]) == parseInt(id_category))
										{
											$(\'#layered-cat-counter\').html(parseInt($(\'#layered-cat-counter\').html()) + 1);
											if ($(\'#categories-treeview\').find(\'input[name="categoryBox[]"][value=\'+id_category+\']:checked\').length == 0)
											{
												$(\'#categories-treeview\').find(\'input[name="categoryBox[]"][value=\'+id_category+\']\').click();
												clickOnCategoryBox($(\'#categories-treeview\').find(\'input[name="categoryBox[]"][value=\'+id_category+\']\'));
											}
											collapseAllCategories();
										}
									}
									else {
										setTimeout(function() { expandCategories(categories, iteration, id_category, false); }, 20 );
										return;
									}
									$(\'#categories-treeview\').parent().parent().show();
									expandCategories(categories, iteration+1, id_category);
									if (typeof(lock_treeview_hidding) == \'undefined\' || !lock_treeview_hidding)
										$(\'#categories-treeview\').parent().parent().hide();
								}
							}
							$(\'#layered-cat-counter\').html(0);
							$(\'.nb_sub_cat_selected\').hide();
							$(\'#categories-treeview\').find(\'input[name="categoryBox[]"]:checked\').each(function(i, it) {
								$(it).click();
								updateNbSubCategorySelected($(it), false);
							});';
                foreach ($layered_values['categories'] as $id_category) {
                    if ($id_category != 1) {
                        $category = new Category($id_category);
                        $parent_list = array_reverse($category->getParentsCategories());
                    } else {
                        $parent_list = array(array('id_category' => 1));
                    }
                    $html .= 'var categories = [];
					';
                    foreach ($parent_list as $parent) {
                        $html .= '
							categories.push(' . (int) $parent['id_category'] . ');';
                    }
                    $html .= '
						expandCategories(categories, 0, ' . (int) $id_category . ', false);';
                }
                $html .= '
				updCatCounter();
				$(\'#scope_1\').attr(\'checked\', \'\');
				$(\'#scope_2\').attr(\'checked\', \'checked\');
				';
            } else {
                $html .= '
				$(\'#scope_2\').attr(\'checked\', \'\');
				$(\'#scope_1\').attr(\'checked\', \'checked\');
				';
            }
            $html .= '
			$(\'#layered_tpl_name\').val(\'' . addslashes($layered_filter['name']) . '\');
			$(\'#id_layered_filter\').val(\'' . (int) $layered_filter['id_layered_filter'] . '\');
			';
            $html .= '
				});
			</script>';
        }
        if (!empty($id_layered_filter)) {
            if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL) {
                $shops = Shop::getShops(true, null, true);
                if (count($shops) > 1) {
                    $helper = new HelperForm();
                    $helper->id = (int) $id_layered_filter;
                    $helper->table = 'layered_filter';
                    $helper->identifier = 'id_layered_filter';
                    $helper->base_folder = Tools::getValue('base_folder') . '/themes/default/template/helpers/form/';
                    $html .= '
					<div id="shop_association_ajax">' . $helper->renderAssoShop() . '</div>
					<script type="text/javascript">
						$(document).ready(function() {
							$(\'#shop_association\').html($(\'#shop_association_ajax\').html());
							$(\'#shop_association_ajax\').remove();
							// Initialize checkbox
							$(\'.input_shop\').each(function(k, v) {
									check_shop_group_status($(v).val());
								check_all_shop();
							});
						});
					</script>';
                }
            }
        }
        return $html;
    }
开发者ID:rongandat,项目名称:vatfairfoot,代码行数:101,代码来源:blocklayered.php

示例2: getContent


//.........这里部分代码省略.........
				FROM ' . _DB_PREFIX_ . 'layered_filter
				WHERE id_layered_filter = ' . (int) Tools::getValue('id_layered_filter'));
                    if ($layered_values) {
                        Db::getInstance()->execute('
					DELETE FROM ' . _DB_PREFIX_ . 'layered_filter
					WHERE id_layered_filter = ' . (int) Tools::getValue('id_layered_filter') . ' LIMIT 1');
                        $this->buildLayeredCategories();
                        $message = $this->displayConfirmation($this->l('Filter template deleted, categories updated (reverted to default Filter template).'));
                    } else {
                        $message = $this->displayError($this->l('Filter template not found'));
                    }
                }
            }
        }
        $category_box = array();
        $attribute_groups = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
			SELECT ag.id_attribute_group, ag.is_color_group, agl.name, COUNT(DISTINCT(a.id_attribute)) n
			FROM ' . _DB_PREFIX_ . 'attribute_group ag
			LEFT JOIN ' . _DB_PREFIX_ . 'attribute_group_lang agl ON (agl.id_attribute_group = ag.id_attribute_group)
			LEFT JOIN ' . _DB_PREFIX_ . 'attribute a ON (a.id_attribute_group = ag.id_attribute_group)
			WHERE agl.id_lang = ' . (int) $cookie->id_lang . '
			GROUP BY ag.id_attribute_group');
        $features = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
			SELECT fl.id_feature, fl.name, COUNT(DISTINCT(fv.id_feature_value)) n
			FROM ' . _DB_PREFIX_ . 'feature_lang fl
			LEFT JOIN ' . _DB_PREFIX_ . 'feature_value fv ON (fv.id_feature = fl.id_feature)
			WHERE (fv.custom IS NULL OR fv.custom = 0) AND fl.id_lang = ' . (int) $cookie->id_lang . '
			GROUP BY fl.id_feature');
        if (Shop::isFeatureActive() && count(Shop::getShops(true, null, true)) > 1) {
            $helper = new HelperForm();
            $helper->id = Tools::getValue('id_layered_filter', null);
            $helper->table = 'layered_filter';
            $helper->identifier = 'id_layered_filter';
            $this->context->smarty->assign('asso_shops', $helper->renderAssoShop());
        }
        if (version_compare(_PS_VERSION_, '1.6.0', '>=') === true) {
            $tree_categories_helper = new HelperTreeCategories('categories-treeview');
            $tree_categories_helper->setRootCategory(Shop::getContext() == Shop::CONTEXT_SHOP ? Category::getRootCategory()->id_category : 0)->setUseCheckBox(true);
        } else {
            if (Shop::getContext() == Shop::CONTEXT_SHOP) {
                $root_category = Category::getRootCategory();
                $root_category = array('id_category' => $root_category->id_category, 'name' => $root_category->name);
            } else {
                $root_category = array('id_category' => '0', 'name' => $this->l('Root'));
            }
            $tree_categories_helper = new Helper();
        }
        $module_url = Tools::getProtocol(Tools::usingSecureMode()) . $_SERVER['HTTP_HOST'] . $this->getPathUri();
        if (method_exists($this->context->controller, 'addJquery')) {
            $this->context->controller->addJS($this->_path . 'js/blocklayered_admin.js');
            if (version_compare(_PS_VERSION_, '1.6.0.3', '>=') === true) {
                $this->context->controller->addjqueryPlugin('sortable');
            } elseif (version_compare(_PS_VERSION_, '1.6.0', '>=') === true) {
                $this->context->controller->addJS(_PS_JS_DIR_ . 'jquery/plugins/jquery.sortable.js');
            } else {
                $this->context->controller->addJS($this->_path . 'js/jquery.sortable.js');
            }
        }
        if (version_compare(_PS_VERSION_, '1.6.0', '>=') === true) {
            $this->context->controller->addCSS($this->_path . 'css/blocklayered_admin_1.6.css');
        } else {
            $this->context->controller->addCSS($this->_path . 'css/blocklayered_admin.css');
        }
        if (Tools::getValue('add_new_filters_template')) {
            $this->context->smarty->assign(array('current_url' => $this->context->link->getAdminLink('AdminModules') . '&configure=blocklayered&tab_module=front_office_features&module_name=blocklayered', 'uri' => $this->getPathUri(), 'id_layered_filter' => 0, 'template_name' => sprintf($this->l('My template - %s'), date('Y-m-d')), 'attribute_groups' => $attribute_groups, 'features' => $features, 'total_filters' => 6 + count($attribute_groups) + count($features)));
            if (version_compare(_PS_VERSION_, '1.6.0', '>=') === true) {
开发者ID:Beattle,项目名称:perrino-shop,代码行数:67,代码来源:blocklayered.php

示例3: displayForm3


//.........这里部分代码省略.........
                    }
                    if ($name_exist) {
                        $res &= $new_theme->add();
                    }
                    if ($res) {
                        $ok[] = $variation;
                    }
                }
            }
            if (count($ok) > 0) {
                $msg = $this->l('The following themes were successfully imported:') . '<ul><i>';
                foreach ($ok as $row) {
                    $msg .= '<li> ' . $row . '</li>';
                }
                $msg .= '</i></ul>';
                $this->_msg = parent::displayConfirmation($msg);
            }
        }
        self::getModules();
        if (file_exists(_IMPORT_FOLDER_ . 'doc') && count($xml->docs->doc) != 0) {
            self::loadDocForm();
        }
        $this->_html .= '<fieldset>';
        if ($this->to_install && count($this->to_install) > 0) {
            $var = '';
            foreach ($this->to_install as $row) {
                if (file_exists(_IMPORT_FOLDER_ . 'modules/' . $row)) {
                    $module_already_exists = file_exists(_PS_MODULE_DIR_ . $row);
                    $var .= '<input type="checkbox" name="modulesToExport[]" id="' . $row . '" value="' . $row . '" checked="checked" />
						<label style="display:bock;float:none" for="' . $row . '">' . $row . ($module_already_exists ? ' <span style="font-size:0.8em;color:red;">' . $this->l('Warning: a module with the same name already exists.') . '</span>' : '') . '</label><br />';
                }
            }
            if ($var != '') {
                $this->_html .= '
					<fieldset>
						<legend>' . $this->l('Select the theme\'s modules you wish to install') . '</legend>
						<p class="margin-form">' . $var . '</p>
					</fieldset>
					<p>&nbsp;</p>';
            }
        }
        $var = '';
        if (is_array($this->to_enable) && !empty($this->to_enable)) {
            $list_to_disabled = array_diff($this->native_modules, $this->to_enable);
        } else {
            $list_to_disabled = $this->native_modules;
        }
        foreach ($list_to_disabled as $row) {
            $obj = Module::getInstanceByName($row);
            if (Validate::isLoadedObject($obj)) {
                if (!file_exists(_IMPORT_FOLDER_ . 'modules/' . $row) && $obj->tab == 'front_office_features') {
                    $var .= '<input type="checkbox" name="modulesToDisable[]" id="' . $row . '" value="' . $row . '" checked="checked" />
						<label style="display:bock;float:none" for="' . $row . '">' . $row . '</label><br />';
                }
            }
        }
        if (!empty($var)) {
            $this->_html .= '
				<fieldset>
					<legend>' . $this->l('Select the modules which must be disabled for this theme') . '</legend>
					<p class="margin-form">' . $var . '</p>
				</fieldset>
				<p>&nbsp;</p>';
        }
        $this->_html .= '
			<fieldset>
				<legend>' . $this->l('Native modules configuration') . '</legend>
				<p>' . $this->l('This option determines which existing native modules have to be enabled/disabled.') . '</p>
				<ul class="margin-form" style="list-style:none">
					<li>
						<input type="radio" name="nativeModules" value="1" id="nativemoduleconfig1"/>
						<label style="display:bock;float:none" for="nativemoduleconfig1">' . $this->l('Keep my current configuration') . '</label>
					</li>
					<li>
						<input type="radio" name="nativeModules" value="2" id="nativemoduleconfig2" checked="checked" />
						<label style="display:bock;float:none" for="nativemoduleconfig2">' . $this->l('Use the theme\'s configuration (recommended)') . '</label>
					</li>
					<li>
						<input type="radio" name="nativeModules" value="3" id="nativemoduleconfig3" />
						<label style="display:bock;float:none" for="nativemoduleconfig3">' . $this->l('Use both my configuration and the theme\'s configuration') . '</label>
					</li>
				</ul>
			</fieldset>
			<p>&nbsp;</p>';
        if ($this->context->shop->isFeatureActive()) {
            $helper_form = new HelperForm();
            $this->_html .= '
			<fieldset>
				<legend>' . $this->l('Select the shop that will use this theme:') . '</legend>
				<div class="margin-form">' . $helper_form->renderAssoShop() . '</div>
			</fieldset>
			<p>&nbsp;</p>';
        }
        $this->_html .= '
			<p class="clear">&nbsp;</p>
			<input type="submit" class="button" name="prevThemes" value="' . $this->l('Previous') . '" />
			<input type="submit" class="button" name="submitModules" value="' . $this->l('Next') . '" />
		</fieldset>
		</form>';
    }
开发者ID:jep004,项目名称:prestashop,代码行数:101,代码来源:themeinstallator.php

示例4: _displayForm

    private function _displayForm()
    {
        /* Language */
        $id_lang_default = (int) Configuration::get('PS_LANG_DEFAULT');
        $languages = Language::getLanguages(false);
        $div_lang_name = 'text¤title';
        $links = '';
        /* Title */
        $title_url = Configuration::get('PS_TMBLOCKLINK1_URL');
        if (!Tools::isSubmit('submitLinkAdd')) {
            if ($id_link = (int) Tools::getValue('id_link')) {
                $res = Db::getInstance()->executeS('
				SELECT *
				FROM ' . _DB_PREFIX_ . 'tmblocklink1 b
				LEFT JOIN ' . _DB_PREFIX_ . 'tmblocklink1_lang bl ON (b.id_tmblocklink1 = bl.id_tmblocklink1)
				WHERE b.id_tmblocklink1=' . (int) $id_link);
                if ($res) {
                    foreach ($res as $row) {
                        $links['text'][(int) $row['id_lang']] = $row['text'];
                        $links['url'] = $row['url'];
                        $links['new_window'] = $row['new_window'];
                    }
                }
            }
        }
        $this->_html .= '
		<script type="text/javascript">
			id_language = Number(' . (int) $id_lang_default . ');
		</script>
		<fieldset>
			<legend><img src="' . $this->_path . 'add.png" alt="" title="" /> ' . $this->l('Add a new link') . '</legend>
			<form method="post" action="index.php?controller=adminmodules&configure=' . Tools::safeOutput(Tools::getValue('configure')) . '&token=' . Tools::safeOutput(Tools::getValue('token')) . '&tab_module=' . Tools::safeOutput(Tools::getValue('tab_module')) . '&module_name=' . Tools::safeOutput(Tools::getValue('module_name')) . '">
				<input type="hidden" name="id_link" value="' . (int) Tools::getValue('id_link') . '" />
				<label>' . $this->l('Text:') . '</label>
				<div class="margin-form">';
        foreach ($languages as $language) {
            $this->_html .= '
					<div id="text_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $id_lang_default ? 'block' : 'none') . '; float: left;">
						<input type="text" name="text_' . $language['id_lang'] . '" id="textInput_' . $language['id_lang'] . '" value="' . (isset($links) && isset($links['text'][$language['id_lang']]) ? $links['text'][$language['id_lang']] : '') . '" /><sup> *</sup>
					</div>';
        }
        $this->_html .= $this->displayFlags($languages, $id_lang_default, $div_lang_name, 'text', true);
        $this->_html .= '
					<div class="clear"></div>
				</div>
				<label>' . $this->l('URL:') . '</label>
				<div class="margin-form"><input type="text" name="url" id="url" value="' . (isset($links) && isset($links['url']) ? Tools::safeOutput($links['url']) : '') . '" /><sup> *</sup></div>
				<label>' . $this->l('Open in a new window:') . '</label>
				<div class="margin-form"><input type="checkbox" name="newWindow" id="newWindow" ' . (isset($links) && $links['new_window'] ? 'checked="checked"' : '') . ' /></div>';
        $shops = Shop::getShops(true, null, true);
        if (Shop::isFeatureActive() && count($shops) > 1) {
            $helper = new HelperForm();
            $helper->id = (int) Tools::getValue('id_link');
            $helper->table = 'tmblocklink1';
            $helper->identifier = 'id_tmblocklink1';
            $this->_html .= '<label for="shop_association">' . $this->l('Shop association:') . '</label><div id="shop_association" class="margin-form">' . $helper->renderAssoShop() . '</div>';
        }
        $this->_html .= '
				<div class="margin-form">
					<input type="submit" class="button" name="submitLinkAdd" value="' . $this->l('Add this link') . '" />
				</div>
			</form>
		</fieldset>
		<fieldset class="space">
			<legend><img src="' . $this->_path . 'logo.gif" alt="" title="" /> ' . $this->l('Block title') . '</legend>
			<form method="post" action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">
				<label>' . $this->l('Block title:') . '</label>
				<div class="margin-form">';
        foreach ($languages as $language) {
            $this->_html .= '
					<div id="title_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $id_lang_default ? 'block' : 'none') . '; float: left;">
						<input type="text" name="title_' . $language['id_lang'] . '" 
						value="' . Tools::safeOutput($this->error && Tools::getIsset('title') ? Tools::getIsset('title') : Configuration::get('PS_TMBLOCKLINK1_TITLE', $language['id_lang'])) . '" /><sup> *</sup>
					</div>';
        }
        $this->_html .= $this->displayFlags($languages, $id_lang_default, $div_lang_name, 'title', true);
        $this->_html .= '
				<div class="clear"></div>
				</div>
				<label>' . $this->l('Block URL:') . '</label>
				<div class="margin-form"><input type="text" name="title_url" value="' . Tools::safeOutput($this->error && Tools::getIsset('title_url') ? Tools::getValue('title_url') : $title_url) . '" /></div>
				<div class="margin-form"><input type="submit" class="button" name="submitTitle" value="' . $this->l('Update') . '" /></div>
			</form>
		</fieldset>';
    }
开发者ID:carloslastresDev,项目名称:HealthyTaiwan_UsingPrestaShop,代码行数:85,代码来源:tmblocklink1.php

示例5: displayForm3


//.........这里部分代码省略.........
                $this->_msg = parent::displayConfirmation($msg);
            }
        }
        self::getModules();
        if (file_exists(_IMPORT_FOLDER_ . 'doc') && count($xml->docs->doc) != 0) {
            self::loadDocForm();
        }
        $this->_html .= '<fieldset>';
        if ($this->to_install && count($this->to_install) > 0) {
            $var = '';
            foreach ($this->to_install as $row) {
                if (file_exists(_IMPORT_FOLDER_ . 'modules/' . $row)) {
                    $module_already_exists = file_exists(_PS_MODULE_DIR_ . $row);
                    $var .= '<input type="checkbox" name="modulesToExport[]" id="' . $row . '" value="' . $row . '" checked="checked" />
						<label style="display:bock;float:none" for="' . $row . '">' . $row . ($module_already_exists ? ' <span style="font-size:0.8em">-> ' . $this->l('Warning: a module with the same name already exists') . '</span>' : '') . '</label><br />';
                }
            }
            if ($var != '') {
                $this->_html .= '
					<fieldset>
						<legend>' . $this->l('Select the theme\'s modules you wish to install') . '</legend>
						<p class="margin-form">' . $var . '</p>
					</fieldset>
					<p>&nbsp;</p>';
            }
        }
        $var = '';
        foreach (array_diff($this->native_modules, $this->to_disable) as $row) {
            $obj = Module::getInstanceByName($row);
            if (Validate::isLoadedObject($obj)) {
                if (!file_exists(_IMPORT_FOLDER_ . 'modules/' . $row) && $obj->tab == 'front_office_features') {
                    $var .= '<input type="checkbox" name="modulesToDisable[]" id="' . $row . '" value="' . $row . '" />
						<label style="display:bock;float:none" for="' . $row . '">' . $row . '</label><br />';
                }
            }
        }
        $this->_html .= '
			<fieldset>
				<legend>' . $this->l('Select modules which must be disabled for this theme') . '</legend>
				<p class="margin-form">' . $var . '</p>
			</fieldset>
			<p>&nbsp;</p>';
        $this->_html .= '
			<fieldset>
				<legend>' . $this->l('Native modules configuration') . '</legend>
				<ul class="margin-form" style="list-style:none">
					<li>
						<input type="radio" name="nativeModules" value="1" id="nativemoduleconfig1"/>
						<label style="display:bock;float:none" for="nativemoduleconfig1">' . $this->l('Current configuration') . '</label>
					</li>
					<li>
						<input type="radio" name="nativeModules" value="2" id="nativemoduleconfig2" checked="checked" />
						<label style="display:bock;float:none" for="nativemoduleconfig2">' . $this->l('Theme\'s configuration') . '</label>
					</li>
					<li>
						<input type="radio" name="nativeModules" value="3" id="nativemoduleconfig3" />
						<label style="display:bock;float:none" for="nativemoduleconfig3">' . $this->l('Both') . '</label>
					</li>
				</ul>
			</fieldset>
			<p>&nbsp;</p>';
        if (Shop::isFeatureActive()) {
            $helper_form = new HelperForm();
            $this->_html .= '
			<fieldset>
				<legend>' . $this->l('Select your shop that will use this theme:') . '</legend>
				<div class="margin-form">' . $helper_form->renderAssoShop() . '</div>
			</fieldset>
			<p>&nbsp;</p>';
        }
        $this->_html .= '
			<p class="clear">&nbsp;</p>
			<input type="submit" class="button" name="prevThemes" value="' . $this->l('Previous') . '" />
			<input type="submit" class="button" name="submitModules" value="' . $this->l('Next') . '" />
		</fieldset>
		</form>
		<script type="text/javascript">
			$(document).ready(function() {
					$.ajax({
						type : "POST",
						url : "' . str_replace('index', 'ajax-tab', AdminController::$currentIndex) . '",
						data :	{
							"theme_list" : ' . Tools::jsonEncode(array((string) $this->xml->theme_key)) . ',
							"controller" : "AdminModules",
							"action" : "wsThemeCall",
							"token" : "' . Tools::getAdminToken('AdminModules' . (int) Tab::getIdFromClassName('AdminModules') . (int) $this->context->employee->id) . '"
						},
						dataType: "json",
						success: function(json)
						{
							//console.log(json);
						},
						error: function(xhr, ajaxOptions, thrownError)
						{
							//jAlert("TECHNICAL ERROR"+res);
						}
					});
				});
		</script>';
    }
开发者ID:jicheng17,项目名称:vipinsg,代码行数:101,代码来源:themeinstallator.php

示例6: renderForm


//.........这里部分代码省略.........
            foreach ($accessories as $accessory) {
                $form_output .= $accessory['id_product'] . '-';
            }
            $form_output .= '" />	
                                <input type="hidden" name="nameAccessories" id="nameAccessories" value="';
            foreach ($accessories as $accessory) {
                $form_output .= $accessory['name'] . '¤';
            }
            $form_output .= '" />';
            $form_output .= '<div id="ajax_choose_product" style="padding:6px; padding-top:2px; width:600px;">
                                        <p class="clear">' . $this->l('Begin typing the first letters of the product name, then select the product from the drop-down list:') . '</p>
                                        <input type="text" value="" id="product_autocomplete_input" />
                                        <img onclick="$(this).prev().search();" style="cursor: pointer;" src="../img/admin/add.gif" alt="' . $this->l('Add a product') . '" />
                                    </div';
            $form_output .= '</div>';
            $form_output .= '</fieldset><div class="clear space">&nbsp;</div>';
        }
        if (isset($this->conf['related_active']) && $this->conf['related_active'] == 1) {
            // RELATED ARTICLES
            $form_output .= '<fieldset>
					<legend><img src="../img/admin/tab-categories.gif"> ' . $this->l('Related blog posts') . '</legend>';
            $blog_related = Tools::getValue('groupRelated', $obj->getRelatedIds(true));
            $articles = BlogPost::listPosts(false, false, null, null, false, null, null, $obj->id);
            $form_output .= '<label> &nbsp; </label>
                             <div class="margin-form" style="height:140px; overflow-x:hidden; overflow-y:scroll; padding:0;">';
            if (count($articles)) {
                $form_output .= '<table cellspacing="0" cellpadding="0" class="table" style="min-width:500px;">
                                <tr>
                                        <th style="width:40px;"></th>
                                        <th style="width:30px;">' . $this->l('ID') . '</th>
                                        <th>' . $this->l('Title') . '</th>
                                </tr>';
                $irow = 0;
                foreach ($articles as $post) {
                    if ($post['id_blog_post'] == $obj->id) {
                        continue;
                    }
                    $iso = count($activeLanguages) > 1 && $post['id_lang'] != 0 ? '(' . Language::getIsoById($post['id_lang']) . ')' : '';
                    $form_output .= '<tr class="' . ($irow++ % 2 ? 'alt_row' : '') . '">
                                                                <td><input type="checkbox" name="groupRelated[]" class="groupBox" id="groupRelated_' . $post['id_blog_post'] . '" value="' . $post['id_blog_post'] . '" ' . (in_array($post['id_blog_post'], $blog_related) ? 'checked="checked" ' : '') . '/></td>
                                                                <td>' . $post['id_blog_post'] . '</td>
                                                                <td><label for="groupRelated_' . $post['id_blog_post'] . '" class="t">' . $post['title'] . ' ' . $iso . '</label></td>
                                                        </tr>';
                }
                $form_output .= '</table>';
                $form_output .= '</div> <p style="font-size:11px;">' . $this->l('Select related posts') . '</p> <div class="clear">&nbsp;</div>';
            } else {
                $form_output .= '<p>' . $this->l('No posts created') . '</p>';
            }
            $form_output .= '</fieldset><div class="clear space">&nbsp;</div>';
        }
        $form_output .= '<fieldset><legend>' . $this->l('SEO - Post metas') . '</legend>';
        $form_output .= HelperFieldForm::displayTextField('link_rewrite', $this->getFieldValue($obj, 'link_rewrite'), 'text', $this->l('Friendly URL :'), $this->l('Only letters and the minus (-) character are allowed'), array('id' => 'link_rewrite_' . $lang_value));
        $form_output .= HelperFieldForm::displayTextField('meta_description', $this->getFieldValue($obj, 'meta_description'), 'textarea', $this->l('META description :'), $this->l('Search engines meta description'), array('rows' => 2));
        $form_output .= HelperFieldForm::displayTextField('meta_keywords', $this->getFieldValue($obj, 'meta_keywords'), 'text', $this->l('META keywords :'), $this->l('Separate keywords by ,'));
        $form_output .= '</fieldset><div class="clear space">&nbsp;</div>';
        $form_output .= '<fieldset><legend><img src="../img/admin/cog.gif"> ' . $this->l('Publication options') . '</legend>';
        $status_options = array(array('value' => 'published', 'title' => $this->l('Published')), array('value' => 'drafted', 'title' => $this->l('Drafted')), array('value' => 'suspended', 'title' => $this->l('Suspended')));
        $status_value = $this->getFieldValue($obj, 'status');
        $form_output .= HelperFieldForm::displaySelectField('status', $status_options, $status_value, $this->l('Status :'));
        if (isset($this->conf['comment_active']) && $this->conf['comment_active'] == 1) {
            $comments_options = array(array('value' => '1', 'title' => $this->l('Enabled')), array('value' => '0', 'title' => $this->l('Disabled')));
            $comments_value = !$obj->id ? 1 : $this->getFieldValue($obj, 'allow_comments');
            $form_output .= HelperFieldForm::displayRadioField('allow_comments', $comments_options, $comments_value, $this->l('Allow comments :'));
        }
        $date_on = $this->getFieldValue($obj, 'date_on') == "" ? date('Y-m-d') : $this->getFieldValue($obj, 'date_on');
        $form_output .= HelperFieldForm::displayDateField('date_on', $date_on, $this->l('Publication date :'));
        if (Shop::isFeatureActive()) {
            $form_output .= '<label>&nbsp;</label>
                             <div class="margin-form">';
            $helperForm = new HelperForm();
            $helperForm->identifier = $this->identifier;
            $helperForm->table = $this->table;
            $helperForm->id = $obj->id;
            $form_output .= $helperForm->renderAssoShop();
            $form_output .= '</div>';
        }
        $form_output .= '</fieldset><div class="clear space">&nbsp;</div>';
        $form_output .= '<div class="small"><sup>*</sup> ' . $this->l('Required field') . '</div>
                    
                    <input type="submit" class="button" name="submitAdd' . $this->table . '" value="' . $this->l('Save') . '" id="' . $this->table . '_form_submit_btn" />
			
		</form>
		
		<div class="clear space">&nbsp;</div>';
        $helper = new HelperCore();
        $helper->module = new Psblog();
        $template = $helper->createTemplate('form_blog_post.tpl');
        $iso_code = $this->context->language->iso_code;
        $iso = file_exists(_PS_ROOT_DIR_ . '/js/tiny_mce/langs/' . $iso_code . '.js') ? $iso_code : 'en';
        $iso_tiny_mce = file_exists(_PS_JS_DIR_ . 'tiny_mce/langs/' . $iso_code . '.js') ? $iso_code : 'en';
        $this->addjQueryPlugin(array('autocomplete', 'ajaxfileupload', 'date'));
        $this->addJS(array(_MODULE_DIR_ . $this->module->name . '/js/psblog.js', _MODULE_DIR_ . $this->module->name . '/js/jquery.MultiFile.pack.js', _PS_JS_DIR_ . 'tiny_mce/tiny_mce.js', _PS_JS_DIR_ . 'tinymce.inc.js', _PS_JS_DIR_ . 'fileuploader.js'));
        $this->addJqueryUI(array('ui.core', 'ui.datepicker'));
        $this->toolbar_btn['save-and-stay'] = array('href' => '#', 'desc' => $this->l('Save and stay'));
        $title = array($this->l('Blog'), $obj->id ? $this->l('Edit') : $this->l('Add new'));
        $template->assign(array('show_toolbar' => true, 'path_css' => _THEME_CSS_DIR_, 'toolbar_btn' => $this->toolbar_btn, 'currentIndex' => self::$currentIndex, 'toolbar_scroll' => true, 'title' => $title, 'ad' => dirname($_SERVER['PHP_SELF']), 'form_content' => $form_output, 'iso_tiny_mce' => $iso_tiny_mce, 'iso' => $iso, 'tinymce' => true, 'vat_number' => file_exists(_PS_MODULE_DIR_ . 'vatnumber/ajax.php'), 'languages' => $this->_languages, 'id_lang_default' => $defaultLanguage, 'defaultFormLanguage' => $defaultLanguage, 'allowEmployeeFormLang' => $this->allow_employee_form_lang));
        $form_content = $template->fetch();
        return $form_content;
    }
开发者ID:rongandat,项目名称:vatfairfoot,代码行数:101,代码来源:AdminBlogPosts.php


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