Ejemplo n.º 1
0
 public static function Agrega_Fila($tabla, $arr_fila)
 {
     $fila = new TTableRow();
     foreach ($arr_fila as $arr_campo) {
         $campo = new TTableCell();
         foreach ($arr_campo as $propiedad => $valor) {
             if ($propiedad != "AddControls") {
                 $campo->{$propiedad} = $valor;
             } else {
                 $campo->getControls()->add($valor);
             }
         }
         $fila->Cells->add($campo);
     }
     $tabla->Rows->add($fila);
     return $fila;
 }
Ejemplo n.º 2
0
 /**
  * Adds attributes to renderer.
  * @param THtmlWriter the renderer
  */
 protected function addAttributesToRender($writer)
 {
     parent::addAttributesToRender($writer);
     if (($scope = $this->getScope()) !== TTableHeaderScope::NotSet) {
         $writer->addAttribute('scope', $scope === TTableHeaderScope::Row ? 'row' : 'col');
     }
     if (($text = $this->getAbbreviatedText()) !== '') {
         $writer->addAttribute('abbr', $text);
     }
     if (($text = $this->getCategoryText()) !== '') {
         $writer->addAttribute('axis', $text);
     }
 }
Ejemplo n.º 3
0
 public function addParsedObject($o)
 {
     if ($o instanceof TFilter) {
         $this->_filters[$o->getDataField()] = $o;
         $cell = new TTableCell();
         //$cell->setId('cell_'.$o->getId());
         $cell->getControls()->add($o);
         $this->getCells()->add($cell);
     } else {
         parent::addParsedObject($o);
     }
 }
Ejemplo n.º 4
0
 private function draw_cells($PFCALCULATOR, $name = "", $details = 1)
 {
     $PFCALCULATOR->executePIVOTSQL($name, $details);
     $PFCALCULATOR->FormatWerte();
     $ROWS = $PFCALCULATOR->getValues();
     $ALTERNATING = 0;
     $templabel = '';
     foreach ($ROWS as $row) {
         $ALTERNATING++;
         $temparray = array();
         $counter = 0;
         //hier bauen wir die einzelnen Zeilen
         $WorkRow = new TTableRow();
         $this->mastertable->Rows[] = $WorkRow;
         if ($ALTERNATING < count($ROWS)) {
             foreach ($row as $value) {
                 $cell = new TTableCell();
                 $cell->EnableViewState = false;
                 $cell->Text = $value;
                 $counter == 0 ? $templabel = $value : array_push($temparray, $value);
                 $counter++;
                 $WorkRow->Cells[] = $cell;
                 fmod($ALTERNATING, 2) == 0 ? $WorkRow->setCssClass('listalternating') : $WorkRow->setCssClass('listnonealternating');
             }
             $this->zwischenergebnisse[$PFCALCULATOR->dimension][$templabel] = $temparray;
         } else {
             foreach ($row as $value) {
                 $cell = new TTableCell();
                 $cell->EnableViewState = false;
                 $cell->Text = $value;
                 $counter == 0 ? $templabel = $value : array_push($temparray, $value);
                 $counter++;
                 $cell->setCssClass('calculatedsumme');
                 $WorkRow->Cells[] = $cell;
                 //$WorkRow->setCssClass('calculatedsumme');
             }
             //$this->zwischenergebnisse[$PFCALCULATOR->dimension][$templabel]=$temparray;
         }
     }
 }
Ejemplo n.º 5
0
 /**
  * Renders and replaces the cell's content on the client-side. When render() is
  * called before the OnPreRender event, such as when render() is called during
  * a callback event handler, the rendering is defered until OnPreRender event
  * is raised.
  * @param THtmlWriter html writer
  */
 public function render($writer)
 {
     if ($this->getHasPreRendered()) {
         parent::render($writer);
         if ($this->getActiveControl()->canUpdateClientSide()) {
             $this->getPage()->getCallbackClient()->replaceContent($this, $writer);
         }
     } else {
         $this->getPage()->getAdapter()->registerControlToRender($this, $writer);
         // If we update a TActiveTableCell on callback, we shouldn't update all childs,
         // because the whole content will be replaced by the parent.
         if ($this->getHasControls()) {
             foreach ($this->findControlsByType('IActiveControl', false) as $control) {
                 $control->getActiveControl()->setEnableUpdate(false);
             }
         }
     }
 }
 /**
  * Constructor.
  * Initializes the tagname to 'th'.
  */
 public function __construct()
 {
     parent::__construct();
     $this->setTagName('th');
 }