/** * * @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; } } } }
/** * * @access public * @param string name of property * @param mixed value * */ function setProperty($name, $value) { parent::setProperty($name, $value); $specialProperties = array('ForeColor'); if (in_array($name, $specialProperties)) { $this->Properties[$name] = MSColor($this->Properties[$name]); } }