Exemplo n.º 1
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;
     $ini = parse_ini_file('application.ini');
     $lang = $ini['language'];
     TAdiantiCoreTranslator::setLanguage($lang);
     TApplicationTranslator::setLanguage($lang);
     date_default_timezone_set($ini['timezone']);
     $this->content = new GtkFixed();
     $vbox = new GtkVBox();
     parent::add($vbox);
     $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::show_all();
 }
Exemplo n.º 2
0
 public static function parse($file, $theme)
 {
     switch ($theme) {
         case 'theme1':
             ob_start();
             $callback = array('SystemPermission', 'checkPermission');
             $menu = TMenuBar::newFromXML('menu.xml', $callback);
             $menu->show();
             $menu_string = ob_get_clean();
             return $menu_string;
             break;
         case 'theme2':
             ob_start();
             $callback = array('SystemPermission', 'checkPermission');
             $xml = new SimpleXMLElement(file_get_contents('menu.xml'));
             $menu = new TMenu($xml, $callback, 1, 'nav collapse', '');
             $menu->class = 'nav';
             $menu->id = 'side-menu';
             $menu->show();
             $menu_string = ob_get_clean();
             return $menu_string;
             break;
         case 'theme3':
             ob_start();
             $callback = array('SystemPermission', 'checkPermission');
             $xml = new SimpleXMLElement(file_get_contents('menu.xml'));
             $menu = new TMenu($xml, $callback, 1, 'treeview-menu', 'treeview', '');
             $menu->class = 'sidebar-menu';
             $menu->id = 'side-menu';
             $menu->show();
             $menu_string = ob_get_clean();
             return $menu_string;
             break;
     }
 }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 4
0
 function __construct()
 {
     parent::__construct();
     parent::set_title('Adianti Framework :: Samples');
     $this->content = new GtkFixed();
     $vbox = new GtkVBox();
     $scroll = new GtkScrolledWindow();
     $scroll->set_policy(GTK::POLICY_AUTOMATIC, GTK::POLICY_ALWAYS);
     $scroll->set_size_request(200, -1);
     $vbox->pack_start(GtkImage::new_from_file('app/images/pageheader.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();
 }
Exemplo n.º 5
0
// define the autoloader
include_once 'lib/adianti/util/TAdiantiLoader.class.php';
spl_autoload_register(array('TAdiantiLoader', 'autoload_web'));
// read configurations
$ini = parse_ini_file('application.ini');
date_default_timezone_set($ini['timezone']);
TAdiantiCoreTranslator::setLanguage($ini['language']);
TApplicationTranslator::setLanguage($ini['language']);
// define constants
define('APPLICATION_NAME', $ini['application']);
define('OS', strtoupper(substr(PHP_OS, 0, 3)));
define('PATH', dirname(__FILE__));
$uri = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
new TSession();
ob_start();
$menu = TMenuBar::newFromXML('menu.xml');
$menu->show();
$menu_string = ob_get_contents();
ob_end_clean();
// verifica se o usuario esta logado para redirecionar
// para o layout e login
if (TSession::getValue('logado')) {
    $template = 'theme1';
} else {
    $template = 'loja';
}
$content = file_get_contents("app/templates/{$template}/layout.html");
$content = TApplicationTranslator::translateTemplate($content);
$content = str_replace('{LIBRARIES}', file_get_contents("app/templates/{$template}/libraries.html"), $content);
$content = str_replace('{URI}', $uri, $content);
$content = str_replace('{class}', isset($_REQUEST['class']) ? $_REQUEST['class'] : '', $content);
Exemplo n.º 6
0
date_default_timezone_set($ini['timezone']);
TAdiantiCoreTranslator::setLanguage($ini['language']);
TApplicationTranslator::setLanguage($ini['language']);
// define constants
define('APPLICATION_NAME', $ini['application']);
define('OS', strtoupper(substr(PHP_OS, 0, 3)));
define('PATH', dirname(__FILE__));
$uri = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$template = 'theme1';
new TSession();
$menu_string = '';
if (TSession::getValue('logged')) {
    $content = file_get_contents("app/templates/{$template}/layout.html");
    ob_start();
    $callback = array('SystemPermission', 'checkPermission');
    $menu = TMenuBar::newFromXML('menu.xml', $callback);
    $menu->show();
    $menu_string = ob_get_contents();
    ob_end_clean();
} else {
    $content = file_get_contents("app/templates/{$template}/login.html");
}
$content = TApplicationTranslator::translateTemplate($content);
$content = str_replace('{LIBRARIES}', file_get_contents("app/templates/{$template}/libraries.html"), $content);
$content = str_replace('{URI}', $uri, $content);
$content = str_replace('{class}', isset($_REQUEST['class']) ? $_REQUEST['class'] : '', $content);
$content = str_replace('{template}', $template, $content);
$content = str_replace('{MENU}', $menu_string, $content);
$content = str_replace('{username}', TSession::getValue('username'), $content);
$content = str_replace('{frontpage}', TSession::getValue('frontpage'), $content);
$css = TPage::getLoadedCSS();