public function generateLayoutVertical() { $id = $this->id ?: 'mv' . uniqid(); list($layout, $hidden) = $this->getLayout(); $array = array(); $row = $i = $j = 0; foreach ($layout as $control) { if ($control->checkAccess()) { $label = $hint = NULL; $pos = ($i == 0 ? ' firstCell' : ($i == $j ? ' lastCell' : '')) . ' cell' . $i; if (!$control instanceof MContainer) { if ($this->isShowLabel()) { $label = $control->generateLabel(); } $hint = $control->generateHint(); } if ($this->labelMode == MFieldLabel::LABEL_ABOVE) { $div = new MDiv($id . '_row' . $i, array($label, $control->generate(), $hint), 'mContainerRow' . $pos); } else { // MFieldLabel::LABEL_SIDE $div = new MHContainer($id . '_row' . $i, array($label, $control->generate() . $hint)); } $height = $control->getRowHeight(); if ($height != '') { $div->setHeight($height); } $array[] = $div; $i++; } } $div = new MDiv($id, $array, 'mVContainer'); $div->cloneStyle($this); $div->setClass('mVContainer'); return array($div, $hidden); }
public function custombox($control) { $content = array(); $content[] = $control->toolBar; if ($control->caption) { $caption = new MLabel($control->caption); $caption->setClass('mCustomBoxCaptionLabel'); $content[] = new MDiv(NULL, $caption, 'mCustomBoxCaption ' . $control->extendClass['title']); } if ($control->hasItems()) { $content[] = new MDiv(NULL, $control->getControls(), 'mCustomBoxContentArea ' . $control->extendClass['content']); } if ($control->actionBar->hasItems()) { $content[] = new MDiv(NULL, $control->actionBar->getControls(), 'mCustomBoxActionBar ' . $control->extendClass['action']); } $box = new MDiv($control->id, $content); $box->setDojoType('Manager.BoxPane'); $box->addDojoProp('classTitle', $control->extendClass['title']); $box->addDojoProp('buttonCancel', 'Fechar'); $box->addDojoProp('title', $control->caption); $box->addDojoProp('toolBar', $control->toolBar->getId()); $div = new MDiv($control->id . 'Outer', $box); $div->cloneStyle($control); return $this->div($div); }