ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilRepositoryObjectPluginSlot.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
12{
16 static function addCreatableSubObjects($a_obj_array)
17 {
18 global $ilPluginAdmin;
19 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "Repository", "robj");
20 foreach ($pl_names as $pl)
21 {
22 $pl_id = $ilPluginAdmin->getId(IL_COMP_SERVICE, "Repository", "robj", $pl);
23 if ($pl_id != "")
24 {
25 $a_obj_array[$pl_id] = array("name" => $pl_id, "lng" => $pl_id, "plugin" => true);
26 }
27 }
28
29 return $a_obj_array;
30 }
31
35 static function isTypePlugin($a_type, $a_active_status = true)
36 {
37 global $ilPluginAdmin;
38
39 include_once("./Services/Component/classes/class.ilPlugin.php");
40 $pname = ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $a_type);
41 if ($pname == "")
42 {
43 return false;
44 }
45
46 if ($ilPluginAdmin->exists(IL_COMP_SERVICE, "Repository", "robj", $pname))
47 {
48 if (!$a_active_status ||
49 $ilPluginAdmin->isActive(IL_COMP_SERVICE, "Repository", "robj", $pname))
50 {
51 return true;
52 }
53 }
54 return false;
55 }
56
64 static function isTypePluginWithLP($a_type, $a_active_status = true)
65 {
66 global $ilPluginAdmin;
67
68 include_once("./Services/Component/classes/class.ilPlugin.php");
69 $pname = ilPlugin::lookupNameForId(IL_COMP_SERVICE, "Repository", "robj", $a_type);
70 if ($pname == "")
71 {
72 return false;
73 }
74
75 if ($ilPluginAdmin->exists(IL_COMP_SERVICE, "Repository", "robj", $pname))
76 {
77 if (!$a_active_status ||
78 $ilPluginAdmin->isActive(IL_COMP_SERVICE, "Repository", "robj", $pname))
79 {
80 if($ilPluginAdmin->hasLearningProgress(IL_COMP_SERVICE, "Repository", "robj", $pname))
81 {
82 return true;
83 }
84 }
85 }
86 return false;
87 }
88}
const IL_COMP_SERVICE
lookupNameForId($a_ctype, $a_cname, $a_slot_id, $a_plugin_id)
Lookup name for id.
Helper methods for repository object plugins.
static isTypePlugin($a_type, $a_active_status=true)
Checks whether a repository type is a plugin or not.
static isTypePluginWithLP($a_type, $a_active_status=true)
Check whether a repository type is a plugin which has active learning progress.
static addCreatableSubObjects($a_obj_array)
Adds objects that can be created to the add new object list array.