本文整理汇总了PHP中Helper::renderAdminCategorieTree方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::renderAdminCategorieTree方法的具体用法?PHP Helper::renderAdminCategorieTree怎么用?PHP Helper::renderAdminCategorieTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Helper
的用法示例。
在下文中一共展示了Helper::renderAdminCategorieTree方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayFormInformations
//.........这里部分代码省略.........
<tr>
<td class="col-left"><label for="id_category_default" class="t">' . $this->l('Default category:') . '</label></td>
<td>
<div id="no_default_category" style="color: red;font-weight: bold;display: none;">' . $this->l('Please check a category in order to select the default category.') . '</div>
<script type="text/javascript">
var post_selected_cat;
</script>';
$default_category = Tools::getValue('id_category', 1);
if (!$obj->id) {
$selectedCat = Category::getCategoryInformations(Tools::getValue('categoryBox', array($default_category)), $this->_defaultFormLanguage);
echo '
<script type="text/javascript">
post_selected_cat = \'' . implode(',', array_keys($selectedCat)) . '\';
</script>';
} else {
if (Tools::isSubmit('categoryBox')) {
$selectedCat = Category::getCategoryInformations(Tools::getValue('categoryBox', array($default_category)), $this->_defaultFormLanguage);
} else {
$selectedCat = Product::getProductCategoriesFull($obj->id, $this->_defaultFormLanguage);
}
}
echo '<select id="id_category_default" name="id_category_default">';
foreach ($selectedCat as $cat) {
echo '<option value="' . $cat['id_category'] . '" ' . ($obj->id_category_default == $cat['id_category'] ? 'selected' : '') . '>' . $cat['name'] . '</option>';
}
echo '</select>
</td>
</tr>
<tr id="tr_categories">
<td colspan="2">
';
// Translations are not automatic for the moment ;)
$trads = array('Home' => $this->l('Home'), 'selected' => $this->l('selected'), 'Collapse All' => $this->l('Collapse All'), 'Expand All' => $this->l('Expand All'), 'Check All' => $this->l('Check All'), 'Uncheck All' => $this->l('Uncheck All'));
echo Helper::renderAdminCategorieTree($trads, $selectedCat) . '
</td>
</tr>
<tr><td colspan="2" style="padding-bottom:5px;"><hr style="width:100%;" /></td></tr>
<tr><td colspan="2">
<span onclick="$(\'#seo\').slideToggle();" style="cursor: pointer"><img src="../img/admin/arrow.gif" alt="' . $this->l('SEO') . '" title="' . $this->l('SEO') . '" style="float:left; margin-right:5px;"/>' . $this->l('Click here to improve product\'s rank in search engines (SEO)') . '</span><br />
<div id="seo" style="display: none; padding-top: 15px;">
<table>
<tr>
<td class="col-left">' . $this->l('Meta title:') . '</td>
<td class="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 size="55" type="text" id="meta_title_' . $language['id_lang'] . '" name="meta_title_' . $language['id_lang'] . '"
value="' . htmlentities($this->getFieldValue($obj, 'meta_title', $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" />
<span class="hint" name="help_box">' . $this->l('Forbidden characters:') . ' <>;=#{}<span class="hint-pointer"> </span></span>
</div>';
}
echo ' <p class="clear">' . $this->l('Product page title; leave blank to use product name') . '</p>
</td>
</tr>
<tr>
<td class="col-left">' . $this->l('Meta description:') . '</td>
<td class="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 size="55" type="text" id="meta_description_' . $language['id_lang'] . '" name="meta_description_' . $language['id_lang'] . '"
value="' . htmlentities($this->getFieldValue($obj, 'meta_description', $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" />
<span class="hint" name="help_box">' . $this->l('Forbidden characters:') . ' <>;=#{}<span class="hint-pointer"> </span></span>
</div>';
}
echo ' <p class="clear">' . $this->l('A single sentence for HTML header') . '</p>
</td>
示例2: displayForm
//.........这里部分代码省略.........
' . ($obj->id ? '<input type="hidden" name="id_' . $this->table . '" value="' . $obj->id . '" />' : '') . '
<fieldset><legend><img src="../img/admin/photo.gif" />' . $this->l('Image Maps') . '</legend>';
echo '
<label>' . $this->l('How to map products in the image:') . ' </label>
<div class="margin-form">
' . $this->l('When a customer hovers over the image with the mouse, a pop-up appears displaying a brief description of the product. The customer can then click to open the product\'s full product page. To achieve this, please define the \'mapping zone\' that, when hovered over, will display the pop-up. Left-click with your mouse to draw the four-sided mapping zone, then release. Then, begin typing the name of the associated product. A list of products appears. Click the appropriate product, then click OK. Repeat these steps for each mapping zone you wish to create. When you have finished mapping zones, click Save Image Map.') . '
</div>
';
echo '<label>' . $this->l('Image map name:') . ' </label>
<div class="margin-form">';
foreach ($this->_languages as $language) {
echo '
<div id="name_' . $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') . '" /><sup> *</sup>
</div>';
}
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, $langtags, 'name');
echo ' <div class="clear"></div>
</div>';
echo '<label>' . $this->l('Status:') . ' </label>
<div class="margin-form">
<input type="radio" name="active" id="active_on" value="1" ' . ((!$obj->id or Tools::getValue('active', $obj->active)) ? 'checked="checked" ' : '') . '/>
<label class="t" for="active_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Activated') . '" title="' . $this->l('Activated') . '" /></label>
<input type="radio" name="active" id="active_off" value="0" ' . ((!Tools::getValue('active', $obj->active) and $obj->id) ? 'checked="checked" ' : '') . '/>
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Deactivated') . '" title="' . $this->l('Deactivated') . '" /></label>
<p>' . $this->l('Activate or deactivate the image map') . '</p>
</div>';
$sceneImageTypes = ImageType::getImagesTypes('scenes');
$largeSceneImageType = NULL;
$thumbSceneImageType = NULL;
foreach ($sceneImageTypes as $sceneImageType) {
if ($sceneImageType['name'] == 'large_scene') {
$largeSceneImageType = $sceneImageType;
}
if ($sceneImageType['name'] == 'thumb_scene') {
$thumbSceneImageType = $sceneImageType;
}
}
echo '<label>' . $this->l('Image to be mapped:') . ' </label>
<div class="margin-form">
<input type="hidden" id="stay_here" name="stay_here" value="" />
<input type="file" name="image" id="image_input" /> <input type="button" value="' . $this->l('Upload image') . '" onclick="{$(\'#stay_here\').val(\'true\');$(\'#scenesForm\').submit();}" class="button" /><br/>
<p>' . $this->l('Format:') . ' JPG, GIF, PNG. ' . $this->l('File size:') . ' ' . $this->maxImageSize / 1000 . '' . $this->l('KB max.') . ' ' . $this->l('If larger than the image size setting, the image will be reduced to ') . ' ' . $largeSceneImageType['width'] . 'x' . $largeSceneImageType['height'] . 'px ' . $this->l('(width x height). If smaller than the image-size setting, a white background will be added in order to achieve the correct image size.') . '.<br />' . $this->l('Note: To change image dimensions, please change the \'large_scene\' image type settings to the desired size (in Back Office > Preferences > Images).') . '</p>';
if ($obj->id && file_exists(_PS_SCENE_IMG_DIR_ . $obj->id . '-large_scene.jpg')) {
echo '<img id="large_scene_image" style="clear:both;border:1px solid black;" alt="" src="' . _THEME_SCENE_DIR_ . $obj->id . '-large_scene.jpg" /><br />';
echo '
<div id="ajax_choose_product" style="display:none; padding:6px; padding-top:2px; width:600px;">
' . $this->l('Begin typing the first letters of the product name, then select the product from the drop-down list:') . '<br /><input type="text" value="" id="product_autocomplete_input" style="width: 450px"/> <input type="button" class="button" value="' . $this->l('OK') . '" onclick="$(this).prev().search();"/><input type="button" class="button" value="' . $this->l('Delete') . '" onclick="undoEdit();" />
</div>
';
echo '
<link rel="stylesheet" type="text/css" href="' . __PS_BASE_URI__ . 'css/jquery.autocomplete.css" />
<link rel="stylesheet" type="text/css" href="' . __PS_BASE_URI__ . 'js/jquery/imgareaselect/imgareaselect-default.css" />
<script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/jquery/jquery.autocomplete.js"></script>
<script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/jquery/imgareaselect/jquery.imgareaselect.pack.js"></script>
<script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/admin-scene-cropping.js"></script>
';
echo '</div>';
echo '<label>' . $this->l('Alternative thumbnail:') . ' </label>
<div class="margin-form">
<input type="file" name="thumb" id="thumb_input" /> ' . $this->l('(optional)') . '
<p>' . $this->l('If you want to use a thumbnail other than one generated from simply reducing the mapped image, please upload it here.') . '<br />' . $this->l('Format:') . ' JPG, GIF, PNG. ' . $this->l('Filesize:') . ' ' . $this->maxImageSize / 1000 . '' . $this->l('Kb max.') . ' ' . $this->l('Automatically resized to') . ' ' . $thumbSceneImageType['width'] . 'x' . $thumbSceneImageType['height'] . 'px ' . $this->l('(width x height)') . '.<br />' . $this->l('Note: To change image dimensions, please change the \'thumb_scene\' image type settings to the desired size (in Back Office > Preferences > Images).') . '</p>
';
if ($obj->id && file_exists(_PS_SCENE_IMG_DIR_ . 'thumbs/' . $obj->id . '-thumb_scene.jpg')) {
echo '<img id="large_scene_image" style="clear:both;border:1px solid black;" alt="" src="' . _THEME_SCENE_DIR_ . 'thumbs/' . $obj->id . '-thumb_scene.jpg" /><br />';
}
echo '</div>
';
$selectedCat = array();
if (Tools::isSubmit('categories')) {
foreach (Tools::getValue('categories') as $k => $row) {
$selectedCat[] = $row;
}
} elseif ($obj->id) {
foreach (Scene::getIndexedCategories($obj->id) as $k => $row) {
$selectedCat[] = $row['id_category'];
}
}
$trads = array('Home' => $this->l('Home'), 'selected' => $this->l('selected'), 'Collapse All' => $this->l('Collapse All'), 'Expand All' => $this->l('Expand All'), 'Check All' => $this->l('Check All'), 'Uncheck All' => $this->l('Uncheck All'));
echo '
<label>' . $this->l('Categories:') . '</label>
<div class="margin-form">
';
echo Helper::renderAdminCategorieTree($trads, $selectedCat, 'categories');
echo '
</div>
<div id="save_scene" class="margin-form">
<input type="submit" name="save_image_map" value="' . $this->l('Save Image Map(s)') . '" class="button" />
</div>
';
} else {
echo '
<br/><span class="bold">' . $this->l('Please add a picture to continue mapping the image...') . '</span><br/><br/>';
}
echo '
<div class="small"><sup>*</sup> ' . $this->l('Required field') . '</div>
</fieldset>
</form>
';
}
示例3: getContent
//.........这里部分代码省略.........
$helper = new Helper();
$helper->id = null;
$helper->table = 'layered_filter';
$helper->identifier = 'id_layered_filter';
if (Shop::isFeatureActive()) {
$html .= '<span style="color: #585A69;display: block;float: left;font-weight: bold;text-align: right;width: 200px;" >' . $this->l('Choose shop association:') . '</span>';
$html .= '<div id="shop_association" style="width: 300px;margin-left: 215px;">' . $helper->renderAssoShop() . '</div>';
}
}
$html .= '
<div id="error-treeview" class="error" style="display: none;">
<img src="../img/admin/error2.png" alt="" /> ' . $this->l('Please select at least one specific category or select "All categories".') . '
</div>
<div style="display: none;">
<div id="layered-categories-selection" style="padding: 10px; text-align: left;">
<h2>' . $this->l('Categories using this template') . '</h2>
<ol style="padding-left: 20px;">
<li>' . $this->l('Select one ore more category using this filter template') . '</li>
<li>' . $this->l('Press "Save this selection" or close the window to save') . '</li>
</ol>';
$selectedCat = array();
// Translations are not automatic for the moment ;)
if (version_compare(_PS_VERSION_, '1.5', '>')) {
if ($this->context->shop() == 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'));
}
$helper = new Helper();
$html .= $helper->renderCategoryTree(null, $selectedCat, 'categoryBox');
} else {
$trads = array('Home' => $this->l('Home'), 'selected' => $this->l('selected'), 'Collapse All' => $this->l('Collapse All'), 'Expand All' => $this->l('Expand All'), 'Check All' => $this->l('Check All'), 'Uncheck All' => $this->l('Uncheck All'), 'search' => $this->l('Search a category'));
$html .= Helper::renderAdminCategorieTree($trads, $selectedCat, 'categoryBox');
}
$html .= '
<br />
<center><input type="button" class="button" value="' . $this->l('Save this selection') . '" onclick="$.fancybox.close();" /></center>
</div>
</div>
<div id="layered-step-2">
<hr size="1" noshade />
<h2>' . $this->l('Step 2/3 - Select filters') . '</h2>
<div id="layered_container">
<div id="layered_container_left" style="width: 360px; float: left; height: 200px; overflow-y: auto;">
<h3>' . $this->l('Selected filters') . ' <span id="num_sel_filters">(0)</span></h3>
<p id="no-filters">' . $this->l('No filters selected yet.') . '</p>
<ul id="selected_filters"></ul>
</div>
<div id="layered-ajax-refresh">
' . $this->ajaxCallBackOffice() . '
</div>
</div>
<div class="clear"></div>
<hr size="1" noshade />';
if (version_compare(_PS_VERSION_, '1.5', '>')) {
$this->context->controller->addJQueryPlugin('fancybox');
$this->context->controller->addJQueryUI('ui.sortable');
$this->context->controller->addJQueryUI('ui.draggable');
$this->context->controller->addJQueryUI('effects.transfer');
$id_lang = Context::getContext()->cookie->id_lang;
} else {
$html .= '<script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/jquery/jquery-ui-1.8.10.custom.min.js"></script>
<script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/jquery/jquery.fancybox-1.3.4.js"></script>
<link type="text/css" rel="stylesheet" href="' . __PS_BASE_URI__ . 'css/jquery.fancybox-1.3.4.css" />';
$id_lang = (int) $cookie->id_lang;
示例4: function
UIAdminAlerts::MError($errors);
}
?>
<div class="row">
<div class="col-md-2 sidebar">
<div class="panel panel-default">
<div class="panel-heading">检索分类</div>
<div class="panel-body">
<script type="text/javascript">
$(document).ready(function(){
var base_url = 'index.php?rule=cms';
// Load category products page when category is clicked
$(document).on('click','#categories-treeview input', function(){
if (this.value !== "")
location.href = base_url + '&id_cms_category=' + parseInt(this.value);
else
location.href = base_url;
});
});
</script>
<?php
$trads = array('Home' => '根分类', 'selected' => '选择', 'Collapse All' => '关闭', 'Expand All' => '展开');
echo Helper::renderAdminCategorieTree($trads, array(Tools::getRequest('id_cms_category') ? Tools::getRequest('id_cms_category') : 1), 'categoryBox', true, 'CMSTree');
?>
</div>
</div>
</div>
</div>
<?php
$btn_group = array(array('type' => 'button', 'title' => '删除选中', 'confirm' => '确定要删除选中项?', 'name' => 'subDelete', 'btn_type' => 'submit', 'class' => 'btn-danger'), array('type' => 'button', 'title' => '激活选中', 'name' => 'subActiveON', 'btn_type' => 'submit', 'class' => 'btn-default'), array('type' => 'button', 'title' => '关闭选中', 'name' => 'subActiveOFF', 'btn_type' => 'submit', 'class' => 'btn-default'));
echo UIViewBlock::area(array('title' => '文章', 'table' => $table, 'class' => 'col-md-10 col-md-offset-2', 'result' => $result, 'btn_groups' => $btn_group), 'table');
示例5: UIAdminBreadcrumb
<?php
if (isset($_POST['SEOCateMetaUpdate'])) {
if (isset($_POST['categoryBox']) && count($_POST['categoryBox']) > 0) {
SEOHelper::updateCategoryMeta($_POST);
}
}
/** 错误处理 */
if (isset($errors)) {
UIAdminAlerts::MError($errors);
}
/** 导航 */
$breadcrumb = new UIAdminBreadcrumb();
$breadcrumb->home();
$breadcrumb->add(array('href' => 'index.php?rule=seo_meta', 'title' => 'Meta管理'));
$breadcrumb->add(array('title' => '编辑', 'active' => true));
$bread = $breadcrumb->draw();
$btn_group = array(array('type' => 'a', 'title' => '产品Metat管理', 'href' => 'index.php?rule=seo_meta_product', 'class' => 'btn-primary', 'icon' => 'share'), array('type' => 'button', 'title' => '更新', 'id' => 'save-seo-meta-form', 'class' => 'btn-success', 'icon' => 'save'));
echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb');
/** 构建表单 */
$form = new UIAdminEditForm('post', 'index.php?rule=seo_meta', 'form-horizontal', 'seo-meta-form');
$cate = array();
if (isset($_POST['categoryBox'])) {
$cate = Tools::getRequest('categoryBox');
}
$trads = array('Home' => '根分类', 'selected' => '选择', 'Collapse All' => '关闭', 'Expand All' => '展开', 'Check All' => '全选', 'Uncheck All' => '全不选');
$form->items = array('title' => array('title' => 'Title规则', 'type' => 'text', 'value' => Tools::Q('title'), 'info' => '可用参数:C_ID,C_NAME,{关键词1|关键词2|关键词3}'), 'keywords' => array('title' => 'Keywords规则', 'type' => 'text', 'value' => Tools::Q('keywords'), 'info' => '可用参数:C_ID,C_NAME,{关键词1|关键词2|关键词3}'), 'description' => array('title' => 'Keywords', 'type' => 'text', 'value' => Tools::Q('description'), 'info' => '可用参数:C_ID,C_NAME,{关键词1|关键词2|关键词3}'), 'rewrite' => array('title' => 'Keywords', 'type' => 'text', 'value' => Tools::Q('rewrite'), 'info' => '可用参数:C_ID,C_NAME,{关键词1|关键词2|关键词3}'), 'categoryBox' => array('title' => '应用到分类', 'type' => 'custom', 'value' => Helper::renderAdminCategorieTree($trads, $cate, 'categoryBox', false, 'Tree')), 'SEOCateMetaUpdate' => array('type' => 'submit', 'class' => 'btn-success', 'icon' => 'save', 'title' => '生成'));
echo UIViewBlock::area(array('title' => '编辑', 'body' => $form->draw()), 'panel');
示例6: displayForm
public function displayForm($token = NULL)
{
global $currentIndex, $cookie;
parent::displayForm();
if (!($obj = $this->loadObject(true))) {
return;
}
$active = $this->getFieldValue($obj, 'active');
$customer_groups = $obj->getGroups();
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><legend><img src="../img/admin/tab-categories.gif" />' . $this->l('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"> </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 category:') . ' </label>
<div class="margin-form">';
// Translations are not automatic for the moment ;)
$trads = array('Home' => $this->l('Home'), 'selected' => $this->l('selected'), 'Collapse All' => $this->l('Collapse All'), 'Expand All' => $this->l('Expand All'));
echo Helper::renderAdminCategorieTree($trads, array(isset($obj->id_parent) ? $obj->id_parent : Tools::getValue('id_parent', 1)), 'id_parent', true);
echo '</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="10" cols="100">' . htmlentities($this->getFieldValue($obj, 'description', (int) $language['id_lang']), ENT_COMPAT, 'UTF-8') . '</textarea>
</div>';
}
echo ' <p class="clear"></p>
</div>
<label>' . $this->l('Image:') . ' </label>
<div class="margin-form">';
echo $this->displayImage($obj->id, _PS_IMG_DIR_ . 'c/' . $obj->id . '.jpg', 350, NULL, Tools::getAdminToken('AdminCatalog' . (int) Tab::getIdFromClassName('AdminCatalog') . (int) $cookie->id_employee), true);
echo ' <br /><input type="file" name="image" />
<p>' . $this->l('Upload category logo from your computer') . '</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"> </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"> </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"> </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') . '" onchange="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"> </span></span>
</div>';
}
echo ' <p class="clear"></p>
</div>
<label>' . $this->l('Groups access:') . ' </label>
<div class="margin-form">';
$groups = Group::getGroups((int) $cookie->id_lang);
if (sizeof($groups)) {
//.........这里部分代码省略.........
示例7: getContent
public function getContent()
{
global $cookie;
$this->instanceDefaultStates();
$this->_postProcess();
$categories = Category::getCategories((int) $cookie->id_lang);
$order_states = OrderState::getOrderStates((int) $cookie->id_lang);
$currency = new Currency((int) Configuration::get('PS_CURRENCY_DEFAULT'));
$defaultLanguage = (int) Configuration::get('PS_LANG_DEFAULT');
$languages = Language::getLanguages(false);
$languageIds = 'voucher_details¤default_loyalty_state¤none_award_loyalty_state¤convert_loyalty_state¤validation_loyalty_state¤cancel_loyalty_state';
$html = '
<script type="text/javascript">
id_language = Number(' . $defaultLanguage . ');
</script>
<h2>' . $this->l('Loyalty Program') . '</h2>
<form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post">
<fieldset>
<legend>' . $this->l('Settings') . '</legend>
<label>' . $this->l('Ratio') . '</label>
<div class="margin-form">
<input type="text" size="2" id="point_rate" name="point_rate" value="' . (double) Configuration::get('PS_LOYALTY_POINT_RATE') . '" /> ' . $currency->sign . '
<label for="point_rate" class="t"> = ' . $this->l('1 reward point') . '.</label>
<br />
<label for="point_value" class="t">' . $this->l('1 point = ') . '</label>
<input type="text" size="2" name="point_value" id="point_value" value="' . (double) Configuration::get('PS_LOYALTY_POINT_VALUE') . '" /> ' . $currency->sign . '
<label for="point_value" class="t">' . $this->l('for the discount') . '.</label>
</div>
<div class="clear"></div>
<label>' . $this->l('Voucher details') . '</label>
<div class="margin-form">';
foreach ($languages as $language) {
$html .= '
<div id="voucher_details_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $defaultLanguage ? 'block' : 'none') . '; float: left;">
<input size="33" type="text" name="voucher_details_' . $language['id_lang'] . '" value="' . Configuration::get('PS_LOYALTY_VOUCHER_DETAILS', (int) $language['id_lang']) . '" />
</div>';
}
$html .= $this->displayFlags($languages, $defaultLanguage, $languageIds, 'voucher_details', true);
$html .= ' </div>
<div class="clear" style="margin-top: 20px"></div>
<label>' . $this->l('Minimum amount in which the voucher can be used') . '</label>
<div class="margin-form">
<input type="text" size="2" name="minimal" value="' . (double) Configuration::get('PS_LOYALTY_MINIMAL') . '" /> ' . $currency->sign . '
</div>
<div class="clear" style="margin-top: 20px"></div>
<label>' . $this->l('Give points on discounted products') . ' </label>
<div class="margin-form">
<input type="radio" name="PS_LOYALTY_NONE_AWARD" id="PS_LOYALTY_NONE_AWARD_on" value="1" ' . (Configuration::get('PS_LOYALTY_NONE_AWARD') ? 'checked="checked" ' : '') . '/>
<label class="t" for="PS_LOYALTY_NONE_AWARD_on"><img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Yes') . '" /></label>
<input type="radio" name="PS_LOYALTY_NONE_AWARD" id="PS_LOYALTY_NONE_AWARD_off" value="0" ' . (!Configuration::get('PS_LOYALTY_NONE_AWARD') ? 'checked="checked" ' : '') . '/>
<label class="t" for="PS_LOYALTY_NONE_AWARD_off"><img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('No') . '" /></label>
</div>
<div class="clear"></div>
<label>' . $this->l('Points are awarded when the order is') . '</label>
<div class="margin-form" style="margin-top:10px">
<select id="id_order_state_validation" name="id_order_state_validation">';
foreach ($order_states as $order_state) {
$html .= '<option value="' . $order_state['id_order_state'] . '" style="background-color:' . $order_state['color'] . ';"';
if ((int) $this->loyaltyStateValidation->id_order_state == $order_state['id_order_state']) {
$html .= ' selected="selected"';
}
$html .= '>' . $order_state['name'] . '</option>';
}
$html .= '</select>
</div>
<div class="clear"></div>
<label>' . $this->l('Points are cancelled when the order is') . '</label>
<div class="margin-form" style="margin-top:10px">
<select id="id_order_state_cancel" name="id_order_state_cancel">';
foreach ($order_states as $order_state) {
$html .= '<option value="' . $order_state['id_order_state'] . '" style="background-color:' . $order_state['color'] . ';"';
if ((int) $this->loyaltyStateCancel->id_order_state == $order_state['id_order_state']) {
$html .= ' selected="selected"';
}
$html .= '>' . $order_state['name'] . '</option>';
}
$html .= '</select>
</div>
<div class="clear"></div>
<label>' . $this->l('Vouchers created by the loyalty system can be used in the following categories :') . '</label>';
$index = explode(',', Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY'));
$indexedCategories = isset($_POST['categoryBox']) ? $_POST['categoryBox'] : $index;
// Translations are not automatic for the moment ;)
$trads = array('Home' => $this->l('Home'), 'selected' => $this->l('selected'), 'Collapse All' => $this->l('Collapse All'), 'Expand All' => $this->l('Expand All'), 'Check All' => $this->l('Check All'), 'Uncheck All' => $this->l('Uncheck All'));
$html .= '<div class="margin-form">' . Helper::renderAdminCategorieTree($trads, $indexedCategories) . '</div>';
$html .= '
<p style="padding-left:200px;">' . $this->l('Mark the box(es) of categories in which loyalty vouchers are usable.') . '</p>
<div class="clear"></div>
<h3 style="margin-top:20px">' . $this->l('Loyalty points progression') . '</h3>
<label>' . $this->l('Initial') . '</label>
<div class="margin-form">';
foreach ($languages as $language) {
$html .= '
<div id="default_loyalty_state_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $defaultLanguage ? 'block' : 'none') . '; float: left;">
<input size="33" type="text" name="default_loyalty_state_' . $language['id_lang'] . '" value="' . (isset($this->loyaltyStateDefault->name[(int) $language['id_lang']]) ? $this->loyaltyStateDefault->name[(int) $language['id_lang']] : $this->loyaltyStateDefault->name[(int) $defaultLanguage]) . '" />
</div>';
}
$html .= $this->displayFlags($languages, $defaultLanguage, $languageIds, 'default_loyalty_state', true);
$html .= ' </div>
//.........这里部分代码省略.........
示例8: array
<div class="col-md-10 form-horizontal">
<div class="form-group">
<label for="categoryBox" class="col-sm-2 control-label">关联分类</label>
<div class="col-sm-10">
<?php
$trads = array('Home' => '根分类', 'selected' => '选择', 'Collapse All' => '关闭', 'Expand All' => '展开', 'Check All' => '全选', 'Uncheck All' => '全不选');
if (!isset($obj)) {
$categoryBox = Tools::getRequest('categoryBox') ? Tools::getRequest('categoryBox') : array();
} else {
if (Tools::isSubmit('categoryBox')) {
$categoryBox = Tools::getRequest('categoryBox');
} else {
$categoryBox = Product::getProductCategoriesFullId($obj->id);
}
}
echo Helper::renderAdminCategorieTree($trads, $categoryBox, 'categoryBox', false, 'Tree');
?>
<a href="index.php?rule=category_edit" class="btn btn-link bt-icon confirm_leave">
<span class="glyphicon glyphicon-plus"></span> 创建一个新分类 <span class="glyphicon glyphicon-new-window"></span>
</a>
</div>
</div>
<?php
if (!isset($obj)) {
$selectedCat = Category::getCategoryInformations(Tools::getRequest('categoryBox'));
} else {
if (Tools::isSubmit('categoryBox')) {
$selectedCat = Category::getCategoryInformations(Tools::getRequest('categoryBox'));
} else {
$selectedCat = Product::getProductCategoriesFull($obj->id);
}
示例9: UIAdminBreadcrumb
SEOHelper::updateProductMeta($_POST);
}
}
/** 错误处理 */
if (isset($errors)) {
UIAdminAlerts::MError($errors);
}
/** 导航 */
$breadcrumb = new UIAdminBreadcrumb();
$breadcrumb->home();
$breadcrumb->add(array('href' => 'index.php?rule=seo_meta', 'title' => 'Meta管理'));
$breadcrumb->add(array('title' => '编辑', 'active' => true));
$bread = $breadcrumb->draw();
$btn_group = array(array('type' => 'a', 'title' => '分类Metat管理', 'href' => 'index.php?rule=seo_meta', 'class' => 'btn-primary', 'icon' => 'share'), array('type' => 'button', 'title' => '更新', 'id' => 'save-seo-meta-form', 'class' => 'btn-success', 'icon' => 'save'));
echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb');
/** 构建表单 */
$form = new UIAdminEditForm('post', 'index.php?rule=seo_meta', 'form-horizontal', 'seo-meta-form');
$cate = array();
if (isset($_POST['categoryBox'])) {
$cate = Tools::getRequest('categoryBox');
}
$brands = Brand::loadData();
$brandKeyVal = array();
if ($brands) {
foreach ($brands['items'] as $brand) {
$brandKeyVal[$brand['id_brand']] = $brand['name'];
}
}
$trads = array('Home' => '根分类', 'selected' => '选择', 'Collapse All' => '关闭', 'Expand All' => '展开', 'Check All' => '全选', 'Uncheck All' => '全不选');
$form->items = array('title' => array('title' => 'Title规则', 'type' => 'text', 'value' => Tools::Q('title'), 'info' => '可用参数:P_ID,P_NAME,P_PRICE,P_OLD_PRICE,P_SKU,P_CATEGORY,P_COLOR,{关键词1|关键词2|关键词3}'), 'keywords' => array('title' => 'Keywords规则', 'type' => 'text', 'value' => Tools::Q('keywords'), 'info' => '可用参数:P_ID,P_NAME,P_PRICE,P_OLD_PRICE,P_SKU,P_CATEGORY,P_COLOR,{关键词1|关键词2|关键词3}'), 'description' => array('title' => 'Keywords', 'type' => 'text', 'value' => Tools::Q('description'), 'info' => '可用参数:P_ID,P_NAME,P_PRICE,P_OLD_PRICE,P_SKU,P_CATEGORY,P_COLOR,{关键词1|关键词2|关键词3}'), 'rewrite' => array('title' => 'Keywords', 'type' => 'text', 'value' => Tools::Q('rewrite'), 'info' => '可用参数:P_ID,P_NAME,P_PRICE,P_OLD_PRICE,P_SKU,P_CATEGORY,P_COLOR,{关键词1|关键词2|关键词3}'), 'categoryBox' => array('title' => '应用到分类', 'type' => 'custom', 'value' => Helper::renderAdminCategorieTree($trads, $cate, 'categoryBox', false, 'Tree')), 'id_brands' => array('title' => '应用到品牌', 'type' => 'select', 'value' => Tools::Q('id_brands'), 'option' => $brandKeyVal, 'info' => '不选则应用到所有品牌'), 'SEOProductMetaUpdate' => array('type' => 'submit', 'class' => 'btn-success', 'icon' => 'save', 'title' => '生成'));
echo UIViewBlock::area(array('title' => '编辑', 'body' => $form->draw()), 'panel');
示例10: array
$breadcrumb->home();
$breadcrumb->add(array('title' => 'CMS', 'href' => 'index.php?rule=cms'));
$breadcrumb->add(array('title' => '编辑', 'active' => true));
$bread = $breadcrumb->draw();
$btn_group = array(array('type' => 'a', 'title' => '返回', 'href' => 'index.php?rule=cms', 'class' => 'btn-primary', 'icon' => 'level-up'), array('type' => 'button', 'title' => '保存', 'id' => 'save-cms-form', 'class' => 'btn-success', 'icon' => 'save'));
echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb');
if (isset($errors)) {
UIAdminAlerts::MError($errors);
}
?>
<script language="javascript">
$("#save-cms-save").click(function(){
$("#cms-form").submit();
})
</script>
<?php
$form = new UIAdminEditForm('post', 'index.php?rule=cms_edit' . (isset($id) ? '&id=' . $id : ''), 'form-horizontal', 'cms-form');
$trads = array('selected' => '选择', 'Home' => '根分类', 'Collapse All' => '关闭', 'Expand All' => '展开');
if (!isset($obj)) {
$categoryBox = Tools::P('categoryBox') ? Tools::P('categoryBox') : array();
} else {
if (Tools::isSubmit('categoryBox')) {
$categoryBox = Tools::P('categoryBox');
} else {
$categoryBox = CMS::getCMSCategoriesFullId($obj->id);
}
}
$category = Helper::renderAdminCategorieTree($trads, $categoryBox, 'categoryBox', true, 'CMSTree');
$tag = '<div class="tagify-container"><input type="text" value="' . (isset($obj) ? Tag::tagToString($obj->id) : Tools::P('tags')) . '" class="form-control" data-role="tagsinput" name="tags" ></div>';
$form->items = array('title' => array('title' => '标题', 'type' => 'text', 'value' => isset($obj) ? $obj->title : Tools::Q('title')), 'active' => array('title' => '状态', 'type' => 'bool', 'value' => isset($obj) ? $obj->active : Tools::Q('active')), 'is_top' => array('title' => '置顶', 'type' => 'bool', 'value' => isset($obj) ? $obj->is_top : Tools::Q('is_top')), 'categoryBox' => array('title' => '分类', 'type' => 'custom', 'value' => $category), 'tags' => array('title' => 'Tag标签', 'type' => 'custom', 'value' => $tag), 'meta_title' => array('title' => 'Meta标题', 'type' => 'text', 'value' => isset($obj) ? $obj->meta_title : Tools::Q('meta_title')), 'meta_keywords' => array('title' => 'Meta关键词', 'type' => 'text', 'value' => isset($obj) ? $obj->meta_keywords : Tools::Q('meta_keywords')), 'meta_description' => array('title' => 'Meta描述', 'type' => 'text', 'value' => isset($obj) ? $obj->meta_description : Tools::Q('meta_description')), 'rewrite' => array('title' => '静态链接', 'type' => 'text', 'value' => isset($obj) ? $obj->rewrite : Tools::Q('rewrite')), 'content' => array('title' => '内容', 'type' => 'textarea', 'class' => 'tinymce', 'value' => isset($obj) ? $obj->content : Tools::Q('content')), 'saveCMS' => array('type' => 'hidden', 'value' => isset($id) ? 'edit' : 'add'));
echo UIViewBlock::area(array('col' => 'col-md-12', 'title' => '编辑', 'body' => $form->draw()), 'panel');
示例11: _displayForm
//.........这里部分代码省略.........
</div>
<label>' . $this->l('Automatic posts management for new products') . '</label>
<div class="margin-form">
<select name="post_action">
<option value="creation"' . ('creation' === Tools::getValue('post_action', $this->_configuration['FBWALLPOSTS_ACTION_NEW_POST']) ? ' selected="selected"' : '') . '>' . $this->l('Post on product creation') . '</option>' . "\n" . '<option value="delay"' . ('delay' === Tools::getValue('post_action', $this->_configuration['FBWALLPOSTS_ACTION_NEW_POST']) ? ' selected="selected"' : '') . '>' . $this->l('Put in queue and delayed post') . '</option>';
$this->_html .= '
</select>
<p class="clear">' . $this->l('A product posted on initial creation will only be posted if it is marked as "Active" and only when you click on the "Save" button for the ') . ' <b>' . $this->l('first time.') . '</b> ' . $this->l('If you save it as inactive the first time to finish up your product sheet before publishing, and then mark it "active" and update it, it will not be posted. This is due to the fact that we can only use the "New product" hook. To get around this problem, we let you archive products for posting and you can then manully fire the posts in one click in the "Delayed posts" tab.') . '
</p>
<p style="font-weight: bold; color: red;">
' . $this->l('NOTE FOR PRESTASHOP 1.5 USERS: You MUST use the delayed posts mode, otherwise the post on Facebook will be done without the photo. This is because, as of version 1.5, you can no longer upload a photo on initial product creation.') . '
</p>
</div>
<center style="color: red;">
<input type="submit" name="submitFBWP" value="' . $this->l('Update') . '" class="button" />
<input type="submit" name="testFBWP" value="' . $this->l('Test (only once config is done)') . '" class="button" /><br /><br />' . $this->l('NOTE: Only click the test button once you have fully completed the configuration') . '
</center>
</div>
<div id="fragment-3" class="ui-tabs-panel">
<h2 style="font-size: 16px;">' . $this->l('Categories selection') . '</h2>
<p>' . $this->l('Only products whose main (default) category is part of the categories checked below will be posted to your Facebook wall.') . '</p>
<p> </p>
';
$trads = array('Home' => $this->l('Home'), 'selected' => $this->l('selected'), 'Collapse All' => $this->l('Collapse All'), 'Expand All' => $this->l('Expand All'), 'Check All' => $this->l('Check All'), 'Uncheck All' => $this->l('Uncheck All'));
if (is_file(_PS_ROOT_DIR_ . '/classes/Helper.php')) {
if (method_exists('Helper', 'renderAdminCategorieTree')) {
$this->_html .= @Helper::renderAdminCategorieTree($trads, $cIndex);
}
} else {
$this->_html .= '
<script type="text/javascript">
function doCheckAll()
{
$("input.categoryBox").attr("checked", true);
}
function doUncheckAll()
{
$("input.categoryBox").attr("checked", false);
}
</script>
<table cellspacing="0" cellpadding="0" class="table">';
$this->_html .= '<tr><td colspan="3"><a href="#" onclick="return doCheckAll();">' . $this->l('Check All') . '</a> - <a href="#" onclick="return doUncheckAll();">' . $this->l('Uncheck All') . '</a></td></tr>';
$this->recurseCategoryForInclude($cIndex, $categories, $categories[0][1], 1);
$this->_html .= '</table><br /><br />';
}
$this->_html .= '
<center style="color: red;">
<input type="submit" name="submitFBWP" value="' . $this->l('Update') . '" class="button" />
<input type="submit" name="testFBWP" value="' . $this->l('Test (only once config is done)') . '" class="button" /><br /><br />' . $this->l('NOTE: Only click the test button once you have fully completed the configuration') . '
</center>
</div>
<div id="fragment-4" class="ui-tabs-panel">
示例12: array
?>
">
<input type="radio" name="active" value="1" autocomplete="off" >启用
</label>
<label class="btn btn-grey">
<input type="radio" name="active" value="0" autocomplete="off">关闭
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="categoryBox" class="col-sm-2 control-label">关联分类</label>
<div class="col-sm-10">
<?php
$trads = array('Home' => '根分类', 'selected' => '选择', 'Collapse All' => '关闭', 'Expand All' => '展开');
echo Helper::renderAdminCategorieTree($trads, array(isset($obj) ? $obj->id_parent : 1), 'id_parent', true, 'CMSTree');
?>
</div>
</div>
<div class="form-group">
<label for="meta_title" class="col-sm-2 control-label">Meta Title</label>
<div class="col-sm-10">
<input type="text" value="<?php
echo isset($obj) ? $obj->meta_title : Tools::getRequest('meta_title');
?>
" class="form-control" name="meta_title" >
</div>
</div>
<div class="form-group">
<label for="meta_keywords" class="col-sm-2 control-label">Meta Keywords</label>
<div class="col-sm-10">