Пример #1
0
 /**
  * put your comment there...
  * 
  * @deprecated All will be moved to other controllers in the future versions.
  */
 public function getInfoViewAction()
 {
     $model = $this->getModel('blocks');
     // Set content type as HTML.
     $this->httpContentType = "text/html";
     // Get block info.
     $id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
     $Info = $model->getInfo($id);
     // Create info view object.
     $view = CJTController::getView('blocks/info');
     // Get view info content.
     $view->info = $Info;
     $this->response = $view->getTemplate('default');
 }
Пример #2
0
 /**
  * put your comment there...
  * 
  * @param mixed $view
  * @param mixed $params
  */
 public static function getInstance($view, $params = null)
 {
     return self::trigger('CJTView.createview', CJTController::getView($view, $params));
 }
Пример #3
0
 /**
  * Get view content through ajax request.
  * 
  * The method is useful for requesting Popup forms through ajax (e.g ThickBox).
  * You can request any view specified in the $allowedViews array.
  * 
  * Call this method using GET method with the following parameters.
  * 	- viewName string Name of the view.
  * 
  * Response body is the view content string.
  * 
  * @return void
  */
 public function getViewAction()
 {
     // Some views required objects to be pushed into it before displaying
     // the controller element is a callback that a Dummy Controller from which
     // this variables should be pushed.
     $allowedViews = array('blocks/new' => array());
     // Prepare parameters.
     $viewName = filter_input(INPUT_GET, 'viewName', FILTER_SANITIZE_STRING);
     if (array_key_exists($viewName, $allowedViews) === FALSE) {
         $this->httpCode = '403 Forbidden';
     } else {
         // Import view file.
         $viewInfo = $allowedViews[$viewName];
         // Get view object.
         $view = CJTController::getView($viewName);
         // Push view variables.
         foreach (isset($viewInfo['vars']) ? $viewInfo['vars'] : array() as $var) {
             $view->{$var} = $_GET["view.{$var}"];
         }
         // Some views required custom pushing, this is can
         // be done by the registered controller.
         if (isset($viewInfo['controller'])) {
             $viewController = $viewInfo['controller'];
             $this->{$viewController}($view);
         }
         // Set Content type.
         $this->httpContentType = "text/html";
         // Get view content.
         $this->response = $view->getTemplate('default');
     }
 }