Exemplo n.º 1
0
 public function generate()
 {
     $onclick = MAction::getOnClick($this->action, $this->property->id);
     $this->addEvent('click', $onclick);
     $this->setContent($this->label);
     return parent::generate();
 }
Exemplo n.º 2
0
 public function generateColumns()
 {
     $p = 0;
     $last = count($this->columns) - 1;
     foreach ($this->columns as $k => $column) {
         $this->dcolumns[$p] = new StdClass();
         $this->dcolumns[$p]->id = $p;
         $this->dcolumns[$p]->field = $column->field ?: 'field' . $p;
         if ($column instanceof MGridAction) {
             if ($column->type == 'select') {
                 $rowCount = count($this->data);
                 $control = new MCheckBox($this->id . "chkAll", 'chkAction', '');
                 $control->addEvent('click', $this->id . ".checkAll({$rowCount});", false);
                 $this->dcolumns[$p]->className = 'select';
             } elseif ($column->type == 'icon') {
                 $control = new MDiv('', '', 'managerIcon');
                 $this->dcolumns[$p]->className = 'actionIcon';
             } elseif ($column->type == 'text') {
                 $control = new MDiv('', '', '');
             }
             $this->dcolumns[$p]->sortable = false;
         } elseif ($column instanceof MGridColumn) {
             if (!$column->visible) {
                 continue;
             }
             $control = new MDiv('', $column->title, '');
             $class = $column->getClass();
             if ($class) {
                 $this->dcolumns[$p]->className = $class;
             }
             $this->dcolumns[$p]->sortable = !$column instanceof MGridControl;
         }
         $this->dcolumns[$p++]->label = $control->generate();
     }
 }
Exemplo n.º 3
0
 public function generate()
 {
     $div = new MDiv($this->id, ' ', 'mButtonIcon ' . $this->icon);
     $action = MAction::getOnClick($this->value, $this->id);
     $div->addEvent('click', $action);
     return $div->generate();
 }
Exemplo n.º 4
0
 public function generate()
 {
     parent::generateAction();
     $div = new MDiv($this->getId(), ' ', 'mButtonFind');
     $div->setAjax($this->getAjax());
     $div->setEvent($this->getEvent());
     $div->setHTMLTitle($this->title);
     return $div->generate();
 }
Exemplo n.º 5
0
 public function generate()
 {
     parent::generateAction();
     $div = new MDiv($this->id, ' ', 'toolIcon toolIcon' . ucfirst($this->icon));
     $div->setAjax($this->getAjax());
     $div->setEvent($this->getEvent());
     $div->setHTMLTitle($this->title);
     return $div->generate();
 }
Exemplo n.º 6
0
 public function generate()
 {
     $div = new MDiv("ddm_{$this->control->id}", $this->control);
     $this->control->setClass("dojoDndItem");
     $js = "ddm_{$this->control->id} = new dojo.dnd.Source('ddm_{$this->control->id}'";
     $js .= $this->options->hasItems() ? ",{" . $this->options->getText(':', ',') . "}" : '';
     $js .= ");";
     $js .= "dojo.parser.parse(\"dojo.byId('ddm_{$this->control->id}')\");";
     $this->page->onLoad($js);
     return $div->generate();
 }
Exemplo n.º 7
0
 public function generate()
 {
     $this->setId(uniqid());
     if ($this->useStore) {
     } else {
         $onclick = MAction::getOnClick($this->action, $this->getId());
         $this->addEvent('click', $onclick);
     }
     $this->setContent(MUtil::detectUTF8($this->label) ? $this->label : utf8_encode($this->label));
     return parent::generate();
 }
Exemplo n.º 8
0
 public function generate()
 {
     $icon = new MImage('', '', 'managerIcon managerIconCursor managerIcon' . ucfirst($this->icon));
     if ($this->text) {
         $text = new MSpan('', $this->text, 'managerIconText managerIconCursor');
     }
     $div = new MDiv($this->id, array($icon, $text), 'mToolIcon');
     $action = MAction::getOnClick($this->action, $div->id);
     $div->addEvent('click', $action);
     if ($this->title) {
         $div->setHTMLTitle($this->title);
     }
     return $div->generate();
 }
Exemplo n.º 9
0
 public function generate()
 {
     $content = '';
     if (!is_array($this->message)) {
         $this->message = array($this->message);
     }
     $this->box = new MBox($this->caption, $this->close, '');
     $textBox = new MDiv($this->id . 'BoxText', $this->message);
     $this->box->setControls($textBox);
     $form = $this->form instanceof MBaseForm ? $this->form->getTagId() : '';
     $b = new MButton("{$this->id}HelpButton", 'Fechar', "!manager.byId('{$this->id}Help').hide();");
     $this->box->addAction($b);
     $help = new MDiv("{$this->id}Help", new MDiv("{$this->id}Box", $this->box, "mHelp"));
     $help->addStyle('display', 'none');
     $help->setDojoType('Manager.DialogSimple');
     return $help->generate();
 }
Exemplo n.º 10
0
 public function generate()
 {
     $this->generateInner();
     if ($this->getScrollable()) {
         $f[] = new MDiv('', $this->getCaption(), 'mScrollableLabel');
         $html = $this->getInnerToString();
         $f[] = $div = new MDiv('', $html, 'mScrollableField');
         $div->height = $this->getScrollHeight();
     } elseif ($this->property->fieldset) {
         $this->setClass('mBaseGroup', false);
         $f = $this->render();
     } else {
         $f = $this->inner;
     }
     $outer = new MDiv('', $f);
     return $outer->generate();
 }
Exemplo n.º 11
0
 public function generate()
 {
     $div = new MDiv('', $this->object . ': ' . $this->target, 'mContentHeader');
     return $div->generate();
 }
Exemplo n.º 12
0
 public function generate()
 {
     $internalForm = false;
     if (!is_array($this->message)) {
         $this->message = array($this->message);
     }
     $this->box = new MBox($this->caption, $this->close, '');
     $type = ucfirst($this->promptType);
     $m = new MUnorderedList($this->id . 'Message', $this->message);
     $m->type = 'none';
     $textBox = new MDiv($this->id . 'BoxText', $m, "text");
     $iconBox = new MDiv($this->id . 'BoxIcon', '', "icon icon{$type}");
     $imageTextBox = new MHContainer('', array($iconBox, $textBox));
     $imageTextBox->setClass('mPromptBox');
     $this->box->setControls($imageTextBox);
     if (!$this->form instanceof MBaseForm) {
         $this->form = new MSimpleForm();
         $this->controls[0] = $this->form;
         $internalForm = true;
     }
     if ($this->buttons) {
         foreach ($this->buttons as $button) {
             list($label, $action, $event) = $button;
             $name = $this->name . trim($label);
             $spanLabel = new MDiv('', $label, 'button');
             $b = new MButton($name, $spanLabel->generate());
             $onclick = "manager.byId(\"{$this->id}\").hide();" . ($action ? MAction::getOnClick($action, $this->form->getTagId()) : '');
             $b->addEvent('click', $onclick, true, false);
             $this->box->addAction($b);
         }
     }
     $this->box->setExtendClass("title title{$type}");
     $this->controls[1] = new MDiv("{$this->id}Box", $this->box, "mPrompt");
     $prompt = new MDiv("{$this->id}Pane", $this->controls);
     if (($this->form instanceof MBaseForm and !$internalForm) || !$this->page->isPostBack()) {
         $prompt = new MDiv($this->id, $prompt, '', $this->getStyle());
         $prompt->addStyle('display', 'none');
         $prompt->setDojoType('Manager.DialogSimple');
     }
     return $prompt->generate();
 }