public static function displayHelp($label, $iso_lang, $country, $ps_version) { $infos = HelpAccess::retrieveInfos($label, $iso_lang, $country, $ps_version); if (array_key_exists('image', $infos) && $infos['image'] != 'none') { echo ' <a class="help-button" href="#" onclick="showHelp(\'' . HelpAccess::URL . '\',\'' . $label . '\',\'' . $iso_lang . '\',\'' . $ps_version . '\',\'' . $infos['version'] . '\',\'' . $country . '\');" title="' . Tools::htmlentitiesUTF8($infos['tooltip']) . '"> <img id="help-' . $label . '" src="../img/admin/' . Tools::htmlentitiesUTF8($infos['image']) . '" alt="" class="middle" style="margin-top: -5px"/> ' . Tools::displayError('HELP') . ' </a> '; if (!empty($infos['tooltip'])) { echo ' <script type="text/javascript"> $(document).ready(function() { $("a.help-button").cluetip({ splitTitle: "|", cluetipClass: "help-button", showTitle: false, arrows: true, dropShadow: false, positionBy: "auto" }); }); </script>'; } } }
/** * @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'] != '') { $last_version = HelpAccess::getVersion($this->label); $tpl_vars['button_class'] = 'process-icon-help'; if ($last_version < $info['version']) { $tpl_vars['button_class'] = 'process-icon-help-new'; } $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; }