function smartyModifierPPSafeoutputLenient($string, $type = null)
{
    if ($type === null) {
        $type = 'html';
    }
    switch ($type) {
        case 'html':
            return PP::safeOutputLenient($string);
        case 'js':
        case 'javascript':
            return PP::safeOutputLenientJS($string);
        case 'value':
            return PP::safeOutputLenientValue($string);
        default:
            return $string;
    }
}
 public static function callbackName($echo, $tr)
 {
     static $show = null;
     if ($show === null) {
         $show = (bool) Configuration::get('PP_TEMPLATE_NAME_IN_CATALOG');
     }
     if ($show) {
         $id_pp_template = PP::getProductTemplateId($tr);
         if ($id_pp_template > 0) {
             PP::getAdminProductsTemplates(PP::getProductTemplateId($tr));
             $name = PP::getTemplateName($id_pp_template, true);
             if ($name != '') {
                 static $template_title = null;
                 if ($template_title === null) {
                     $module = Module::getInstanceByName('pproperties');
                     $translations = $module->getTranslations('AdminProductsController');
                     $template_title = $translations['template_title'];
                 }
                 return $echo . '<br><span class="pp_list_template" title="' . $template_title . '"><i class="icon-template"></i>' . PP::safeOutputLenient($name) . '</span>';
             }
         }
     }
     return $echo;
 }
示例#3
0
 private function getTemplatesTabHtml()
 {
     $helper = $this->createTemplate('templates');
     $helper->tpl_vars['integrated'] = $this->integrated;
     if ($this->integrated) {
         $templates = PP::getTemplates();
         $buy_block_text = array();
         foreach ($templates as &$template) {
             $display_mode = array();
             if (($template['pp_display_mode'] & 1) == 1) {
                 $display_mode[] = 1;
             }
             if (($template['pp_display_mode'] & 2) == 2) {
                 $display_mode[] = 2;
             }
             if (($template['pp_display_mode'] & 4) == 4) {
                 $display_mode[] = 3;
             }
             $template['display_mode'] = implode(',', $display_mode);
             if ($template['pp_explanation']) {
                 $buy_block_text[$template['pp_bo_buy_block_index']] = PP::safeOutputLenient($template['pp_explanation']);
             }
         }
         ksort($buy_block_text, SORT_NUMERIC);
         $helper->tpl_vars['templates'] = PP::safeOutput($templates);
         $helper->tpl_vars['buy_block_text'] = $buy_block_text;
         $translations = $this->getTranslations('EditTemplate');
         $helper->tpl_vars['display_mode_text'] = array($translations['s_pp_display_mode_1_long'], $translations['s_pp_display_mode_2'], $translations['s_pp_display_mode_4']);
     } else {
         $helper->tpl_vars['integration_message'] = $this->getTabIntegrationWarning();
     }
     return $helper->generate();
 }