ILIAS  release_4-4 Revision
ilHtmlBlockGUIGen Class Reference

GUI class for HTML Block. More...

+ Inheritance diagram for ilHtmlBlockGUIGen:
+ Collaboration diagram for ilHtmlBlockGUIGen:

Public Member Functions

 __construct ()
 Constructor. More...
 
executeCommand ()
 Execute command. More...
 
 setFormEditMode ($a_form_edit_mode)
 Set FormEditMode. More...
 
 getFormEditMode ()
 Get FormEditMode. More...
 
 outputFormHtmlBlock ()
 FORM HtmlBlock: Output form. More...
 
 editHtmlBlock ()
 FORM HtmlBlock: Edit form. More...
 
 createHtmlBlock ()
 FORM HtmlBlock: Create HtmlBlock. More...
 
 saveHtmlBlock ()
 FORM HtmlBlock: Save HtmlBlock. More...
 
 updateHtmlBlock ()
 FORM HtmlBlock: Update HtmlBlock. More...
 
 getValuesHtmlBlock ()
 FORM HtmlBlock: Get current values for HtmlBlock form. More...
 
 checkInputHtmlBlock ()
 FORM HtmlBlock: Check input. More...
 
 prepareSaveHtmlBlock (&$a_html_block)
 FORM HtmlBlock: Prepare Saving of HtmlBlock. More...
 
 prepareFormHtmlBlock (&$a_form_gui)
 FORM HtmlBlock: Prepare form. More...
 
