ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
class.ilPluginLP.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once "Services/Object/classes/class.ilObjectLP.php";
6
15{
16 protected $status; // [mixed]
17
18 const INACTIVE_PLUGIN = -1;
19
20 protected function __construct($a_obj_id)
21 {
22 parent::__construct($a_obj_id);
23
24 $this->initPlugin();
25 }
26
27 protected function initPlugin()
28 {
29 // active plugin?
30 include_once 'Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php';
32 {
33 $obj = ilObjectFactory::getInstanceByObjId($this->obj_id, false); // #12640
34 if($obj && $obj instanceof ilLPStatusPluginInterface)
35 {
36 $this->status = $obj;
37 }
38 }
39 // inactive plugin?
41 {
42 $this->status = self::INACTIVE_PLUGIN;
43 }
44 }
45
46 public function getPluginInstance()
47 {
48 return $this->status;
49 }
50
51 public function getDefaultMode()
52 {
54 }
55
56 public function getValidModes()
57 {
58 return array(
61 );
62 }
63
64 public function getCurrentMode()
65 {
66 if($this->status !== null)
67 {
69 }
71 }
72}
73
74?>
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupType($a_id, $a_reference=false)
lookup object type
__construct($a_obj_id)
const INACTIVE_PLUGIN
static isTypePluginWithLP($a_type, $a_active_status=true)
Check whether a repository type is a plugin which has active learning progress.
Interface for plugin classes that want to support Learning Progress.