本文整理汇总了PHP中Tools::safeOutput方法的典型用法代码示例。如果您正苦于以下问题:PHP Tools::safeOutput方法的具体用法?PHP Tools::safeOutput怎么用?PHP Tools::safeOutput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tools
的用法示例。
在下文中一共展示了Tools::safeOutput方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContent
public function getContent()
{
// If we try to update the settings
$output = '';
if (isset($_POST['submitModule'])) {
Configuration::updateValue('blocksocial_facebook', $_POST['facebook_url'] != '' ? $_POST['facebook_url'] : '');
Configuration::updateValue('blocksocial_twitter', $_POST['twitter_url'] != '' ? $_POST['twitter_url'] : '');
Configuration::updateValue('blocksocial_rss', $_POST['rss_url'] != '' ? $_POST['rss_url'] : '');
$output = '<div class="conf confirm">' . $this->l('Configuration updated') . '</div>';
}
return '
<h2>' . $this->displayName . '</h2>
' . $output . '
<form action="' . Tools::htmlentitiesutf8($_SERVER['REQUEST_URI']) . '" method="post">
<fieldset class="width2">
<label for="facebook_url">' . $this->l('Facebook URL: ') . '</label>
<input type="text" id="facebook_url" name="facebook_url" value="' . Tools::safeOutput(Configuration::get('blocksocial_facebook') != "" ? Configuration::get('blocksocial_facebook') : "") . '" />
<div class="clear"> </div>
<label for="twitter_url">' . $this->l('Twitter URL: ') . '</label>
<input type="text" id="twitter_url" name="twitter_url" value="' . Tools::safeOutput(Configuration::get('blocksocial_twitter') != "" ? Configuration::get('blocksocial_twitter') : "") . '" />
<div class="clear"> </div>
<label for="rss_url">' . $this->l('RSS URL: ') . '</label>
<input type="text" id="rss_url" name="rss_url" value="' . Tools::safeOutput(Configuration::get('blocksocial_rss') != "" ? Configuration::get('blocksocial_rss') : "") . '" />
<div class="clear"> </div>
<br /><center><input type="submit" name="submitModule" value="' . $this->l('Update settings') . '" class="button" /></center>
</fieldset>
</form>';
}
示例2: displayForm
public function displayForm()
{
return '
<form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post">
<fieldset>
<legend><img src="' . $this->_path . 'logo.gif" alt="" title="" />' . $this->l('Settings') . '</legend>
<label>' . $this->l('Maximum depth') . '</label>
<div class="margin-form">
<input type="text" name="maxDepth" value="' . Configuration::get('BLOCK_CATEG_MAX_DEPTH') . '" />
<p class="clear">' . $this->l('Set the maximum depth of sublevels displayed in this block (0 = infinite)') . '</p>
</div>
<label>' . $this->l('Dynamic') . '</label>
<div class="margin-form">
<input type="radio" name="dhtml" id="dhtml_on" value="1" ' . (Tools::getValue('dhtml', Configuration::get('BLOCK_CATEG_DHTML')) ? 'checked="checked" ' : '') . '/>
<label class="t" for="dhtml_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
<input type="radio" name="dhtml" id="dhtml_off" value="0" ' . (!Tools::getValue('dhtml', Configuration::get('BLOCK_CATEG_DHTML')) ? 'checked="checked" ' : '') . '/>
<label class="t" for="dhtml_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
<p class="clear">' . $this->l('Activate dynamic (animated) mode for sublevels') . '</p>
</div>
<label>' . $this->l('Footer columns number') . '</label>
<div class="margin-form">
<input type="text" name="nbrColumns" value="' . Configuration::get('BLOCK_CATEG_NBR_COLUMN_FOOTER') . '" />
<p class="clear">' . $this->l('Set the number of footer columns') . '</p>
</div>
<center><input type="submit" name="submitBlockCategories" value="' . $this->l('Save') . '" class="button" /></center>
</fieldset>
</form>';
}
示例3: __construct
/**
* constructor
*
* @param string $path the path to a file or folder
*/
function __construct($path = null)
{
if (!is_null($path)) {
if (file_exists($path)) {
$this->filePath = $path;
if (is_file($this->filePath)) {
$this->fileStat = @stat($path);
$this->fileInfo['size'] = $this->fileStat[7];
$this->fileInfo['atime'] = $this->fileStat[8];
$this->fileInfo['ctime'] = $this->fileStat[10];
$this->fileInfo['mtime'] = $this->fileStat[9];
$this->fileInfo['path'] = addslashes($path);
$this->fileInfo['name'] = addslashes(basename($path));
$this->fileInfo['is_writable'] = $this->isWritable();
$this->fileInfo['is_readable'] = $this->isReadable();
} elseif (is_dir($this->filePath)) {
$this->fileStat = @stat($path);
$this->fileInfo['name'] = addslashes(basename($path));
$this->fileInfo['path'] = addslashes($path);
$this->fileInfo['atime'] = $this->fileStat[8];
$this->fileInfo['ctime'] = $this->fileStat[10];
$this->fileInfo['mtime'] = $this->fileStat[9];
$this->fileInfo['is_writable'] = $this->isWritable();
$this->fileInfo['is_readable'] = $this->isReadable();
}
} else {
trigger_error('No such file exists. ' . Tools::safeOutput($path), E_USER_NOTICE);
}
}
}
示例4: hookAdminStatsModules
public function hookAdminStatsModules($params)
{
$graphParams = array('layers' => 2, 'type' => 'line', 'option' => 3);
$totalVisits = $this->getTotalVisits();
$totalGuests = $this->getTotalGuests();
if (Tools::getValue('export')) {
$this->csvExport(array('layers' => 2, 'type' => 'line', 'option' => 3));
}
$this->html = '
<div class="blocStats"><h2 class="icon-' . $this->name . '"><span></span>' . $this->displayName . '</h2>
<p>
<img src="../img/admin/down.gif" />' . $this->l('A visit corresponds to an internet user coming to your shop, and until the end of their session, only one visit is counted.') . '
' . $this->l('A visitor is an unknown person who has not registered or logged into your store. A visitor can also be considered a person who has visited your shop multiple times.') . '
</p>
<div style="margin-top:20px"></div>
<p>' . $this->l('Total visits:') . ' <span class="totalStats">' . $totalVisits . '</span></p>
<p>' . $this->l('Total visitors:') . ' <span class="totalStats">' . $totalGuests . '</span></p>
' . ($totalVisits ? $this->engine($graphParams) . '<p><a class="button export-csv" href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&export=1"><span>' . $this->l('CSV Export') . '</span></a></p>' : '') . '
</div>
<br />
<div class="blocStats"><h2 class="icon-guide"><span></span>' . $this->l('Guide') . '</h2>
<h2>' . $this->l('Determine the interest of a visit.') . '</h2>
' . $this->l('The visitors\' evolution graph strongly resembles the visits\' graph, but provides additional information:') . '<br />
<ul>
<li>' . $this->l('If this is the case, congratulations, your website is well planned and pleasing. Glad to see that you\'ve been paying attention.') . '</li>
<li>' . $this->l('Otherwise, the conclusion is not so simple. The problem can be aesthetic or ergonomic. It is also possible that many visitors have mistakenly visited your URL without possessing a particular interest in your shop. This strange and ever-confusing phenomenon is most likely cause by search engines. If this is the case, you should consider revising your SEO structure.') . '</li>
</ul>
' . $this->l('This information is mostly qualitative. It is up to you to determine the interest of a disjointed visit.') . '<br />
</div>';
return $this->html;
}
示例5: renderList
/**
* Render form
* @return string
*/
public function renderList()
{
$this->form = '
<div class="row">
<table class="table">
<thead>
<tr>
<th><span class="title_box ">Test</span></th>
<th><span class="title_box ">Test</span></th>
<th><span class="title_box ">Test</span></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="row">
<div class="col-lg-12">
<a class="btn btn-default pull-right" href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&refresh=1&refreshType=1">
<i class="icon-refresh"></i> ' . $this->l('Refresh') . '
</a>
</div>
</div>';
$this->context->smarty->assign('form', $this->form);
$this->output .= $this->context->smarty->fetch($this->path . 'views/templates/admin/socialuserheaderadmin.tpl');
//$this->context->smarty->assign('current_url', '?controller=AdminXlsProductImport2&token='.Tools::getAdminTokenLite('AdminSocialUserProfile'));
return $this->output . parent::renderList();
}
示例6: displayForm
public function displayForm()
{
$orders = array('date_add' => $this->l('Date Add'), 'date_add DESC' => $this->l('Date Add DESC'), 'name' => $this->l('Name'), 'name DESC' => $this->l('Name DESC'), 'quantity' => $this->l('Quantity'), 'quantity DESC' => $this->l('Quantity DESC'), 'price' => $this->l('Price'), 'price DESC' => $this->l('Price DESC'));
return '
<form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post">
<fieldset>
<legend><img src="' . $this->_path . 'logo.gif" alt="" title="" />' . $this->l('Settings') . '</legend>
<div class="row-form">
' . $this->params->selectTag($orders, "Order By", 'porder', $this->params->get('porder')) . '
<p class="clear">' . $this->l('The maximum number of products in each page Carousel (default: 3).') . '</p>
</div>
<div class="row-form">
' . $this->params->inputTag('Items Per Page', 'itemspage', $this->params->get('itemspage')) . '
<p class="clear">' . $this->l('The maximum number of products in each page Carousel (default: 3).') . '</p>
</div>
<div class="row-form">
' . $this->params->inputTag('Colums In Each Carousel', 'columns', $this->params->get('columns')) . '
<p class="clear">' . $this->l('The maximum column products in each page Carousel (default: 3).') . '</p>
</div>
<div class="row-form">
' . $this->params->inputTag('Items In all Carousels', 'itemstab', $this->params->get('itemstab')) . '
<p class="clear">' . $this->l('The maximum number of products in each Carousel (default: 6).') . '</p>
</div>
<center><input type="submit" name="submitSpecials" value="' . $this->l('Save') . '" class="button" /></center>
</fieldset>
</form>';
}
示例7: displayForm
public function displayForm()
{
$output = '
<form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post">
<fieldset><legend><img src="' . $this->_path . 'logo.gif" alt="" title="" />' . $this->l('Settings') . '</legend>
<label>' . $this->l('Use a plain-text list.') . '</label>
<div class="margin-form">
<input type="radio" name="text_list" id="text_list_on" value="1" ' . (Tools::getValue('text_list', Configuration::get('MANUFACTURER_DISPLAY_TEXT')) ? 'checked="checked" ' : '') . '/>
<label class="t" for="text_list_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
<input type="radio" name="text_list" id="text_list_off" value="0" ' . (!Tools::getValue('text_list', Configuration::get('MANUFACTURER_DISPLAY_TEXT')) ? 'checked="checked" ' : '') . '/>
<label class="t" for="text_list_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
' . $this->l('Display') . ' <input type="text" size="2" name="text_nb" value="' . (int) Tools::getValue('text_nb', Configuration::get('MANUFACTURER_DISPLAY_TEXT_NB')) . '" /> ' . $this->l('Elements') . '
<p class="clear">' . $this->l('Display manufacturers in a plain-text list') . '</p>
</div>
<label>' . $this->l('Use a drop-down list.') . '</label>
<div class="margin-form">
<input type="radio" name="form_list" id="form_list_on" value="1" ' . (Tools::getValue('form_list', Configuration::get('MANUFACTURER_DISPLAY_FORM')) ? 'checked="checked" ' : '') . '/>
<label class="t" for="form_list_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
<input type="radio" name="form_list" id="form_list_off" value="0" ' . (!Tools::getValue('form_list', Configuration::get('MANUFACTURER_DISPLAY_FORM')) ? 'checked="checked" ' : '') . '/>
<label class="t" for="form_list_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
<p class="clear">' . $this->l('Display manufacturers in a drop-down list.') . '</p>
</div>
<center><input type="submit" name="submitBlockManufacturers" value="' . $this->l('Save') . '" class="button" /></center>
</fieldset>
</form>';
return $output;
}
示例8: __construct
public function __construct()
{
$this->bootstrap = true;
$this->table = 'alias';
$this->className = 'Alias';
$this->lang = false;
parent::__construct();
// Alias fields
$this->addRowAction('edit');
$this->addRowAction('delete');
if (!Tools::getValue('realedit')) {
$this->deleted = false;
}
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash'));
$this->fields_list = array('alias' => array('title' => $this->l('Aliases')), 'search' => array('title' => $this->l('Search')), 'active' => array('title' => $this->l('Status'), 'class' => 'fixed-width-sm', 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false));
// Search options
$current_file_name = array_reverse(explode('/', $_SERVER['SCRIPT_NAME']));
$cron_url = Tools::getHttpHost(true, true) . __PS_BASE_URI__ . basename(_PS_ADMIN_DIR_) . '/searchcron.php?full=1&token=' . substr(_COOKIE_KEY_, 34, 8);
list($total, $indexed) = Db::getInstance()->getRow('SELECT COUNT(*) as "0", SUM(product_shop.indexed) as "1" FROM ' . _DB_PREFIX_ . 'product p ' . Shop::addSqlAssociation('product', 'p') . ' WHERE product_shop.`visibility` IN ("both", "search") AND product_shop.`active` = 1');
$this->fields_options = array('indexation' => array('title' => $this->l('Indexing'), 'icon' => 'icon-cogs', 'info' => '<p>' . $this->l('The "indexed" products have been analyzed by PrestaShop and will appear in the results of a Front Office search.') . '<br />
' . $this->l('Indexed products') . ' <strong>' . (int) $indexed . ' / ' . (int) $total . '</strong>.
</p>
<p>' . $this->l('Building the product index may take a few minutes.') . $this->l('If your server stops before the process ends, you can resume the indexing by clicking "Add missing products."') . '</p>
<a href="searchcron.php?token=' . substr(_COOKIE_KEY_, 34, 8) . '&redirect=1" class="btn-link"><i class="icon-external-link-sign"></i> ' . $this->l('Add missing products to the index.') . '</a><br />
<a href="searchcron.php?full=1&token=' . substr(_COOKIE_KEY_, 34, 8) . '&redirect=1" class="btn-link"><i class="icon-external-link-sign"></i> ' . $this->l('Re-build the entire index.') . '</a><br /><br />
' . $this->l('You can set a cron job that will rebuild your index using the following URL:') . ' <a href="' . Tools::safeOutput($cron_url) . '"><i class="icon-external-link-sign"></i> ' . Tools::safeOutput($cron_url) . '</a>', 'fields' => array('PS_SEARCH_INDEXATION' => array('title' => $this->l('Indexing'), 'validation' => 'isBool', 'type' => 'bool', 'cast' => 'intval', 'desc' => $this->l('Enable the automatic indexing of products. If you enable this feature, the products will be indexed in the search automatically when they are saved. If the feature is disabled, you will have to index products manually by using the links provided in the field set.'))), 'submit' => array('title' => $this->l('Save'))), 'search' => array('title' => $this->l('Search'), 'icon' => 'icon-search', 'fields' => array('PS_SEARCH_AJAX' => array('title' => $this->l('Ajax search'), 'validation' => 'isBool', 'type' => 'bool', 'cast' => 'intval', 'hint' => array($this->l('Enable ajax search for your visitors.'), $this->l('With ajax search, the first 10 products matching the user query will appear in real time below the input field.'))), 'PS_INSTANT_SEARCH' => array('title' => $this->l('Instant search'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'hint' => array($this->l('Enable instant search for your visitors?'), $this->l('With instant search, the results will appear immediately as the user writes a query.'))), 'PS_SEARCH_MINWORDLEN' => array('title' => $this->l('Minimum word length (in characters)'), 'hint' => $this->l('Only words this size or larger will be indexed.'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_BLACKLIST' => array('title' => $this->l('Blacklisted words'), 'validation' => 'isGenericName', 'hint' => $this->l('Please enter the index words separated by a "|".'), 'type' => 'textLang')), 'submit' => array('title' => $this->l('Save'))), 'relevance' => array('title' => $this->l('Weight'), 'icon' => 'icon-cogs', 'info' => $this->l('The "weight" represents its importance and relevance for the ranking of the products when completing a new search.') . '<br />
' . $this->l('A word with a weight of eight will have four times more value than a word with a weight of two.') . '<br /><br />
' . $this->l('We advise you to set a greater weight for words which appear in the name or reference of a product. This will allow the search results to be as precise and relevant as possible.') . '<br /><br />
' . $this->l('Setting a weight to 0 will exclude that field from search index. Re-build of the entire index is required when changing to or from 0'), 'fields' => array('PS_SEARCH_WEIGHT_PNAME' => array('title' => $this->l('Product name weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_REF' => array('title' => $this->l('Reference weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_SHORTDESC' => array('title' => $this->l('Short description weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_DESC' => array('title' => $this->l('Description weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_CNAME' => array('title' => $this->l('Category weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_MNAME' => array('title' => $this->l('Manufacturer weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_TAG' => array('title' => $this->l('Tags weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_ATTRIBUTE' => array('title' => $this->l('Attributes weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_FEATURE' => array('title' => $this->l('Features weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval')), 'submit' => array('title' => $this->l('Save'))));
}
开发者ID:carloslastresDev,项目名称:HealthyTaiwan_UsingPrestaShop,代码行数:30,代码来源:AdminSearchConfController.php
示例9: __construct
public function __construct()
{
global $cookie;
$this->className = 'Configuration';
$this->table = 'configuration';
$max_upload = (int) ini_get('upload_max_filesize');
$max_post = (int) ini_get('post_max_size');
$upload_mb = min($max_upload, $max_post);
$timezones = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT name FROM ' . _DB_PREFIX_ . 'timezone');
$taxes[] = array('id' => 0, 'name' => $this->l('None'));
foreach (Tax::getTaxes((int) $cookie->id_lang) as $tax) {
$taxes[] = array('id' => $tax['id_tax'], 'name' => $tax['name']);
}
$order_process_type = array(array('value' => PS_ORDER_PROCESS_STANDARD, 'name' => $this->l('Standard (5 steps)')), array('value' => PS_ORDER_PROCESS_OPC, 'name' => $this->l('One page checkout')));
$round_mode = array(array('value' => PS_ROUND_UP, 'name' => $this->l('superior')), array('value' => PS_ROUND_DOWN, 'name' => $this->l('inferior')), array('value' => PS_ROUND_HALF, 'name' => $this->l('classical')));
$cms_tab = array(0 => array('id' => 0, 'name' => $this->l('None')));
foreach (CMS::listCms($cookie->id_lang) as $cms_file) {
$cms_tab[] = array('id' => $cms_file['id_cms'], 'name' => $cms_file['meta_title']);
}
$this->_fieldsGeneral = array('PS_SHOP_ENABLE' => array('title' => $this->l('Enable Shop'), 'desc' => $this->l('Activate or deactivate your shop. Deactivate your shop while you perform maintenance on it. Please note that the webservice will not be disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_MAINTENANCE_IP' => array('title' => $this->l('Maintenance IP'), 'desc' => $this->l('IP addresses allowed to access the Front Office even if shop is disabled. Use a comma to separate them (e.g., 42.24.4.2,127.0.0.1,99.98.97.96)'), 'validation' => 'isGenericName', 'type' => 'maintenance_ip', 'size' => 30, 'default' => ''), 'PS_SSL_ENABLED' => array('title' => $this->l('Enable SSL'), 'desc' => $this->l('If your hosting provider allows SSL, you can activate SSL encryption (https://) for customer account identification and order processing'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_COOKIE_CHECKIP' => array('title' => $this->l('Check IP on the cookie'), 'desc' => $this->l('Check the IP address of the cookie in order to avoid your cookie being stolen'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_COOKIE_LIFETIME_FO' => array('title' => $this->l('Lifetime of the Front Office cookie'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '480'), 'PS_COOKIE_LIFETIME_BO' => array('title' => $this->l('Lifetime of the Back Office cookie'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '480'), 'PS_TOKEN_ENABLE' => array('title' => $this->l('Increase Front Office security'), 'desc' => $this->l('Enable or disable token on the Front Office in order to improve PrestaShop security'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_HELPBOX' => array('title' => $this->l('Back Office help boxes'), 'desc' => $this->l('Enable yellow help boxes which are displayed under form fields in the Back Office'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_ORDER_PROCESS_TYPE' => array('title' => $this->l('Order process type'), 'desc' => $this->l('You can choose the order process type as either standard (5 steps) or One Page Checkout'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $order_process_type, 'identifier' => 'value'), 'PS_GUEST_CHECKOUT_ENABLED' => array('title' => $this->l('Enable guest checkout'), 'desc' => $this->l('Your guest can make an order without registering'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_CONDITIONS' => array('title' => $this->l('Terms of service'), 'desc' => $this->l('Require customers to accept or decline terms of service before processing the order'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'js' => array('on' => 'onchange="changeCMSActivationAuthorization()"', 'off' => 'onchange="changeCMSActivationAuthorization()"')), 'PS_CONDITIONS_CMS_ID' => array('title' => $this->l('Conditions of use of CMS page'), 'desc' => $this->l('Choose the Conditions of use of CMS page'), 'validation' => 'isInt', 'type' => 'select', 'list' => $cms_tab, 'identifier' => 'id', 'cast' => 'intval'), 'PS_GIFT_WRAPPING' => array('title' => $this->l('Offer gift-wrapping'), 'desc' => $this->l('Suggest gift-wrapping to customer and possibility of leaving a message'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_GIFT_WRAPPING_PRICE' => array('title' => $this->l('Gift-wrap pricing'), 'desc' => $this->l('Set a price for gift-wrapping'), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'price'), 'PS_GIFT_WRAPPING_TAX' => array('title' => $this->l('Gift-wrapping tax'), 'desc' => $this->l('Set a tax for gift-wrapping'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $taxes, 'identifier' => 'id'), 'PS_ATTACHMENT_MAXIMUM_SIZE' => array('title' => $this->l('Maximum attachment size'), 'desc' => $this->l('Set the maximum size of attached files (in Megabytes ).') . ' ' . $this->l('Maximum:') . ' ' . ((int) str_replace('M', '', ini_get('post_max_size')) > (int) str_replace('M', '', ini_get('upload_max_filesize')) ? ini_get('upload_max_filesize') : ini_get('post_max_size')), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '2'), 'PS_RECYCLABLE_PACK' => array('title' => $this->l('Offer recycled packaging'), 'desc' => $this->l('Suggest recycled packaging to customer'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_CART_FOLLOWING' => array('title' => $this->l('Save cart content and re-display it at login'), 'desc' => $this->l('Recall and display contents of shopping cart following customer login'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_PRICE_ROUND_MODE' => array('title' => $this->l('Round mode'), 'desc' => $this->l('You can choose how to round prices: always round superior; always round inferior, or classic rounding'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'), 'PRESTASTORE_LIVE' => array('title' => $this->l('Automatically check for module updates'), 'desc' => $this->l('New modules and updates are displayed on the modules page'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_HIDE_OPTIMIZATION_TIPS' => array('title' => $this->l('Hide optimization tips'), 'desc' => $this->l('Hide optimization tips on the back office homepage'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_DISPLAY_SUPPLIERS' => array('title' => $this->l('Display suppliers and manufacturers'), 'desc' => $this->l('Display manufacturers and suppliers list even if corresponding blocks are disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_FORCE_SMARTY_2' => array('title' => $this->l('Use Smarty 2 instead of 3'), 'desc' => $this->l('Enable if your theme is incompatible with Smarty 3 (you should update your theme, since Smarty 2 will be unsupported from PrestaShop v1.5)'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_LIMIT_UPLOAD_FILE_VALUE' => array('title' => $this->l('Limit upload file value'), 'desc' => $this->l('Define the limit upload for a downloadable product, this value has to be inferior or equal to your server\'s maximum upload file ') . sprintf('(%s MB).', $upload_mb), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'limit', 'default' => '1'), 'PS_LIMIT_UPLOAD_IMAGE_VALUE' => array('title' => $this->l('Limit upload image value'), 'desc' => $this->l('Define the limit upload for an image, this value has to be inferior or equal to your server\'s maximum upload file ') . sprintf('(%s MB).', $upload_mb), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'limit', 'default' => '1'));
if (function_exists('date_default_timezone_set')) {
$this->_fieldsGeneral['PS_TIMEZONE'] = array('title' => $this->l('Time Zone:'), 'validation' => 'isAnything', 'type' => 'select', 'list' => $timezones, 'identifier' => 'name');
}
// No HTTPS activation if you haven't already.
if (!Tools::usingSecureMode() && !_PS_SSL_ENABLED_) {
$this->_fieldsGeneral['PS_SSL_ENABLED']['type'] = 'disabled';
$this->_fieldsGeneral['PS_SSL_ENABLED']['disabled'] = '<a href="https://' . Tools::getShopDomainSsl() . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">' . $this->l('Please click here to use HTTPS protocol before enabling SSL.') . '</a>';
}
parent::__construct();
}
示例10: displayForm
public function displayForm()
{
return '
<form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post">
<fieldset>
<legend><img src="' . $this->_path . 'logo.gif" alt="" title="" />' . $this->l('Settings') . '</legend>
<label>' . $this->l('Theamer') . '</label>
<div class="margin-form">
<select name="font" id="font">
<option value="almelo" ' . (Tools::getValue('font', Configuration::get('BLANK_FONT')) == "almelo" ? 'selected="selected" ' : '') . '>' . $this->l('Almelo') . '</option>
<option value="jura" ' . (Tools::getValue('font', Configuration::get('BLANK_FONT')) == "jura" ? 'selected="selected" ' : '') . '>' . $this->l('Jura') . '</option>
<option value="gabo" ' . (Tools::getValue('font', Configuration::get('BLANK_FONT')) == "gabo" ? 'selected="selected" ' : '') . '>' . $this->l('Gabo') . '</option>
<option value="economica" ' . (Tools::getValue('font', Configuration::get('BLANK_FONT')) == "economica" ? 'selected="selected" ' : '') . '>' . $this->l('Economica') . '</option>
<option value="ubuntu" ' . (Tools::getValue('font', Configuration::get('BLANK_FONT')) == "ubuntu" ? 'selected="selected" ' : '') . '>' . $this->l('Ubuntu') . '</option>
</select>
</div>
<div class="margin-form">
<select name="colour" id="colour">
<option value="white" ' . (Tools::getValue('colour', Configuration::get('BLANK_COLOUR')) == "white" ? 'selected="selected" ' : '') . '>' . $this->l('White') . '</option>
<option value="beige" ' . (Tools::getValue('colour', Configuration::get('BLANK_COLOUR')) == "beige" ? 'selected="selected" ' : '') . '>' . $this->l('Beige') . '</option>
</select>
</div>
<center><input type="submit" name="submitTheamer" value="' . $this->l('Save') . '" class="button" /></center>
</fieldset>
</form>';
}
示例11: _displayForm
private function _displayForm()
{
$this->_html .= '
<form method="post" action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">
<fieldset>
<legend><img src="' . $this->_path . 'logo.gif" />' . $this->l('Settings') . '</legend>
<label>' . $this->l('Display configuration in a new page?') . '</label>
<div class="margin-form">
<input type="radio" name="new_page" value="1" ' . (Configuration::get('NW_CONFIRMATION_NEW_PAGE') ? 'checked="checked" ' : '') . '/>' . $this->l('yes') . '
<input type="radio" name="new_page" value="0" ' . (!Configuration::get('NW_CONFIRMATION_NEW_PAGE') ? 'checked="checked" ' : '') . '/>' . $this->l('no') . '
</div>
<div class="clear"></div>
<label>' . $this->l('Send confirmation e-mail after subscription?') . '</label>
<div class="margin-form">
<input type="radio" name="conf_email" value="1" ' . (Configuration::get('NW_CONFIRMATION_EMAIL') ? 'checked="checked" ' : '') . '/>' . $this->l('yes') . '
<input type="radio" name="conf_email" value="0" ' . (!Configuration::get('NW_CONFIRMATION_EMAIL') ? 'checked="checked" ' : '') . '/>' . $this->l('no') . '
</div>
<div class="clear"></div>
<label>' . $this->l('Welcome voucher code') . '</label>
<div class="margin-form">
<input type="text" name="voucher" value="' . Configuration::get('NW_VOUCHER_CODE') . '" />
<p>' . $this->l('Leave blank for disabling') . '</p>
</div>
<div class="margin-form clear pspace"><input type="submit" name="submitUpdate" value="' . $this->l('Update') . '" class="button" /></div>
</fieldset>
</form>';
return $this->_html;
}
示例12: postProcess
public function postProcess()
{
// Update the cart ONLY if $this->cookies are available, in order to avoid ghost carts created by bots
if ($this->context->cookie->exists() && !$this->errors && !($this->context->customer->isLogged() && !$this->isTokenValid())) {
if (Tools::getIsset('add') || Tools::getIsset('update')) {
$this->processChangeProductInCart();
} elseif (Tools::getIsset('delete')) {
$this->processDeleteProductInCart();
} elseif (Tools::getIsset('changeAddressDelivery')) {
$this->processChangeProductAddressDelivery();
} elseif (Tools::getIsset('allowSeperatedPackage')) {
$this->processAllowSeperatedPackage();
} elseif (Tools::getIsset('duplicate')) {
$this->processDuplicateProduct();
}
// Make redirection
if (!$this->errors && !$this->ajax) {
$queryString = Tools::safeOutput(Tools::getValue('query', null));
if ($queryString && !Configuration::get('PS_CART_REDIRECT')) {
Tools::redirect('index.php?controller=search&search=' . $queryString);
}
// Redirect to previous page
if (isset($_SERVER['HTTP_REFERER'])) {
preg_match('!http(s?)://(.*)/(.*)!', $_SERVER['HTTP_REFERER'], $regs);
if (isset($regs[3]) && !Configuration::get('PS_CART_REDIRECT')) {
$url = preg_replace('/(\\?)+content_only=1/', '', $_SERVER['HTTP_REFERER']);
Tools::redirect($url);
}
}
Tools::redirect('index.php?controller=order&' . (isset($this->id_product) ? 'ipa=' . $this->id_product : ''));
}
} elseif (!$this->isTokenValid()) {
Tools::redirect('index.php');
}
}
示例13: initContent
public function initContent()
{
if ((empty($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off') && Configuration::get('PS_SSL_ENABLED')) {
// You can uncomment these lines if you want to force https even from localhost and automatically redirect
// header('HTTP/1.1 301 Moved Permanently');
// header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
// exit();
$clientIsMaintenanceOrLocal = in_array(Tools::getRemoteAddr(), array_merge(array('127.0.0.1'), explode(',', Configuration::get('PS_MAINTENANCE_IP'))));
// If ssl is enabled, https protocol is required. Exception for maintenance and local (127.0.0.1) IP
if ($clientIsMaintenanceOrLocal) {
$this->errors[] = Tools::displayError('SSL is activated. However, your IP is allowed to use unsecure mode (Maintenance or local IP).');
} else {
$warningSslMessage = Tools::displayError('SSL is activated. Please connect using the following url to log in in secure mode (https).');
$warningSslMessage .= '<a href="https://' . Tools::safeOutput(Tools::getServerName()) . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">https://' . Tools::safeOutput(Tools::getServerName()) . Tools::safeOutput($_SERVER['REQUEST_URI']) . '</a>';
$this->context->smarty->assign(array('warningSslMessage' => $warningSslMessage));
}
}
if (file_exists(_PS_ADMIN_DIR_ . '/../install') || file_exists(_PS_ADMIN_DIR_ . '/../admin')) {
$this->context->smarty->assign(array('randomNb' => rand(100, 999), 'wrong_folder_name' => true));
}
// Redirect to admin panel
if (Tools::isSubmit('redirect') && Validate::isControllerName(Tools::getValue('redirect'))) {
$this->context->smarty->assign('redirect', Tools::getValue('redirect'));
} else {
$tab = new Tab((int) $this->context->employee->default_tab);
$this->context->smarty->assign('redirect', $this->context->link->getAdminLink($tab->class_name));
}
if ($nb_errors = count($this->errors)) {
$this->context->smarty->assign(array('errors' => $this->errors, 'nbErrors' => $nb_errors, 'shop_name' => Tools::safeOutput(Configuration::get('PS_SHOP_NAME')), 'disableDefaultErrorOutPut' => true));
}
$this->setMedia();
$this->initHeader();
parent::initContent();
$this->initFooter();
}
示例14: hookAdminStatsModules
public function hookAdminStatsModules($params)
{
$totalVisits = $this->getTotalVisits();
$totalGuests = $this->getTotalGuests();
if (Tools::getValue('export')) {
$this->csvExport(array('layers' => 2, 'type' => 'line', 'option' => 3));
}
$this->_html = '
<fieldset class="width3"><legend><img src="../modules/' . $this->name . '/logo.gif" /> ' . $this->displayName . '</legend>
<p><center>
<img src="../img/admin/down.gif" />' . $this->l('A visit corresponds to an internet user coming to your shop. Until the end of their session, only one visit is counted.') . '
' . $this->l('A visitor is an unknown person, who has not registered or logged on, surfing on your shop. A visitor can come and visit your shop many times.') . '
</center></p>
<div style="margin-top:20px"></div>
<p>' . $this->l('Total visits:') . ' ' . $totalVisits . '</p>
<p>' . $this->l('Total visitors:') . ' ' . $totalGuests . '</p>
' . ($totalVisits ? ModuleGraph::engine(array('layers' => 2, 'type' => 'line', 'option' => 3)) . '<p><a href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&export=1"><img src="../img/admin/asterisk.gif" />' . $this->l('CSV Export') . '</a></p>' : '') . '
</fieldset>
<br class="clear" />
<fieldset class="width3"><legend><img src="../img/admin/comment.gif" /> ' . $this->l('Guide') . '</legend>
<h2>' . $this->l('Determine the interest of a visit') . '</h2>
' . $this->l('The visitors\' evolution graph strongly resembles the visits\' graph, but provides additional information:') . '<br />
<ul>
<li>' . $this->l('If this is the case, congratulations, your website is well planned and pleasing.') . '</li>
<li>' . $this->l('Otherwise, the conclusion is not so simple. The problem can be aesthetic or ergonomic, or else the offer is not sufficient. It is also possible that these visitors mistakenly came here with no particular interest for your shop; this can happen frequently when using search engines.') . '</li>
</ul>
' . $this->l('This information is mostly qualitative: you\'re the one that really needs to determine the interest of a one-off visit.') . '<br />
</fieldset>';
return $this->_html;
}
示例15: hookAdminStatsModules
public function hookAdminStatsModules($params)
{
$graphParams = array('layers' => 2, 'type' => 'line', 'option' => 3);
$totalVisits = $this->getTotalVisits();
$totalGuests = $this->getTotalGuests();
if (Tools::getValue('export')) {
$this->csvExport(array('layers' => 2, 'type' => 'line', 'option' => 3));
}
$this->html = '
<div class="blocStats"><h2 class="icon-' . $this->name . '"><span></span>' . $this->displayName . '</h2>
<p>
<img src="../img/admin/down.gif" />' . $this->l('A visit corresponds to an internet user coming to your shop. Until the end of their session, only one visit is counted.') . '
' . $this->l('A visitor is an unknown person, who has not registered or logged on, surfing on your shop. A visitor can come and visit your shop many times.') . '
</p>
<div style="margin-top:20px"></div>
<p>' . $this->l('Total visits:') . ' <span class="totalStats">' . $totalVisits . '</span></p>
<p>' . $this->l('Total visitors:') . ' <span class="totalStats">' . $totalGuests . '</span></p>
' . ($totalVisits ? $this->engine($graphParams) . '<p><a class="button export-csv" href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&export=1"><span>' . $this->l('CSV Export') . '</span></a></p>' : '') . '
</div>
<br />
<div class="blocStats"><h2 class="icon-guide"><span></span>' . $this->l('Guide') . '</h2>
<h2>' . $this->l('Determine the interest of a visit') . '</h2>
' . $this->l('The visitors\' evolution graph strongly resembles the visits\' graph, but provides additional information:') . '<br />
<ul>
<li>' . $this->l('If this is the case, congratulations, your website is well planned and pleasing.') . '</li>
<li>' . $this->l('Otherwise, the conclusion is not so simple. The problem can be aesthetic or ergonomic, or else the offer is not sufficient. It is also possible that these visitors mistakenly came here without particular interest for your shop; this phenomenon often happens with the search engines.') . '</li>
</ul>
' . $this->l('This information is mostly qualitative: you have to determine the interest of a disjointed visit.') . '<br />
</div>';
return $this->html;
}