public function addAction($label, $image, $action, $params = array()) { $id = md5($params['text']); $link = new MImageLinkLabelAction('', '', $action, $image, $this->iconType, $target); $link->addEvent('mouseenter', "manager.getElementById('{$id}_hlayout').style.backgroundColor='#EEE';"); $link->addEvent('mouseout', "manager.getElementById('{$id}_hlayout').style.backgroundColor='white';"); $bold = new MLabel($label, 'black', true); $text = new MLabel($bold->generate() . ': ' . $params['text']); $control = new MHContainer($id, array($link, $text)); $control->setShowLabel(false); $class = 'mPanelCell' . ucfirst($this->iconType); $link->setClass($class); $this->add($control, '', '', ''); }
protected function getLayout() { $layout = array(); $hidden = array(); $controls = $this->getControls(); foreach ($controls as $control) { if ($control->visible) { if (is_array($control)) { $array = array(); foreach ($control as $field) { if ($field->visible) { $array[] = $field; } } $control = new MHContainer('', $array); $control->setShowLabel(true); } elseif ($control instanceof MHiddenField) { $hidden[] = $control; } else { $this->hasLabel |= $control->getLabel() != ''; $this->hasHint |= $control->getHint() != ''; $layout[] = $control; } } } return array($layout, $hidden); }