public function add(HTML_Element $element, $content_check = true)
 {
     if (!$content_check || $element instanceof HTML_Flow) {
         parent::add($element, $content_check);
     } else {
         throw new HTML_Content_Exception('Class ' . get_class($element) . ' doesn\'t implement the HTML_Flow interface.');
     }
 }
 public function add(HTML_Element $element, $content_check = true)
 {
     if (!$content_check || $element instanceof HTML_TR) {
         parent::add($element, $content_check);
     } else {
         throw new HTML_Content_Exception('Class ' . get_class($element) . ' not allowed here, only HTML_TR allowed.');
     }
 }
 public function add(HTML_Element $element, $content_check = true)
 {
     if (!$content_check || $element instanceof HTML_Text || $element instanceof HTML_Text_Group) {
         parent::add($element, $content_check);
     } else {
         throw new HTML_Content_Exception('Attempt to add a non HTML_Text class: ' . get_class($element));
     }
 }
 public function add(HTML_Element $element, $content_check = true)
 {
     if (!$content_check || $element instanceof HTML_LI) {
         parent::add($element, $content_check);
     } else {
         throw new HTML_Content_Exception('Cannot add an instance of class: ' . get_class($element));
     }
 }
 public function addOption($value, $text, $selected = false, $disabled = false, $raw = false)
 {
     $option = new HTML_Option($value, $text, $selected, $disabled);
     if ($raw) {
         $option->raw = true;
     }
     parent::add($option);
 }
 public function add(HTML_Element $element, $content_check = true)
 {
     if (!$content_check || $element instanceof HTML_OptGroup) {
         HTML_Entity_Group::add($element, $content_check);
     } else {
         parent::add($element, $content_check);
     }
 }
Example #7
0
 public function add(HTML_Element $element, $content_check = true)
 {
     if (!$content_check || $element instanceof HTML_Inline) {
         if ($content_check && $element instanceof HTML_A) {
             throw new HTML_Content_Exception('Attempt of "a" tags nesting');
         } else {
             parent::add($element, $content_check);
         }
     } else {
         throw new HTML_Content_Exception('Class ' . get_class($element) . ' doesn\'t implement the HTML_Inline interface.');
     }
 }
 public function add(HTML_Element $element, $content_check = true)
 {
     if (!$content_check || $element instanceof HTML_Table_Content) {
         if ($content_check && $element instanceof HTML_Caption) {
             if (!empty($this->_elements)) {
                 throw new HTML_Content_Exception('Caption permitted only as the first child element of the table element.');
             }
         }
         parent::add($element, $content_check);
     } else {
         throw new HTML_Content_Exception('Class ' . get_class($element) . ' doesn\'t implement the HTML_Table_Content interface.');
     }
 }