示例#1
0
 /**
  * TuiyoViewProfile::display()
  * @param mixed $tpl
  * @return void
  */
 public function homepage($tpl = null)
 {
     $model = TuiyoLoader::model("applications", true);
     $nModel = TuiyoLoader::model("notifications", true);
     $pModel = TuiyoLoader::model("profile", true);
     $document = $GLOBALS['API']->get("document");
     $user = $GLOBALS['API']->get('user', empty($profileID) ? null : (int) $profileID);
     //$document->enqueMessage( "This is a sample Message" , "notice" );
     $livestyle = TUIYO_LIVE_PATH . '/client/default/';
     $document->addCSS(TUIYO_LIVE_PATH . '/client/default/css/homepage.css');
     $document->addJS(TUIYO_LIVE_PATH . '/client/default/script/homepage.js');
     $document->addJS(TUIYO_STREAM);
     $document->addJS(TUIYO_OEMBED);
     //If guest profile?
     if ($user->joomla->get('guest')) {
         $redirect = JRoute::_(TUIYO_INDEX . "&view=welcome");
         $GLOBALS['mainframe']->redirect($redirect);
     }
     //Who has viewed my Profile
     $uPlugins = $model->getAllUserPlugins($user->id, "services", false);
     //Get the HTML
     $tmplPath = TUIYO_VIEWS . DS . "profile" . DS . "tmpl";
     $tmplVars = array("user" => $user, "styleDir" => $livestyle, "livePath" => TUIYO_LIVE_PATH, "lastVisted" => TuiyoTimer::diff(strtotime($user->joomla->lastvisitDate)), "countViews" => NULL, "lastUsed" => (array) $model->getRecentlyUsed($user->id, 8), "notices" => $nModel->getAllNotifications($user->id), "pages" => $nModel->getState('pagination'), "plugins" => $uPlugins, "visitors" => $pModel->getProfileRecentVisitors($user->id));
     //Get Timeline 2.0
     $plugins = $model->getAllSystemPlugins("services", false);
     $tplVars2 = array("styleDir" => TUIYO_STYLEDIR, "user" => $user, "sharewith" => array("p00" => "@everyone"), "plugins" => $plugins, "canPost" => !$user->joomla->get('guest') ? 1 : 0);
     $activity = $document->parseTmpl("activity", $tmplPath, $tplVars2);
     $content = $document->parseTmpl("dashboard", $tmplPath, $tmplVars);
     $this->assignRef('activity', $activity);
     $this->assignRef('livestyle', $livestyle);
     $this->assignRef("content", $content);
     parent::setLayoutExt('tpl');
     parent::display($tpl);
 }
	/**
	 * Test JViewLegacy::setLayoutExt()
	 *
	 * @since   11.3
	 * @covers  JViewLegacy::setLayoutExt
	 */
	public function testSetLayoutExt()
	{
		$this->assertAttributeEquals('php', '_layoutExt', $this->class);

		$this->class->setLayoutExt('tmpl');

		$this->assertAttributeEquals('tmpl', '_layoutExt', $this->class);
	}
示例#3
0
 /**
  * TuiyoViewWelcome::showSetup()
  * 
  * @param mixed $user
  * @return void
  */
 public function showSetup($user = null)
 {
     $tmpl = $GLOBALS['API']->get("document");
     $livestyle = TUIYO_LIVE_PATH . '/client/default/';
     //Assign References
     $this->assignRef('livestyle', $livestyle);
     $this->assignRef('user', $user);
     //Terms
     $terms = $tmpl->parseTmpl("terms", TUIYO_FILES, array(), "html");
     $this->assignRef('terms', $terms);
     //Style
     $tmpl->addCSS(TUIYO_LIVE_PATH . '/client/default/css/homepage.css');
     $tmpl->addJS(TUIYO_LIVE_PATH . '/client/default/script/setup.js');
     //Display the view
     parent::setLayout('setup');
     parent::setLayoutExt('tpl');
     parent::display();
 }