ILIAS  release_4-4 Revision
ilPCContentIncludeGUI Class Reference

Class ilPCContentIncludeGUI. More...

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

Public Member Functions

 ilPCContentIncludeGUI (&$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
 ilPageContentGUI ($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
 
- 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.

Member Function Documentation

◆ create()

ilPCContentIncludeGUI::create ( )

create new content include in dom and update page in db

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

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

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

◆ ilPCContentIncludeGUI()

ilPCContentIncludeGUI::ilPCContentIncludeGUI ( $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::ilPageContentGUI($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
27  }

◆ 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, $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  $tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
84  $tpl->setCurrentBlock("btn_cell");
85  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
86  $tpl->setVariable("BTN_LINK",
87  $ilCtrl->getLinkTarget($this, "insert"));
88  $ilCtrl->setParameter($this, "subCmd", "");
89  $tpl->setVariable("BTN_TXT", $lng->txt("cont_select_media_pool"));
90  $tpl->parseCurrentBlock();
91 
92 // $this->getTabs($ilTabs, true);
93 // $ilTabs->setSubTabActive("cont_mob_from_media_pool");
94 
95  include_once("./Modules/MediaPool/classes/class.ilObjMediaPool.php");
96  include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
97  $pool = new ilObjMediaPool($_SESSION["cont_media_pool"]);
98  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
99  $mpool_table = new ilMediaPoolTableGUI($this, "insert", $pool, "mep_folder",
101  $mpool_table->setInsertCommand("create_incl");
102 
103  $tpl->setContent($mpool_table->getHTML());
104  }
105  else
106  {
107  $this->poolSelection();
108  }
109  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
global $ilCtrl
Definition: ilias.php:18
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
Media pool object.
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 114 of file class.ilPCContentIncludeGUI.php.

References $_GET, $ilCtrl, ilPageContentGUI\$tpl, IL_FM_POSITIVE, and ilPoolSelectorGUI\setContentGUIClass().

Referenced by insert(), and insertFromPool().

115  {
116  global $ilCtrl, $tree, $tpl, $ilTabs;
117 
118 // $this->getTabs($ilTabs, true);
119 // $ilTabs->setSubTabActive("cont_mob_from_media_pool");
120 
121  include_once "./Services/COPage/classes/class.ilPoolSelectorGUI.php";
122  $exp = new ilPoolSelectorGUI($this->ctrl->getLinkTarget($this, "insert"));
123  $exp->setContentGUIClass(get_class($this));
124  if ($_GET["expand"] == "")
125  {
126  $expanded = $tree->readRootId();
127  }
128  else
129  {
130  $expanded = $_GET["expand"];
131  }
132  $exp->setExpand($expanded);
133 
134  $exp->setTargetGet("sel_id");
135  $this->ctrl->setParameter($this, "target_type", $a_type);
136  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
137  $exp->setParamsGet($this->ctrl->getParameterArray($this, "insert"));
138 
139  // filter
140  $exp->setFiltered(true);
141  $exp->setFilterMode(IL_FM_POSITIVE);
142  $exp->addFilter("root");
143  $exp->addFilter("cat");
144  $exp->addFilter("grp");
145  $exp->addFilter("fold");
146  $exp->addFilter("crs");
147  $exp->addFilter("mep");
148 
149  $sel_types = array('mep');
150 
151  $exp->setOutput(0);
152 
153  $tpl->setContent($exp->getOutput());
154  }
$_GET["client_id"]
const IL_FM_POSITIVE
global $ilCtrl
Definition: ilias.php:18
setContentGUIClass($a_val)
Set content GUI class.
Select media pool for adding objects into pages.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ selectPool()

ilPCContentIncludeGUI::selectPool ( )

Select concrete pool.

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

References $_GET, $_SESSION, and $ilCtrl.

Referenced by insert().

191  {
192  global $ilCtrl;
193 
194  $_SESSION["cont_media_pool"] = $_GET["pool_ref_id"];
195  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
196  $ilCtrl->redirect($this, "insert");
197  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_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: