예제 #1
0
 /**
  * TuiyoControllerFriends::__construct()
  * 
  * @return void
  */
 function __construct()
 {
     //Tuiyo controller
     TuiyoControllerCore::init();
     //Joomla controller
     parent::__construct();
 }
예제 #2
0
파일: core.php 프로젝트: night-coder/ignite
 /**
  * Class constructor
  * TuiyoController::__construct()
  * 
  * @return void
  */
 public function __construct($app = null, $authorise = true)
 {
     $this->current = $app;
     $doFoo = JRequest::getVar("do", null);
     $view = array(JRequest::getVar("view"), JRequest::getVar("redirect"));
     //Doable Tasks
     static $dos = array("help" => "showHelp", "login" => "doLogin", "register" => "registerUser", "exAPI" => "externalLogin", "start" => "createProfile", "setup" => "buildProfile", "signup" => "createUser");
     //Check that the user is logged In / Or allowable task
     if ($authorise && !array_key_exists($doFoo, $dos)) {
         $user = $GLOBALS['API']->get('user', null);
         if (!$user->isUserLoggedIn()) {
             //$document 	= $GLOBALS['API']->get('user', null);
             $welcome = JRoute::_(TUIYO_INDEX . '&redirect=welcome&do=login', false, null);
             $this->setRedirect($welcome, _("You must be logged in to view this section of our site"), "notice");
             $this->redirect();
         } elseif (!$user->hasProfile()) {
             //If user does not have a profile
             $start = JRoute::_(TUIYO_INDEX . "&redirect=core&do=start", false, null);
             $this->setRedirect($start);
             $this->redirect();
         }
         TuiyoControllerCore::authorise();
     }
     //Construct the parent aswell!
     parent::__construct();
     TuiyoEventLoader::preparePlugins("profile");
     //Authorise and register Task
     if (is_null($app) && array_key_exists($doFoo, $dos)) {
         $this->authorise();
         $this->registerTask($doFoo, $dos[$doFoo]);
         //die;
     } elseif (!array_key_exists($doFoo, $dos) && in_array("core", $view)) {
         $GLOBALS['mainframe']->redirect(JRoute::_(TUIYO_INDEX . "&view=welcome"));
     }
 }
예제 #3
0
 /**
  * TuiyoControllerProfile::__construct()
  * Constructs the task;
  * @return void
  */
 public function __construct()
 {
     /** Do we need user to be logged in? **/
     TuiyoControllerCore::init("Profile", false);
     TuiyoEventLoader::preparePlugins("profile");
     //Parent constructor or break
     parent::__construct();
 }
예제 #4
0
 /**
  * TuiyoControllerWelcome::__construct()
  * Constructor method
  * 
  * @return void
  */
 public function __construct()
 {
     //construct JController
     parent::__construct();
     //construct Tuiyo Controller;
     TuiyoControllerCore::init('welcome', false);
     //get the view
     $this->view = $this->getView('welcome', 'html');
 }
예제 #5
0
 /**
  * TuiyoControllerTimeline::__construct()
  * @return void
  */
 public function __construct()
 {
     //		if (!JRequest::getCmd( 'view') ) {
     //         	JRequest::setVar('view', 'profile');
     //      	}
     TuiyoControllerCore::init("Timeline", false);
     TuiyoEventLoader::preparePlugins("timeline");
     parent::__construct();
 }
예제 #6
0
 /**
  * TuiyoControllerWidgets::__construct()
  * @return void
  */
 function __construct()
 {
     //Tuiyo controller
     TuiyoControllerCore::init("Widgets", true);
     //Component only
     JRequest::setVar('tmpl', 'component');
     //Joomla controller
     parent::__construct();
 }
예제 #7
0
파일: apps.php 프로젝트: night-coder/ignite
 /**
  * TuiyoControllerApps::__construct()
  * @return void
  */
 function __construct()
 {
     TuiyoControllerCore::init();
     parent::__construct();
     //load the application
     $redirect = JRequest::getVar("redirect", null);
     $app = JRequest::getVar("app", $redirect);
     $appTask = JRequest::getVar("ref", null);
     $do = JRequest::getVar("do", null);
     if (!empty($app) && strval(strtolower($do)) !== "add") {
         $this->startApplication($app);
     }
 }
예제 #8
0
 /**
  * TuiyoControllerGroups::__construct()
  * @return void
  */
 function __construct()
 {
     TuiyoControllerCore::init("Articles", FALSE);
     parent::__construct();
 }
예제 #9
0
 /**
  * TuiyoControllerPhotos::__construct()
  * @return void
  */
 public function __construct()
 {
     TuiyoControllerCore::init("Photos", false);
     parent::__construct();
 }
예제 #10
0
 public function __construct()
 {
     TuiyoControllerCore::init("Notifications", false);
     TuiyoEventLoader::preparePlugins("notifications");
     parent::__construct();
 }