Exemplo n.º 1
0
 public static function render($partial, $data = array())
 {
     $path = self::PARTIAL_BASE . Layout::getLayout() . '/';
     if (!file_exists(dirname(dirname(__FILE__)) . View::VIEW_PATH . Layout::getLayout() . '/' . $path . $partial . View::VIEW_EXT)) {
         $path = self::PARTIAL_BASE . 'main/';
     }
     $partial = new View($path . $partial, $data);
     return $partial->render();
 }
Exemplo n.º 2
0
 public function info($arguments)
 {
     if (empty($arguments[0])) {
         return $this->setView('nil');
     }
     $top = dirname(dirname(__FILE__)) . '/views/';
     $place = '/pages/info/' . basename($arguments[0]) . '.php';
     if (!file_exists($top . Layout::getLayout() . $place) && !file_exists($top . 'main' . $place)) {
         return $this->nil();
     }
     $this->setView('pages/info/' . basename($arguments[0]));
 }
Exemplo n.º 3
0
 public function __construct($viewPath, $data = array(), $driver = self::DRIVER_TRADITIONAL)
 {
     $this->viewPath = dirname(dirname(__FILE__)) . self::VIEW_PATH . Layout::getLayout() . '/' . $viewPath . self::VIEW_EXT;
     if (!file_exists($this->viewPath)) {
         $this->viewPath = dirname(dirname(__FILE__)) . self::VIEW_PATH . 'main/' . $viewPath . self::VIEW_EXT;
     }
     $this->driver = self::DRIVER_PREFIX . $driver . self::VIEW_SUFFIX;
     if (!class_exists($this->driver)) {
         die('Invalid driver.');
     }
     $this->data = $data;
 }
Exemplo n.º 4
0
 public function __construct($viewPath, $data = array(), $driver = self::DRIVER_TRADITIONAL)
 {
     // hard code the layout for now, pull
     // later we'll pull the default layout from the config and then check
     // it against user preference.
     Layout::selectLayout(Config::get(self::CONFIG_LAYOUT));
     $this->viewPath = dirname(dirname(__FILE__)) . self::VIEW_PATH . Layout::getLayout() . '/' . $viewPath . self::VIEW_EXT;
     if (!file_exists($this->viewPath)) {
         $this->viewPath = dirname(dirname(__FILE__)) . self::VIEW_PATH . 'main/' . $viewPath . self::VIEW_EXT;
     }
     $this->driver = self::DRIVER_PREFIX . $driver . self::VIEW_SUFFIX;
     if (!class_exists($this->driver)) {
         die('Invalid driver.');
     }
     $this->data = $data;
 }
Exemplo n.º 5
0
 private static function deliveryResponse()
 {
     $isAjax = Request::isAjax();
     if ($isAjax) {
         if (empty(self::$_reply) || !is_array(self::$_reply)) {
             exit('No reply seted by ajax controller or reply is not an array');
         }
         foreach (self::$_reply as $key => $value) {
             if ($key != 'reply' && !is_numeric($value) && !is_array($value) && $value) {
                 self::$_reply[$key] = Language::translation($value);
             }
         }
         Request::responseHeader();
         echo json_encode(self::$_reply);
     } else {
         Layout::MenuFooterAutoload();
         Layout::replaceTag();
         Layout::translation();
         Request::responseHeader();
         echo Layout::getLayout();
     }
 }
Exemplo n.º 6
0
//Create objects
$layout = new Layout();
$register = new Validation();
$db = new Db();
?>

<html>
    <head>
        <title>Welcome to OpenRPS</title>

        <link rel="stylesheet" href="openrps_core/css/main.css"/>
        <link rel="stylesheet" href="openrps_core/css/dashboard.css"/>
    </head>
    <body>
        <?php 
$layout->getLayout("header_loggedin");
?>
        <!-- Service listing -->

        <div class="two columns">
        <p><h3>Your Profile</h3></p>
        <p><a href="change_personal_info.php">Change Personal Info</a></p>
        <p><a href="delete_account.php">Delete Your Account</a></p>
        </div>

        <h2>Hi <?php 
print $username;
?>
, Welcome to OpenRPS!</h2>

        <?php 
Exemplo n.º 7
0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<?php 
include 'openrps_core/eng/Layout.php';
include 'openrps_core/eng/Validation.php';
include_once 'openrps_core/eng/Db.php';
//Set the title
$title = 'Sign Up for OpenRPS';
//Create objects
$layout = new Layout();
$validation = new Validation();
$db = new Db();
//Render layout
$layout->getLayout("header");
//Set post variables
$username = $_POST['username'];
$password = $_POST['password'];
$password_confirm = $_POST['password_confirm'];
$email = $_POST['email'];
//Validate form
//check passwords
if ($password != $password_confirm) {
    echo "<div class=\"danger alert\">Your passwords don't match!</div>";
    return;
}
$reg_status = $validation->valCheckEmpty($username, $password, $email);
if ($reg_status != 'true') {
    echo "<div class=\"danger alert\">{$reg_status}</div>";
}
if ($reg_status == 'true') {
Exemplo n.º 8
0
?>

<html>
    <head>
        <!-- CSS Libraries -->
        <link rel="stylesheet" href="openrps_core/css/vendor/normalize.css"/>
        <link rel="stylesheet" href="openrps_core/css/vendor/foundation.min.css"/>

        <!-- CSS code -->
        <link rel="stylesheet" href="openrps_core/css/main.css"/>
        <link rel="stylesheet" href="openrps_core/css/promotional.css"/>

    </head>
    <body>
        <?php 
$layout->getLayout("header_notloggedin");
?>
        <section class="hero">
            <div class="hero-text">
                <h1><span class="dark-transparent-bg">Welcome to OpenRPS</span></h1>
                <h3><span class="dark-transparent-bg">The RBE system</span></h3>
            </div>
        </section>
        <section class="row">

            <div class="columns large-4 showcase-card">
                <img src="img/resource_tracking.svg"/>
                <h4>Resource Tracking</h4>
                <p>
                    Tracks the resources real time in any environment.
                </p>