当前位置: 首页>>代码示例>>PHP>>正文


PHP JemHelper::getAttendeesNumbers方法代码示例

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


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

示例1: getItems

	/**
	 * Method to get a list of events.
	 */
	public function getItems()
	{
		$items	= parent::getItems();

		if (empty($items)) {
			return array();
		}

		$user	= JemFactory::getUser();
		$userId	= $user->get('id');
		$guest	= $user->get('guest');
		$groups = $user->getAuthorisedViewLevels();
		$input	= JFactory::getApplication()->input;

		$calendarMultiday = $this->getState('filter.calendar_multiday');

		# Get the global params
		$globalParams = JComponentHelper::getParams('com_jem', true);

		# Convert the parameter fields into objects.
		foreach ($items as $index => $item)
		{
			$eventParams = new JRegistry;
			$eventParams->loadString($item->attribs);

			$item->params = clone $this->getState('params');
			$item->params->merge($eventParams);

			# adding categories
			$item->categories = $this->getCategories($item->id);

			# check if the item-categories is empty, if so the user has no access to that event at all.
			if (empty($item->categories)) {
				unset ($items[$index]);
			} else {
			# write access permissions.
				$item->params->set('access-edit', $user->can('edit', 'event', $item->id, $item->created_by));
			}
		} // foreach

		if ($items) {
			/*$items =*/ JemHelper::getAttendeesNumbers($items);

			if ($calendarMultiday) {
				$items = self::calendarMultiday($items);
			}
		}

		return $items;
	}
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:53,代码来源:eventslist.php

示例2: getItems

 /**
  * Method to get a list of events.
  */
 public function getItems()
 {
     $items = parent::getItems();
     if ($items) {
         $app = JFactory::getApplication();
         $user = JFactory::getUser();
         $userId = $user->get('id');
         $guest = $user->get('guest');
         $groups = $user->getAuthorisedViewLevels();
         $input = JFactory::getApplication()->input;
         $calendarMultiday = $this->getState('filter.calendar_multiday');
         # Convert the parameter fields into objects.
         foreach ($items as $index => $item) {
             $eventParams = new JRegistry();
             $eventParams->loadString($item->attribs);
             if ($this->getState('params')) {
                 $item->params = clone $this->getState('params');
             } else {
                 $params = new JRegistry();
                 $item->params = $params;
             }
             $item->params->merge($eventParams);
             # access permissions.
             if (!$guest) {
                 $asset = 'com_jem.event.' . $item->id;
                 # Check general edit permission first.
                 if ($user->authorise('core.edit', $asset)) {
                     $item->params->set('access-edit', true);
                 } elseif (!empty($userId) && $user->authorise('core.edit.own', $asset)) {
                     # Check for a valid user and that they are the owner.
                     if ($userId == $item->created_by) {
                         $item->params->set('access-edit', true);
                     }
                 }
             }
             # adding categories
             $item->categories = $this->getCategories($item->id);
             # retrieving filter-access
             $access = $this->getState('filter.access');
             if ($access) {
                 // If the access filter has been set, we already have only the events this user can view.
                 $item->params->set('access-view', true);
             } else {
                 $user = JFactory::getUser();
                 $groups = $user->getAuthorisedViewLevels();
                 $item->params->set('access-view', in_array($item->access, $groups));
             }
             # check if the item-categories is empty, if so the user has no access to that event at all.
             if (empty($item->categories)) {
                 unset($items[$index]);
             }
         }
         if ($items) {
             $items = JemHelper::getAttendeesNumbers($items);
             if ($calendarMultiday) {
                 $items = self::calendarMultiday($items);
             }
         }
         return $items;
     } else {
         return array();
     }
 }
开发者ID:JKoelman,项目名称:JEM-3,代码行数:66,代码来源:eventslist.php


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