コード例 #1
0
ファイル: TColor.php プロジェクト: cbsistem/adiantiframework
 /**
  * Shows the widget at the screen
  */
 public function show()
 {
     $wrapper = new TElement('div');
     $wrapper->{'class'} = 'input-group color-div';
     $span = new TElement('span');
     $span->{'class'} = 'input-group-addon tcolor';
     $i = new TElement('i');
     $i->{'class'} = 'tcolor-icon';
     $span->add($i);
     ob_start();
     parent::show();
     $child = ob_get_contents();
     ob_end_clean();
     $wrapper->add($child);
     $wrapper->add($span);
     $wrapper->show();
     if (parent::getEditable()) {
         TScript::create(" tcolor_start(); ");
     }
 }
コード例 #2
0
ファイル: TSeekButton2.php プロジェクト: edurbs/sobcontrole
 /**
  * Show the widget
  */
 public function show()
 {
     // check if it's not editable
     if (parent::getEditable()) {
         if (!TForm::getFormByName($this->formName) instanceof TForm) {
             throw new Exception(AdiantiCoreTranslator::translate('You must pass the ^1 (^2) as a parameter to ^3', __CLASS__, $this->name, 'TForm::setFields()'));
         }
         $serialized_action = '';
         if ($this->action) {
             // get the action class name
             if (is_array($callback = $this->action->getAction())) {
                 if (is_object($callback[0])) {
                     $rc = new ReflectionClass($callback[0]);
                     $classname = $rc->getShortName();
                 } else {
                     $classname = $callback[0];
                 }
                 $inst = new $classname();
                 $ajaxAction = new TAction(array($inst, 'onSelect'));
                 if (in_array($classname, array('TStandardSeek2'))) {
                     $ajaxAction->setParameter('parent', $this->action->getParameter('parent'));
                     $ajaxAction->setParameter('database', $this->action->getParameter('database'));
                     $ajaxAction->setParameter('model', $this->action->getParameter('model'));
                     $ajaxAction->setParameter('display_field', $this->action->getParameter('display_field'));
                     $ajaxAction->setParameter('receive_key', $this->action->getParameter('receive_key'));
                     $ajaxAction->setParameter('receive_field', $this->action->getParameter('receive_field'));
                     $ajaxAction->setParameter('criteria', $this->action->getParameter('criteria'));
                     $ajaxAction->setParameter('display_field2', $this->action->getParameter('display_field2'));
                 } else {
                     if ($actionParameters = $this->action->getParameters()) {
                         foreach ($actionParameters as $key => $value) {
                             $ajaxAction->setParameter($key, $value);
                         }
                     }
                 }
                 $ajaxAction->setParameter('form_name', $this->formName);
                 $string_action = $ajaxAction->serialize(FALSE);
                 if ($this->useOutEvent) {
                     $this->setProperty('seekaction', "__adianti_post_lookup('{$this->formName}', '{$string_action}', document.{$this->formName}.{$this->name})");
                     $this->setProperty('onBlur', $this->getProperty('seekaction'), FALSE);
                 }
             }
             $this->action->setParameter('form_name', $this->formName);
             $serialized_action = $this->action->serialize(FALSE);
         }
         parent::show();
         $this->button->onclick = "javascript:serialform=(\$('#{$this->formName}').serialize());\n                  __adianti_append_page('engine.php?{$serialized_action}&'+serialform)";
         $this->button->show();
         if ($this->auxiliar) {
             echo ' ';
             $this->auxiliar->show();
         }
     } else {
         parent::show();
     }
 }
コード例 #3
0
ファイル: TDate.php プロジェクト: kiibe/linkERP
 /**
  * Shows the widget at the screen
  */
 public function show()
 {
     $js_mask = str_replace('yyyy', 'yy', $this->mask);
     $language = strtolower(LANG);
     if (parent::getEditable()) {
         TScript::create("tdate_start( '#{$this->id}', '{$this->mask}', '{$language}');");
     }
     parent::show();
 }