* @license PHP License * @package wb * @subpackage Markup */ WBClass::load('WBMarkup_Converter'); /** * Tag converter * * Convert node to node * * @version 0.5.0 * @package wb * @subpackage Markup */ class WBMarkup_Converter_Wb_ItsComment extends WBMarkup_Converter { /** * transform Xinha Tags to XML * * @todo solve problem with internal but SSL links * @todo implement VFSFile links * @param array $node to be modified document node * @return bool true on success */ public function toXml(&$node) { return true; } /** * transform Xml to Wxml (html) tags * * @todo not implemented * @param array $node to be modified document node * @return bool true on success */ public function toWxml(&$node) { return true; } /** * transform XML to Html * * @param array $node to be modified document node * @return bool true on success */ public function toHtml(&$node) { if (!$this->loadTemplates($node['attributes']['tmpl'])) { throw WBClass::create('WBException', array( 'msg' => 'Could not load template for comment: ' . $node['attributes']['tmpl'], 'code' => 1, 'class' => __CLASS__ )); return true; } // remove CDATA marker if (0 == strncmp(' $value) { if (is_scalar($value)) { $tmplData[$key] = $value; continue; } if ('diff' == $key) { foreach ($value as $k => $v) { if (is_array($v)) { if ('ticketmedia' == $k) { foreach ($v as $i => $t) { if (empty($t['value'])) { unset($v[$i]); } } $v = array_values($v); } $tmplData['diff_' . $k . '_count'] = count($v); if ($this->tmpl->exists('diff_' . $k . '_list_entry')) { $this->tmpl->addRows('diff_' . $k . '_list_entry', $v); } continue; } if (empty($v) && empty($data[$k])) { continue; } $tmplData['diff_' . $k] = $v; } continue; } $tmplData[$key . '_count'] = count($value); if ($this->tmpl->exists($key . '_list_entry')) { $this->tmpl->addVar($key . '_list_entry', 'value', $value); } } $this->template2HtmlNode($node, $tmplData); return true; } }