Example #1
0
 /**
  * Prints a view file.
  */
 public static function getView(Controller $controller)
 {
     global $data;
     $config = Config::getInstance();
     $data = $controller->getData();
     $action = $controller->action;
     $class = $controller->class;
     $head = true;
     $header = true;
     $footer = true;
     if (defined('REUSINGDUBLIN_API')) {
         $head = false;
         $header = false;
         $footer = false;
     }
     if (isset($_GET['modal'])) {
         $head = true;
         $header = false;
         $footer = true;
     }
     if ($head) {
         require_once REUSINGDUBLIN_DIR . '/view/head.php';
     }
     if ($header) {
         require_once REUSINGDUBLIN_DIR . '/view/header.php';
     }
     require_once REUSINGDUBLIN_DIR . '/view/' . lcfirst($class) . $action . '.php';
     if ($footer) {
         require_once REUSINGDUBLIN_DIR . '/view/footer.php';
     }
 }
Example #2
0
if (isset($site['derelict'])) {
    echo $site['derelict'];
}
?>
</dd>
            <dt>Description</dt>
            <dd><?php 
if (isset($site['info'])) {
    echo Controller::autoLinkText($site['info']);
}
?>
</dd>
            <dt>Suggested uses</dt>
            <dd><?php 
if (isset($site['tellUsInfo'])) {
    echo Controller::autoLinkText($site['tellUsInfo']);
}
?>
</dd>
            <dt>Why has this area been highlighted?</dt>
            <dd><?php 
if (isset($site['highlighted'])) {
    echo $site['highlighted'];
}
?>
</dd>
        </dl>

    </div>

    <div class="container-fluid">
Example #3
0
 private function update(array $data)
 {
     $db = Model::factory();
     $files = $data['files'];
     unset($data['files']);
     //update a site
     if (isset($data['id'])) {
         $db->update('Site', $data, 'id');
     } else {
         $data['id'] = $db->insert('Site', $data);
     }
     //files
     $data['files'] = Controller::upload($files, $data['id']);
     return $data;
 }
Example #4
0
/**
 * boostrap
 */
require_once 'bootstrap.php';
// end bootstrap
/**
 * Routing
 */
$config = \ReusingDublin\Config::getInstance();
$query = isset($_GET['q']) ? $_GET['q'] : null;
$config->set('query', $query);
// end Routing
/**
 * Controller
 */
$controller = \ReusingDublin\Controller::factory($config->routes);
/**
 * Ajax.
 * If ajax request then controller should contain json string.
 * @see Config::setQuery() Where ajax routes are defined.
 */
if (defined('REUSINGDUBLIN_API')) {
    echo $controller->result;
    die;
}
/**
 * Print View
 */
if (!\ReusingDublin\Error::isError($controller)) {
    \ReusingDublin\View::getView($controller);
}