- Public Member Functions inherited from ilBlockGUI
 ilBlockGUI ()
 Constructor. More...
 
 addHeaderLink ($a_href, $a_text, $status=true)
 
 getHeaderLinks ()
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setBigMode ($a_bigmode)
 Set Big Mode. More...
 
 getBigMode ()
 Get Big Mode. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels. More...
 
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 getCurrentDetailLevel ()
 Get Current Detail Level. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setImage ($a_image)
 Set Image. More...
 
 getImage ()
 Get Image. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info. More...
 
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands ($a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setColSpan ($a_colspan)
 Set Columns Span. More...
 
 getColSpan ()
 Get Columns Span. More...
 
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow. More...
 
 getEnableDetailRow ()
 Get EnableDetailRow. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getDetailParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand ($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false)
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command. More...
 
 getHeaderCommands ()
 Get Header Block commands. More...
 
 addFooterLink ($a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
 Add a footer text/link. More...
 
 getFooterLinks ()
 Get footer links. More...
 
 clearFooterLinks ()
 Clear footer links. More...
 
 handleDetailLevel ()
 Handle read/write current detail level. More...
 
 getHTML ()
 Handle config status. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links. More...
 
 fillDetailRow ()
 Fill Detail Setting Row. More...
 

Protected Attributes

 $form_edit_mode
 
- Protected Attributes inherited from ilBlockGUI
 $data = array()
 
 $colspan = 1
 
 $enablenuminfo = true
 
 $detail_min = 0
 
 $detail_max = 0
 
 $bigmode = false
 
 $footer_links = array()
 
 $block_id = 0
 
 $header_commands = array()
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $enabledetailrow = true
 
 $header_links = array()
 
 $footerinfo = false
 
 $footerinfo_icon = false
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $dropdown
 

Additional Inherited Members

- Static Public Member Functions inherited from ilBlockGUI
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 
- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

Detailed Description

GUI class for HTML Block.

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

Definition at line 36 of file class.ilHtmlBlockGUIGen.php.

Constructor & Destructor Documentation

◆ __construct()

ilHtmlBlockGUIGen::__construct ( )

Constructor.

Definition at line 45 of file class.ilHtmlBlockGUIGen.php.

References $_GET, and $ilCtrl.

46  {
47  global $ilCtrl;
48 
49  $this->ctrl = $ilCtrl;
50 
51 
52  include_once("Services/Block/classes/class.ilHtmlBlock.php");
53  if ($_GET["html_block_id"] > 0)
54  {
55  $this->html_block = new ilHtmlBlock($_GET["html_block_id"]);
56  }
57 
58  $this->ctrl->saveParameter($this, array("html_block_id"));
59 
60 
61  }
$_GET["client_id"]
A HTML block allows to present simple HTML within a block.
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ checkInputHtmlBlock()

ilHtmlBlockGUIGen::checkInputHtmlBlock ( )

FORM HtmlBlock: Check input.

Definition at line 269 of file class.ilHtmlBlockGUIGen.php.

References $_POST, and ilTypeCheck\check().

Referenced by ilHtmlBlockGUI\saveHtmlBlock(), saveHtmlBlock(), and updateHtmlBlock().

270  {
271 
272  include_once("./Services/Utilities/classes/class.ilTypeCheck.php");
273  $ilTypeCheck = new ilTypeCheck();
274 
275  $this->form_check["HtmlBlock"] = array();
276  $this->form_check["HtmlBlock"]["Title"] =
277  ilTypeCheck::check("varchar", $_POST["block_title"], true);
278  $this->form_check["HtmlBlock"]["Content"] =
279  ilTypeCheck::check("text", $_POST["block_content"], false);
280 
281  foreach($this->form_check["HtmlBlock"] as $prop_check)
282  {
283  if (!$prop_check["ok"])
284  {
285  return false;
286  }
287  }
288  return true;
289 
290  }
$_POST['username']
Definition: cron.php:12
Type checking functions.
check($a_type, $a_value, $a_required=false, $a_min="", $a_max="")
Check input.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createHtmlBlock()

ilHtmlBlockGUIGen::createHtmlBlock ( )

FORM HtmlBlock: Create HtmlBlock.

Definition at line 179 of file class.ilHtmlBlockGUIGen.php.

References IL_FORM_CREATE, outputFormHtmlBlock(), and setFormEditMode().

Referenced by ilHtmlBlockGUI\create().

180  {
182  return $this->outputFormHtmlBlock();
183 
184  }
const IL_FORM_CREATE
setFormEditMode($a_form_edit_mode)
Set FormEditMode.
outputFormHtmlBlock()
FORM HtmlBlock: Output form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editHtmlBlock()

ilHtmlBlockGUIGen::editHtmlBlock ( )

FORM HtmlBlock: Edit form.

Definition at line 168 of file class.ilHtmlBlockGUIGen.php.

References IL_FORM_EDIT, outputFormHtmlBlock(), and setFormEditMode().

169  {
171  return $this->outputFormHtmlBlock();
172 
173  }
const IL_FORM_EDIT
setFormEditMode($a_form_edit_mode)
Set FormEditMode.
outputFormHtmlBlock()
FORM HtmlBlock: Output form.
+ Here is the call graph for this function:

◆ executeCommand()

& ilHtmlBlockGUIGen::executeCommand ( )

Execute command.

Definition at line 67 of file class.ilHtmlBlockGUIGen.php.

References $cmd, and $ilCtrl.

68  {
69  global $ilCtrl;
70 
71  // get next class and command
72  $next_class = $this->ctrl->getNextClass($this);
73  $cmd = $this->ctrl->getCmd();
74 
75  switch ($next_class)
76  {
77  default:
78  $html = $this->$cmd();
79  break;
80  }
81 
82  return $html;
83 
84  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18

◆ getFormEditMode()

ilHtmlBlockGUIGen::getFormEditMode ( )

Get FormEditMode.

Returns
int Form Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE | IL_FORM_RE_EDIT | IL_FORM_RE_CREATE)

Definition at line 101 of file class.ilHtmlBlockGUIGen.php.

References $form_edit_mode.

Referenced by getValuesHtmlBlock(), and outputFormHtmlBlock().

102  {
103  return $this->form_edit_mode;
104  }
+ Here is the caller graph for this function:

◆ getValuesHtmlBlock()

ilHtmlBlockGUIGen::getValuesHtmlBlock ( )

FORM HtmlBlock: Get current values for HtmlBlock form.

Definition at line 237 of file class.ilHtmlBlockGUIGen.php.

References $_POST, ilObjAdvancedEditing\_getUsedHTMLTagsAsString(), getFormEditMode(), IL_FORM_CREATE, IL_FORM_EDIT, IL_FORM_RE_CREATE, IL_FORM_RE_EDIT, and ilUtil\stripSlashes().

Referenced by outputFormHtmlBlock().

238  {
239  $values = array();
240 
241  switch ($this->getFormEditMode())
242  {
243  case IL_FORM_CREATE:
244  $values["Title"] = "";
245  $values["Content"] = "";
246  break;
247 
248  case IL_FORM_EDIT:
249  $values["Title"] = $this->html_block->getTitle();
250  $values["Content"] = $this->html_block->getContent();
251  break;
252 
253  case IL_FORM_RE_EDIT:
254  case IL_FORM_RE_CREATE:
255  $values["Title"] = ilUtil::stripSlashes($_POST["block_title"]);
256  $values["Content"] = ilUtil::stripSlashes($_POST["block_content"]
258  break;
259  }
260 
261  return $values;
262 
263  }
$_POST['username']
Definition: cron.php:12
& _getUsedHTMLTagsAsString($a_module="")
Returns a string of all allowed HTML tags for text editing.
const IL_FORM_CREATE
getFormEditMode()
Get FormEditMode.
const IL_FORM_EDIT
const IL_FORM_RE_EDIT
const IL_FORM_RE_CREATE
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ outputFormHtmlBlock()

ilHtmlBlockGUIGen::outputFormHtmlBlock ( )

FORM HtmlBlock: Output form.

Definition at line 110 of file class.ilHtmlBlockGUIGen.php.

References $lng, getFormEditMode(), getValuesHtmlBlock(), IL_FORM_CREATE, IL_FORM_RE_CREATE, and prepareFormHtmlBlock().

Referenced by createHtmlBlock(), editHtmlBlock(), saveHtmlBlock(), and updateHtmlBlock().

111  {
112  global $lng;
113 
114  $lng->loadLanguageModule("block");
115 
116  include("Services/Form/classes/class.ilPropertyFormGUI.php");
117 
118  $form_gui = new ilPropertyFormGUI();
119 
120  $values = $this->getValuesHtmlBlock();
121 
122  // Property Title
123  $alert = ($this->form_check["HtmlBlock"]["Title"]["error"] != "")
124  ? $this->form_check["HtmlBlock"]["Title"]["error"]
125  : "";
126  $form_gui->addTextProperty($lng->txt("block_html_block_title"),
127  "block_title",
128  $values["Title"],
129  "", $alert, true
130  , "200");
131 
132  // Property Content
133  $alert = ($this->form_check["HtmlBlock"]["Content"]["error"] != "")
134  ? $this->form_check["HtmlBlock"]["Content"]["error"]
135  : "";
136  $form_gui->addTextAreaProperty($lng->txt("block_html_block_content"),
137  "block_content",
138  $values["Content"],
139  "", $alert, false
140  , "40", "8", true);
141 
142  // save and cancel commands
143  if (in_array($this->getFormEditMode(), array(IL_FORM_CREATE,IL_FORM_RE_CREATE)))
144  {
145  $form_gui->addCommandButton("saveHtmlBlock", $lng->txt("save"));
146  $form_gui->addCommandButton("cancelSaveHtmlBlock", $lng->txt("cancel"));
147  }
148  else
149  {
150  $form_gui->addCommandButton("updateHtmlBlock", $lng->txt("save"));
151  $form_gui->addCommandButton("cancelUpdateHtmlBlock", $lng->txt("cancel"));
152  }
153 
154  $form_gui->setTitle($lng->txt("block_html_block_head"));
155  $form_gui->setFormAction($this->ctrl->getFormAction($this));
156 
157  // individual preparation of form
158  $this->prepareFormHtmlBlock($form_gui);
159 
160  return $form_gui->getHTML();
161 
162  }
This class represents a property form user interface.
prepareFormHtmlBlock(&$a_form_gui)
FORM HtmlBlock: Prepare form.
const IL_FORM_CREATE
getFormEditMode()
Get FormEditMode.
const IL_FORM_RE_CREATE
getValuesHtmlBlock()
FORM HtmlBlock: Get current values for HtmlBlock form.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareFormHtmlBlock()

ilHtmlBlockGUIGen::prepareFormHtmlBlock ( $a_form_gui)

FORM HtmlBlock: Prepare form.

(Can be overwritten in derived classes)

Parameters
object$a_form_guiilPropertyFormGUI instance.

Definition at line 307 of file class.ilHtmlBlockGUIGen.php.

Referenced by outputFormHtmlBlock().

308  {
309 
310  }
+ Here is the caller graph for this function:

◆ prepareSaveHtmlBlock()

ilHtmlBlockGUIGen::prepareSaveHtmlBlock ( $a_html_block)

FORM HtmlBlock: Prepare Saving of HtmlBlock.

Parameters
object$a_html_blockHtmlBlock object.

Definition at line 297 of file class.ilHtmlBlockGUIGen.php.

Referenced by saveHtmlBlock().

298  {
299 
300  }
+ Here is the caller graph for this function:

◆ saveHtmlBlock()

ilHtmlBlockGUIGen::saveHtmlBlock ( )

FORM HtmlBlock: Save HtmlBlock.

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

References $_POST, ilObjAdvancedEditing\_getUsedHTMLTagsAsString(), checkInputHtmlBlock(), IL_FORM_RE_CREATE, outputFormHtmlBlock(), prepareSaveHtmlBlock(), setFormEditMode(), and ilUtil\stripSlashes().

191  {
192  include_once("./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php");
193  if ($this->checkInputHtmlBlock())
194  {
195  $this->html_block = new ilHtmlBlock();
196  $this->html_block->setTitle(ilUtil::stripSlashes($_POST["block_title"]));
197  $this->html_block->setContent(ilUtil::stripSlashes($_POST["block_content"]
199  $this->prepareSaveHtmlBlock($this->html_block);
200  $this->html_block->create();
201  }
202  else
203  {
205  return $this->outputFormHtmlBlock();
206  }
207 
208  }
$_POST['username']
Definition: cron.php:12
& _getUsedHTMLTagsAsString($a_module="")
Returns a string of all allowed HTML tags for text editing.
A HTML block allows to present simple HTML within a block.
const IL_FORM_RE_CREATE
setFormEditMode($a_form_edit_mode)
Set FormEditMode.
prepareSaveHtmlBlock(&$a_html_block)
FORM HtmlBlock: Prepare Saving of HtmlBlock.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
checkInputHtmlBlock()
FORM HtmlBlock: Check input.
outputFormHtmlBlock()
FORM HtmlBlock: Output form.
+ Here is the call graph for this function:

◆ setFormEditMode()

ilHtmlBlockGUIGen::setFormEditMode (   $a_form_edit_mode)

Set FormEditMode.

Parameters
int$a_form_edit_modeForm Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE | IL_FORM_RE_EDIT | IL_FORM_RE_CREATE)

Definition at line 91 of file class.ilHtmlBlockGUIGen.php.

Referenced by createHtmlBlock(), editHtmlBlock(), saveHtmlBlock(), and updateHtmlBlock().

92  {
93  $this->form_edit_mode = $a_form_edit_mode;
94  }
+ Here is the caller graph for this function:

◆ updateHtmlBlock()

ilHtmlBlockGUIGen::updateHtmlBlock ( )

FORM HtmlBlock: Update HtmlBlock.

Definition at line 214 of file class.ilHtmlBlockGUIGen.php.

References $_POST, ilObjAdvancedEditing\_getUsedHTMLTagsAsString(), checkInputHtmlBlock(), IL_FORM_RE_EDIT, outputFormHtmlBlock(), setFormEditMode(), and ilUtil\stripSlashes().

215  {
216  include_once("./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php");
217  if ($this->checkInputHtmlBlock())
218  {
219 
220  $this->html_block->setTitle(ilUtil::stripSlashes($_POST["block_title"]));
221  $this->html_block->setContent(ilUtil::stripSlashes($_POST["block_content"]
223  $this->html_block->update();
224  }
225  else
226  {
228  return $this->outputFormHtmlBlock();
229  }
230 
231  }
$_POST['username']
Definition: cron.php:12
& _getUsedHTMLTagsAsString($a_module="")
Returns a string of all allowed HTML tags for text editing.
const IL_FORM_RE_EDIT
setFormEditMode($a_form_edit_mode)
Set FormEditMode.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
checkInputHtmlBlock()
FORM HtmlBlock: Check input.
outputFormHtmlBlock()
FORM HtmlBlock: Output form.
+ Here is the call graph for this function:

Field Documentation

◆ $form_edit_mode

ilHtmlBlockGUIGen::$form_edit_mode
protected

Definition at line 39 of file class.ilHtmlBlockGUIGen.php.

Referenced by getFormEditMode().


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