コード例 #1
0
 /**
  *
  * @access public
  * @param Report
  * @param array XML data
  *
  */
 function load(&$parent, $data)
 {
     $this->_parent =& $parent;
     $this->Name = $data['Name'];
     $this->Height = empty($data['Height']) ? 0 : $data['Height'];
     $this->ForceNewPage = empty($data['ForceNewPage']) ? 0 : $data['ForceNewPage'];
     if (isset($data['Visible'])) {
         $this->Visible = $data['Visible'];
     }
     if (isset($data['BackColor'])) {
         $this->BackColor = MSColor($data['BackColor']);
     }
     if (isset($data['CanGrow'])) {
         $this->CanGrow = $data['CanGrow'];
     }
     if (isset($data['CanShrink'])) {
         $this->CanShrink = $data['CanShrink'];
     }
     if (isset($data['KeepTogether'])) {
         $this->KeepTogether = $data['KeepTogether'];
     }
     if (isset($data['EventProcPrefix'])) {
         $this->EventProcPrefix = $data['EventProcPrefix'];
     } else {
         $this->EventProcPrefix = $data['Name'];
     }
     $s = $data['EventProcPrefix'] . '_Format';
     if (method_exists($this->_parent->_Code, $s)) {
         $this->_OnFormatFunc = $s;
     } else {
         $this->_OnFormatFunc = 'allSections_Format';
         // null-OnFormat
     }
     $s = $data['EventProcPrefix'] . '_Print';
     if (method_exists($this->_parent->_Code, $s)) {
         $this->_OnPrintFunc = $s;
     } else {
         $this->_OnPrintFunc = 'allSections_Print';
         // null-OnPrint
     }
     if (!empty($data['Controls'])) {
         foreach ($data['Controls'] as $c) {
             $ctl =& ControlFactory::create($c['ControlType'], $c, $parent->hReport);
             if ($ctl == false) {
                 Amber::showError('Warning', 'Skipping unsupported control type: ' . htmlentities($c['ControlType']));
             } else {
                 $this->Controls[] =& $ctl;
                 $parent->Controls[$ctl->Name] =& $ctl;
                 $parent->ControlValues[$ctl->Name] =& $ctl->Value;
                 $ctl->_SectionSlip =& $parent->SectionSlip;
             }
         }
     }
 }
コード例 #2
0
ファイル: Report.php プロジェクト: BackupTheBerlios/amber-svn
 /**
  * @access protected
  */
 function initDesignHeader()
 {
     $this->_designSection =& new section('');
     $this->_designSection->Name = '<designBorder>';
     $this->_designSection->Height = 240;
     $this->_designSection->Visible = true;
     $this->_designSection->BackColor = 0xffffff;
     $this->_designSection->CanGrow = false;
     $this->_designSection->CanShrink = false;
     $this->_designSection->KeepTogether = false;
     $this->_designSection->EventProcPrefix = '';
     $this->_designSection->_parent =& $this;
     $this->_designSection->_OnFormatFunc = 'allSections_Format';
     $ctlProp = array('Name' => '', 'Left' => 0, 'Top' => 0, 'Width' => $this->Width, 'Height' => 240, 'Visible' => true, 'BackStyle' => 1, 'BackColor' => 0xdddddd, 'BorderStyle' => 0, 'BorderColor' => 0, 'BorderWidth' => 1, 'BorderLineStyle' => 0, 'zIndex' => 0, 'Value' => '', '_OldValue' => '', 'ForeColor' => 0x0, 'FontName' => 'Arial', 'FontSize' => 8, 'FontWeight' => 500, 'TextAlign' => 0, 'FontItalic' => false, 'FontUnderline' => false, 'Caption' => 'Test');
     $ctl =& ControlFactory::create(100, $ctlProp, $this->hReport);
     $this->_exporter->setControlExporter($ctl);
     $this->_designSection->Controls['label'] =& $ctl;
 }