本文整理汇总了PHP中FRoute::events方法的典型用法代码示例。如果您正苦于以下问题:PHP FRoute::events方法的具体用法?PHP FRoute::events怎么用?PHP FRoute::events使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FRoute
的用法示例。
在下文中一共展示了FRoute::events方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Deletes a discussion
*
* @since 1.2
* @access public
*/
public function delete()
{
// Check for request forgeries
FD::checkToken();
// Ensure that the user is logged in.
FD::requireLogin();
// Get the discussion object
$id = $this->input->get('id', 0, 'int');
$discussion = FD::table('Discussion');
$discussion->load($id);
// Get the event object
$eventId = $this->input->get('eventId', 0, 'int');
$event = FD::event($eventId);
if (!$event->isAdmin() && $discussion->created_by != $this->my->id && !$this->my->isSiteAdmin()) {
return $this->redirect($event->getPermalink());
}
// Delete the discussion
$discussion->delete();
// @points: events.discussion.delete
// Deduct points from the discussion creator when the discussion is deleted
$points = FD::points();
$points->assign('events.discussion.delete', 'com_easysocial', $discussion->created_by);
FD::info()->set(JText::_('APP_EVENT_DISCUSSIONS_DISCUSSION_DELETED_SUCCESS'));
// After deleting, we want to redirect to the discussions listing
$url = FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'appId' => $this->getApp()->id), false);
// Perform a redirection
$this->redirect($url);
}
示例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($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');
}
示例3: getPermalink
/**
* Returns the permalink to the page of this event, depending on the layout.
*
* @author Jason Rey <jasonrey@stackideas.com>
* @since 1.3
* @access public
* @param boolean $xhtml True if permalink is required to be in xhtml format.
* @param boolean $external True if permalink is required to be in external format.
* @param string $layout The layout of the event page.
* @param boolean $sef True if permalink is required to be a SEF link.
* @return string The permalink of this event.
*/
public function getPermalink($xhtml = true, $external = false, $layout = 'item', $sef = true)
{
$options = array('id' => $this->getAlias(), 'layout' => $layout, 'external' => $external, 'sef' => $sef);
return FRoute::events($options, $xhtml);
}
示例4:
<div class="pull-left widget-title">
<?php
echo JText::_('APP_USER_EVENTS_WIDGET_EVENTS');
?>
</div>
<span class="widget-label">(<?php
echo $total;
?>
)</span>
<?php
if ($this->my->id == $user->id) {
?>
<div class="pull-right fd-small">
<a href="<?php
echo FRoute::events(array('layout' => 'create'));
?>
">
<i class="icon-es-add"></i><?php
echo JText::_('COM_EASYSOCIAL_NEW_EVENT');
?>
</a>
</div>
<?php
}
?>
</div>
<div class="es-widget-body">
<?php
if ($total > 0) {
?>
示例5:
echo $event->getCategory()->id;
?>
" href="<?php
echo FRoute::events(array('layout' => 'category', 'id' => $event->getCategory()->getAlias()));
?>
">
<?php
echo $event->getCategory()->get('title');
?>
</a>
</span>
<span>
<i class="ies-users"></i>
<a href="<?php
echo FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'appId' => $guestApp->getAlias()));
?>
"><?php
echo JText::sprintf(FD::string()->computeNoun('COM_EASYSOCIAL_EVENTS_GUESTS', $event->getTotalGuests()), $event->getTotalGuests());
?>
</a>
</span>
</div>
</div>
</div>
<?php
if ($guest->isParticipant() && !$guest->isPending() || !$guest->isParticipant() && !$event->isOver()) {
?>
<div class="list-media-footer fd-cf" data-guest-state-wrap data-id="<?php
echo $event->id;
?>
示例6: foreach
<p><?php
echo JText::_('COM_EASYSOCIAL_EVENTS_SELECT_CATEGORY_INFO');
?>
</p>
</div>
<hr />
<div class="es-create-category-select">
<div class="btn-group" data-bs-toggle="radio-buttons">
<?php
foreach ($categories as $category) {
?>
<div class="btn-wrap">
<a href="<?php
echo FRoute::events(array_merge($categoryRouteBaseOptions, array('category_id' => $category->id)));
?>
" class="btn btn-es">
<img src="<?php
echo $category->getAvatar(SOCIAL_AVATAR_SQUARE);
?>
" class="avatar" />
<span><?php
echo $category->get('title');
?>
</span>
<div class="es-description fd-small es-muted mt-5"><?php
echo $category->get('description');
?>
</div>
</a>
示例7:
echo $this->html('string.truncater', $event->getDescription(), 250);
?>
</p>
<div class="stream-apps-meta mt-5">
<i class="ies-calendar mr-5"></i>
<?php
echo $event->getStartEndDisplay();
?>
</div>
<ul class="stream-apps-meta ml-0 pl-0">
<li>
<span>
<a href="<?php
echo FRoute::events(array('layout' => 'category', 'id' => $event->getCategory()->getAlias()));
?>
">
<i class="ies-database"></i> <?php
echo $event->getCategory()->get('title');
?>
</a>
</span>
</li>
<li>
<span>
<a href="<?php
echo FRoute::albums(array('uid' => $event->id, 'type' => SOCIAL_TYPE_EVENT));
?>
">
<i class="ies-picture"></i> <?php
示例8: deleteFilter
public function deleteFilter($eventId)
{
$ajax = FD::ajax();
FD::requireLogin();
FD::info()->set($this->getMessage());
$event = FD::event($eventId);
$url = FRoute::events(array('layout' => 'item', 'id' => $event->getAlias()), false);
return $ajax->redirect($url);
}
示例9: createNotification
/**
* Creates a new notification item
*
* @since 1.3
* @access public
* @param string $action The action associated with the notification.
*/
public function createNotification($action)
{
// To prevent unexpected callees in creating notification
$allowed = array('going', 'maybe', 'notgoing', 'makeadmin', 'revokeadmin', 'approve', 'reject', 'request', 'withdraw', 'remove');
if (!in_array($action, $allowed)) {
return;
}
// Actor is the guest for:
// going
// maybe
// notgoing
// request
// withdraw
$actor = FD::user($this->uid);
// Actor is the current logged in user for:
// makeadmin
// revokeadmin
// reject
// approve
// remove
if (in_array($action, array('makeadmin', 'revokeadmin', 'reject', 'approve', 'remove'))) {
$actor = FD::user();
}
$event = FD::event($this->cluster_id);
// COM_EASYSOCIAL_EMAILS_EVENT_GUEST_MAKEADMIN_SUBJECT
// COM_EASYSOCIAL_EMAILS_EVENT_GUEST_REVOKEADMIN_SUBJECT
// COM_EASYSOCIAL_EMAILS_EVENT_GUEST_REJECT_SUBJECT
// COM_EASYSOCIAL_EMAILS_EVENT_GUEST_APPROVE_SUBJECT
// COM_EASYSOCIAL_EMAILS_EVENT_GUEST_REMOVE_SUBJECT
// COM_EASYSOCIAL_EMAILS_EVENT_GUEST_GOING_SUBJECT
// COM_EASYSOCIAL_EMAILS_EVENT_GUEST_MAYBE_SUBJECT
// COM_EASYSOCIAL_EMAILS_EVENT_GUEST_NOTGOING_SUBJECT
// COM_EASYSOCIAL_EMAILS_EVENT_GUEST_REQUEST_SUBJECT
// COM_EASYSOCIAL_EMAILS_EVENT_GUEST_WITHDRAW_SUBJECT
// site/event/guest.makeadmin
// site/event/guest.revokeadmin
// site/event/guest.reject
// site/event/guest.approve
// site/event/guest.remove
// site/event/guest.going
// site/event/guest.maybe
// site/event/guest.notgoing
// site/event/guest.request
// site/event/guest.withdraw
$emailOptions = (object) array('title' => 'COM_EASYSOCIAL_EMAILS_EVENT_GUEST_' . strtoupper($action) . '_SUBJECT', 'template' => 'site/event/guest.' . strtolower($action), 'event' => $event->getName(), 'eventAvatar' => $event->getAvatar(), 'eventLink' => $event->getPermalink(false, true), 'response' => $action, 'actor' => $actor->getName(), 'actorLink' => $actor->getPermalink(false, true), 'actorAvatar' => $actor->getAvatar());
$systemOptions = (object) array('uid' => $this->id, 'title' => '', 'actor_id' => $actor->id, 'context_ids' => $this->cluster_id, 'context_type' => SOCIAL_TYPE_EVENT, 'type' => 'events', 'url' => $event->getPermalink(false, false, 'item', false), 'image' => $event->getAvatar(), 'response' => $action, 'eventId' => $event->id);
// Special case for request
// If action is request, we use a different permalink instead so that the generated system notification is pointing to the guest app
// Request email also needs to point to the guest app
if ($action === 'request') {
// Get the guest app first
$guestApp = FD::table('App');
$guestApp->load(array('type' => SOCIAL_TYPE_APPS, 'group' => SOCIAL_TYPE_EVENT, 'element' => 'guests'));
$emailOptions->link = FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'appId' => $guestApp->getAlias(), 'type' => 'pending', 'external' => true));
$systemOptions->url = FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'appId' => $guestApp->getAlias(), 'type' => 'pending', 'sef' => false));
}
$targets = array();
// If action is makeadmin, revokeadmin, reject, approve, remove, then supposed to notify the guest instead
if (in_array($action, array('makeadmin', 'revokeadmin', 'reject', 'approve', 'remove'))) {
$targets[] = $this->uid;
} else {
// Notify the event owner and admins
$targets[] = $event->getCreator()->id;
$admins = $event->getAdmins();
foreach ($admins as $admin) {
$targets[] = $admin->uid;
}
// Remove self, unique it, and reset the targets array
$targets = array_values(array_unique(array_diff($targets, array(FD::user()->id))));
}
// Send notification now
// events.guest.makeadmin
// events.guest.revokeadmin
// events.guest.reject
// events.guest.approve
// events.guest.remove
// events.guest.going
// events.guest.maybe
// events.guest.notgoing
// events.guest.request
// events.guest.withdraw
FD::notify('events.guest.' . $action, $targets, $emailOptions, $systemOptions);
}
示例10: initInfo
public function initInfo()
{
FD::checkToken();
$eventId = JRequest::getInt('eventId');
$event = FD::event($eventId);
if (empty($event) || empty($event->id)) {
$this->view->setMessage(JText::_('COM_EASYSOCIAL_EVENTS_INVALID_EVENT_ID'), SOCIAL_MSG_ERROR);
return $this->view->call(__FUNCTION__);
}
if (!$event->isPublished()) {
$this->view->setMessage(JText::_('COM_EASYSOCIAL_EVENTS_EVENT_UNAVAILABLE'), SOCIAL_MSG_ERROR);
return $this->view->call(__FUNCTION__);
}
$guest = $event->getGuest($this->my->id);
if (!$this->my->isSiteAdmin() && !$event->isOpen() && !$guest->isGuest() && (!$event->isGroupEvent() || $event->isGroupEvent() && !$event->getGroup()->isMember())) {
$this->view->setMessage(JText::_('COM_EASYSOCIAL_EVENTS_NO_ACCESS_TO_EVENT'), SOCIAL_MSG_ERROR);
return $this->view->call(__FUNCTION__);
}
FD::language()->loadAdmin();
$steps = FD::model('Steps')->getSteps($event->category_id, SOCIAL_TYPE_CLUSTERS, SOCIAL_EVENT_VIEW_DISPLAY);
$fieldsLib = FD::fields();
$fieldsLib->init(array('privacy' => false));
$fieldsModel = FD::model('Fields');
$index = 1;
foreach ($steps as $step) {
$step->fields = $fieldsModel->getCustomFields(array('step_id' => $step->id, 'data' => true, 'dataId' => $event->id, 'dataType' => SOCIAL_TYPE_EVENT, 'visible' => SOCIAL_EVENT_VIEW_DISPLAY));
if (!empty($step->fields)) {
$args = array($event);
$fieldsLib->trigger('onDisplay', SOCIAL_FIELDS_GROUP_EVENT, $step->fields, $args);
}
$step->hide = true;
foreach ($step->fields as $field) {
// As long as one of the field in the step has an output, then this step shouldn't be hidden
// If step has been marked false, then no point marking it as false again
// We don't break from the loop here because there is other checking going on
if (!empty($field->output) && $step->hide === true) {
$step->hide = false;
}
}
if ($index === 1) {
$step->url = FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'type' => 'info'), false);
} else {
$step->url = FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'type' => 'info', 'infostep' => $index), false);
}
$step->title = $step->get('title');
$step->active = !$step->hide && $index == 1;
if ($step->active) {
$theme = FD::themes();
$theme->set('fields', $step->fields);
$step->html = $theme->output('site/events/item.info');
}
$step->index = $index;
$index++;
}
return $this->view->call(__FUNCTION__, $steps);
}
示例11: defined
<?php
/**
* @package EasySocial
* @copyright Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* EasySocial is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
?>
<li>
<a href="<?php
echo FRoute::events(array('layout' => 'create', 'group_id' => $group->id));
?>
"><?php
echo JText::_('APP_GROUP_EVENTS_CREATE_EVENT');
?>
</a>
</li>
示例12: foreach
if ($params->get('show_apps', true)) {
?>
<div class="es-event-menu-apps">
<div class="es-title mt-10"><?php
echo JText::_('MOD_EASYSOCIAL_EVENT_MENU_APPLICATIONS');
?>
</div>
<ul class="es-menu-list">
<?php
foreach ($apps as $application) {
?>
<li>
<a href="<?php
echo FRoute::events(array('layout' => 'item', 'id' => $event->getAlias(), 'appId' => $application->getAlias()));
?>
">
<img src="<?php
echo $application->getIcon();
?>
" width="16" class="mr-5" />
<?php
echo $application->get('title');
?>
</a>
</li>
<?php
}
?>
</ul>
示例13:
<?php
if (!empty($activeCategory->description)) {
?>
<p class="fd-small">
<?php
echo $activeCategory->get('description');
?>
</p>
<?php
}
?>
<div class="mt-15">
<a href="<?php
echo FRoute::events(array('layout' => 'category', 'id' => $activeCategory->getAlias()));
?>
" class="btn btn-es-primary btn-sm"><?php
echo JText::_('COM_EASYSOCIAL_EVENTS_VIEW_CATEGORY');
?>
→</a>
</div>
</div>
</div>
<hr />
<?php
}
?>
<?php
示例14:
</a>
<?php
}
}
?>
</div>
<?php
if (!empty($days[$dayNumber])) {
?>
<div class="event-details">
<div class="event-details-title">
<i class="ies-calendar"></i>
<a
href="<?php
echo FRoute::events(array('filter' => 'date', 'date' => $calendar->year . '-' . $calendar->month . '-' . $dayNumberPadded));
?>
"
title="<?php
echo JText::sprintf('COM_EASYSOCIAL_PAGE_TITLE_EVENTS_FILTER_DATE', FD::date($calendar->year . '-' . $calendar->month . '-' . $dayNumberPadded)->format(JText::_('COM_EASYSOCIAL_DATE_DMY')));
?>
"
data-route
data-date="<?php
echo $calendar->year . '-' . $calendar->month . '-' . $dayNumberPadded;
?>
">
<?php
echo FD::date($calendar->year . '-' . $calendar->month . '-' . $dayNumberPadded)->format(JText::_('COM_EASYSOCIAL_DATE_DMY'));
?>
</a>
示例15: foreach
<?php
foreach ($categories as $category) {
?>
<li
data-events-filters-type="category"
data-events-filters-categoryid="<?php
echo $category->id;
?>
"
class="<?php
echo $activeCategory && $activeCategory->id == $category->id ? 'active' : '';
?>
"
>
<a href="<?php
echo FRoute::events(array('categoryid' => $category->getAlias()));
?>
" title="<?php
echo $this->html('string.escape', $category->get('title'));
?>
"><?php
echo $category->get('title');
?>
</a>
<span data-total-events="<?php
echo $category->getTotalEvents();
?>
" class="es-count-no pull-right"><?php
echo $category->getTotalEvents(array('start-after' => $now));
?>
</span>