本文整理汇总了PHP中FD::page方法的典型用法代码示例。如果您正苦于以下问题:PHP FD::page方法的具体用法?PHP FD::page怎么用?PHP FD::page使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FD
的用法示例。
在下文中一共展示了FD::page方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInput
protected function getInput()
{
FD::language()->loadAdmin();
FD::language()->loadSite();
FD::page()->start();
JFactory::getDocument()->addStylesheet(rtrim(JURI::root(), '/') . '/administrator/components/com_easysocial/themes/default/styles/style.css');
$theme = FD::themes();
$label = (string) $this->element['label'];
$name = (string) $this->name;
if ($this->value) {
$category = FD::table('EventCategory');
$category->load($this->value);
$label = $category->get('title');
}
$theme->set('name', $name);
$theme->set('id', $this->id);
$theme->set('value', $this->value);
$theme->set('label', $label);
$output = $theme->output('admin/jfields/eventcategory');
// We do not want to process stylesheets on Joomla 2.5 and below.
$options = array();
if (FD::version()->getVersion() < 3) {
$options['processStylesheets'] = false;
}
FD::page()->end($options);
return $output;
}
示例2: display
/**
* Displays the application output in the canvas.
*
* @since 1.0
* @access public
* @param int The user id that is currently being viewed.
*/
public function display($userId = null, $docType = null)
{
// Require user to be logged in
FD::requireLogin();
$id = JRequest::getVar('schedule_id');
// Get the user that's being accessed.
$user = FD::user($userId);
$calendar = FD::table('Calendar');
$calendar->load($id);
if (!$calendar->id || !$id) {
FD::info()->set(false, JText::_('APP_CALENDAR_CANVAS_INVALID_SCHEDULE_ID'), SOCIAL_MSG_ERROR);
return $this->redirect(FD::profile(array('id' => $user->getAlias()), false));
}
$my = FD::user();
$privacy = FD::privacy($my->id);
$result = $privacy->validate('apps.calendar', $calendar->id, 'view', $user->id);
if (!$result) {
FD::info()->set(false, JText::_('APP_CALENDAR_NO_ACCESS'), SOCIAL_MSG_ERROR);
JFactory::getApplication()->redirect(FRoute::dashboard());
}
FD::page()->title($calendar->title);
// Render the comments and likes
$likes = FD::likes();
$likes->get($id, 'calendar', 'create', SOCIAL_APPS_GROUP_USER);
// Apply comments on the stream
$comments = FD::comments($id, 'calendar', 'create', SOCIAL_APPS_GROUP_USER, array('url' => FRoute::albums(array('layout' => 'item', 'id' => $id))));
$params = $this->app->getParams();
$this->set('params', $params);
$this->set('likes', $likes);
$this->set('comments', $comments);
$this->set('calendar', $calendar);
$this->set('user', $user);
echo parent::display('canvas/item/default');
}
示例3: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
// Load the language file.
FD::language()->loadAdmin();
// Render the headers
FD::page()->start();
// Attach dialog's css file.
JFactory::getDocument()->addStylesheet(rtrim(JURI::root(), '/') . '/administrator/components/com_easysocial/themes/default/styles/style.css');
$theme = FD::themes();
$label = (string) $this->element['label'];
$name = (string) $this->name;
$title = JText::_('COM_EASYSOCIAL_JFIELD_SELECT_BADGE');
if ($this->value) {
$badge = FD::table('Badge');
$badge->load($this->value);
$title = $badge->get('title');
}
$theme->set('name', $name);
$theme->set('id', $this->id);
$theme->set('value', $this->value);
$theme->set('label', $label);
$theme->set('title', $title);
$output = $theme->output('admin/jfields/badge');
// We do not want to process stylesheets on Joomla 2.5 and below.
$options = array();
if (FD::version()->getVersion() < 3) {
$options['processStylesheets'] = false;
}
FD::page()->end($options);
return $output;
}
示例4: display
/**
* Displays the application output in the canvas.
*
* @since 1.0
* @access public
* @param int The user id that is currently being viewed.
*/
public function display($uid = null, $docType = null)
{
$event = FD::event($uid);
// Get the article item
$news = FD::table('EventNews');
$news->load($this->input->get('newsId', 0, 'int'));
// Check if the user is really allowed to view this item
if (!$event->canViewItem()) {
return $this->redirect($event->getPermalink(false));
}
// Get the author of the article
$author = FD::user($news->created_by);
// Get the url for the article
$url = FRoute::apps(array('layout' => 'canvas', 'customView' => 'item', 'uid' => $event->getAlias(), 'type' => SOCIAL_TYPE_EVENT, 'id' => $this->app->getAlias(), 'articleId' => $news->id), false);
// Apply comments for the article
$comments = FD::comments($news->id, 'news', 'create', SOCIAL_APPS_GROUP_EVENT, array('url' => $url));
// Apply likes for the article
$likes = FD::likes()->get($news->id, 'news', 'create', SOCIAL_APPS_GROUP_EVENT);
// Set the page title
FD::page()->title($news->get('title'));
// Retrieve the params
$params = $this->app->getParams();
$this->set('app', $this->app);
$this->set('params', $params);
$this->set('event', $event);
$this->set('likes', $likes);
$this->set('comments', $comments);
$this->set('author', $author);
$this->set('news', $news);
echo parent::display('canvas/item');
}
示例5: display
/**
* Displays the application output in the canvas.
*
* @since 1.2
* @access public
* @param int The user id that is currently being viewed.
*/
public function display($groupId = null, $docType = null)
{
$group = FD::group($groupId);
// Check if the viewer is allowed here.
if (!$group->canViewItem()) {
return $this->redirect($group->getPermalink(false));
}
// Get app params
$params = $this->app->getParams();
// Load the milestone
$id = JRequest::getInt('milestoneId');
$milestone = FD::table('Milestone');
$milestone->load($id);
FD::page()->title(JText::_('APP_GROUP_TASKS_TITLE_CREATE_MILESTONE'));
if ($id && $milestone->id) {
FD::page()->title(JText::_('APP_GROUP_TASKS_TITLE_EDITING_MILESTONE'));
}
// Get a list of members from the group
$groupModel = FD::model('Groups');
$members = $groupModel->getMembers($group->id);
$this->set('members', $members);
$this->set('milestone', $milestone);
$this->set('params', $params);
$this->set('group', $group);
echo parent::display('views/form');
}
示例6: getInput
protected function getInput()
{
FD::language()->loadAdmin();
FD::language()->loadSite();
FD::page()->start();
JFactory::getDocument()->addStylesheet(rtrim(JURI::root(), '/') . '/administrator/components/com_easysocial/themes/default/styles/style.css');
$theme = FD::themes();
$label = (string) $this->element['label'];
$name = (string) $this->name;
$title = JText::_('COM_EASYSOCIAL_JFIELD_SELECT_EVENT');
if ($this->value) {
$id = explode(':', $this->value);
$id = $id[0];
$group = FD::group($id);
$title = $group->getName();
}
$theme->set('name', $name);
$theme->set('id', $this->id);
$theme->set('value', $this->value);
$theme->set('label', $label);
$theme->set('title', $title);
$output = $theme->output('admin/jfields/event');
// We do not want to process stylesheets on Joomla 2.5 and below.
$options = array();
if (FD::version()->getVersion() < 3) {
$options['processStylesheets'] = false;
}
FD::page()->end($options);
return $output;
}
示例7: display
public function display()
{
// Get the configuration objects
$config = FD::config();
$jConfig = FD::config('joomla');
// Get the stream library
$stream = FD::stream();
$stream->get();
// Get the result in an array form
$result = $stream->toArray();
// Set the document properties
$doc = JFactory::getDocument();
$doc->link = FRoute::dashboard();
FD::page()->title(JText::_('COM_EASYSOCIAL_STREAM_FEED_TITLE'));
$doc->setDescription(JText::sprintf('COM_EASYSOCIAL_STREAM_FEED_DESC', $jConfig->getValue('sitename')));
if ($result) {
$useEmail = $jConfig->getValue('feed_email');
foreach ($result as $row) {
$item = new JFeedItem();
$item->title = $row->title;
$item->link = FRoute::stream(array('id' => $row->uid));
$item->description = $row->content;
$item->date = $row->created->toMySQL();
$item->author = $row->actor->getName();
if ($useEmail != 'none') {
$item->authorEmail = $jConfig->getValue('mailfrom');
if ($useEmail == 'author') {
$item->authorEmail = $row->actor->email;
}
}
$doc->addItem($item);
}
}
}
示例8: getInput
protected function getInput()
{
// Load the language file.
FD::language()->loadAdmin();
// Render the headers
FD::page()->start();
$theme = FD::themes();
$label = (string) $this->element['label'];
$name = (string) $this->name;
$title = JText::_('COM_EASYSOCIAL_JFIELD_SELECT_PROFILE');
if ($this->value) {
$profile = FD::table('Profile');
$profile->load($this->value);
$title = $profile->get('title');
}
$theme->set('name', $name);
$theme->set('id', $this->id);
$theme->set('value', $this->value);
$theme->set('label', $label);
$theme->set('title', $title);
$output = $theme->output('admin/jfields/profile');
// We do not want to process stylesheets on Joomla 2.5 and below.
$options = array();
if (FD::version()->getVersion() < 3) {
$options['processStylesheets'] = false;
}
FD::page()->end($options);
return $output;
}
示例9: display
/**
* Displays the application output in the canvas.
*
* @since 1.0
* @access public
* @param int The user id that is currently being viewed.
*/
public function display($uid = null, $docType = null)
{
$group = FD::group($uid);
$editor = JFactory::getEditor();
// Only allow group admin to create or edit news
if (!$group->isAdmin() && !$this->my->isSiteAdmin()) {
FD::info()->set(false, JText::_('COM_EASYSOCIAL_GROUPS_ONLY_MEMBER_ARE_ALLOWED'), SOCIAL_MSG_ERROR);
return $this->redirect($group->getPermalink(false));
}
$id = JRequest::getInt('newsId');
$news = FD::table('GroupNews');
$news->load($id);
FD::page()->title(JText::_('APP_GROUP_NEWS_FORM_UPDATE_PAGE_TITLE'));
// Determine if this is a new record or not
if (!$id) {
$news->comments = true;
FD::page()->title(JText::_('APP_GROUP_NEWS_FORM_CREATE_PAGE_TITLE'));
}
// Get app params
$params = $this->app->getParams();
$this->set('params', $params);
$this->set('news', $news);
$this->set('editor', $editor);
$this->set('group', $group);
echo parent::display('canvas/form');
}
示例10: display
/**
* Responsible to display the generic login form.
*
* @since 1.0
* @access public
*/
public function display($tpl = null)
{
$my = FD::user();
// If user is already logged in, they should not see this page.
if ($my->id > 0) {
return $this->redirect(FRoute::dashboard(array(), false));
}
// Add page title
FD::page()->title(JText::_('COM_EASYSOCIAL_LOGIN_PAGE_TITLE'));
// Add breadcrumb
FD::page()->breadcrumb(JText::_('COM_EASYSOCIAL_LOGIN_PAGE_BREADCRUMB'));
// Facebook codes.
$facebook = FD::oauth('Facebook');
$config = FD::config();
$loginMenu = $config->get('general.site.login');
// Get any callback urls.
$return = FD::getCallback();
// If return value is empty, always redirect back to the dashboard
if (!$return) {
// Determine if there's a login redirection
$urlFromCaller = FD::input()->getVar('return', '');
if ($urlFromCaller) {
$return = $urlFromCaller;
} else {
if ($loginMenu != 'null') {
$return = FRoute::getMenuLink($loginMenu);
} else {
$return = FRoute::dashboard(array(), false);
}
$return = base64_encode($return);
}
} else {
$return = base64_encode($return);
}
if ($config->get('registrations.enabled')) {
$profileId = $config->get('registrations.mini.profile', 'default');
if ($profileId === 'default') {
$profileId = Foundry::model('profiles')->getDefaultProfile()->id;
}
$options = array('visible' => SOCIAL_PROFILES_VIEW_MINI_REGISTRATION, 'profile_id' => $profileId);
$fieldsModel = Foundry::model('fields');
$fields = $fieldsModel->getCustomFields($options);
if (!empty($fields)) {
FD::language()->loadAdmin();
$fieldsLib = FD::fields();
$session = JFactory::getSession();
$registration = FD::table('Registration');
$registration->load($session->getId());
$data = $registration->getValues();
$args = array(&$data, &$registration);
$fieldsLib->trigger('onRegisterMini', SOCIAL_FIELDS_GROUP_USER, $fields, $args);
$this->set('fields', $fields);
}
}
$this->set('return', $return);
$this->set('facebook', $facebook);
return parent::display('site/login/default');
}
示例11: __construct
public function __construct($params)
{
$this->params = $params;
// Process scripts
$page = FD::page();
$page->processScripts();
// Process styling
$doc = FD::document();
$doc->init();
}
示例12: setBreadcrumbs
public function setBreadcrumbs($layout)
{
// Set the link to the groups
FD::page()->breadcrumb($this->group->getName(), FRoute::groups(array('layout' => 'item', 'id' => $this->group->getAlias())));
if ($layout == 'item') {
FD::page()->breadcrumb($this->album->get('title'), $this->album->getPermalink());
}
// Set the albums breadcrumb
FD::page()->breadcrumb($this->getPageTitle($layout, false));
}
示例13: setBreadcrumbs
public function setBreadcrumbs($layout)
{
if ($layout == 'item') {
FD::page()->breadcrumb(JText::_('COM_EASYSOCIAL_PAGE_TITLE_ALBUMS'), FRoute::albums());
FD::page()->breadcrumb($this->album->get('title'), $this->album->getPermalink());
FD::page()->breadcrumb($this->photo->get('title'));
}
if ($layout == 'form') {
FD::page()->breadcrumb(JText::_('COM_EASYSOCIAL_PAGE_TITLE_ALBUMS'), FRoute::albums());
FD::page()->breadcrumb($this->album->get('title'), $this->album->getPermalink());
FD::page()->breadcrumb($this->photo->get('title'), $this->photo->getPermalink());
FD::page()->breadcrumb(JText::_('Editing photo'));
}
}
示例14: display
/**
* Displays the application output in the canvas.
*
* @since 1.0
* @access public
* @param int The user id that is currently being viewed.
*/
public function display($uid = null, $docType = null)
{
FD::requireLogin();
$event = FD::event($uid);
if (!$event->canViewItem()) {
return $this->redirect($event->getPermalink(false));
}
// Load up the app params
$params = $this->app->getParams();
// Get the discussion item
$id = $this->input->get('discussionId', 0, 'int');
$discussion = FD::table('Discussion');
$discussion->load($id);
// Get the author of the article
$author = FD::user($discussion->created_by);
// Get the url for the article
$url = FRoute::apps(array('layout' => 'canvas', 'customView' => 'item', 'uid' => $event->getAlias(), 'type' => SOCIAL_TYPE_EVENT, 'id' => $this->app->getAlias(), 'discussionId' => $discussion->id), false);
// Set the page title
FD::page()->title($discussion->get('title'));
// Increment the hits for this discussion item
$discussion->addHit();
// Get a list of other news
$model = FD::model('Discussions');
$replies = $model->getReplies($discussion->id, array('ordering' => 'created'));
$participants = $model->getParticipants($discussion->id);
// Get the answer
$answer = false;
if ($discussion->answer_id) {
$answer = FD::table('Discussion');
$answer->load($discussion->answer_id);
$answer->author = FD::user($answer->created_by);
}
// Determines if we should allow file sharing
$access = $event->getAccess();
$files = $access->get('files.enabled', true);
$this->set('app', $this->app);
$this->set('files', $files);
$this->set('params', $params);
$this->set('answer', $answer);
$this->set('participants', $participants);
$this->set('discussion', $discussion);
$this->set('event', $event);
$this->set('replies', $replies);
$this->set('author', $author);
echo parent::display('canvas/item');
}
示例15: display
/**
* Displays the application output in the canvas.
*
* @since 1.0
* @access public
* @param int The user id that is currently being viewed.
*/
public function display($uid = null, $docType = null)
{
$group = FD::group($uid);
if (!$group->isMember() && !$this->my->isSiteAdmin()) {
FD::info()->set(false, JText::_('COM_EASYSOCIAL_GROUPS_ONLY_MEMBER_ARE_ALLOWED'), SOCIAL_MSG_ERROR);
return $this->redirect($group->getPermalink(false));
}
// Set the page title
FD::page()->title(JText::_('APP_GROUP_DISCUSSIONS_PAGE_TITLE_CREATE'));
// Get the discussion item
$discussion = FD::table('Discussion');
// Determines if we should allow file sharing
$access = $group->getAccess();
$files = $access->get('files.enabled', true);
$this->set('files', $files);
$this->set('discussion', $discussion);
$this->set('group', $group);
echo parent::display('canvas/form');
}