Ejemplo n.º 1
0
 /**
  * Load all the conditions in the form description
  *
  * @param DOMDocument $dom
  * @param string $schemeName
  */
 protected static function loadConditions()
 {
     One_Form_Factory::$_conditions = array();
     $xpath = new DOMXPath(self::$_dom);
     $conditions = $xpath->query('/form/conditions');
     if ($conditions->length > 0) {
         $conditions = $conditions->item(0);
     } else {
         return;
     }
     foreach ($conditions->childNodes as $condition) {
         if ($condition instanceof DOMElement) {
             switch (strtolower($condition->localName)) {
                 case 'cinclude':
                     self::parseInclude($condition->getAttribute('file'));
                     break;
                 case 'condition':
                     self::parseCondition($condition, $condition->getAttribute('name'));
                     break;
             }
         }
     }
 }