Exemplo n.º 1
0
 /**
  * kick start the View, which creates the response
  * based on our previously set content data.
  * finally echo the response or overwrite this method
  * and do something else with it.
  * @return string
  */
 public function afterroute()
 {
     if (!$this->response) {
         trigger_error('No View has been set.');
     }
     echo $this->response->render();
 }
Exemplo n.º 2
0
 public function index(\Base $f3, $params)
 {
     $this->response->addTitle($f3->get('LN__AdminMenu_Home'));
     $f3->set('title_h1', $f3->get('LN__AdminMenu_Home'));
     switch ($this->moduleInit(@$params['module'])) {
         case "manual":
             $this->buffer(\View\Base::stub());
             break;
         case "custompages":
             $this->custompages($f3, $params);
             break;
         case "news":
             $this->news($f3, $params);
             break;
         case "modules":
             $this->buffer(\View\Base::stub());
             break;
         case "shoutbox":
             $this->shoutbox($f3, $params);
             break;
         case "home":
             $this->home($f3);
             break;
         default:
             $this->buffer(\Template::instance()->render('access.html'));
     }
 }
Exemplo n.º 3
0
 /**
  * create and return response content
  * @return mixed
  */
 public function __construct()
 {
     $f3 = \Base::instance();
     $UI = $f3->get('UI');
     // develop
     $tpl = 'default';
     $folder = file_exists($UI . $tpl . '/layout.html') ? $tpl : 'default';
     $f3->set('UI', "{$UI}{$folder}/");
     $f3->set('SELF', rawurlencode($_SERVER["QUERY_STRING"]));
     \View\Base::javascript('body', TRUE, 'global.js');
     \View\Base::javascript('body', FALSE, "var base='{$f3->get('BASE')}'");
 }
Exemplo n.º 4
0
 public function __construct(array $aParams)
 {
     parent::__construct($aParams);
     $this->model = new Readout();
     $this->externalModel = new OpenWeatherMap();
     switch ($aParams['range']) {
         case 'year':
             $this->internalData = $this->model->getMonthlyAggregate(365, "ASC");
             $this->externalData = $this->externalModel->getMonthlyAggregate(365, "ASC");
             break;
         default:
             $this->internalData = $this->model->getDayAggregate(30, "ASC");
             $this->externalData = $this->externalModel->getDayAggregate(30, "ASC");
             break;
     }
 }
Exemplo n.º 5
0
 public function __construct(array $aParams)
 {
     parent::__construct($aParams);
     $this->model = new \Model\Readout();
 }
Exemplo n.º 6
0
 /**
  * Connect to the controller and run our action.
  *
  * @return void
  **/
 private function _connect($class_path, $action, $parameters)
 {
     $parts = explode("/", $class_path);
     $controller = array_pop($parts);
     if (!isset($action) || empty($action)) {
         $action = "index";
     }
     Components\Registry::instance()->controller = $controller;
     Components\Registry::instance()->action = $action;
     Components\Registry::instance()->view = $class_path . "/" . $action;
     $file_path = $class_path . "_controller.php";
     $class = \Inflector::camelize($controller . "_controller");
     require_once 'application_controller.php';
     if ($this->_find_controller($file_path)) {
         include_once $file_path;
     } else {
         throw new \Error("No controller found for path.");
     }
     $controller = new $class();
     if (!method_exists($controller, $action)) {
         throw new \Error("Method '{$action}' does not exist on {$class}.");
         return;
     }
     $controller->params =& $parameters;
     $controller->{$action}();
     \View\Base::instance()->render();
 }
Exemplo n.º 7
0
 protected function team(\Base $f3)
 {
     $team = $this->model->listTeam();
     print_r($team);
     $this->buffer(\View\Base::stub());
 }
Exemplo n.º 8
0
 protected function characters(\Base $f3, $params, $feedback)
 {
     $this->buffer(\View\Base::stub());
 }
Exemplo n.º 9
0
 protected function home(\Base $f3)
 {
     $this->buffer(\View\Base::stub());
 }
Exemplo n.º 10
0
 public function profile(\Base $f3, $params)
 {
     $this->response->addTitle($f3->get('LN__UserMenu_Profile'));
     $this->buffer(\View\Base::stub("profile"));
     $this->showMenu("profile");
 }
 public function __construct(array $aParams)
 {
     parent::__construct($aParams);
     $this->model = new $this->modelName();
 }