private function draw_spacer($PFCALCULATOR, $title = "Graph")
 {
     $FirstRow = new TActiveTableRow();
     $FirstRow->setID("R" . $this->sheetrow . "G");
     //new for grouping
     $this->resulttable->Rows[] = $FirstRow;
     $ControlListCell = array();
     //clean the children
     $ControlListCellChildren = array();
     //clean the children
     $cell = new TActiveTableCell();
     //id and button to expand and collapse
     $cell->setID("R" . $this->sheetrow . "C1G");
     $imagebutton = new TActiveImageButton();
     $imagebutton->setID("R" . $this->sheetrow . "C1GIB");
     $imagebutton->setImageUrl("/rliq/themes/basic/gfx/group-collapse.gif");
     $imagebutton->setText("collapse");
     $imagebutton->onCallback = "page.hideRowGroup";
     $imagebutton->setCommandParameter($this->sheetrow);
     $cell->Controls->add($imagebutton);
     $ControlListCellChildren[] = array("class" => "TActiveImageButton", "id" => "R" . $this->sheetrow . "C1GIB", "OnCallback" => "page.hideRowGroup", "CommandParameter" => $this->sheetrow);
     //$cell->Text=$title;
     $activeLabel = new TActiveLabel();
     $activeLabel->setID("R" . $this->sheetrow . "C1GAL");
     $activeLabel->setText(" " . $title);
     $cell->Controls->add($activeLabel);
     $ControlListCellChildren[] = array("class" => "TActiveLabel", "id" => "R" . $this->sheetrow . "C1GAL", "OnCallback" => "", "CommandParameter" => "");
     $cell->EnableViewState = true;
     $cell->setCssClass('listheader');
     //echo (count($PFCALCULATOR->Perioden)*$PFCALCULATOR->NumberOfColumns)+1;
     $cell->setColumnSpan($PFCALCULATOR->NumberOfColumns + 1);
     $FirstRow->Cells[] = $cell;
     $ControlListCell[] = array("class" => "TActiveTableCell", "id" => "R" . $this->sheetrow . "C1G", "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCellChildren);
     $this->dynamicControlList[] = array("class" => "TActiveTableRow", "id" => "R" . $this->sheetrow . "G", "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCell);
     $this->sheetrow++;
     //inccrement of the sheetrow
 }
 public function initializeCell($cell, $columnIndex, $itemType)
 {
     if ($itemType === TListItemType::Item || $itemType === TListItemType::AlternatingItem || $itemType === TListItemType::SelectedItem || $itemType === TListItemType::EditItem) {
         $buttonType = $this->getButtonType();
         if ($buttonType === TButtonColumnType::LinkButton) {
             $button = new TActiveLinkButton();
         } else {
             if ($buttonType === TButtonColumnType::PushButton) {
                 $button = new TActiveButton();
             } else {
                 $button = new TActiveImageButton();
                 $button->setImageUrl($this->getImageUrl());
                 $button->setToolTip($this->getText());
             }
         }
         $button->setText($this->getText());
         $button->setCommandName($this->getCommandName());
         $button->setCausesValidation($this->getCausesValidation());
         $button->setValidationGroup($this->getValidationGroup());
         if ($this->getDataTextField() !== '' || $buttonType === TButtonColumnType::ImageButton && $this->getDataImageUrlField() !== '') {
             $button->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn'));
         }
         $cell->getControls()->add($button);
         $cell->registerObject('Button', $button);
     } else {
         parent::initializeCell($cell, $columnIndex, $itemType);
     }
 }
示例#3
0
 /**
  * Creates a pager button.
  * Override parent implementation to create, depending on the button type, a TActiveLinkButton,
  * a TActiveButton or a TActiveImageButton may be created.
  * 
  * @param string button type, either LinkButton or PushButton
  * @param boolean whether the button should be enabled
  * @param string caption of the button
  * @param string CommandName corresponding to the OnCommand event of the button
  * @param string CommandParameter corresponding to the OnCommand event of the button
  * @return mixed the button instance
  */
 protected function createPagerButton($buttonType, $enabled, $text, $commandName, $commandParameter)
 {
     if ($buttonType === TPagerButtonType::LinkButton) {
         if ($enabled) {
             $button = new TActiveLinkButton();
         } else {
             $button = new TLabel();
             $button->setText($text);
             return $button;
         }
     } else {
         if ($buttonType === TPagerButtonType::ImageButton) {
             $button = new TActiveImageButton();
             $button->setImageUrl($this->getPageImageUrl($text, $commandName));
             if ($enabled) {
                 $button->Visible = true;
             } else {
                 $button->Visible = false;
             }
         } else {
             $button = new TActiveButton();
             if (!$enabled) {
                 $button->setEnabled(false);
             }
         }
     }
     if ($buttonType === TPagerButtonType::ImageButton) {
         $button->ImageUrl = $text;
     }
     $button->setText($text);
     $button->setCommandName($commandName);
     $button->setCommandParameter($commandParameter);
     $button->setCausesValidation(false);
     $button->attachEventHandler('OnCallback', array($this, 'handleCallback'));
     $button->getAdapter()->getBaseActiveControl()->setClientSide($this->getClientSide());
     return $button;
 }
示例#4
0
 public function createTable()
 {
     for ($ii = 1; $ii <= 10; $ii++) {
         $MyRow = new TActiveTableRow();
         $ControlListCell = array();
         //clean the children
         if ($ii % 3 == 0) {
             $rowId = "R" . $ii . "G";
         } else {
             $rowId = "R" . $ii;
         }
         $MyRow->setID($rowId);
         $this->MyTable->Rows[] = $MyRow;
         for ($jj = 1; $jj <= 10; $jj++) {
             $cell = new TActiveTableCell();
             $ControlListCellChildren = array();
             //clean the children
             if ($jj % 3 == 0) {
                 $cellID = "R" . $ii . "C" . $jj . "G";
             } else {
                 $cellID = "R" . $ii . "C" . $jj;
             }
             $cell->setID($cellID);
             //my imagebutton for test
             if ($jj == 1) {
                 if ($ii % 3 == 0) {
                     $imagebutton = new TActiveImageButton();
                     $imagebutton->setID($cellID . "IB");
                     $imagebutton->setImageUrl("/rliq/themes/basic/gfx/group-collapse.gif");
                     $imagebutton->setText("collapse");
                     $imagebutton->onCallback = "page.hideRowGroup";
                     $imagebutton->setCommandParameter($ii);
                     $cell->Controls->add($imagebutton);
                     $ControlListCellChildren[] = array("class" => "TActiveImageButton", "id" => $cellID . "IB", "OnCallback" => "page.hideRowGroup", "CommandParameter" => $ii);
                 } else {
                     $cell->Text = $jj * $ii;
                 }
             } else {
                 if ($ii == 1) {
                     if ($jj % 3 == 0) {
                         $imagebutton = new TActiveImageButton();
                         $imagebutton->setID($cellID . "IB");
                         $imagebutton->setImageUrl("/rliq/themes/basic/gfx/group-collapse.gif");
                         $imagebutton->setText("collapse");
                         $imagebutton->onCallback = "page.hideColumnGroup";
                         $imagebutton->setCommandParameter($jj);
                         $cell->Controls->add($imagebutton);
                         $ControlListCellChildren[] = array("class" => "TActiveImageButton", "id" => $cellID . "IB", "OnCallback" => "page.hideColumnGroup", "CommandParameter" => $jj);
                     } else {
                         $cell->Text = $jj * $ii;
                     }
                 } else {
                     $cell->Text = $jj * $ii;
                 }
             }
             //this must appear at the end
             $MyRow->Cells[] = $cell;
             $ControlListCell[] = array("class" => "TActiveTableCell", "id" => $cellID, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCellChildren);
         }
         $this->dynamicControlList[] = array("class" => "TActiveTableRow", "id" => $rowId, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCell);
     }
 }