Ejemplo n.º 1
0
 /**
  * Processes the opt:attributes-build and opt:attributes-ignore attributes.
  * @internal
  * @param Opt_Xml_Element $node The node
  * @param Opt_Xml_Attribute $attr The attribute to process
  */
 public function processAttribute(Opt_Xml_Node $node, Opt_Xml_Attribute $attr)
 {
     if ($attr->getName() == 'attributes-build') {
         $ignoreList = $node->getAttribute('opt:attributes-ignore');
         if ($ignoreList instanceof Opt_Xml_Attribute) {
             $ignore = $this->_compiler->compileExpression($ignoreList->getValue(), false, Opt_Compiler_Class::ESCAPE_OFF);
             $ignore = $ignore[0];
         } else {
             $ignore = 'array()';
         }
         $expression = $this->_compiler->compileExpression($attr->getValue(), false, Opt_Compiler_Class::ESCAPE_OFF);
         $node->addAfter(Opt_Xml_Buffer::TAG_ENDING_ATTRIBUTES, 'echo Opt_Function::buildAttributes(' . $expression[0] . ', ' . $ignore . ', \' \'); ');
     }
 }