Esempio n. 1
0
function smartyModifierPPSafeoutput($string, $type = null)
{
    if ($type === null) {
        $type = 'html';
    }
    switch ($type) {
        case 'html':
            return PP::safeOutput($string);
        case 'js':
        case 'javascript':
            return PP::safeOutputJS($string);
        case 'value':
            return PP::safeOutputValue($string);
        default:
            return $string;
    }
}
Esempio n. 2
0
 private function createHelperFormSelect($name, $data, $type, $helper, $template, $all_properties, $property_types)
 {
     if ($type !== false && !is_array($type)) {
         $type = array($type);
     }
     $options = array();
     $helper->fields_value[$name] = 0;
     $options[] = array('id' => 0, 'name' => ' ');
     foreach ($all_properties[$this->default_language_id] as $id => $prop) {
         if ($type === false || in_array($property_types[$id], $type)) {
             $options[] = array('id' => $id, 'name' => PP::safeOutputValue($prop['text']));
             if (is_array($template)) {
                 if (isset($template[$name]) && $template[$name] == $prop['text']) {
                     $helper->fields_value[$name] = $id;
                 }
             } else {
                 if ($template == $prop['text']) {
                     $helper->fields_value[$name] = $id;
                 }
             }
         }
     }
     $select = array('type' => 'select', 'name' => $name, 'options' => array('query' => $options, 'id' => 'id', 'name' => 'name'));
     if (is_array($data)) {
         foreach ($data as $key => $value) {
             $select[$key] = $value;
         }
     }
     return $select;
 }