diff --git a/admin-dev/ajax.php b/admin-dev/ajax.php index abc02b7dc..5cdd245c5 100644 --- a/admin-dev/ajax.php +++ b/admin-dev/ajax.php @@ -543,18 +543,6 @@ if (Tools::isSubmit('toggleScreencast')) } } -if (Tools::isSubmit('helpAccess')) -{ - $item = Tools::getValue('item'); - $isoUser = Tools::getValue('isoUser'); - $country = Tools::getValue('country'); - $version = Tools::getValue('version'); - - if (isset($item) AND isset($isoUser) AND isset($country)) - die(HelpAccess::displayHelp($item, $isoUser, $country, $version)); - die('{nohelp}'); -} - if (Tools::isSubmit('getHookableList')) { /* PrestaShop demo mode */ @@ -654,8 +642,8 @@ if (Tools::isSubmit('saveHook')) $i++; } $value = rtrim($value, ','); - $res &= Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'hook_module` - (id_module, id_shop, id_hook, position) + $res &= Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'hook_module` + (id_module, id_shop, id_hook, position) VALUES '.$value); } @@ -1014,3 +1002,4 @@ if (Tools::isSubmit('getZones')) $array = array('hasError' => false, 'errors' => '', 'data' => $html); die(Tools::jsonEncode($html)); } + diff --git a/admin-dev/themes/default/css/admin.css b/admin-dev/themes/default/css/admin.css index f932fc7ee..dc501486f 100644 --- a/admin-dev/themes/default/css/admin.css +++ b/admin-dev/themes/default/css/admin.css @@ -26,7 +26,7 @@ select[disabled="disabled"], input[disabled="disabled"],textarea[disabled="disab /*BUTTON*/ .button{ - background: #e3e3e3 url('../img/bg-button-degrade.png') repeat-x scroll left top; + background: #e3e3e3 url('../img/bg-button-degrade.png') repeat-x scroll left top; background: -moz-linear-gradient(center top , #F9F9F9, #E3E3E3) repeat scroll 0 0 transparent; background: -webkit-gradient(linear, center top ,center bottom, from(#F9F9F9), to(#E3E3E3)) repeat scroll 0 0 transparent; border-color: #CCCCCC #BBBBBB #A0A0A0;border-left: 1px solid #BBBBBB;border-radius: 3px 3px 3px 3px;border-right: 1px solid #BBBBBB;border-style: solid;border-width: 1px;color: #000000;margin: 0; outline: medium none;padding: 3px 8px;text-align: center;vertical-align: middle;white-space: nowrap; text-shadow:0 1px 0 #fff;} @@ -203,6 +203,7 @@ a.module_toggle_all{color: #268CCD;} .toolbarBox .process-icon-new.add_product{ background-image: url('../img/process-icon-addProduct.png');} .toolbarBox .process-icon-partialRefund{ background-image: url('../img/process-icon-partial-refund.png');} .toolbarBox .process-icon-standardRefund{ background-image: url('../img/process-icon-standard-refund.png');} +.toolbarBox .process-icon-help{ background-image: url('../img/process-icon-help.png');} div.fix-toolbar {border-bottom: 1px solid #E0E0E0;position:fixed;top:0;opacity:0.9;z-index:1;} diff --git a/admin-dev/themes/default/img/process-icon-help.png b/admin-dev/themes/default/img/process-icon-help.png new file mode 100644 index 000000000..c003c0df0 Binary files /dev/null and b/admin-dev/themes/default/img/process-icon-help.png differ diff --git a/admin-dev/themes/default/template/header.tpl b/admin-dev/themes/default/template/header.tpl index de45740ba..564be4338 100644 --- a/admin-dev/themes/default/template/header.tpl +++ b/admin-dev/themes/default/template/header.tpl @@ -31,7 +31,7 @@ {$meta_title} - PrestaShop™ {if $display_header} '; - } - return $content; - } } diff --git a/classes/helper/HelperForm.php b/classes/helper/HelperForm.php index 4b853cedd..195fc2fe9 100644 --- a/classes/helper/HelperForm.php +++ b/classes/helper/HelperForm.php @@ -141,13 +141,6 @@ class HelperFormCore extends Helper $this->tpl->assign(array( 'title' => $this->title, 'toolbar_btn' => $this->toolbar_btn, - - 'ps_help_context' => $this->ps_help_context, - 'class_name' => get_class($this->context->controller), - 'iso_user' => $this->context->language->id, - 'country_iso_code' => $this->context->country->iso_code, - 'version' => _PS_VERSION_, - 'show_toolbar' => $this->show_toolbar, 'toolbar_fix' => $this->toolbar_fix, 'submit_action' => $this->submit_action, diff --git a/classes/helper/HelperHelpAccess.php b/classes/helper/HelperHelpAccess.php new file mode 100644 index 000000000..b1ddbd060 --- /dev/null +++ b/classes/helper/HelperHelpAccess.php @@ -0,0 +1,76 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision$ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/** + * @since 1.5 + */ +class HelperHelpAccess extends Helper +{ + public $label; + public $iso_lang; + public $country; + public $ps_version; + + + public function __construct($label, $iso_lang, $country, $ps_version) + { + parent::__construct(); + $this->base_folder = 'helper/help_access/'; + + $this->tpl = $this->createTemplate('button.tpl'); + $this->label = $label; + $this->iso_lang = $iso_lang; + $this->country = $country; + $this->ps_version = $ps_version; + } + + /** + * @return string|void + */ + public function generate() + { + $info = HelpAccess::retrieveInfos($this->label, $this->iso_lang, $this->country, $this->ps_version); + $content = ''; + + if (array_key_exists('version', $info) && $info['version'] != '') + { + $tpl_vars['label'] = $this->label; + $tpl_vars['iso_lang'] = $this->iso_lang; + $tpl_vars['country'] = $this->country; + $tpl_vars['version'] = $this->ps_version; + $tpl_vars['doc_version'] = $info['version']; + $tpl_vars['help_base_url'] = HelpAccess::URL; + $tpl_vars['tooltip'] = $info['tooltip']; + + $this->tpl->assign($tpl_vars); + + $content = parent::generate(); + } + + return $content; + } +} \ No newline at end of file diff --git a/classes/helper/HelperList.php b/classes/helper/HelperList.php index f16cb75b3..d4dd9fc78 100644 --- a/classes/helper/HelperList.php +++ b/classes/helper/HelperList.php @@ -589,13 +589,6 @@ class HelperListCore extends Helper 'show_toolbar' => $this->show_toolbar, 'toolbar_fix' => $this->toolbar_fix, 'toolbar_btn' => $this->toolbar_btn, - - 'ps_help_context' => $this->ps_help_context, - 'class_name' => get_class($this->context->controller), - 'iso_user' => $this->context->language->id, - 'country_iso_code' => $this->context->country->iso_code, - 'version' => _PS_VERSION_, - 'table' => $this->table, 'currentIndex' => $this->currentIndex, 'action' => $action, diff --git a/js/helpAccess.js b/js/helpAccess.js index a8d6cdc4e..d65f1acbf 100644 --- a/js/helpAccess.js +++ b/js/helpAccess.js @@ -1,25 +1,23 @@ -$(document).ready(function(){ - if($('.help-context')) - { - $.ajax({ - type: 'POST', - url: 'index.php', - data: { - 'ajax' : '1', - 'action' : 'helpAccess', - 'item' : class_name, - 'isoUser' : iso_user, - 'country' : country_iso_code, - 'version' : _PS_VERSION_ - }, - async : true, - success: function(msg) { - if(msg.status == 'ok' && msg.content != 'none') - { - $(".help-context").html(msg.content); - $(".help-context").fadeIn("slow").show(); - } - } - }); - } -}); \ No newline at end of file +function getHelpButton(label){ + var button = ''; + $.ajax({ + type: 'POST', + url: 'index.php', + data: { + 'ajax' : 1, + 'action' : 'helpAccess', + 'item' : label, + 'isoUser' : iso_user, + 'country' : country_iso_code, + 'version' : _PS_VERSION_ + }, + dataType: "json", + async : false, + success: function(msg) { + if(msg.content != 'none' && msg.content != '') + button = msg.content; + } + }); + + return button; +} \ No newline at end of file