コード例 #1
0
ファイル: index.php プロジェクト: laiello/almoxarifadocedup
 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');
     }
 }
コード例 #2
0
ファイル: index.php プロジェクト: Wooddu/MMNZ
 private function runPage($page, array $extra = array())
 {
     $run = false;
     if ($this->hasScript($page)) {
         $run = true;
         require $this->getScript($page);
     }
     if ($this->hasTemplate($page)) {
         $run = true;
         //required in layout/index.php
         $template = $this->getTemplate($page);
         $flashes = null;
         if (Flash::hasFlashes()) {
             $flashes = Flash::getFlashes();
         }
         require self::LAYOUT_DIR . 'index.php';
     }
     if (!$run) {
         die('Page ' . $page . ' has neither script nor template!');
     }
 }
コード例 #3
0
ファイル: index.php プロジェクト: html5Vision/FlashMessage
Flash::addFlash('Here is the warning message', 'warning');
Flash::addFlash('Something wrong happend because it\'s an error message', 'error');
Flash::addFlash('Yeah that\'s work fine, well played', 'success');
Flash::addFlash('In reality I hate php.', 'info');
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <link rel="stylesheet" href="css/styles.css"/>
    </head>
    <body>
        <?php 
if (Flash::hasFlashes()) {
    foreach (Flash::getFlashes() as $flash) {
        echo "<p class=\"flash " . $flash['type'] . "\">" . $flash['message'] . "</p>";
    }
}
?>
        <h1>Example of utilisation</h1>
        <?php 
$code = "<?php \n\n\t";
$code .= "// Require the Flash class \n\t";
$code .= "require 'Flash.php';\n\n\t";
$code .= "// Register flashes messages \n\t";
$code .= "Flash::addFlash('Here is the warning message', 'warning');\n\t";
$code .= "Flash::addFlash('Something wrong happend because it\\'s an error message', 'error');\n\t";
$code .= "Flash::addFlash('Yeah that\\'s work fine, well played', 'success');\n\t";
$code .= "Flash::addFlash('In reality I hate php.', 'info');\n\n\t";
$code .= "// If we have one or more messages registered \n\t";
コード例 #4
0
ファイル: index.php プロジェクト: jhonochoa/larabel
 private function runPage($page, array $extra = array())
 {
     $run = false;
     if ($this->hasScript($page)) {
         $run = true;
         require $this->getScript($page);
     }
     if ($this->hasTemplate($page)) {
         $run = true;
         // data for main template
         $template = $this->getTemplate($page);
         $flashes = null;
         if (Flash::hasFlashes()) {
             $flashes = Flash::getFlashes();
         }
         // main template (layout)
         require self::LAYOUT_DIR . 'index.phtml';
     }
     if (!$run) {
         die('Page "' . $page . '" has neither script nor template!');
     }
 }