ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilPCContentIncludeGUI Class Reference

Class ilPCContentIncludeGUI. More...

+ Inheritance diagram for ilPCContentIncludeGUI:
+ Collaboration diagram for ilPCContentIncludeGUI:

Public Member Functions

 __construct (&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
 Constructor @access public. More...
 
 executeCommand ()
 execute command More...
 
 insert ()
 Insert new resources component form. More...
 
 insertFromPool ($a_post_cmd="edpost", $a_submit_cmd="create_mob")
 Insert page snippet from media pool. More...
 
 poolSelection ()
 Pool Selection. More...
 
 create ()
 create new content include in dom and update page in db More...
 
 selectPool ()
 Select concrete pool. More...
 
- Public Member Functions inherited from ilPageContentGUI
 __construct ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor @access public. More...
 
 setContentObject ($a_val)
 Set content object. More...
 
 getContentObject ()
 Get content object. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 setPageConfig ($a_val)
 Set Page Config. More...
 
 getPageConfig ()
 Get Page Config. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 getStyle ()
 Get style object. More...
 
 setCharacteristics ($a_chars)
 Set Characteristics. More...
 
 getCharacteristics ()
 Get characteristics. More...
 
 getHierId ()
 get hierarchical id in dom object More...
 
 setHierId ($a_hier_id)
 get hierarchical id in dom object More...
 
 getBBMenu ($a_ta_name="par_content")
 Get the bb menu incl. More...
 
 delete ()
 delete content element More...
 
 moveAfter ()
 move content element after another element More...
 
 moveBefore ()
 move content element before another element More...
 
 splitPage ()
 split page to new page at specified position More...
 
 splitPageNext ()
 split page to next page at specified position More...
 
 displayValidationError ()
 display validation errors More...
 
 cancelCreate ()
 cancel creating page content More...
 
 cancelUpdate ()
 cancel update More...
 
 cancel ()
 Cancel. More...
 
 deactivate ()
 gui function set enabled if is not enabled and vice versa More...
 
 cut ()
 Cut single element. More...
 
 copy ()
 Copy single element. More...
 
 getTemplateOptions ($a_type)
 Get table templates. More...
 

Protected Attributes

 $access
 
 $tabs
 
- Protected Attributes inherited from ilPageContentGUI
 $error
 
 $log
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $tpl
 
 $lng
 
 $ctrl
 
 $pg_obj
 
 $hier_id
 
 $dom
 
 $updated
 
 $target_script
 
 $return_location
 
 $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 
- Static Protected Attributes inherited from ilPageContentGUI
static $common_bb_buttons
 

Detailed Description

Class ilPCContentIncludeGUI.

User Interface for Content Includes (Snippets) Editing

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 17 of file class.ilPCContentIncludeGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPCContentIncludeGUI::__construct ( $a_pg_obj,
$a_content_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Constructor @access public.

Definition at line 34 of file class.ilPCContentIncludeGUI.php.

35 {
36 global $DIC;
37
38 $this->ctrl = $DIC->ctrl();
39 $this->access = $DIC->access();
40 $this->tabs = $DIC->tabs();
41 $this->tpl = $DIC["tpl"];
42 $this->lng = $DIC->language();
43 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
44 }
global $DIC
Definition: saml.php:7

References $DIC.

Member Function Documentation

◆ create()

ilPCContentIncludeGUI::create ( )

create new content include in dom and update page in db

Definition at line 162 of file class.ilPCContentIncludeGUI.php.

163 {
166
167 if (is_array($_POST["id"])) {
168 for ($i = count($_POST["id"]) - 1; $i>=0; $i--) {
169 // similar code in ilpageeditorgui::insertFromClipboard
170 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
171 include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
172 $this->content_obj = new ilPCContentInclude($this->getPage());
173 $this->content_obj->create($this->pg_obj, $_GET["hier_id"], $this->pc_id);
174 $this->content_obj->setContentType("mep");
175 $this->content_obj->setContentId($_POST["id"][$i]);
176 }
177 $this->updated = $this->pg_obj->update();
178 }
179 if ($this->updated === true) {
180 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
181 } else {
182 $this->insert();
183 }
184 }
$_GET["client_id"]
$_POST["username"]
insert()
Insert new resources component form.
Class ilPCContentInclude.
$i
Definition: disco.tpl.php:19
global $ilCtrl
Definition: ilias.php:18

References $_GET, $_POST, ilPageContentGUI\$ctrl, $i, $ilCtrl, ilPageContentGUI\$lng, ilPageContentGUI\getPage(), and insert().

+ Here is the call graph for this function:

◆ executeCommand()

ilPCContentIncludeGUI::executeCommand ( )

execute command

Definition at line 49 of file class.ilPCContentIncludeGUI.php.

50 {
51 // get next class that processes or forwards current command
52 $next_class = $this->ctrl->getNextClass($this);
53
54 // get current command
55 $cmd = $this->ctrl->getCmd();
56
57 switch ($next_class) {
58 default:
59 $ret = $this->$cmd();
60 break;
61 }
62
63 return $ret;
64 }
$ret
Definition: parser.php:6

References $ret.

◆ insert()

ilPCContentIncludeGUI::insert ( )

Insert new resources component form.

Definition at line 69 of file class.ilPCContentIncludeGUI.php.

70 {
71 switch ($_GET["subCmd"]) {
72 case "selectPool":
73 $this->selectPool();
74 break;
75
76 case "poolSelection":
77 $this->poolSelection();
78 break;
79
80 default:
81 $this->insertFromPool($a_post_cmd, $a_submit_cmd);
82 break;
83 }
84 }
selectPool()
Select concrete pool.
insertFromPool($a_post_cmd="edpost", $a_submit_cmd="create_mob")
Insert page snippet from media pool.

References $_GET, insertFromPool(), poolSelection(), and selectPool().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertFromPool()

ilPCContentIncludeGUI::insertFromPool (   $a_post_cmd = "edpost",
  $a_submit_cmd = "create_mob" 
)

Insert page snippet from media pool.

Definition at line 89 of file class.ilPCContentIncludeGUI.php.

90 {
92 $ilAccess = $this->access;
93 $ilTabs = $this->tabs;
96
97
98 if ($_SESSION["cont_media_pool"] != "" &&
99 $ilAccess->checkAccess("write", "", $_SESSION["cont_media_pool"])
100 && ilObject::_lookupType(ilObject::_lookupObjId($_SESSION["cont_media_pool"])) == "mep") {
101 $html = "";
102 $tb = new ilToolbarGUI();
103
104 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
105
106 $tb->addButton(
107 $lng->txt("cont_select_media_pool"),
108 $ilCtrl->getLinkTarget($this, "insert")
109 );
110 $html = $tb->getHTML();
111
112 $ilCtrl->setParameter($this, "subCmd", "");
113
114 include_once("./Modules/MediaPool/classes/class.ilObjMediaPool.php");
115 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
116 $pool = new ilObjMediaPool($_SESSION["cont_media_pool"]);
117 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
118 $mpool_table = new ilMediaPoolTableGUI(
119 $this,
120 "insert",
121 $pool,
122 "mep_folder",
124 );
125 $mpool_table->setInsertCommand("create_incl");
126
127 $html.= $mpool_table->getHTML();
128
129 $tpl->setContent($html);
130 } else {
131 $this->poolSelection();
132 }
133 }
$_SESSION["AccountId"]
TableGUI class for recent changes in wiki.
Media pool object.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
$html
Definition: example_001.php:87

References $_SESSION, $access, ilPageContentGUI\$ctrl, $html, $ilCtrl, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, ilObject\_lookupObjId(), ilObject\_lookupType(), ilMediaPoolTableGUI\IL_MEP_SELECT_CONTENT, and poolSelection().

Referenced by insert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ poolSelection()

ilPCContentIncludeGUI::poolSelection ( )

Pool Selection.

Definition at line 138 of file class.ilPCContentIncludeGUI.php.

139 {
142
143 // $this->getTabs($ilTabs, true);
144 // $ilTabs->setSubTabActive("cont_mob_from_media_pool");
145
146 include_once "./Services/COPage/classes/class.ilPoolSelectorGUI.php";
147 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
148 $exp = new ilPoolSelectorGUI($this, "insert");
149
150 // filter
151 $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "mep"));
152 $exp->setClickableTypes(array('mep'));
153
154 if (!$exp->handleCommand()) {
155 $tpl->setContent($exp->getHTML());
156 }
157 }
Select media pool for adding objects into pages.

References ilPageContentGUI\$ctrl, $ilCtrl, and ilPageContentGUI\$tpl.

Referenced by insert(), and insertFromPool().

+ Here is the caller graph for this function:

◆ selectPool()

ilPCContentIncludeGUI::selectPool ( )

Select concrete pool.

Definition at line 189 of file class.ilPCContentIncludeGUI.php.

190 {
192
193 $_SESSION["cont_media_pool"] = $_GET["pool_ref_id"];
194 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
195 $ilCtrl->redirect($this, "insert");
196 }

References $_GET, $_SESSION, ilPageContentGUI\$ctrl, and $ilCtrl.

Referenced by insert().

+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilPCContentIncludeGUI::$access
protected

Definition at line 22 of file class.ilPCContentIncludeGUI.php.

Referenced by insertFromPool().

◆ $tabs

ilPCContentIncludeGUI::$tabs
protected

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

Referenced by insertFromPool().


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