ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 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 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $ilias
 
 $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...
 
- Protected Attributes inherited from ilPageContentGUI
 $log
 
- 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 public.

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

25  {
26  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
27  }

Member Function Documentation

◆ create()

ilPCContentIncludeGUI::create ( )

create new content include in dom and update page in db

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

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

140  {
141  global $ilCtrl, $lng;
142 
143  if (is_array($_POST["id"]))
144  {
145  for($i = count($_POST["id"]) - 1; $i>=0; $i--)
146  {
147  // similar code in ilpageeditorgui::insertFromClipboard
148  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
149  include_once("./Services/COPage/classes/class.ilPCMediaObject.php");
150  $this->content_obj = new ilPCContentInclude($this->getPage());
151  $this->content_obj->create($this->pg_obj, $_GET["hier_id"], $this->pc_id);
152  $this->content_obj->setContentType("mep");
153  $this->content_obj->setContentId($_POST["id"][$i]);
154  }
155  $this->updated = $this->pg_obj->update();
156  }
157  if ($this->updated === true)
158  {
159  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
160  }
161  else
162  {
163  $this->insert();
164  }
165  }
$_GET["client_id"]
insert()
Insert new resources component form.
global $ilCtrl
Definition: ilias.php:18
Class ilPCContentInclude.
$_POST["username"]
+ Here is the call graph for this function:

◆ executeCommand()

ilPCContentIncludeGUI::executeCommand ( )

execute command

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

References $cmd, and $ret.

33  {
34  // get next class that processes or forwards current command
35  $next_class = $this->ctrl->getNextClass($this);
36 
37  // get current command
38  $cmd = $this->ctrl->getCmd();
39 
40  switch($next_class)
41  {
42  default:
43  $ret = $this->$cmd();
44  break;
45  }
46 
47  return $ret;
48  }
$cmd
Definition: sahs_server.php:35
$ret
Definition: parser.php:6

◆ insert()

ilPCContentIncludeGUI::insert ( )

Insert new resources component form.

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

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

Referenced by create().

54  {
55  switch ($_GET["subCmd"])
56  {
57  case "selectPool":
58  $this->selectPool();
59  break;
60 
61  case "poolSelection":
62  $this->poolSelection();
63  break;
64 
65  default:
66  $this->insertFromPool($a_post_cmd, $a_submit_cmd);
67  break;
68  }
69  }
$_GET["client_id"]
insertFromPool($a_post_cmd="edpost", $a_submit_cmd="create_mob")
Insert page snippet from media pool.
selectPool()
Select concrete pool.
+ 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 74 of file class.ilPCContentIncludeGUI.php.

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

Referenced by insert().

75  {
76  global $ilCtrl, $ilAccess, $ilTabs, $tpl, $lng;
77 
78 
79  if ($_SESSION["cont_media_pool"] != "" &&
80  $ilAccess->checkAccess("write", "", $_SESSION["cont_media_pool"])
81  && ilObject::_lookupType(ilObject::_lookupObjId($_SESSION["cont_media_pool"])) == "mep")
82  {
83  $html = "";
84  $tb = new ilToolbarGUI();
85 
86  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
87 
88  $tb->addButton($lng->txt("cont_select_media_pool"),
89  $ilCtrl->getLinkTarget($this, "insert"));
90  $html = $tb->getHTML();
91 
92  $ilCtrl->setParameter($this, "subCmd", "");
93 
94  include_once("./Modules/MediaPool/classes/class.ilObjMediaPool.php");
95  include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
96  $pool = new ilObjMediaPool($_SESSION["cont_media_pool"]);
97  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
98  $mpool_table = new ilMediaPoolTableGUI($this, "insert", $pool, "mep_folder",
100  $mpool_table->setInsertCommand("create_incl");
101 
102  $html.= $mpool_table->getHTML();
103 
104  $tpl->setContent($html);
105  }
106  else
107  {
108  $this->poolSelection();
109  }
110  }
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
Media pool object.
$html
Definition: example_001.php:87
TableGUI class for recent changes in wiki.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ poolSelection()

ilPCContentIncludeGUI::poolSelection ( )

Pool Selection.

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

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

Referenced by insert(), and insertFromPool().

116  {
117  global $tpl, $ilCtrl;
118 
119 // $this->getTabs($ilTabs, true);
120 // $ilTabs->setSubTabActive("cont_mob_from_media_pool");
121 
122  include_once "./Services/COPage/classes/class.ilPoolSelectorGUI.php";
123  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
124  $exp = new ilPoolSelectorGUI($this, "insert");
125 
126  // filter
127  $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "mep"));
128  $exp->setClickableTypes(array('mep'));
129 
130  if (!$exp->handleCommand())
131  {
132  $tpl->setContent($exp->getHTML());
133  }
134  }
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
Select media pool for adding objects into pages.
+ Here is the caller graph for this function:

◆ selectPool()

ilPCContentIncludeGUI::selectPool ( )

Select concrete pool.

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

References $_GET, $_SESSION, and $ilCtrl.

Referenced by insert().

171  {
172  global $ilCtrl;
173 
174  $_SESSION["cont_media_pool"] = $_GET["pool_ref_id"];
175  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
176  $ilCtrl->redirect($this, "insert");
177  }
$_SESSION["AccountId"]
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

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