/**
  * Returns formatter object for a given format
  *
  * @static
  * @param string $format
  * @return ezpAttributeOperatorFormatterInterface|null
  */
 public static function getOutputFormatter($format)
 {
     if (!self::isRegisteredFormatter($format)) {
         $format = eZINI::instance('template.ini')->variable('AttributeOperator', 'DefaultFormatter');
     }
     if (!self::$formatter instanceof ezpAttributeOperatorFormatterInterface || $format != self::$format) {
         self::$formatter = self::createFormatter($format);
         self::$format = $format;
     }
     return self::$formatter;
 }
 function modify($tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters, $placement)
 {
     $showValues = $namedParameters['show_values'] == 'show';
     $max = $namedParameters['max_val'];
     $format = $namedParameters['format'];
     $formatter = ezpAttributeOperatorManager::getOutputFormatter($format);
     // check for an object or an array that is not empty
     if (is_object($operatorValue) || is_array($operatorValue) && !empty($operatorValue)) {
         $outputString = "";
         $this->displayVariable($operatorValue, $formatter, $showValues, $max, 0, $outputString);
         if ($formatter instanceof ezpAttributeOperatorFormatterInterface) {
             $operatorValue = $formatter->header($outputString, $showValues);
         }
     } else {
         if ($formatter instanceof ezpAttributeOperatorFormatterInterface) {
             $operatorValue = $formatter->exportScalar($operatorValue);
         }
     }
 }
    function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters )
    {
        $max = $namedParameters["max_val"];
        $format = $namedParameters["format"];
        $showValues = $namedParameters["show_values"] == "show";

        $formatter = ezpAttributeOperatorManager::getOutputFormatter( $format );

        $outputString = "";
        $this->displayVariable( $operatorValue, $formatter, $showValues, $max, 0, $outputString );

        if ( $formatter instanceof ezpAttributeOperatorFormatterInterface )
                $operatorValue = $formatter->header( $outputString, $showValues );
    }