• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP FRoute类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中FRoute的典型用法代码示例。如果您正苦于以下问题:PHP FRoute类的具体用法?PHP FRoute怎么用?PHP FRoute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了FRoute类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: 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');
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:38,代码来源:view.html.php


示例2: revoke

 /**
  * Post processing once a user's access has been revoked
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function revoke()
 {
     FD::info()->set($this->getMessage());
     $url = FRoute::profile(array('layout' => 'edit'), false);
     $this->redirect($url);
     $this->close();
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:15,代码来源:view.html.php


示例3: getRedirectionUrl

 /**
  * Retrieves the redirection url for sign in / sign out.
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function getRedirectionUrl($menuId)
 {
     $menu = JFactory::getApplication()->getMenu();
     $menuItem = $menu->getItem($menuId);
     // Set the default return URL.
     $return = FRoute::dashboard(array(), false);
     if ($menuItem) {
         if ($menuItem->component != 'com_easysocial') {
             if (strpos($menuItem->link, '?') > 0) {
                 $return = JRoute::_($menuItem->link . '&Itemid=' . $menuItem->id, false);
             } else {
                 $return = JRoute::_($menuItem->link . '?Itemid=' . $menuItem->id, false);
             }
             // If the logout return is null, it means the menu item is on the home page.
             if (!$return || isset($menuItem->home) && $menuItem->home) {
                 $return = JURI::root();
             }
         }
         if ($menuItem->component == 'com_easysocial') {
             $view = isset($menuItem->query['view']) ? $menuItem->query['view'] : '';
             if ($view) {
                 $queries = $menuItem->query;
                 unset($queries['option']);
                 unset($queries['view']);
                 $arguments = array($queries, false);
                 $return = call_user_func_array(array('FRoute', $view), $arguments);
             }
         }
     }
     return $return;
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:39,代码来源:toolbar.php


示例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($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');
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:41,代码来源:view.html.php


示例5: route

 /**
  * Redirects a notification item to the intended location
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function route()
 {
     // The user needs to be logged in to access notifications
     FD::requireLogin();
     // Get the notification id
     $id = $this->input->get('id', 0, 'int');
     $table = FD::table('Notification');
     $table->load($id);
     // Default redirection URL
     $redirect = FRoute::dashboard(array(), false);
     if (!$id || !$table->id) {
         $this->info->set(JText::_('COM_EASYSOCIAL_NOTIFICATIONS_INVALID_ID_PROVIDED'), SOCIAL_MSG_ERROR);
         return $this->redirect($redirect);
     }
     // Ensure that the viewer really owns this item
     if ($table->target_id != $this->my->id) {
         $this->info->set(JText::_('COM_EASYSOCIAL_NOTIFICATIONS_NOT_ALLOWED'), SOCIAL_MSG_ERROR);
         return $this->redirect($redirect);
     }
     // Mark the notification item as read
     $table->markAsRead();
     // Ensure that all & are replaced with &
     $url = str_ireplace('&', '&', $table->url);
     $redirect = FRoute::_($url, false);
     $this->redirect($redirect);
     $this->close();
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:35,代码来源:view.html.php


示例6: 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);
         }
     }
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:34,代码来源:view.feed.php


示例7: route

 /**
  * Redirects a notification item to the intended location
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function route()
 {
     // The user needs to be logged in to access notifications
     FD::requireLogin();
     // Check for user profile completeness
     FD::checkCompleteProfile();
     $id = JRequest::getInt('id');
     $table = FD::table('Notification');
     $table->load($id);
     if (!$id || !$table->id) {
         FD::info()->set(JText::_('COM_EASYSOCIAL_NOTIFICATIONS_INVALID_ID_PROVIDED'), SOCIAL_MSG_ERROR);
         return $this->redirect(FRoute::dashboard(array(), false));
     }
     // Check if the user is allowed to view this notification item.
     $my = FD::user();
     if ($table->target_id != $my->id) {
         FD::info()->set(JText::_('COM_EASYSOCIAL_NOTIFICATIONS_NOT_ALLOWED'), SOCIAL_MSG_ERROR);
         return $this->redirect(FRoute::dashboard(array(), false));
     }
     // Mark the notification item as read
     $table->markAsRead();
     // Ensure that all & are replaced with &
     $url = str_ireplace('&', '&', $table->url);
     $this->redirect(FRoute::_($url, false));
     $this->close();
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:34,代码来源:view.html.php


示例8: create_report

 public function create_report()
 {
     $app = JFactory::getApplication();
     $msg = $app->input->get('message', '', 'STRING');
     $title = $app->input->get('user_title', '', 'STRING');
     $item_id = $app->input->get('itemId', 0, 'INT');
     $log_user = $this->plugin->get('user')->id;
     $data = array();
     $data['message'] = $msg;
     $data['uid'] = $item_id;
     $data['type'] = 'stream';
     $data['title'] = $title;
     $data['extension'] = 'com_easysocial';
     //build share url use for share post through app
     $sharing = FD::get('Sharing', array('url' => FRoute::stream(array('layout' => 'item', 'id' => $item_id, 'external' => true, 'xhtml' => true)), 'display' => 'dialog', 'text' => JText::_('COM_EASYSOCIAL_STREAM_SOCIAL'), 'css' => 'fd-small'));
     $url = $sharing->url;
     $data['url'] = $url;
     // Get the reports model
     $model = FD::model('Reports');
     // Determine if this user has the permissions to submit reports.
     $access = FD::access();
     // Determine if this user has exceeded the number of reports that they can submit
     $total = $model->getCount(array('created_by' => $log_user));
     if ($access->exceeded('reports.limit', $total)) {
         $final_result['message'] = "Limit exceeds";
         $final_result['status'] = true;
         return $final_result;
     }
     // Create the report
     $report = FD::table('Report');
     $report->bind($data);
     // Set the creator id.
     $report->created_by = $log_user;
     // Set the default state of the report to new
     $report->state = 0;
     // Try to store the report.
     $state = $report->store();
     // If there's an error, throw it
     if (!$state) {
         $final_result['message'] = "Can't save report";
         $final_result['status'] = true;
         return $final_result;
     }
     // @badge: reports.create
     // Add badge for the author when a report is created.
     $badge = FD::badges();
     $badge->log('com_easysocial', 'reports.create', $log_user, JText::_('COM_EASYSOCIAL_REPORTS_BADGE_CREATED_REPORT'));
     // @points: reports.create
     // Add points for the author when a report is created.
     $points = FD::points();
     $points->assign('reports.create', 'com_easysocial', $log_user);
     // Determine if we should send an email
     $config = FD::config();
     if ($config->get('reports.notifications.moderators')) {
         $report->notify();
     }
     $final_result['message'] = "Report logged successfully!";
     $final_result['status'] = true;
     return $final_result;
 }
开发者ID:yalive,项目名称:com_api-plugins,代码行数:60,代码来源:report.php


示例9: onDisplay

 /**
  * Responsible to output the html codes that is displayed to
  * a user when their profile is viewed.
  *
  * @since	1.0
  * @access	public
  */
 public function onDisplay($user)
 {
     $value = $this->value;
     if (!$value) {
         return;
     }
     if (!$this->allowedPrivacy($user)) {
         return;
     }
     // If there's no http:// or https:// , automatically append http://
     if (stristr($value, 'http://') === false && stristr($value, 'https://') === false) {
         $value = 'http://' . $value;
     }
     // Push vars to the theme
     $this->set('value', $this->escape($value));
     // linkage to advanced search page.
     $field = $this->field;
     if ($field->searchable) {
         $params = array('layout' => 'advanced');
         $params['criterias[]'] = $field->unique_key . '|' . $field->element;
         $params['operators[]'] = 'contain';
         $params['conditions[]'] = $this->escape($this->value);
         $advsearchLink = FRoute::search($params);
         $this->set('advancedsearchlink', $advsearchLink);
     }
     return $this->display();
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:34,代码来源:url.php


示例10: getTitle

 /**
  * Retrieve the title of the stream
  *
  * @since	1.2
  * @access	public
  * @param	string
  * @return
  */
 public function getTitle()
 {
     // Get the actors
     $actors = $this->item->actors;
     // Get the source id
     $sourceId = $this->share->uid;
     // Load the stream
     $stream = FD::table('Stream');
     $stream->load($sourceId);
     // If stream cannot be loaded, skip this altogether
     if (!$stream->id) {
         return;
     }
     // Build the permalink to the stream item
     $link = FRoute::stream(array('layout' => 'item', 'id' => $sourceId));
     // Get the target user.
     $target = FD::user($stream->actor_id);
     $actor = $actors[0];
     $theme = FD::get('Themes');
     $theme->set('actor', $actor);
     $theme->set('link', $link);
     $theme->set('target', $target);
     $title = $theme->output('apps/group/shares/streams/stream/title');
     return $title;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:33,代码来源:stream.php


示例11: getRegistrationURL

 public function getRegistrationURL()
 {
     $usersConfig = JComponentHelper::getParams('com_users');
     if ($usersConfig->get('allowUserRegistration')) {
         return FRoute::registration();
     }
     return null;
 }
开发者ID:Ruud68,项目名称:Kunena-Forum,代码行数:8,代码来源:login.php


示例12: afterCategory

 /**
  * Display user photos on the side bar
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function afterCategory($group)
 {
     $app = $this->getApp();
     $permalink = FRoute::groups(array('layout' => 'item', 'id' => $group->getAlias(), 'appId' => $app->getAlias()));
     $theme = FD::themes();
     $theme->set('permalink', $permalink);
     $theme->set('group', $group);
     echo $theme->output('themes:/apps/group/members/widgets/header');
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:17,代码来源:view.html.php


示例13: form

 /**
  * Responsible to display the generic login form via ajax
  *
  * @since	1.0
  * @access	public
  */
 public function form($tpl = null)
 {
     $ajax = FD::ajax();
     $my = FD::user();
     // If user is already logged in, they should not see this page.
     if ($my->id > 0) {
         $this->setMessage(JText::_('COM_EASYSOCIAL_LOGIN_ALREADY_LOGGED_IN'), SOCIAL_MSG_ERROR);
         return $ajax->reject($this->getMessage());
     }
     // Facebook codes.
     $facebook = FD::oauth('Facebook');
     // Get any callback urls.
     $return = FD::getCallback();
     // If return value is empty, always redirect back to the dashboard
     if (!$return) {
         $return = FRoute::dashboard(array(), false);
     }
     // Determine if there's a login redirection
     $config = FD::config();
     $loginMenu = $config->get('general.site.login');
     if ($loginMenu != 'null') {
         $return = FD::get('toolbar')->getRedirectionUrl($loginMenu);
     }
     $return = base64_encode($return);
     $this->set('return', $return);
     $this->set('facebook', $facebook);
     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 = FD::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);
         }
     }
     $contents = parent::display('site/login/dialog.login');
     return $ajax->resolve($contents);
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:55,代码来源:view.ajax.php


