Exemplo n.º 1
0
 /**
  * Convert the <table:table-cell/> element.
  * 
  * @param ezcDocumentPropertyContainerDomElement $element 
  * @return void
  */
 protected function convertCell(ezcDocumentPropertyContainerDomElement $element)
 {
     $element->setProperty('type', 'entry');
     $attrs = $element->getProperty('attributes');
     if (!is_array($attrs)) {
         $attrs = array();
     }
     /*
      * Col spanning is not supported by native DocBook tables.
     if ( $element->hasAttributeNS(
          ezcDocumentOdt::NS_ODT_TABLE,
          'number-columns-spanned'
      ) )
     {
         $attrs['colspan'] = $element->getAttributeNS(
             ezcDocumentOdt::NS_ODT_TABLE,
             'number-columns-spanned'
         );
     }
     */
     if ($element->hasAttributeNS(ezcDocumentOdt::NS_ODT_TABLE, 'number-rows-spanned')) {
         $attrs['morerows'] = $element->getAttributeNS(ezcDocumentOdt::NS_ODT_TABLE, 'number-rows-spanned') - 1;
     }
     $element->setProperty('attributes', $attrs);
 }
Exemplo n.º 2
0
 /**
  * Convert the <table:table-cell/> element.
  * 
  * @param ezcDocumentPropertyContainerDomElement $element 
  * @return void
  */
 protected function convertCell(ezcDocumentPropertyContainerDomElement $element)
 {
     $element->setProperty('type', 'td');
     $attrs = $element->getProperty('attributes');
     if (!is_array($attrs)) {
         $attrs = array();
     }
     if ($element->hasAttributeNS(ezcDocumentOdt::NS_ODT_TABLE, 'number-columns-spanned')) {
         $attrs['colspan'] = $element->getAttributeNS(ezcDocumentOdt::NS_ODT_TABLE, 'number-columns-spanned');
     }
     if ($element->hasAttributeNS(ezcDocumentOdt::NS_ODT_TABLE, 'number-rows-spanned')) {
         $attrs['rowspan'] = $element->getAttributeNS(ezcDocumentOdt::NS_ODT_TABLE, 'number-rows-spanned');
     }
     $element->setProperty('attributes', $attrs);
 }