本文整理汇总了PHP中TApplication类的典型用法代码示例。如果您正苦于以下问题:PHP TApplication类的具体用法?PHP TApplication怎么用?PHP TApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TApplication类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: loadProgram
/**
* Load an specific program
*/
public static function loadProgram($param)
{
$program = $param['input'][0];
if ($program) {
TApplication::loadPage($program);
}
}
开发者ID:edurbs,项目名称:sobcontrole,代码行数:10,代码来源:SearchBox.class.php
示例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);
}
开发者ID:jfrank1500,项目名称:curso_php,代码行数:10,代码来源:SearchBox.class.php
示例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();
}
开发者ID:enieber,项目名称:adianti,代码行数:30,代码来源:index.gtk.php
示例4: __construct
public function __construct()
{
parent::__construct();
$this->texto = new TLabel('');
parent::add($this->texto);
if (!isset($_REQUEST['method'])) {
TApplication::executeMethod("PaginaAjuda", "onHelp");
}
}
开发者ID:jfrank1500,项目名称:curso_php,代码行数:9,代码来源:PaginaAjuda.class.php
示例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;
}
开发者ID:thalelinh,项目名称:MoneyManager,代码行数:52,代码来源:TConnection.class.php
示例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;
}
开发者ID:thalelinh,项目名称:MoneyManager,代码行数:13,代码来源:Get_methods.class.php
示例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());
}
}
开发者ID:jfrank1500,项目名称:curso_php,代码行数:19,代码来源:MultiStepMultiFormView.class.php
示例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;
}
开发者ID:thalelinh,项目名称:MoneyManager,代码行数:17,代码来源:Autoloader.php
示例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);
}
}
开发者ID:enieber,项目名称:adianti,代码行数:25,代码来源:TMenuItem.class.php
示例10: onLogout
/**
* método onLogout
* Executado quando o usuário clicar no botão logout
*/
function onLogout()
{
TSession::setValue('logged', FALSE);
TApplication::gotoPage('LoginForm', '');
}
开发者ID:jfrank1500,项目名称:curso_php,代码行数:9,代码来源:LoginForm.class.php
示例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();
开发者ID:bailey-ann,项目名称:stringtools,代码行数:12,代码来源:index.php
示例12: onLogout
/**
* método onLogout
* Executado quando o usuário clicar no botão logout
*/
function onLogout()
{
TSession::setValue('logged', FALSE);
TApplication::executeMethod('LoginForm', '');
}
开发者ID:jhonleandres,项目名称:crmbf,代码行数:9,代码来源:LoginForm.class.php
示例13: dirname
<?php
require_once dirname(__FILE__) . '/../../../framework/prado.php';
$app = new TApplication('protected700/application.xml');
$app->run();
开发者ID:Nurudeen,项目名称:prado,代码行数:5,代码来源:index700.php
示例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());
}
}
开发者ID:jhonleandres,项目名称:crmbf,代码行数:23,代码来源:TButton.class.php
示例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');
}
}
开发者ID:laiello,项目名称:almoxarifadocedup,代码行数:58,代码来源:index.php
示例16: onEdit
/**
* method onEdit()
* Executed whenever the user clicks at the edit button da datagrid
*/
function onEdit($param)
{
TApplication::loadPage('DesignedFormView', 'onEdit', $param);
}
开发者ID:jfrank1500,项目名称:curso_php,代码行数:8,代码来源:DesignedDataGridView.class.php
示例17: onUpdate
/**
* Simulates an save button
* Show the form content
*/
public function onUpdate($param)
{
$data = $this->form->getData("TipoAtividade");
// optional parameter: active record class
// pegar os dados da sessao armazenar na variavel
$cotacao_items = TSession::getValue('array_items');
// inicia transacao com o banco 'pg_ceres'
TTransaction::open('atividade');
// put the data back to the form
$this->form->setData($data);
$msg = '';
$contAdd = 0;
foreach ($cotacao_items as $item) {
$itemObj = new StdClass();
$itemObj->id = $item['id'];
$itemObj->no = $item['nome'];
foreach ($this->form->getFields() as $name => $field) {
// pegando valor do combo
if ($field instanceof TCombo) {
if ($name === 'sistema' . $contAdd) {
$itemObj->sistema = $field->getValue();
}
if ($name === 'ticket' . $contAdd) {
$itemObj->ticket = $field->getValue();
}
}
}
$contAdd++;
$cotacao_items_add[] = get_object_vars($itemObj);
}
try {
if ($msg == '') {
// percore o objeto e armazena
foreach ($cotacao_items_add as $item) {
$itemObj = new TipoAtividade($item['id']);
$itemObj->nome = $item['nome'];
$itemObj->sistema_id = $item['sistema'];
$itemObj->ticket_id = $item['ticket'];
// armazena o objeto
$itemObj->store();
}
$msg = 'Registro salvo com sucesso!';
// finaliza a transacao
TTransaction::close();
} else {
$icone = 'error';
}
if ($icone == 'error') {
// exibe mensagem de erro
new TMessage($icone, "Erro ao Salvar o registro!");
} else {
// show the message
$param = array();
$param['id'] = filter_input(INPUT_GET, 'id');
//chama o formulario com o grid
TApplication::gotoPage('TipoAtividadesVinculos', 'onReloadTwo', $param);
// reload
new TMessage("info", $msg);
}
} catch (Exception $e) {
// em caso de exce??o
// exibe a mensagem gerada pela excecao
new TMessage('error', $e->getMessage());
// desfaz todas altera??es no banco de dados
TTransaction::rollback();
}
}
开发者ID:jhonleandres,项目名称:Atividades,代码行数:71,代码来源:TipoAtividadesVinculos.class.php
示例18: onLogout
/**
* Logout
*/
function onLogout()
{
TSession::freeSession();
TApplication::gotoPage('LoginForm', '');
}
开发者ID:eduardojsouza,项目名称:liger,代码行数:8,代码来源:LoginForm.class.php
示例19: onLogout
/**
* Logout
*/
public static function onLogout()
{
SystemAccessLog::registerLogout();
TSession::freeSession();
TApplication::gotoPage('LoginForm', '');
}
开发者ID:edurbs,项目名称:sobcontrole,代码行数:9,代码来源:LoginForm.class.php
示例20: dirname
$basePath = dirname(__FILE__);
//$frameworkPath='../../framework/pradolite.php';
$frameworkPath = '../../framework/prado.php';
$assetsPath = $basePath . "/assets";
$runtimePath = $basePath . "/protected/runtime";
$sqlite_dir = $basePath . "/protected/App_Data/SQLite";
$sqlite_db = $sqlite_dir . '/time-tracker.db';
if (!is_file($frameworkPath)) {
die("Unable to find prado framework path {$frameworkPath}.");
}
if (!is_writable($assetsPath)) {
die("Please make sure that the directory {$assetsPath} is writable by Web server process.");
}
if (!is_writable($runtimePath)) {
die("Please make sure that the directory {$runtimePath} is writable by Web server process.");
}
if (!is_writable($sqlite_dir)) {
die("Please make sure that the directory {$sqlite_dir} is writable by Web server process.");
}
if (!is_writable($sqlite_db)) {
die("Please make sure that the sqlite database file {$sqlite_dir} is writable by Web server process.");
}
require_once $frameworkPath;
function h($text)
{
$app = Prado::getApplication()->getGlobalization();
$charset = $app ? $app->getCharset() : 'UTF-8';
return htmlentities($text, ENT_QUOTES, $charset);
}
$application = new TApplication();
$application->run('protected', false, TApplication::CONFIG_TYPE_PHP);
开发者ID:Nurudeen,项目名称:prado,代码行数:31,代码来源:index_php.php
注:本文中的TApplication类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论