本文整理汇总了PHP中FRoute::groups方法的典型用法代码示例。如果您正苦于以下问题:PHP FRoute::groups方法的具体用法?PHP FRoute::groups怎么用?PHP FRoute::groups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FRoute
的用法示例。
在下文中一共展示了FRoute::groups方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Deletes a discussion
*
* @since 1.2
* @access public
*/
public function delete()
{
// Check for request forgeriess
FD::checkToken();
// Ensure that the user is logged in.
FD::requireLogin();
// Load up ajax lib
$ajax = FD::ajax();
$id = JRequest::getInt('id');
$groupId = JRequest::getInt('groupId');
$discussion = FD::table('Discussion');
$discussion->load($id);
$my = FD::user();
$group = FD::group($groupId);
if (!$group->isAdmin() && $discussion->created_by != $my->id && !$my->isSiteAdmin()) {
return $this->redirect($group->getPermalink());
}
// Delete the discussion
$discussion->delete();
// @points: groups.discussion.delete
// Deduct points from the discussion creator when the discussion is deleted
$points = FD::points();
$points->assign('groups.discussion.delete', 'com_easysocial', $discussion->created_by);
FD::info()->set(JText::_('APP_GROUP_DISCUSSIONS_DISCUSSION_DELETED_SUCCESS'));
// After deleting, we want to redirect to the discussions listing
$url = FRoute::groups(array('layout' => 'item', 'id' => $group->getAlias(), 'appId' => $this->getApp()->id), false);
// Perform a redirection
$this->redirect($url);
}
示例2: 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');
}
示例3: 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));
}
示例4:
?>
" data-es-provide="tooltip" data-placement="bottom">
<i class="ies-locked"></i> <?php
echo JText::_('COM_EASYSOCIAL_GROUPS_CLOSED_GROUP');
?>
</span>
<?php
}
?>
</h4>
<ul class="stream-apps-meta ml-0 pl-0">
<li>
<span>
<a href="<?php
echo FRoute::groups(array('layout' => 'category', 'id' => $group->getCategory()->getAlias()));
?>
">
<i class="ies-database"></i> <?php
echo $group->getCategory()->get('title');
?>
</a>
</span>
</li>
<li>
<span>
<a href="<?php
echo FRoute::albums(array('uid' => $group->id, 'type' => SOCIAL_TYPE_GROUP));
?>
">
<i class="ies-picture"></i> <?php
示例5: display
public function display($groupId = null, $docType = null)
{
$group = FD::group($groupId);
// Check access
if (!$group->getAccess()->get('events.groupevent', true)) {
return $this->redirect($group->getPermalink(false));
}
// Check if the viewer is allowed here.
if (!$group->canViewItem()) {
return $this->redirect($group->getPermalink(false));
}
$params = $this->app->getParams();
// Retrieve event's model
$model = FD::model('Events');
// Get the start date
$start = $this->input->get('start', 0, 'int');
// Should we include past events?
$includePast = $this->input->get('includePast', 0, 'int');
// Ordering of the events
$ordering = $this->input->get('ordering', 'start', 'string');
// Get featured events
$featuredOptions = array('state' => SOCIAL_STATE_PUBLISHED, 'featured' => true, 'ordering' => 'start', 'limit' => 5, 'limitstart' => $start, 'group_id' => $group->id, 'type' => 'all', 'ordering' => $ordering);
$featuredEvents = $model->getEvents($featuredOptions);
// Default options
$options = array('state' => SOCIAL_STATE_PUBLISHED, 'featured' => false, 'ordering' => 'start', 'limit' => 5, 'limitstart' => $start, 'group_id' => $group->id, 'type' => 'all', 'ordering' => $ordering);
if (empty($includePast)) {
$options['ongoing'] = true;
$options['upcoming'] = true;
}
// Get the events
$events = $model->getEvents($options);
$pagination = $model->getPagination();
$pagination->setVar('option', 'com_easysocial');
$pagination->setVar('view', 'groups');
$pagination->setVar('layout', 'item');
$pagination->setVar('id', $group->getAlias());
$pagination->setVar('appId', $this->app->getAlias());
$hrefs = array();
$routeOptions = array('layout' => 'item', 'id' => $group->getAlias(), 'appId' => $this->app->getAlias());
// We use start as key because order is always start by default, and it is the page default link
$hrefs = array('start' => array('nopast' => FRoute::groups($routeOptions), 'past' => FRoute::groups(array_merge($routeOptions, array('includePast' => 1)))), 'created' => array('nopast' => FRoute::groups(array_merge($routeOptions, array('ordering' => 'created'))), 'past' => FRoute::groups(array_merge($routeOptions, array('ordering' => 'created', 'includePast' => 1)))));
$this->set('hrefs', $hrefs);
// Parameters to work with site/event/default.list
$this->set('featuredEvents', $featuredEvents);
$this->set('events', $events);
$this->set('pagination', $pagination);
$this->set('group', $group);
$this->set('filter', 'all');
$this->set('delayed', false);
$this->set('showSorting', true);
$this->set('showDistanceSorting', false);
$this->set('showPastFilter', true);
$this->set('showDistance', false);
$this->set('hasLocation', false);
$this->set('includePast', false);
$this->set('ordering', $ordering);
$this->set('includePast', $includePast);
$this->set('activeCategory', false);
$this->set('isGroupOwner', true);
$guestApp = FD::table('App');
$guestApp->load(array('type' => SOCIAL_TYPE_APPS, 'group' => SOCIAL_TYPE_EVENT, 'element' => 'guests'));
$this->set('guestApp', $guestApp);
echo parent::display('groups/default');
}
示例6:
?>
</a>
</li>
<?php
}
?>
<?php
if ($this->config->get('groups.enabled')) {
?>
<li class="<?php
echo $view == 'groups' ? 'active' : '';
?>
">
<a href="<?php
echo FRoute::groups();
?>
">
<?php
echo JText::_('COM_EASYSOCIAL_TOOLBAR_PROFILE_GROUPS');
?>
</a>
</li>
<?php
}
?>
<?php
if ($this->config->get('events.enabled')) {
?>
<li class="<?php
示例7: saveFilter
/**
* Post process after saving group filter
*
* @since 1.2
* @access public
* @param StreamFilter object
* @return
*/
public function saveFilter($filter, $groupId)
{
// Unauthorized users should not be allowed to access this page.
FD::requireLogin();
FD::info()->set($this->getMessage());
$group = FD::group($groupId);
$this->redirect(FRoute::groups(array('layout' => 'item', 'id' => $group->getAlias()), false));
}
示例8: foreach
?>
</div>
</div>
<div class="es-widget-body">
<ul class="widget-list fd-nav fd-nav-stacked">
<?php
foreach ($apps as $app) {
?>
<li class="<?php
echo $appId == $app->id ? 'active' : '';
?>
" data-es-group-filter>
<a href="<?php
echo FRoute::groups(array('layout' => 'item', 'id' => $group->getAlias(), 'appId' => $app->getAlias()));
?>
"
data-es-group-item-app
data-app-id="<?php
echo $app->id;
?>
"
title="<?php
echo $this->html('string.escape', $group->getName());
?>
- <?php
echo $app->get('title');
?>
"
>
示例9: foreach
</a>
</li>
<!-- Progress -->
<?php
$counter = 1;
?>
<?php
foreach ($steps as $step) {
?>
<?php
$customClass = $step->sequence == $currentStep || $currentStep > $step->sequence || $currentStep == SOCIAL_REGISTER_COMPLETED_STEP ? ' active' : '';
$customClass .= $step->sequence < $currentStep || $currentStep == SOCIAL_REGISTER_COMPLETED_STEP ? $customClass . ' past' : '';
if ($stepSession->hasStepAccess($step->sequence)) {
// $link = $step->sequence == $currentStep ? 'javascript:void(0);' : FRoute::registration( array( 'layout' => 'steps' , 'step' => $step->sequence ) );
$link = $step->sequence == $currentStep ? 'javascript:void(0);' : FRoute::groups(array('layout' => 'steps', 'step' => $counter));
} else {
$link = 'javascript:void(0);';
}
?>
<li class="divider-vertical<?php
echo $customClass;
?>
"></li>
<li class="stepItem<?php
echo $customClass;
?>
"
data-original-title="<?php
echo JText::_($step->title, true);
?>
示例10:
>
<i class="ies-pencil"></i>
</a>
<a href="<?php
echo FRoute::groups(array('layout' => 'item', 'id' => $group->getAlias(), 'filterId' => $filter->getAlias()));
?>
"
data-es-group-stream
data-type="custom"
data-dashboardFeeds-item
data-id="<?php
echo $filter->id;
?>
"
data-url="<?php
echo FRoute::groups(array('layout' => 'item', 'id' => $group->getAlias(), 'filterId' => $filter->getAlias()));
?>
"
data-title="<?php
echo $this->html('string.escape', $filter->title);
?>
"
class="data-dashboardfeeds-item"
>
<i class="ies-list mr-5"></i> <?php
echo $filter->title;
?>
</a>
</li>
示例11:
" />
</div>
<div class="media-body">
<h3 class="h3 es-title-font mt-10"><?php
echo $activeCategory->get('title');
?>
</h3>
</div>
</div>
<p class="fd-small">
<?php
echo $activeCategory->get('description');
?>
</p>
<div class="mt-15">
<a href="<?php
echo FRoute::groups(array('layout' => 'category', 'id' => $activeCategory->getAlias()));
?>
" class="btn btn-es-primary btn-sm"><?php
echo JText::_('COM_EASYSOCIAL_GROUPS_MORE_INFO_CATEGORY');
?>
→</a>
</div>
</div>
<hr />
<?php
}
示例12: foreach
?>
<ul class="widget-list widget-list-with-count fd-nav fd-nav-stacked" data-es-groups-categories>
<?php
foreach ($categories as $category) {
?>
<li data-es-groups-category data-es-groups-category-id="<?php
echo $category->id;
?>
"
class="<?php
echo $activeCategory && $activeCategory->id == $category->id ? 'active' : '';
?>
"
>
<a href="<?php
echo FRoute::groups(array('categoryid' => $category->getAlias()));
?>
" title="<?php
echo $this->html('string.escape', $category->get('title'));
?>
"><?php
echo $category->get('title');
?>
</a>
<span data-total-groups="<?php
echo $category->getTotalGroups(true);
?>
" class="es-count-no pull-right"><?php
echo $category->getTotalGroups(true);
?>
</span>
示例13: save
/**
* Retrieves the new article form
*
* @since 1.2
* @access public
* @return
*/
public function save()
{
// Check for request forgeriess
FD::checkToken();
// Ensure that the user is logged in.
FD::requireLogin();
// Get the posted data
$post = JRequest::get('post');
// Determines if this is an edited news.
$id = JRequest::getInt('newsId');
// Load up the news obj
$news = FD::table('GroupNews');
$news->load($id);
$message = !$news->id ? JText::_('APP_GROUP_NEWS_CREATED_SUCCESSFULLY') : JText::_('APP_GROUP_NEWS_UPDATED_SUCCESSFULLY');
// Get the group
$groupId = JRequest::getInt('cluster_id');
$group = FD::group($groupId);
$my = FD::user();
// Get the app id
$app = $this->getApp();
if (!$group->isAdmin()) {
$url = FRoute::groups($group->getPermalink(false));
return $this->redirect($url);
}
$options = array();
$options['title'] = JRequest::getVar('title');
$options['content'] = JRequest::getVar('news_content', '', 'post', 'string', JREQUEST_ALLOWRAW);
$options['comments'] = JRequest::getBool('comments');
$options['state'] = SOCIAL_STATE_PUBLISHED;
// Only bind this if it's a new item
if (!$news->id) {
$options['cluster_id'] = $groupId;
$options['created_by'] = $my->id;
$options['hits'] = 0;
}
// Bind the data
$news->bind($options);
// Check if there are any errors
if (!$news->check()) {
FD::info()->set($news->getError(), SOCIAL_MSG_ERROR);
$url = FRoute::apps(array('layout' => 'canvas', 'customView' => 'form', 'uid' => $group->getAlias(), 'type' => SOCIAL_TYPE_GROUP, 'id' => $app->getAlias()), false);
return $this->redirect($url);
}
// If everything is okay, bind the data.
$news->store();
// Redirect to the appropriate page now
$url = FRoute::apps(array('layout' => 'canvas', 'customView' => 'item', 'uid' => $group->getAlias(), 'type' => SOCIAL_TYPE_GROUP, 'id' => $app->getAlias(), 'newsId' => $news->id), false);
// If it is a new item, we want to run some other stuffs here.
if (!$id) {
// @points: groups.news.create
// Add points to the user that updated the group
$points = FD::points();
$points->assign('groups.news.create', 'com_easysocial', $my->id);
$app = $this->getApp();
$permalink = $app->getPermalink('canvas', array('customView' => 'item', 'groupId' => $group->id, 'newsId' => $news->id));
// Notify users about the news.
$options = array('userId' => $my->id, 'permalink' => $permalink, 'newsId' => $news->id, 'newsTitle' => $news->title, 'newsContent' => strip_tags($news->content));
$group->notifyMembers('news.create', $options);
}
FD::info()->set($message, SOCIAL_MSG_SUCCESS);
// Perform a redirection
$this->redirect($url);
}
示例14: approve
/**
* Approves a user's registration application
*
* @since 1.0
* @access public
* @param string
* @return
*/
public function approve($email = true)
{
// Upda the group's state first.
$this->state = SOCIAL_CLUSTER_PUBLISHED;
$state = $this->save();
// Activity logging.
// Announce to the world when a new user registered on the site.
$config = FD::config();
// If we need to send email to the user, we need to process this here.
if ($email) {
FD::language()->loadSite();
// Push arguments to template variables so users can use these arguments
$params = array('title' => $this->getName(), 'name' => $this->getCreator()->getName(), 'avatar' => $this->getAvatar(SOCIAL_AVATAR_LARGE), 'groupUrl' => $this->getPermalink(false, true), 'editUrl' => FRoute::groups(array('external' => true, 'layout' => 'edit', 'id' => $this->getAlias()), false));
// Get the email title.
$title = JText::sprintf('COM_EASYSOCIAL_EMAILS_GROUP_APPLICATION_APPROVED', $this->getName());
// Immediately send out emails
$mailer = FD::mailer();
// Get the email template.
$mailTemplate = $mailer->getTemplate();
// Set recipient
$mailTemplate->setRecipient($this->getCreator()->getName(), $this->getCreator()->email);
// Set title
$mailTemplate->setTitle($title);
// Set the contents
$mailTemplate->setTemplate('site/group/approved', $params);
// Set the priority. We need it to be sent out immediately since this is user registrations.
$mailTemplate->setPriority(SOCIAL_MAILER_PRIORITY_IMMEDIATE);
// Try to send out email now.
$mailer->create($mailTemplate);
}
// Once a group is approved, generate a stream item for it.
// Add activity logging when a user creates a new group.
if ($config->get('groups.stream.create')) {
$stream = FD::stream();
$streamTemplate = $stream->getTemplate();
// Set the actor
$streamTemplate->setActor($this->creator_uid, SOCIAL_TYPE_USER);
// Set the context
$streamTemplate->setContext($this->id, SOCIAL_TYPE_GROUPS);
$streamTemplate->setVerb('create');
$streamTemplate->setSiteWide();
$streamTemplate->setAccess('core.view');
// Set the params to cache the group data
$registry = FD::registry();
$registry->set('group', $this);
// Set the params to cache the group data
$streamTemplate->setParams($registry);
$streamTemplate->setCluster($this->id, SOCIAL_TYPE_GROUP, $this->type);
// Add stream template.
$stream->add($streamTemplate);
}
return true;
}
示例15: foreach
<p><?php
echo JText::_('COM_EASYSOCIAL_GROUPS_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::groups(array('controller' => 'groups', 'task' => 'selectCategory', '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>