public function &doProcess(__ConfigurationSection &$section) { $return_value = array('dynamic_rules' => array(), 'static_rules' => array()); $view_definition_sections = $section->getSections(); foreach ($view_definition_sections as $view_definition_section) { $view_definition = new __ViewDefinition(); $view_definition->setViewCode($view_definition_section->getAttribute('code')); $view_definition->setViewClass($view_definition_section->getAttribute('class')); $view_definition_subsections = $view_definition_section->getSections(); foreach ($view_definition_subsections as $view_definition_subsection) { switch (strtoupper($view_definition_subsection->getName())) { case 'PROPERTY': $property_name = $view_definition_subsection->getAttribute('name'); $property_value = $view_definition_subsection->getAttribute('value'); $view_definition->addProperty($property_name, $property_value); break; } } if (strpos($view_definition->getViewCode(), '*') !== false) { $clasify = 'dynamic_rules'; } else { $clasify = 'static_rules'; } $return_value[$clasify][strtoupper($view_definition->getViewCode())] =& $view_definition; unset($view_definition); } return $return_value; }
public function &doProcess(__ConfigurationSection &$section) { $return_value = array(); $ui_component_tag_sections = $section->getSections(); foreach ($ui_component_tag_sections as &$ui_component_tag_section) { $tag_name = $ui_component_tag_section->getAttribute('tag-name'); $component_class = $ui_component_tag_section->getAttribute('component-class'); $component_tag = new __ComponentTag($tag_name); $component_tag->setComponentClass($component_class); $component_writer_sections = $ui_component_tag_section->getSections(); foreach ($component_writer_sections as $component_writer_section) { $component_section_name = strtoupper($component_writer_section->getName()); switch ($component_section_name) { case 'UI-COMPONENT-WRITER': $client = $component_writer_section->getAttribute('client'); $component_writer_class = $component_writer_section->getAttribute('class'); $component_writer_subsections = $component_writer_section->getSections(); $component_writer_decorator_classes = array(); foreach ($component_writer_subsections as $component_writer_subsection) { $section_name = strtoupper($component_writer_subsection->getName()); switch ($section_name) { case 'DECORATORS': $decorator_sections = $component_writer_subsection->getSections(); $next_order = 10000; foreach ($decorator_sections as $decorator_section) { if ($decorator_section->hasAttribute('order')) { $order = $decorator_section->getAttribute('order'); } else { $order = $next_order; $next_order++; } $component_writer_decorator_classes[$order] = $decorator_section->getAttribute('class'); } break; case 'VIEW': $view_definition = new __ViewDefinition(); $view_definition->setViewClass($component_writer_subsection->getAttribute('class')); $view_definition_subsections = $component_writer_subsection->getSections(); foreach ($view_definition_subsections as $view_definition_subsection) { switch (strtoupper($view_definition_subsection->getName())) { case 'PROPERTY': $property_name = $view_definition_subsection->getAttribute('name'); $property_value = $view_definition_subsection->getAttribute('value'); $view_definition->addProperty($property_name, $property_value); break; } } $component_tag->addViewDefinition($client, $view_definition); unset($view_definition); break; } } $component_tag->addComponentWriterClass($client, $component_writer_class, $component_writer_decorator_classes); break; case 'UI-COMPONENT-INTERFACE': $ui_component_interface = $this->_getComponentInterfaceSpec($component_writer_section); $component_tag->setComponentInterfaceSpec($ui_component_interface); break; } } $return_value[$tag_name] = $component_tag; unset($component_tag); } return $return_value; }