示例14: preview

 public function preview()
 {
     $fileid = JRequest::getInt('uid');
     if (empty($fileid)) {
         FD::info()->set((object) array('message' => JText::_('PLG_FIELDS_FILE_ERROR_INVALID_FILE_ID'), 'type' => SOCIAL_MSG_ERROR));
         $this->redirect(FRoute::dashboard(array(), false));
     }
     $file = FD::table('file');
     $state = $file->load($fileid);
     if (!$state || !$file->hasPreview() || !$this->params->get('allow_preview')) {
         FD::info()->set((object) array('message' => JText::_('PLG_FIELDS_FILE_ERROR_PREVIEW_NOT_ALLOWED'), 'type' => SOCIAL_MSG_ERROR));
         $this->redirect(FRoute::dashboard(array(), false));
     }
     $file->preview();
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:15,代码来源:file.php


示例15: format

 public function format(&$notes)
 {
     if (!$notes) {
         return;
     }
     // Since this is the dashboard view, we may freely use the current user.
     $my = FD::user();
     $stream = FD::stream();
     foreach ($notes as &$note) {
         $comments = FD::comments($note->id, 'notes', 'create', SOCIAL_APPS_GROUP_USER, array('url' => FRoute::apps(array('layout' => 'canvas', 'userid' => $my->getAlias(), 'cid' => $note->id))));
         $likes = FD::likes($note->id, 'notes', 'create', SOCIAL_APPS_GROUP_USER);
         $options = array('comments' => $comments, 'likes' => $likes);
         $note->actions = $stream->getActions($options);
     }
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:15,代码来源:view.html.php


示例16: __construct

 public function __construct($config = array())
 {
     // We want to allow child classes to easily access theme configurations on the view
     $this->themeConfig = FD::themes()->getConfig();
     parent::__construct($config);
     // Check if there is a method isFeatureEnabled exists. If it does, we should do a check all the time.
     if (method_exists($this, 'isFeatureEnabled')) {
         $this->isFeatureEnabled();
     }
     // // When the user doesn't have community access, ensure that they can only view selected views.
     if (!$this->my->hasCommunityAccess()) {
         // Get the current view
         $view = $this->getName();
         $layout = $this->input->get('layout', '', 'cmd');
         // If this is an ajax call, we need to allow some ajax calls to go through
         $allowedAjaxNamespaces = array('site/views/profile/showFormError');
         if ($this->doc->getType() == 'ajax') {
             $namespace = $this->input->get('namespace', '', 'default');
             // If this is an ajax call, and the namespace is valid, skip checking below
             if (in_array($namespace, $allowedAjaxNamespaces)) {
                 return;
             }
         }
         // Define allowed views and layout
         $allowedViews = array('profile');
         $allowedLayouts = array('edit');
         // views that we should redirect the user to profile edit page.
         $redirectView = array('dashboard', 'profile');
         // User should be allowed to logout from the site
         $isLogout = $this->input->get('controller', '', 'cmd') == 'account' && $this->input->get('task', '', 'cmd') == 'logout' || $this->input->get('view', '', 'cmd') == 'login' && $this->input->get('layout', '', 'cmd') == 'logout';
         // user should be allowed to save their profile details on the site.
         $isProfileSaving = $this->input->get('controller', '', 'cmd') == 'profile' && $this->input->get('task', '', 'cmd') == 'save';
         if (in_array($view, $redirectView) && !$layout && !$isLogout && !$isProfileSaving) {
             // we need to redirect the user to profile edit page.
             $this->redirect(FRoute::profile(array('layout' => 'edit'), false));
             return;
         }
         // Ensure that the restricted user is not able to view other views
         if (!in_array($view, $allowedViews) && !$isLogout && !$isProfileSaving) {
             return JError::raiseError(500, JText::_('COM_EASYSOCIAL_NOT_ALLOWED_TO_VIEW_SECTION'));
         }
         // Ensure that the user is only viewing the allowed layouts
         if (!in_array($layout, $allowedLayouts) && !$isLogout && !$isProfileSaving) {
             return JError::raiseError(500, JText::_('COM_EASYSOCIAL_NOT_ALLOWED_TO_VIEW_SECTION'));
         }
     }
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:47,代码来源:views.php


示例17: 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');
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:53,代码来源:view.html.php


示例18: 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($eventId = null, $docType = null)
 {
     // Load up the event
     $event = FD::event($eventId);
     // Get the event params
     $params = $event->getParams();
     // Load up the events model
     $model = FD::model('Events');
     $type = FD::input()->getString('type', 'going');
     $options = array();
     if ($type === 'going') {
         $options['state'] = SOCIAL_EVENT_GUEST_GOING;
     }
     if ($params->get('allowmaybe') && $type === 'maybe') {
         $options['state'] = SOCIAL_EVENT_GUEST_MAYBE;
     }
     if ($params->get('allownotgoingguest') && $type === 'notgoing') {
         $options['state'] = SOCIAL_EVENT_GUEST_NOT_GOING;
     }
     if ($event->isClosed() && $type === 'pending') {
         $options['state'] = SOCIAL_EVENT_GUEST_PENDING;
     }
     if ($type === 'admin') {
         $options['admin'] = 1;
     }
     $this->set('type', $type);
     $guests = $model->getGuests($event->id, $options);
     $pagination = $model->getPagination();
     $this->set('event', $event);
     $this->set('guests', $guests);
     $eventAlias = $event->getAlias();
     $appAlias = $this->app->getAlias();
     $permalinks = array('going' => '', 'notgoing' => '', 'maybe' => '', 'admin' => '', 'pending' => '');
     // Avoid using $filter because it is a FRoute reserved word
     foreach ($permalinks as $key => &$value) {
         $value = FRoute::events(array('layout' => 'item', 'id' => $eventAlias, 'appId' => $appAlias, 'type' => $key));
     }
     $this->set('permalinks', $permalinks);
     $myGuest = $event->getGuest();
     $this->set('myGuest', $myGuest);
     echo parent::display('events/default');
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:49,代码来源:view.html.php


示例19: display

 public function display($tpl = null)
 {
     $fieldid = JRequest::getInt('id');
     $task = JRequest::getWord('task');
     $field = FD::table('field');
     $state = $field->load($fieldid);
     if (!$state) {
         FD::info()->set(JText::_('COM_EASYSOCIAL_FIELDS_INVALID_ID'), SOCIAL_MSG_ERROR);
         $this->redirect(FRoute::dashboard(array(), false));
         $this->close();
     }
     $app = $field->getApp();
     if (!$app) {
         FD::info()->set(JText::sprintf('COM_EASYSOCIAL_FIELDS_APP_DOES_NOT_EXIST', $app->element), SOCIAL_MSG_ERROR);
         $this->redirect(FRoute::dashboard(array(), false));
         $this->close();
     }
     $base = SOCIAL_FIELDS . '/' . $app->group . '/' . $app->element . '/views';
     $classname = 'SocialFieldView' . ucfirst($app->group) . ucfirst($app->element);
     if (!class_exists($classname)) {
         if (!JFile::exists($base . '/' . $app->element . '.php')) {
             FD::info()->set(JText::sprintf('COM_EASYSOCIAL_FIELDS_VIEW_DOES_NOT_EXIST', $app->element), SOCIAL_MSG_ERROR);
             $this->redirect(FRoute::dashboard(array(), false));
             $this->close();
         }
         require_once $base . '/' . $app->element . '.php';
     }
     if (!class_exists($classname)) {
         FD::info()->set(JText::sprintf('COM_EASYSOCIAL_FIELDS_CLASS_DOES_NOT_EXIST', $classname), SOCIAL_MSG_ERROR);
         $this->redirect(FRoute::dashboard(array(), false));
         $this->close();
     }
     $view = new $classname($app->group, $app->element);
     if (!is_callable(array($view, $task))) {
         FD::info()->set(JText::sprintf('COM_EASYSOCIAL_FIELDS_METHOD_DOES_NOT_EXIST', $task), SOCIAL_MSG_ERROR);
         $this->redirect(FRoute::dashboard(array(), false));
         $this->close();
     }
     $view->init($field);
     return $view->{$task}();
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:41,代码来源:view.html.php


示例20: load

 public function load($options = array())
 {
     if (!isset($options['url'])) {
         $options['url'] = FRoute::_(JRequest::getURI());
     }
     $this->url = $options['url'];
     // If display mode is specified, set it accordingly.
     if (isset($options['display'])) {
         $this->display = $options['display'];
     }
     // Set the default text to our own text.
     $this->text = JText::_('COM_EASYSOCIAL_SHARING_SHARE_THIS');
     // If text is provided, allow user to override the default text.
     if (isset($options['text'])) {
         $this->text = $options['text'];
     }
     // Obey settings
     $config = FD::config();
     foreach (self::$availableVendors as $vendor) {
         if ($config->get('sharing.vendors.' . $vendor)) {
             $this->vendors[] = $vendor;
         }
     }
     // Force exclude
     if (isset($options['exclude'])) {
         $this->vendors = array_diff($this->vendors, self::$availableVendors);
         unset($options['exclude']);
     }
     // Force include
     if (isset($options['include'])) {
         $notInList = array_diff($options['include'], $this->vendors);
         $this->vendors = array_merge($this->vendors, $options['include']);
         unset($options['include']);
     }
     if (isset($options['css'])) {
         $this->css = $options['css'];
     }
     $this->options = $options;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:39,代码来源:sharing.php



注:本文中的FRoute类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP FSFile类代码示例发布时间:2022-05-23
下一篇:
PHP FPDI类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap