public function add(HTML_Element $element, $content_check = true) { if (!$content_check || $element instanceof HTML_TD || $element instanceof HTML_Columns) { parent::add($element, $content_check); } else { throw new HTML_Content_Exception('Attempt to add a non HTML_TD / HTML_Columns class: ' . get_class($element)); } }
public function add(HTML_Element $element, $content_check = true) { if (!$content_check || $element instanceof HTML_Block) { parent::add($element, $content_check); } else { throw new HTML_Content_Exception('Class ' . get_class($element) . ' doesn\'t implement the HTML_Block interface.'); } }
protected function updateTemplate_CatalogProduct($p, array &$produkt_fields, array $p_vzor) { $vzor_fields = array(); $vzor_group = new HTML_Group(); $zaklad_vzory = $this->_index->zaklad_vzory; if (empty($zaklad_vzory)) { throw new Template_Element_Missing_Exception('zaklad_vzory'); } if (count($zaklad_vzory) !== 1) { throw new Template_Invalid_Structure_Exception("The \"zaklad_vzory\" element duplicity"); } $vzor_group->add(clone $zaklad_vzory[0]); foreach ($p_vzor as $elem) { $vzor_clone = clone $elem; $vzor_fields[$vzor_clone->specification] = $vzor_clone; $vzor_group->add($vzor_clone); } $index = new HTML_Indexer($vzor_group, 'eid', false); if ($p !== null) { //$po = new Kiwi_Product($p->PID); $po = Kiwi_Object_Manager::load('Kiwi_Product', array($p->PID)); // allows caching // generování řádků popisujících umístění produktu v katalogu $this->updateTemplate_Location($index, $po); // generování názvu produktu $this->updateTemplate_Title($index, $po); // generování kódu produktu $this->updateTemplate_Code($index, $po); // generování fotografie $this->updateTemplate_CatalogPhoto($index, $po); // generování odkazu na detail produktu $this->updateTemplate_DetailLink($index, $po); // generování dalších fotografií $this->updateTemplate_AdditionalPhotos($index, $po); // generování ilustrativních fotografií $this->updateTemplate_IllustrativePhotos($index, $po); // generování fotografií produktů z kolekce $this->updateTemplate_CollectionPhotos($index, $po); // generování příloh $this->updateTemplate_Attachments($index, $po); // generování odkazu pro objednání $this->updateTemplate_OrderLink($index, $po); // generování příznaku novinky $this->updateTemplate_Novelty($index, $po); // generování příznaku akce $this->updateTemplate_Action($index, $po); // generování příznaku slevy $this->updateTemplate_Discount($index, $po); // generování ceny (cen) $this->updateTemplate_Cost($index, $po); // generování popisu $this->updateTemplate_Description($index, $po); // generování vlastností $this->updateTemplate_Properties($index, $po); } foreach ($vzor_fields as $section => $field) { if (array_key_exists($section, $produkt_fields)) { $produkt_fields[$section]->add($field); } } }