本文整理汇总了PHP中TApplication类的典型用法代码示例。如果您正苦于以下问题:PHP TApplication类的具体用法?PHP TApplication怎么用?PHP TApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TApplication类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadProgram
/**
* Load an specific program
*/
public static function loadProgram($param)
{
$program = $param['input'][0];
if ($program) {
TApplication::loadPage($program);
}
}
示例2: loadProgram
/**
* Load an specific program
*/
public function loadProgram($param)
{
$data = $this->form->getData();
$programs = array_keys($data->input);
$program = $programs[0];
TApplication::loadPage($program);
}
示例3: __construct
/**
* 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();
}
示例4: __construct
public function __construct()
{
parent::__construct();
$this->texto = new TLabel('');
parent::add($this->texto);
if (!isset($_REQUEST['method'])) {
TApplication::executeMethod("PaginaAjuda", "onHelp");
}
}
示例5: open
public static function open($name)
{
// verifica se existe arquivo de configuração para este banco de dados
$filename = TApplication::get_root_dir() . "/model/app.config/{$name}.ini";
if (file_exists($filename)) {
// lê o INI e retorna um array
$db = parse_ini_file($filename);
} else {
// se não existir, lança um erro
throw new Exception("Arquivo '{$name}' não encontrado");
}
// lê as informações contidas no arquivo
$user = isset($db['user']) ? $db['user'] : null;
$pass = isset($db['pass']) ? $db['pass'] : null;
$name = isset($db['name']) ? $db['name'] : null;
$host = isset($db['host']) ? $db['host'] : null;
$type = isset($db['type']) ? $db['type'] : null;
$port = isset($db['port']) ? $db['port'] : null;
// descobre qual o tipo (driver) de banco de dados a ser utilizado
switch ($type) {
case 'mysql':
$port = $port ? $port : '3306';
TApplication::addCurrentTime('Pré acesso');
$conn = new PDO("mysql:host={$host};port={$port};dbname={$name}", $user, $pass);
TApplication::addCurrentTime('Acesso ao Banco');
break;
case 'pgsql':
$port = $port ? $port : '5432';
$conn = new PDO("pgsql:dbname={$name}; user={$user}; password={$pass}; host={$host};port={$port}");
break;
case 'sqlite':
$conn = new PDO("sqlite:{$name}");
break;
case 'ibase':
$conn = new PDO("firebird:dbname={$name}", $user, $pass);
break;
case 'oci8':
$conn = new PDO("oci:dbname={$name}", $user, $pass);
break;
case 'mssql':
$conn = new PDO("mssql:host={$host},1433;dbname={$name}", $user, $pass);
break;
default:
throw new Exception("Banco de Dados '{$type}' não suportado");
}
// define para que o PDO lance exceções na ocorrência de erros
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// define para que o PDO substitua strings vazias por valores nulos
$conn->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_EMPTY_STRING);
// retorna o objeto instanciado.
return $conn;
}
示例6: prepare
public function prepare()
{
$result = array();
$class_files = glob(TApplication::get_root_dir() . '\\model\\app.control\\*.class.php');
foreach ($class_files as $path) {
$classname = substr(basename($path), 0, -10);
/** @var SimpleAction $obj */
$obj = new $classname('SKIP');
$result[$classname] = array("attrs" => $obj->get_input_keys(), "connRequired" => $obj->connected != null);
// Atributos obrigatórios
}
return $result;
}
示例7: onNextForm
/**
* onNextForm
*/
public function onNextForm()
{
try {
$this->form->validate();
$data = $this->form->getData();
if ($data->password !== $data->confirm) {
throw new Exception('Passwords do not match');
}
// store data in the session
TSession::setValue('form_step1_data', $data);
// Load another page
TApplication::loadPage('MultiStepMultiForm2View', 'onLoadFromForm1', (array) $data);
} catch (Exception $e) {
new TMessage('error', $e->getMessage());
}
}
示例8: class_autoloader
function class_autoloader($classname)
{
if (class_exists("TApplication")) {
$root = TApplication::get_root_dir();
} else {
$root = dirname(__FILE__, 3);
}
$folders = array('model/app.ado', 'model/app.control');
foreach ($folders as $folder) {
$path = "{$root}/{$folder}/{$classname}.class.php";
if (file_exists($path)) {
include_once $path;
return true;
}
}
return false;
}
示例9: __construct
/**
* Class Constructor
* @param $label The menu label
* @param $action The menu action
* @param $image The menu image
*/
public function __construct($label, $action, $image = NULL)
{
parent::__construct(utf8_decode($label));
// converts into ISO
parent::set_image(null);
if (OS == 'WIN') {
parent::set_border_width(3);
}
$this->label = $label;
$this->action = $action;
$this->image = $image;
if (file_exists($image)) {
parent::set_image(GtkImage::new_from_file($image));
}
$inst = TApplication::getInstance();
if ($inst instanceof TApplication) {
parent::connect_simple('activate', array($inst, 'run'), $action);
}
}
示例10: onLogout
/**
* método onLogout
* Executado quando o usuário clicar no botão logout
*/
function onLogout()
{
TSession::setValue('logged', FALSE);
TApplication::gotoPage('LoginForm', '');
}
示例11: dirname
<?php
$basePath = dirname(__FILE__);
$frameworkPath = '../prado-3.2.2.r3297/framework/prado.php';
$assetsPath = $basePath . "/assets";
if (!is_writable($assetsPath)) {
die("Please make sure that the directory {$assetsPath} is writable by Web server process.");
}
require_once $frameworkPath;
//include_once("analyticstracking.php") ;
$application = new TApplication();
$application->run();
示例12: onLogout
/**
* método onLogout
* Executado quando o usuário clicar no botão logout
*/
function onLogout()
{
TSession::setValue('logged', FALSE);
TApplication::executeMethod('LoginForm', '');
}
示例13: dirname
<?php
require_once dirname(__FILE__) . '/../../../framework/prado.php';
$app = new TApplication('protected700/application.xml');
$app->run();
示例14: onExecute
/**
* Execute the action
* @param $action callback to be executed
* @ignore-autocomplete on
*/
public function onExecute($action)
{
$callb = $action->getAction();
if (is_object($callb[0])) {
$object = $callb[0];
call_user_func($callb, $action->getParameters());
//aquip, este IF estava acima do call_user_func
if (method_exists($object, 'show')) {
if ($object->get_child()) {
$object->show();
}
}
} else {
$class = $callb[0];
$method = $callb[1];
TApplication::executeMethod($class, $method, $action->getParameters());
}
}
示例15: run
public static function run()
{
$sessao = new TSessao(true);
include 'util/Validacao.php';
$flashes = null;
$usuario = $sessao->getVar('usuario');
include 'app.functions/validate.php';
$valida = validate($usuario);
//include 'relatorios/teste.php';
if ($valida) {
if ($usuario) {
$menu = new TMenu($usuario->permissoes, array('gerenciar'));
TApplication::setStyle('menu');
TApplication::setStyle('controler_bar');
}
if (!$_GET) {
if ($usuario == null) {
require "app.comuns/app.control/login.php";
TApplication::setStyle('login');
$templatePage = "app.comuns/template/login.phtml";
} else {
if ($sessao->getVar('msg1') != null) {
if ($sessao->getVar('msg1') == 5) {
Flash::addFlash('Você não tem permissão!');
$flashes = Flash::getFlashes();
$sessao->removeVar('msg1');
}
}
$templatePage = "app.comuns/template/panel.phtml";
}
} else {
$modulo = isset($_GET['modulo']) ? $_GET['modulo'] : null;
$page = isset($_GET['page']) ? $_GET['page'] : null;
if (file_exists("modulos/{$modulo}/app.control/{$page}.php")) {
require "modulos/{$modulo}/app.control/{$page}.php";
}
if (file_exists("modulos/{$modulo}/template/{$page}.phtml")) {
$templatePage = "modulos/{$modulo}/template/{$page}.phtml";
}
}
if (isset($validacao)) {
if ($validacao !== true) {
$erros = $validacao;
}
}
if (Flash::hasFlashes()) {
$flashes = Flash::getFlashes();
}
if (!isset($_GET['ajax'])) {
TApplication::setStyle('style');
TApplication::setStyle('principal');
TApplication::setStyle('redmond/jquery-ui-1.8.16.custom');
require 'layout/index.phtml';
}
} else {
header('location: index.php');
}
}