ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilWorkspaceFolderUserSettings Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilWorkspaceFolderUserSettings:

Public Member Functions

 __construct (int $user_id, ilWorkspaceFolderUserSettingsRepository $repo, ilWorkspaceTree $tree=null)
 
 getSortation (int $wfld_id)
 
 updateSortation (int $wfld_id, int $sortation)
 
 getEffectiveSortation (int $wfld_wsp_id)
 Get effective sortation for a workspace folder (next upper context that has sortation > 0) More...
 

Protected Attributes

ilTree $tree
 
int $user_id
 
ilWorkspaceFolderUserSettingsRepository $repo
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning User settings for workspace folders

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file class.ilWorkspaceFolderUserSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilWorkspaceFolderUserSettings::__construct ( int  $user_id,
ilWorkspaceFolderUserSettingsRepository  $repo,
ilWorkspaceTree  $tree = null 
)

Definition at line 30 of file class.ilWorkspaceFolderUserSettings.php.

References $repo, and $user_id.

34  {
35  $this->repo = $repo;
36  $this->user_id = $user_id;
37  $this->tree = ($tree != null)
38  ? $tree
40  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilWorkspaceFolderUserSettingsRepository $repo

Member Function Documentation

◆ getEffectiveSortation()

ilWorkspaceFolderUserSettings::getEffectiveSortation ( int  $wfld_wsp_id)

Get effective sortation for a workspace folder (next upper context that has sortation > 0)

Definition at line 63 of file class.ilWorkspaceFolderUserSettings.php.

References $id, $path, $tree, ilTree\getPathId(), and ilWorkspaceFolderSorting\SORT_ALPHABETICAL_ASC.

63  : int
64  {
66 
67  // get path
68  $path = $tree->getPathId($wfld_wsp_id);
69  // get object ids of path
70  $obj_ids = array_map(function ($wsp_id) use ($tree) {
71  return $tree->lookupObjectId($wsp_id);
72  }, $path);
73 
74  // get sortations for object ids
75  $sortations = $this->repo->getSortationMultiple($obj_ids);
76 
77  // search bottom to top first one with sortation > 0
78  foreach (array_reverse($obj_ids) as $id) {
79  if ($sortations[$id] > 0) {
80  return $sortations[$id];
81  }
82  }
84  }
$path
Definition: ltiservices.php:32
getPathId(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getSortation()

ilWorkspaceFolderUserSettings::getSortation ( int  $wfld_id)

Definition at line 42 of file class.ilWorkspaceFolderUserSettings.php.

References ilObject\_lookupType(), ilWorkspaceFolderSorting\SORT_ALPHABETICAL_ASC, and ilWorkspaceFolderSorting\SORT_DERIVED.

42  : int
43  {
44  $sort = $this->repo->getSortation($wfld_id);
45  if ($sort > 0) {
46  return $sort;
47  }
48  if (ilObject::_lookupType($wfld_id) == "wfld") {
50  }
52  }
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ updateSortation()

ilWorkspaceFolderUserSettings::updateSortation ( int  $wfld_id,
int  $sortation 
)

Definition at line 54 of file class.ilWorkspaceFolderUserSettings.php.

55  {
56  $this->repo->updateSortation($wfld_id, $sortation);
57  }

Field Documentation

◆ $repo

ilWorkspaceFolderUserSettingsRepository ilWorkspaceFolderUserSettings::$repo
protected

Definition at line 28 of file class.ilWorkspaceFolderUserSettings.php.

Referenced by __construct().

◆ $tree

ilTree ilWorkspaceFolderUserSettings::$tree
protected

Definition at line 26 of file class.ilWorkspaceFolderUserSettings.php.

Referenced by getEffectiveSortation().

◆ $user_id

int ilWorkspaceFolderUserSettings::$user_id
protected

Definition at line 27 of file class.ilWorkspaceFolderUserSettings.php.

Referenced by __construct().


The documentation for this class was generated from the following file: