Пример #1
0
 /**
  * @param $properties
  * @param bool $inHeader
  * @param int $colspan
  * @param int $rowspan
  */
 protected function _odtTableCellOpenUsePropertiesInternal($properties, $inHeader = false, $colspan = 1, $rowspan = 1)
 {
     $disabled = array();
     // Find our table state.
     $table = $this->state->findClosestWithClass('table', 'table');
     if ($table != NULL) {
         $auto_columns = $table->getTableAutoColumns();
     }
     // Create style name. (Re-enable background-color!)
     $style_obj = $this->factory->createTableCellStyle($properties);
     $this->docHandler->addAutomaticStyle($style_obj);
     $style_name = $style_obj->getProperty('style-name');
     // Create a paragraph style for the paragraph within the cell.
     // Disable properties that belong to the table cell style.
     $disabled['border'] = 1;
     $disabled['border-left'] = 1;
     $disabled['border-right'] = 1;
     $disabled['border-top'] = 1;
     $disabled['border-bottom'] = 1;
     $disabled['background-color'] = 1;
     $disabled['background-image'] = 1;
     $disabled['vertical-align'] = 1;
     $style_name_paragraph = $this->_createParagraphStyle($properties, $disabled);
     // Open cell.
     $this->doc .= '<table:table-cell office:value-type="string" table:style-name="' . $style_name . '" ';
     if ($colspan > 1) {
         $this->doc .= ' table:number-columns-spanned="' . $colspan . '"';
     }
     if ($inHeader === true && $auto_columns === true && $colspan == 0) {
         $this->doc .= ' table:number-columns-spanned="<MaxColsPlaceholder>"';
     }
     if ($rowspan > 1) {
         $this->doc .= ' table:number-rows-spanned="' . $rowspan . '"';
     }
     $this->doc .= '>';
     if ($inHeader === true) {
         $this->state->enter('table:table-cell', 'table-header');
     } else {
         $this->state->enter('table:table-cell', 'table-cell');
     }
     // Opening a cell allows opening of a new paragraph!
     $this->state->setInParagraph(false);
     // If a paragraph style was created, means text properties were set,
     // then we open a paragraph with our own style. Otherwise we use the standard style.
     if ($style_name_paragraph != NULL) {
         $this->p_open($style_name_paragraph);
     } else {
         $this->p_open();
     }
 }
Пример #2
0
 /**
  * @param $properties
  * @param bool $inHeader
  * @param int $colspan
  * @param int $rowspan
  */
 protected function _odtTableCellOpenUsePropertiesInternal($properties, $inHeader = false, $colspan = 1, $rowspan = 1)
 {
     $disabled = array();
     if ($inHeader === false) {
         // Table header definition is finished.
         $this->temp_in_header = false;
     }
     // Create style name. (Re-enable background-color!)
     $style_name = $this->factory->createTableCellStyle($style, $properties);
     $this->autostyles[$style_name] = $style;
     // Create a paragraph style for the paragraph within the cell.
     // Disable properties that belong to the table cell style.
     $disabled['border'] = 1;
     $disabled['border-left'] = 1;
     $disabled['border-right'] = 1;
     $disabled['border-top'] = 1;
     $disabled['border-bottom'] = 1;
     $disabled['background-color'] = 1;
     $disabled['background-image'] = 1;
     $disabled['vertical-align'] = 1;
     $style_name_paragraph = $this->_createParagraphStyle($properties, $disabled);
     // Open cell.
     $this->doc .= '<table:table-cell office:value-type="string" table:style-name="' . $style_name . '" ';
     if ($colspan > 1) {
         $this->doc .= ' table:number-columns-spanned="' . $colspan . '"';
     }
     if ($inHeader === true && $this->temp_autocols === true && $colspan == 0) {
         $this->doc .= ' table:number-columns-spanned="<MaxColsPlaceholder>"';
     }
     if ($rowspan > 1) {
         $this->doc .= ' table:number-rows-spanned="' . $rowspan . '"';
     }
     $this->doc .= '>';
     // If a paragraph style was created, means text properties were set,
     // then we open a paragraph with our own style. Otherwise we use the standard style.
     if ($style_name_paragraph != NULL) {
         $this->p_open($style_name_paragraph);
     } else {
         $this->p_open();
     }
 }