コード例 #1
0
 function collaborationGroup()
 {
     if (isset($this->GroupID) and $this->GroupID) {
         return eZCollaborationGroup::fetch($this->GroupID, $this->UserID);
     }
     return null;
 }
コード例 #2
0
 /**
  * Returns a shared instance of the eZCollaborationProfile class
  * pr user id.
  * note: Transaction unsafe. If you call several transaction unsafe methods you must enclose
  * the calls within a db transaction; thus within db->begin and db->commit.
  *
  * @param int|false $userID Uses current user id if false.
  * @return eZCollaborationProfile
  */
 static function instance($userID = false)
 {
     if ($userID === false) {
         $user = eZUser::currentUser();
         $userID = $user->attribute('contentobject_id');
     }
     $instance =& $GLOBALS["eZCollaborationProfile-{$userID}"];
     if (!isset($instance)) {
         $instance = eZCollaborationProfile::fetchByUser($userID);
         if ($instance === null) {
             $group = eZCollaborationGroup::instantiate($userID, ezpI18n::tr('kernel/classes', 'Inbox'));
             $instance = eZCollaborationProfile::create($userID, $group->attribute('id'));
             $instance->store();
         }
     }
     return $instance;
 }
コード例 #3
0
ファイル: group.php プロジェクト: CG77/ezpublish-legacy
<?php

/**
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
 * @license For full copyright and license information view LICENSE file distributed with this source code.
 * @version 2014.11.1
 * @package kernel
 */
$Module = $Params['Module'];
$ViewMode = $Params['ViewMode'];
$GroupID = $Params['GroupID'];
$Offset = $Params['Offset'];
if (!is_numeric($Offset)) {
    $Offset = 0;
}
$collabGroup = eZCollaborationGroup::fetch($GroupID);
if ($collabGroup === null) {
    return $Module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel');
}
if (!eZCollaborationViewHandler::groupExists($ViewMode)) {
    return $Module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel');
}
$view = eZCollaborationViewHandler::instance($ViewMode, eZCollaborationViewHandler::TYPE_GROUP);
$template = $view->template();
$collabGroupTitle = $collabGroup->attribute('title');
$viewParameters = array('offset' => $Offset);
$tpl = eZTemplate::factory();
$tpl->setVariable('view_parameters', $viewParameters);
$tpl->setVariable('collab_group', $collabGroup);
$Result = array();
$Result['content'] = $tpl->fetch($template);
コード例 #4
0
 function parentGroup()
 {
     if (isset($this->ParentGroupID) and $this->ParentGroupID) {
         return eZCollaborationGroup::fetch($this->ParentGroupID);
     }
     return null;
 }
 function fetchGroupTree($parentGroupID, $sortBy, $offset, $limit, $depth)
 {
     $treeParameters = array('parent_group_id' => $parentGroupID, 'offset' => $offset, 'limit' => $limit, 'sort_by' => $sortBy, 'depth' => $depth);
     $children = eZCollaborationGroup::subTree($treeParameters);
     if ($children === null) {
         return array('error' => array('error_type' => 'kernel', 'error_code' => eZError::KERNEL_NOT_FOUND));
     }
     return array('result' => $children);
 }