コード例 #1
0
ファイル: Toolbar.php プロジェクト: rtsantos/mais
 /**
  * Adiciona um botão na Toolbar
  * 
  * @param ZendT_View_Button $button 
  * @param string $name
  * @return \ZendT_View_Toolbar
  */
 public function addButton(ZendT_View_Button $button, $name = null)
 {
     if ($name == null) {
         $name = $button->getId();
     }
     $button->addClass('item');
     $this->_buttons[$name] = $button;
     $this->_buttonsOrder[] = $name;
     return $this;
 }
コード例 #2
0
ファイル: ActionCrud.php プロジェクト: rtsantos/mais
 /**
  * Cria botões para window
  *
  * @param array $buttons
  * @return array
  */
 protected function _createButtons(array $buttons)
 {
     $retorno = array();
     foreach ($buttons as $button) {
         if ($button['onClick'] != '') {
             $button['onClick'] = stripslashes(urldecode($button['onClick']));
             if (substr($button['onClick'], 0, 7) == 'base64:') {
                 $button['onClick'] = base64_decode(substr($button['onClick'], 7));
             }
             $_button = new ZendT_View_Button('button' . str_replace(' ', '_', $button['caption']), $button['caption'], new ZendT_JS_Command($button['onClick']));
             $_button->setIcon($button['icon']);
             if (isset($button['class'])) {
                 $_button->addClass($button['class']);
             }
             //$idButton = $_button->getId();
             $retorno['buttons'] .= $_button->render();
             $key = strtolower(substr(trim($button['caption']), 0, 1));
             if ($key != 'c') {
                 $this->view->hotkeys()->add('key_' . $_button->getId(), 'ctrl+' . $key, "jQuery('#" . $_button->getId() . "').click();");
             }
             /* $retorno['functions'].= "$('#" . $idButton . "').click(" .  . ");\n"; */
         }
     }
     return $retorno;
 }