Example #1
0
 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, '', '', '');
 }
Example #2
0
 public function generateInner()
 {
     $this->setRender('hr');
     if ($margin = $this->getMargin()) {
         $this->addStyle('margin-top', "{$margin}");
     }
     if ($this->getText() instanceof MControl) {
         $this->setClass('mSeparator');
         $this->inner = $this->getText()->generate() . $this->render();
     } elseif (trim($this->getText()) != '') {
         $this->setClass('mSeparator');
         $text = new MLabel($this->getText(), $color);
         $this->inner = $text->generate() . $this->render();
     } else {
         $this->setClass('mHr', false);
     }
 }