function show()
 {
     if (!$this->carregado) {
         $this->onReload();
     }
     parent::show();
 }
 /**
  * Shows the page
  */
 function show()
 {
     // if the datagrid was not loaded yet
     if (!$this->loaded) {
         $this->onReload();
     }
     parent::show();
 }
Beispiel #3
0
 /**
  * Select the register by ID and return the information to the main form
  *     When using onblur signal, AJAX passes all needed parameters via GET
  *     instead of calling onSetup before.
  */
 public static function onSelect($param)
 {
     $key = $param['key'];
     $database = isset($param['database']) ? $param['database'] : TSession::getValue('standard_seek_database');
     $receive_key = isset($param['receive_key']) ? $param['receive_key'] : TSession::getValue('standard_seek_receive_key');
     $receive_field = isset($param['receive_field']) ? $param['receive_field'] : TSession::getValue('standard_seek_receive_field');
     $display_field = isset($param['display_field']) ? $param['display_field'] : TSession::getValue('standard_seek_display_field');
     $parent = isset($param['parent']) ? $param['parent'] : TSession::getValue('standard_seek_parent');
     try {
         TTransaction::open($database);
         // load the active record
         $model = isset($param['model']) ? $param['model'] : TSession::getValue('standard_seek_model');
         $activeRecord = new $model($key);
         $pk = constant("{$model}::PRIMARYKEY");
         $object = new StdClass();
         $object->{$receive_key} = isset($activeRecord->{$pk}) ? $activeRecord->{$pk} : '';
         $object->{$receive_field} = isset($activeRecord->{$display_field}) ? $activeRecord->{$display_field} : '';
         TTransaction::close();
         TForm::sendData($parent, $object);
         parent::closeWindow();
         // closes the window
     } catch (Exception $e) {
         // clear fields
         $object = new StdClass();
         $object->{$receive_key} = '';
         $object->{$receive_field} = '';
         TForm::sendData($parent, $object);
         // undo all pending operations
         TTransaction::rollback();
     }
 }
 /**
  * Shows the exception stack
  */
 function show()
 {
     $error_array = $this->e->getTrace();
     $table = new TTable();
     $row = $table->addRow();
     $message = $this->e->getMessage();
     $message = str_replace('<br>', "\n", $message);
     $title = new GtkLabel();
     $title->set_markup('<b>General Error: ' . $message . '</b>' . "\n");
     $row->addCell($title);
     foreach ($error_array as $error) {
         $file = isset($error['file']) ? $error['file'] : '';
         $line = isset($error['line']) ? $error['line'] : '';
         $file = str_replace(PATH, '', $file);
         $row = $table->addRow();
         $row->addCell('File: ' . $file . ' : ' . $line);
         $row = $table->addRow();
         $args = array();
         if ($error['args']) {
             foreach ($error['args'] as $arg) {
                 if (is_object($arg)) {
                     $args[] = get_class($arg) . ' object';
                 } else {
                     if (is_array($arg)) {
                         $array_param = array();
                         foreach ($arg as $value) {
                             if (is_object($value)) {
                                 $array_param[] = get_class($value);
                             } else {
                                 if (is_array($value)) {
                                     $array_param[] = 'array';
                                 } else {
                                     $array_param[] = $value;
                                 }
                             }
                         }
                         $args[] = implode(',', $array_param);
                     } else {
                         $args[] = (string) $arg;
                     }
                 }
             }
         }
         $label = new GtkLabel();
         $row->addCell($label);
         $class = isset($error['class']) ? $error['class'] : '';
         $type = isset($error['type']) ? $error['type'] : '';
         $label->set_markup('  <i>' . '<span foreground="#78BD4C">' . $class . '</span>' . '<span foreground="#600097">' . $type . '</span>' . '<span foreground="#5258A3">' . $error['function'] . '</span>' . '(' . '<span foreground="#894444">' . implode(',', $args) . '</span>' . ')</i>');
     }
     $scroll = new TScroll();
     $scroll->setSize(690, 390);
     $scroll->add($table);
     $scroll->child->modify_bg(GTK::STATE_NORMAL, GdkColor::parse('#ffffff'));
     parent::add($scroll);
     parent::show();
 }