コード例 #1
0
ファイル: engine.php プロジェクト: jhonleandres/pecommerce
 public static function run($debug = FALSE)
 {
     new TSession();
     if ($_REQUEST) {
         parent::run($debug);
     }
 }
コード例 #2
0
 public static function checkCliente()
 {
     if (!TSession::getValue('cliente_logado')) {
         new TMessage('info', 'Você não esta logado');
         TCoreApplication::executeMethod('ClientesLogin');
     }
 }
コード例 #3
0
 function __construct()
 {
     parent::__construct();
     parent::set_size_request(500, 300);
     parent::set_title('Adianti ERP Template');
     parent::add(new GtkLabel('No desktop version available for this system'));
     parent::show_all();
 }
コード例 #4
0
ファイル: index.gtk.php プロジェクト: jhonleandres/pecommerce
 function __construct()
 {
     parent::__construct();
     parent::set_title('Adianti Framework :: Samples');
     $this->content = new GtkFixed();
     $vbox = new GtkVBox();
     $vbox->pack_start(GtkImage::new_from_file('app/images/pageheader-gtk.png'), false, false);
     $MenuBar = TMenuBar::newFromXML('menu.xml');
     $vbox->pack_start($MenuBar, false, false);
     $vbox->pack_start($this->content, true, true);
     parent::add($vbox);
     parent::show_all();
 }
コード例 #5
0
 /**
  * Constructor Method
  */
 function __construct()
 {
     parent::__construct();
     parent::set_size_request(840, 640);
     parent::set_position(GTK::WIN_POS_CENTER);
     parent::connect_simple('delete-event', array($this, 'onClose'));
     parent::connect_simple('destroy', array('Gtk', 'main_quit'));
     parent::set_title(self::APP_TITLE);
     parent::set_icon(GdkPixbuf::new_from_file('favicon.png'));
     $gtk = GtkSettings::get_default();
     $gtk->set_long_property("gtk-button-images", TRUE, 0);
     $gtk->set_long_property("gtk-menu-images", TRUE, 0);
     self::$inst = $this;
     set_error_handler(array('TCoreApplication', 'errorHandler'));
 }
コード例 #6
0
ファイル: engine.php プロジェクト: jhonleandres/crmbf
 public static function run($debug = FALSE)
 {
     new TSession();
     $lang = TSession::getValue('language') ? TSession::getValue('language') : 'en';
     TAdiantiCoreTranslator::setLanguage($lang);
     TApplicationTranslator::setLanguage($lang);
     if ($_REQUEST) {
         $class = isset($_REQUEST['class']) ? $_REQUEST['class'] : '';
         if (!TSession::getValue('logged') and $class !== 'LoginForm') {
             echo TPage::getLoadedCSS();
             echo TPage::getLoadedJS();
             new TMessage('error', 'Not logged');
             return;
         }
         parent::run($debug);
     }
 }
コード例 #7
0
 public static function run($debug = FALSE)
 {
     new TSession();
     if ($_REQUEST) {
         $class = isset($_REQUEST['class']) ? $_REQUEST['class'] : '';
         if (!TSession::getValue('logged') and $class !== 'LoginForm') {
             new TMessage('error', _t('Permission denied'), new TAction(array('LoginForm', 'onLogout')));
         } else {
             if ($class and $class !== 'LoginForm') {
                 $programs = (array) TSession::getValue('programs');
                 $default_programs = array('TStandardSeek' => TRUE, 'TFileUploader' => TRUE, 'EmptyPage' => TRUE);
                 $programs = array_merge($programs, $default_programs);
                 if (!isset($programs[$class])) {
                     new TMessage('error', _t('Permission denied'));
                     return false;
                 }
             }
             parent::run($debug);
         }
     }
 }
コード例 #8
0
 public static function logout()
 {
     TSession::freeSession();
     TCoreApplication::executeMethod('FormLogar');
 }
コード例 #9
0
 public function logout()
 {
     TSession::freeSession();
     TCoreApplication::executeMethod('Home');
 }
コード例 #10
0
ファイル: index.gtk.php プロジェクト: jhonleandres/crmbf
 /**
  * Pack a class inside the application window
  * @param $callback
  */
 public function run($callback)
 {
     if (TSession::getValue('logged')) {
         $this->scroll->show_all();
     } else {
         $this->scroll->hide();
     }
     $class = is_array($callback) ? $callback[0] : $callback;
     if ($class == 'SetupPage') {
         $this->configureMenu();
     }
     return parent::run($callback);
 }