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

PHP User\Group类代码示例

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

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



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

示例1: displayTask

 /**
  * Displays a list of groups
  *
  * @return	void
  */
 public function displayTask()
 {
     // Incoming
     $this->view->filters = array('gid' => Request::getState($this->_option . '.' . $this->_controller . '.gid', 'gid', ''));
     // Ensure we have a group ID
     if (!$this->view->filters['gid']) {
         App::redirect(Route::url('index.php?option=' . $this->_option, false), Lang::txt('COM_GROUPS_MISSING_ID'), 'error');
         return;
     }
     // Load the group page
     $group = new Group();
     $group->read($this->view->filters['gid']);
     $this->view->filters['gidNumber'] = $group->get('gidNumber');
     $this->view->filters['search'] = urldecode(trim(Request::getState($this->_option . '.' . $this->_controller . '.search', 'search', '')));
     $this->view->filters['status'] = trim(Request::getState($this->_option . '.' . $this->_controller . '.status', 'status', ''));
     // Sorting options
     $this->view->filters['sort'] = trim(Request::getState($this->_option . '.' . $this->_controller . '.sort', 'filter_order', 'name'));
     $this->view->filters['sort_Dir'] = trim(Request::getState($this->_option . '.' . $this->_controller . '.sortdir', 'filter_order_Dir', 'ASC'));
     // Filters for returning results
     $this->view->filters['limit'] = Request::getState($this->_option . '.' . $this->_controller . '.limit', 'limit', Config::get('list_limit'), 'int');
     $this->view->filters['start'] = Request::getState($this->_option . '.' . $this->_controller . '.limitstart', 'limitstart', 0, 'int');
     // In case limit has been changed, adjust limitstart accordingly
     $this->view->filters['start'] = $this->view->filters['limit'] != 0 ? floor($this->view->filters['start'] / $this->view->filters['limit']) * $this->view->filters['limit'] : 0;
     $tbl = new Tables\Group($this->database);
     $this->view->total = $tbl->countMembers($this->view->filters);
     $this->view->rows = $tbl->findMembers($this->view->filters);
     //add invite emails to list
     if ($this->view->filters['status'] == '' || $this->view->filters['status'] == 'invitee') {
         //get group invite emails
         $hubzeroGroupInviteEmail = new \Hubzero\User\Group\InviteEmail($this->database);
         $inviteemails = $hubzeroGroupInviteEmail->getInviteEmails($group->get('gidNumber'));
         //add invite emails to list
         foreach ($inviteemails as $inviteemail) {
             $this->view->rows[$inviteemail['email']] = new \stdClass();
             $this->view->rows[$inviteemail['email']]->name = $inviteemail['email'];
             $this->view->rows[$inviteemail['email']]->username = null;
             $this->view->rows[$inviteemail['email']]->email = $inviteemail['email'];
             $this->view->rows[$inviteemail['email']]->uidNumber = null;
             $this->view->rows[$inviteemail['email']]->role = 'inviteemail';
         }
     }
     $this->view->group = $group;
     // Set any errors
     foreach ($this->getErrors() as $error) {
         $this->view->setError($error);
     }
     // Output the HTML
     $this->view->display();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:54,代码来源:membership.php


示例2: up

 /**
  * Up
  **/
 public function up()
 {
     // select all groups with duplicate cname's
     $query = "SELECT gidNumber, cn, description\n\t\t\t\t  FROM `#__xgroups` WHERE cn IN (\n\t\t\t\t\t  SELECT cn FROM `#__xgroups` GROUP BY cn HAVING COUNT(*) > 1\n\t\t\t\t  ) ORDER BY gidNumber;";
     $this->db->setQuery($query);
     $duplicateGroups = $this->db->loadObjectList();
     // var to hold original groups
     $original = array();
     // loop through each group
     foreach ($duplicateGroups as $duplicateGroup) {
         // make sure to keep the original group
         if (!in_array($duplicateGroup->cn, $original)) {
             $original[] = $duplicateGroup->cn;
             continue;
         }
         // delete group
         // also deletes membership related stuff
         $hzGroup = \Hubzero\User\Group::getInstance($duplicateGroup->gidNumber);
         $hzGroup->delete();
     }
     // // Add unique index to cn column
     if ($this->db->tableExists('#__xgroups')) {
         if (!$this->db->tableHasKey('#__xgroups', 'idx_cn')) {
             $query = "ALTER TABLE `#__xgroups` ADD UNIQUE INDEX `idx_cn` (`cn`);";
             $this->db->setQuery($query);
             $this->db->query();
         }
     }
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:32,代码来源:Migration20140423131112ComGroups.php


示例3: up

 /**
  * Up
  **/
 public function up()
 {
     // include com_wishlist files
     require_once PATH_CORE . DS . 'components' . DS . 'com_wishlist' . DS . 'models' . DS . 'wishlist.php';
     // Load some objects
     $wishlist = new \Components\Wishlist\Tables\Wishlist($this->db);
     $wish = new \Components\Wishlist\Tables\Wish($this->db);
     // Get records
     $lists = $wishlist->getRecords(array('category' => 'group'));
     // vars to hold counts
     $deletedLists = 0;
     $deletedWishes = 0;
     // check to make sure each group wishlist has a valid group
     foreach ($lists as $list) {
         // load group
         $group = \Hubzero\User\Group::getInstance($list->referenceid);
         // if group doesnt exist we need to remove the list and wishes
         if (!$group || !is_object($group)) {
             // Get wishes
             $wishes = $wish->get_wishes($list->id, array('filterby' => 'all', 'sortby' => ''), 1);
             // delete each wish
             foreach ($wishes as $item) {
                 $wish->load($item->id);
                 $wish->delete();
                 $deletedWishes++;
             }
             // delete wishlist
             $wishlist->load($list->id);
             $wishlist->delete();
             $deletedLists++;
         }
     }
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:36,代码来源:Migration20150115234546PlgGroupsWishlist.php


示例4: __construct

 /**
  * Constructor - sets output mechanism and arguments for use by command
  *
  * @param   \Hubzero\Console\Output    $output     The ouput renderer
  * @param   \Hubzero\Console\Arguments $arguments  The command arguments
  * @return  void
  **/
 public function __construct(Output $output, Arguments $arguments)
 {
     parent::__construct($output, $arguments);
     // Do we have a group arg?
     if ($cname = $this->arguments->getOpt('group')) {
         $group = \Hubzero\User\Group::getInstance($cname);
     } else {
         // Get the current directory
         $currentDirectory = getcwd();
         // Remove web root
         $currentDirectory = str_replace(PATH_APP, '', $currentDirectory);
         // Get group upload directory
         $groupsConfig = \Component::params('com_groups');
         $groupsDirectory = trim($groupsConfig->get('uploadpath', '/site/groups'), DS);
         // Are we within the groups upload path
         if (strpos($currentDirectory, $groupsDirectory)) {
             $gid = str_replace($groupsDirectory, '', $currentDirectory);
             $gid = trim($gid, DS);
             // Get group instance
             $group = \Hubzero\User\Group::getInstance($gid);
         }
     }
     // Make sure we have a group & its super!
     if (isset($group) && $group && $group->isSuperGroup()) {
         $this->group = $group;
     } else {
         $this->output->error('Error: Provided group is not valid');
     }
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:36,代码来源:Group.php


示例5: execute

 /**
  * Override Execute Method
  *
  * @return 	void
  */
 public function execute()
 {
     //get the cname, active tab, and action for plugins
     $this->cn = Request::getVar('cn', '');
     $this->active = Request::getVar('active', '');
     $this->action = Request::getVar('action', '');
     // Check if they're logged in
     if (User::isGuest()) {
         $this->loginTask(Lang::txt('COM_GROUPS_ERROR_MUST_BE_LOGGED_IN'));
         return;
     }
     //check to make sure we have  cname
     if (!$this->cn) {
         $this->_errorHandler(400, Lang::txt('COM_GROUPS_ERROR_NO_ID'));
     }
     // Load the group page
     $this->group = Group::getInstance($this->cn);
     // Ensure we found the group info
     if (!$this->group || !$this->group->get('gidNumber')) {
         $this->_errorHandler(404, Lang::txt('COM_GROUPS_ERROR_NOT_FOUND'));
     }
     // Check authorization
     if ($this->_authorize() != 'manager' && !$this->_authorizedForTask('group.pages')) {
         $this->_errorHandler(403, Lang::txt('COM_GROUPS_ERROR_NOT_AUTH'));
     }
     //continue with parent execute method
     parent::execute();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:33,代码来源:pages.php


示例6: __construct

 /**
  * Constructor
  *
  * @param   integer  $referenceid  Scope ID (group, course, etc.)
  * @return  void
  */
 public function __construct($referenceid = 0)
 {
     $this->set('referenceid', $referenceid)->set('category', 'group')->set('option', $this->_segments['option']);
     $this->_item = \Hubzero\User\Group::getInstance($referenceid);
     if (!$this->_item) {
         $this->_item = new \Hubzero\User\Group();
     }
     $this->_segments['cn'] = $this->_item->get('cn');
     $this->_segments['active'] = 'wishlist';
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:16,代码来源:group.php


示例7: loadLanguage

 /**
  * Loads the plugin language file
  *
  * @param   string   $extension  The extension for which a language file should be loaded
  * @param   string   $basePath   The basepath to use
  * @return  boolean  True, if the file has successfully loaded.
  */
 public function loadLanguage($extension = '', $basePath = PATH_APP)
 {
     if (empty($extension)) {
         $extension = 'plg_' . $this->_type . '_' . $this->_name;
     }
     $group = \Hubzero\User\Group::getInstance(Request::getCmd('cn'));
     if ($group && $group->isSuperGroup()) {
         $basePath = PATH_APP . DS . 'site' . DS . 'groups' . DS . $group->get('gidNumber');
     }
     $lang = \App::get('language');
     return $lang->load(strtolower($extension), $basePath, null, false, true) || $lang->load(strtolower($extension), PATH_APP . DS . 'plugins' . DS . $this->_type . DS . $this->_name, null, false, true) || $lang->load(strtolower($extension), PATH_APP . DS . 'plugins' . DS . $this->_type . DS . $this->_name, null, false, true) || $lang->load(strtolower($extension), PATH_CORE . DS . 'plugins' . DS . $this->_type . DS . $this->_name, null, false, true);
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:19,代码来源:blog.php


示例8: __construct

 /**
  * Constructor
  *
  * @param   integer  $scope_id  Scope ID (group, course, etc.)
  * @return  void
  */
 public function __construct($scope_id)
 {
     $group = \Hubzero\User\Group::getInstance($scope_id);
     if (!$group) {
         $group = new \Hubzero\User\Group();
         $group->set('cn', '_unknown_');
     }
     $this->_segments['cn'] = $group->get('cn');
     $this->_segments['active'] = 'forum';
     $this->_segments['scope'] = '';
     $this->_name = $group->get('cn');
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:18,代码来源:group.php


示例9: execute

 /**
  * Override Execute Method
  *
  * @return 	void
  */
 public function execute()
 {
     // Incoming
     $this->gid = Request::getVar('gid', '');
     // Ensure we have a group ID
     if (!$this->gid) {
         App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=manage', false), Lang::txt('COM_GROUPS_MISSING_ID'), 'error');
         return;
     }
     $this->group = Group::getInstance($this->gid);
     parent::execute();
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:17,代码来源:modules.php


示例10: listTask

 /**
  * Display members of a group
  *
  * @apiMethod GET
  * @apiUri    /groups/{id}/members/list
  * @apiParameter {
  * 		"name":          "id",
  * 		"description":   "Group identifier",
  * 		"type":          "integer",
  * 		"required":      true,
  * 		"default":       0
  * }
  * @apiParameter {
  * 		"name":          "list",
  * 		"description":   "Comma-separated list of member status",
  * 		"type":          "string",
  * 		"required":      false,
  * 		"default":       "",
  * 		"allowedValues": "members, managers, invitees, applicants"
  * }
  * @apiParameter {
  * 		"name":          "start",
  * 		"description":   "Number of where to start returning results.",
  * 		"type":          "integer",
  * 		"required":      false,
  * 		"default":       0
  * }
  * @return  void
  */
 public function listTask()
 {
     $id = Request::getInt('id', 0);
     $group = \Hubzero\User\Group::getInstance($id);
     if (!$group) {
         throw new Exception(Lang::txt('COM_GROUPS_ERROR_MISSING_RECORD'), 404);
     }
     // get all group members, managers, etc
     $members = $group->get('members');
     $managers = $group->get('managers');
     $invitees = $group->get('invitees');
     $applicants = $group->get('applicants');
     // get what the user wants back
     $list = Request::getVar('list', 'members, managers, invitees, applicants');
     // split by comma
     if (is_string($list)) {
         $list = explode(',', $list);
         $list = array_map('trim', $list);
         $list = array_map('strtolower', $list);
     }
     // var to hold return
     $response = array();
     // add members
     if (in_array('members', $list)) {
         foreach ($members as $k => $member) {
             $members[$k] = array('uidNumber' => $member);
         }
         $response['members'] = $members;
     }
     // add managers
     if (in_array('managers', $list)) {
         foreach ($managers as $k => $manager) {
             $managers[$k] = array('uidNumber' => $manager);
         }
         $response['managers'] = $managers;
     }
     // add invitees
     if (in_array('invitees', $list)) {
         foreach ($invitees as $k => $invitee) {
             $invitees[$k] = array('uidNumber' => $invitee);
         }
         $response['invitees'] = $invitees;
     }
     // add managers
     if (in_array('applicants', $list)) {
         foreach ($applicants as $k => $applicant) {
             $applicants[$k] = array('uidNumber' => $applicant);
         }
         $response['applicants'] = $applicants;
     }
     $this->send($response);
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:81,代码来源:membersv1_0.php


示例11: execute

 /**
  * Override Execute Method
  *
  * @return  void
  */
 public function execute()
 {
     $id = Request::getInt('gidNumber');
     // Load the group page
     $this->group = Group::getInstance($id);
     // Ensure we found the group info
     if (!$this->group || !$this->group->get('gidNumber')) {
         App::abort(404, Lang::txt('COM_GROUPS_ERROR_NOT_FOUND'));
     }
     //build path to the group folder
     $this->path = PATH_APP . DS . trim($this->config->get('uploadpath', '/site/groups'), DS) . DS . $this->group->get('gidNumber');
     //continue with parent execute method
     parent::execute();
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:19,代码来源:media.php


示例12: __construct

 /**
  * Constructor
  *
  * @param   integer  $scope_id  Scope ID (group, course, etc.)
  * @return  void
  */
 public function __construct($scope_id = 0)
 {
     $this->set('scope_id', $scope_id);
     $group = \Hubzero\User\Group::getInstance($scope_id);
     if (!$group || !$group->get('cn')) {
         $group = new \Hubzero\User\Group();
         $group->set('gidNumber', $scope_id);
         $group->set('cn', $scope_id);
         $group->set('description', Lang::txt('(unknown)'));
     }
     $this->_group = $group;
     $this->_segments['cn'] = $group->get('cn');
     $this->_segments['active'] = 'collections';
     $this->set('option', $this->_segments['option']);
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:21,代码来源:group.php


示例13: onUserAfterDelete

 /**
  * Method is called after user data is deleted from the database
  *
  * @param array  $user   holds the user data
  * @param bool   $succes true if user was succesfully stored in the database
  * @param string $msg    message
  */
 public function onUserAfterDelete($user, $succes, $msg)
 {
     // Check params for group name
     $groupAlias = $this->params->get('group', false);
     if ($groupAlias) {
         // Get the group
         $group = \Hubzero\User\Group::getInstance($groupAlias);
         if (is_object($group)) {
             // Remove the user from the group
             $group->remove('members', array($user['id']));
             // Update the groups
             $group->update();
         }
     }
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:22,代码来源:geo.php


示例14: __construct

 /**
  * Constructor
  *
  * @param   integer  $scope_id  Scope ID (group, course, etc.)
  * @return  void
  */
 public function __construct($scope_id = 0)
 {
     $this->set('scope_id', $scope_id);
     $this->_item = UserGroup::getInstance($scope_id);
     if (!$this->_item instanceof UserGroup) {
         $this->_item = new UserGroup();
     }
     $this->_segments['cn'] = $this->_item->get('cn');
     $this->_segments['active'] = 'blog';
     $groupParams = Component::params('com_groups');
     $uploadpath = $groupParams->get('uploadpath', '/site/groups');
     $uploadpath = trim($uploadpath, DS) . DS . $this->get('scope_id') . DS . 'uploads' . DS . 'blog';
     $this->set('path', $uploadpath);
     $this->set('scope', $this->_segments['cn'] . '/blog');
     $this->set('option', $this->_segments['option']);
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:22,代码来源:group.php


示例15: onSearch

 /**
  * Build search query and add it to the $results
  *
  * @param      object $request  \Components\Search\Models\Basic\Request
  * @param      object &$results \Components\Search\Models\Basic\Result\Set
  * @param      object $authz    \Components\Search\Models\Basic\Authorization
  * @return     void
  */
 public static function onSearch($request, &$results, $authz)
 {
     $terms = $request->get_term_ar();
     $weight = 'match(e.title, e.content) against(\'' . join(' ', $terms['stemmed']) . '\')';
     $addtl_where = array();
     foreach ($terms['mandatory'] as $mand) {
         $addtl_where[] = "(e.title LIKE '%{$mand}%' OR e.content LIKE '%{$mand}%')";
     }
     foreach ($terms['forbidden'] as $forb) {
         $addtl_where[] = "(e.title NOT LIKE '%{$forb}%' AND e.content NOT LIKE '%{$forb}%')";
     }
     // Commenting out Access check as it was never used and column was removed from table
     // during events refactoring
     //
     // @author Chris Smoak
     // @date   4/20/2014
     //
     // $addtl_where[] = '(e.access IN (' . implode(',', User::getAuthorisedViewLevels()) . '))';
     $rows = new \Components\Search\Models\Basic\Result\Sql("SELECT\n\t\t\t\te.title,\n\t\t\t\te.content AS description,\n\t\t\t\te.scope,\n\t\t\t\te.scope_id,\n\t\t\t\tconcat('index.php?option=com_events&task=details&id=', e.id) AS link,\n\t\t\t\t{$weight} AS weight,\n\t\t\t\tpublish_up AS date,\n\t\t\t\t'Events' AS section\n\t\t\tFROM `#__events` e\n\t\t\tWHERE\n\t\t\t\tstate = 1 AND\n\t\t\t\tapproved AND {$weight} > 0" . ($addtl_where ? ' AND ' . join(' AND ', $addtl_where) : '') . " ORDER BY {$weight} DESC");
     foreach ($rows->to_associative() as $row) {
         if (!$row) {
             continue;
         }
         // check group perms
         if ($row->scope == 'group') {
             // load group
             $group = \Hubzero\User\Group::getInstance($row->scope_id);
             // make sure we found one
             if (!$group) {
                 continue;
             }
             // get group calendar access
             $access = \Hubzero\User\Group\Helper::getPluginAccess($group, 'calendar');
             // is calendar off
             // is calendar for registered users & not logged in
             // is calendar for members only and we are not a member
             if ($access == 'nobody' || $access == 'registered' && User::isGuest() || $access == 'members' && !in_array(User::get('id'), $group->get('members'))) {
                 continue;
             }
         }
         $row->set_description(preg_replace('/(\\[+.*?\\]+|\\{+.*?\\}+|[=*])/', '', $row->get_description()));
         $results->add($row);
     }
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:52,代码来源:events.php


示例16: onResourcesSub

 /**
  * Return data on a resource sub view (this will be some form of HTML)
  *
  * @param   object   $resource  Current resource
  * @param   string   $option    Name of the component
  * @param   integer  $miniview  View style
  * @return  array
  */
 public function onResourcesSub($resource, $option, $miniview = 0)
 {
     $arr = array('area' => $this->_name, 'html' => '', 'metadata' => '');
     if (!$resource->group_owner || substr($resource->group_owner, 0, strlen('app-')) == 'app-') {
         return $arr;
     }
     $group = \Hubzero\User\Group::getInstance($resource->group_owner);
     if (!$group || !$group->get('gidNumber')) {
         return $arr;
     }
     // Pass the view some info
     $view = $this->view('default', 'display')->set('option', $option)->set('resource', $resource)->set('params', $this->params)->set('group', $group);
     if ($miniview) {
         $view->setLayout('mini');
     }
     // Return the output
     $arr['html'] = $view->setErrors($this->getErrors())->loadTemplate();
     return $arr;
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:27,代码来源:groups.php


示例17: getReportedItem

 /**
  * Get items reported as abusive
  *
  * @param   integer  $refid     Comment ID
  * @param   string   $category  Item type (kb)
  * @param   integer  $parent    Parent ID
  * @return  array
  */
 public function getReportedItem($refid, $category, $parent)
 {
     if ($category != 'forum') {
         return null;
     }
     $query = "SELECT rc.id, rc.comment as `text`, rc.parent, rc.created_by as author, rc.created, rc.title as subject, rc.anonymous as anon, 'forum' AS parent_category,\n\t\t\t\t\ts.alias AS section, c.alias AS category, rc.scope, rc.scope_id, rc.object_id, rc.thread\n\t\t\t\t\tFROM `#__forum_posts` AS rc\n\t\t\t\t\tLEFT JOIN `#__forum_categories` AS c ON c.id = rc.category_id\n\t\t\t\t\tLEFT JOIN `#__forum_sections` AS s ON s.id = c.section_id\n\t\t\t\t\tWHERE rc.id=" . $refid;
     $database = App::get('db');
     $database->setQuery($query);
     $rows = $database->loadObjectList();
     if ($rows) {
         require_once PATH_CORE . DS . 'components' . DS . 'com_forum' . DS . 'models' . DS . 'manager.php';
         foreach ($rows as $key => $row) {
             /*$thread = $row->id;
             		if ($row->parent)
             		{
             			$thread = $this->_getThread($row->parent);
             		}*/
             if (preg_match('/^<!-- \\{FORMAT:(.*)\\} -->/i', $row->text, $matches)) {
                 $rows[$key]->text = preg_replace('/^(<!-- \\{FORMAT:.*\\} -->)/i', '', $row->text);
             }
             switch ($row->scope) {
                 case 'course':
                     require_once PATH_CORE . DS . 'components' . DS . 'com_courses' . DS . 'models' . DS . 'course.php';
                     $offering = \Components\Courses\Models\Offering::getInstance($row->scope_id);
                     $course = \Components\Courses\Models\Course::getInstance($offering->get('course_id'));
                     $url = 'index.php?option=com_courses&gid=' . $course->get('alias') . '&controller=offering&offering=' . $offering->get('alias') . '&active=discussions&thread=' . $row->thread;
                     break;
                 case 'group':
                     $group = \Hubzero\User\Group::getInstance($row->scope_id);
                     $url = 'index.php?option=com_groups&cn=' . $group->get('cn') . '&active=forum&scope=' . $row->section . '/' . $row->category . '/' . $parent;
                     break;
                 case 'site':
                 default:
                     $url = 'index.php?option=com_forum&section=' . $row->section . '&category=' . $row->category . '&thread=' . $parent;
                     break;
             }
             $rows[$key]->href = Route::url($url);
         }
     }
     return $rows;
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:49,代码来源:forum.php


示例18: cleanGroupFolders

 /**
  * Remove unused group folders
  *
  * @param   object   $job  \Components\Cron\Models\Job
  * @return  boolean
  */
 public function cleanGroupFolders(\Components\Cron\Models\Job $job)
 {
     // get group params
     $groupParameters = Component::params('com_groups');
     // get group upload path
     $groupUploadPath = ltrim($groupParameters->get('uploadpath', '/site/groups'), DS);
     // get group folders
     $groupFolders = Filesystem::directories(PATH_APP . DS . $groupUploadPath);
     // loop through each group folder
     foreach ($groupFolders as $groupFolder) {
         // load group object for each folder
         $hubzeroGroup = \Hubzero\User\Group::getInstance(trim($groupFolder));
         // if we dont have a group object delete folder
         if (!is_object($hubzeroGroup)) {
             // delete folder
             Filesystem::delete(PATH_APP . DS . $groupUploadPath . DS . $groupFolder);
         }
     }
     // job is no longer active
     return true;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:27,代码来源:groups.php


示例19: render

 /**
  * Generate macro output
  *
  * @return     string
  */
 public function render()
 {
     //get the args passed in
     $args = explode(',', $this->args);
     //parse each arg into key value pair
     foreach ($args as $a) {
         $kv[] = explode('=', trim($a));
     }
     //set final args
     foreach ($kv as $k) {
         $arg[$k[0]] = isset($k[1]) ? $k[1] : $k[0];
     }
     //set a default
     //$default_events = 3;
     //get the user defined # of events
     //$num_events = (isset($arg['number']) && is_numeric($arg['number']) && $arg['number'] > 0) ? $arg['number'] : $default_events;
     //get the group
     $cn = Request::getVar('cn');
     //get the group object based on gid
     $group = \Hubzero\User\Group::getInstance($cn);
     //check to make sure we have a valid group
     if (!is_object($group)) {
         return '[This macro is designed for Groups only]';
     }
     //array of filters
     $filters = array('id' => isset($arg['id']) ? $arg['id'] : null, 'limit' => isset($arg['number']) ? $arg['number'] : 3);
     //get group events
     $events = $this->getGroupEvents($group, $filters);
     //create the html container
     $html = '<div class="upcoming_events">';
     //display the title
     $html .= isset($arg['title']) && $arg['title'] != '' ? '<h3>' . $arg['title'] . '</h3>' : '';
     //render the events
     $html .= $this->renderEvents($group, $events);
     //close the container
     $html .= '</div>';
     //return rendered events
     return $html;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:44,代码来源:groupevent.php


示例20: up

 /**
  * Up
  **/
 public function up()
 {
     // get groups who dont have a created value
     $query = "SELECT * FROM `#__xgroups` WHERE `created` IS NULL ";
     $this->db->setQuery($query);
     $groups = $this->db->loadObjectList();
     // get created logs
     $query2 = "SELECT `gidNumber`,`timestamp`,`actorid` FROM `#__xgroups_log` WHERE `action`='group_created'";
     $this->db->setQuery($query2);
     $logs = $this->db->loadAssocList('gidNumber');
     //check each group to see if we have a created log
     foreach ($groups as $group) {
         if (isset($logs[$group->gidNumber])) {
             $log = $logs[$group->gidNumber];
             $hubzeroUserGroup = \Hubzero\User\Group::getInstance($group->gidNumber);
             if (is_object($hubzeroUserGroup)) {
                 $hubzeroUserGroup->set('created', $log['timestamp']);
                 $hubzeroUserGroup->set('created_by', $log['actorid']);
                 $hubzeroUserGroup->update();
             }
         }
     }
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:26,代码来源:Migration20140225094500ComGroups.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP User\Profile类代码示例发布时间:2022-05-23
下一篇:
PHP Component\SiteController类代码示例发布时间: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