ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPCListGUI Class Reference

Class ilPCListGUI. More...

+ Inheritance diagram for ilPCListGUI:
+ Collaboration diagram for ilPCListGUI:

Public Member Functions

 ilPCListGUI (&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
 Constructor public.
executeCommand ()
 execute command
 insert ()
 insert new list form
 create ()
 Save list.
 edit ()
 edit properties form
 saveProperties ()
 Save properties.
 initListForm ($a_mode="edit")
 Init list form.
 getValues ()
 Get current values for list from.
- Public Member Functions inherited from ilPageContentGUI
 ilPageContentGUI (&$a_pg_obj, &$a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor public.
 setStyleId ($a_styleid)
 Set Style Id.
 getStyleId ()
 Get Style Id.
 getStyle ()
 Get style object.
 setCharacteristics ($a_chars)
 Set Characteristics.
 getCharacteristics ()
 Get characteristics.
 getHierId ()
 get hierarchical id in dom object
 setHierId ($a_hier_id)
 get hierarchical id in dom object
 getBBMenu ($a_ta_name="par_content")
 Get the bb menu incl.
 delete ()
 delete content element
 moveAfter ()
 move content element after another element
 moveBefore ()
 move content element before another element
 splitPage ()
 split page to new page at specified position
 splitPageNext ()
 split page to next page at specified position
 displayValidationError ()
 display validation errors
 cancelCreate ()
 cancel creating page content
 cancelUpdate ()
 cancel update
 deactivate ()
 gui function set enabled if is not enabled and vice versa
 getTemplateOptions ($a_type)
 Get table templates.

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons.
- Data Fields inherited from ilPageContentGUI
 $content_obj
 $ilias
 $tpl
 $lng
 $ctrl
 $pg_obj
 $hier_id
 $dom
 $updated
 $target_script
 $return_location
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style.
- Static Protected Attributes inherited from ilPageContentGUI
static $common_bb_buttons

Detailed Description

Class ilPCListGUI.

User Interface for LM List Editing

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilPCListGUI.php 23226 2010-03-17 11:41:07Z akill

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

Member Function Documentation

ilPCListGUI::create ( )

Save list.

Definition at line 66 of file class.ilPCListGUI.php.

References $_POST, $ilCtrl, ilPageContentGUI\$lng, ilPageContentGUI\$tpl, and initListForm().

{
global $tpl, $lng, $ilCtrl;
$this->initListForm("create");
if ($this->form->checkInput())
{
$this->content_obj = new ilPCList($this->dom);
$this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
$this->content_obj->addItems($_POST["nr_items"]);
$this->content_obj->setStartValue($_POST["start_value"]);
$this->content_obj->setListType($_POST["list_type"]);
if ($_POST["list_type"] == "Unordered")
{
$this->content_obj->setNumberingType("");
$this->content_obj->setStyleClass($_POST["bullet_style"]);
}
else
{
$this->content_obj->setNumberingType($_POST["numbering_type"]);
$this->content_obj->setStyleClass($_POST["number_style"]);
}
$this->updated = $this->pg_obj->update();
if ($this->updated === true)
{
$this->ctrl->returnToParent($this, "jump".$this->hier_id);
}
}
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}

+ Here is the call graph for this function:

ilPCListGUI::edit ( )

edit properties form

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

References ilPageContentGUI\displayValidationError(), getValues(), and initListForm().

{
$this->initListForm("edit");
$this->getValues();
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

& ilPCListGUI::executeCommand ( )

execute command

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

References $cmd, and $ret.

{
// get next class that processes or forwards current command
$next_class = $this->ctrl->getNextClass($this);
// get current command
$cmd = $this->ctrl->getCmd();
switch($next_class)
{
default:
$ret =& $this->$cmd();
break;
}
return $ret;
}
ilPCListGUI::getValues ( )

Get current values for list from.

Definition at line 280 of file class.ilPCListGUI.php.

References ilPageContentGUI\$tpl.

Referenced by edit().

{
global $tpl;
$values = array();
$values["start_value"] = $this->content_obj->getStartValue();
$values["list_type"] = $this->content_obj->getListType();
$values["numbering_type"] = $this->content_obj->getNumberingType();
if ($values["list_type"] == "Ordered")
{
$values["number_style"] = $this->content_obj->getStyleClass();
$values["bullet_style"] = "";
}
else
{
$values["bullet_style"] = $this->content_obj->getStyleClass();
$values["number_style"] = "";
}
$this->form->setValuesByArray($values);
}

+ Here is the caller graph for this function:

ilPCListGUI::ilPCListGUI ( $a_pg_obj,
$a_content_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Constructor public.

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

References ilPageContentGUI\ilPageContentGUI().

{
parent::ilPageContentGUI($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
}

+ Here is the call graph for this function:

ilPCListGUI::initListForm (   $a_mode = "edit")

Init list form.

Parameters
int$a_modeEdit Mode

Definition at line 148 of file class.ilPCListGUI.php.

References ilPageContentGUI\$lng, ilSubEnabledFormPropertyGUI\addSubItem(), ilPageContentGUI\getCharacteristics(), ilPageContentGUI\getCharacteristicsOfCurrentStyle(), ilNumberInputGUI\setMaxLength(), and ilSelectInputGUI\setOptions().

Referenced by create(), edit(), insert(), and saveProperties().

{
global $lng;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
// type
$radg = new ilRadioGroupInputGUI($lng->txt("type"), "list_type");
$op1 = new ilRadioOption($lng->txt("cont_bullet_list"), "Unordered");
// style of bullet list
require_once("./Services/Form/classes/class.ilAdvSelectInputGUI.php");
$style = new ilAdvSelectInputGUI($this->lng->txt("cont_style"),
"bullet_style");
$options = $this->getCharacteristics();
if ($a_mode == "edit" && $this->content_obj->getListType() == "Unordered"
&& $this->content_obj->getStyleClass() != ""
&& !in_array($this->content_obj->getStyleClass(), $options))
{
$options[$this->content_obj->getStyleClass()] =
$this->content_obj->getStyleClass();
}
if (count($options) > 1)
{
foreach($options as $k => $option)
{
$html = '<ul class="ilc_list_u_'.$k.'"><li class="ilc_list_item_StandardListItem">'.
$option.'</li></ul>';
if ($k == "BulletedList")
{
$k = "";
}
$style->addOption($k, $option, $html);
}
$style->setValue("");
$op1->addSubItem($style);
}
$radg->addOption($op1);
$op2 = new ilRadioOption($lng->txt("cont_numbered_list"), "Ordered");
// style of numbered list
require_once("./Services/Form/classes/class.ilAdvSelectInputGUI.php");
$style = new ilAdvSelectInputGUI($this->lng->txt("cont_style"),
"number_style");
$options = $this->getCharacteristics();
if ($a_mode == "edit" && $this->content_obj->getListType() == "Ordered"
&& $this->content_obj->getStyleClass() != ""
&& !in_array($this->content_obj->getStyleClass(), $options))
{
$options[$this->content_obj->getStyleClass()] =
$this->content_obj->getStyleClass();
}
if (count($options) > 1)
{
foreach($options as $k => $option)
{
$html = '<ol class="ilc_list_o_'.$k.'"><li class="ilc_list_item_StandardListItem">'.
$option.'</li></ol>';
if ($k == "NumberedList")
{
$k = "";
}
$style->addOption($k, $option, $html);
}
$style->setValue("");
$op2->addSubItem($style);
}
// numeric type
$options = array(
"Number" => $this->lng->txt("cont_number_std"),
"Decimal" => $this->lng->txt("cont_decimal"),
"Roman" => $this->lng->txt("cont_roman"),
"roman" => $this->lng->txt("cont_roman_s"),
"Alphabetic" => $this->lng->txt("cont_alphabetic"),
"alphabetic" => $this->lng->txt("cont_alphabetic_s")
);
$si = new ilSelectInputGUI($this->lng->txt("cont_number_type"), "numbering_type");
$si->setOptions($options);
$op2->addSubItem($si);
// starting value
$ni = new ilNumberInputGUI($this->lng->txt("cont_start_value"), "start_value");
$ni->setMaxLength(3);
$ni->setSize(3);
$ni->setInfo($lng->txt("cont_start_value_info"));
$op2->addSubItem($ni);
$radg->addOption($op2);
$radg->setValue("Unordered");
$this->form->addItem($radg);
// nr of items
$options = array();
if ($a_mode == "create")
{
for ($i=1; $i<=10; $i++)
{
$options[$i] = $i;
}
$si = new ilSelectInputGUI($this->lng->txt("cont_nr_items"), "nr_items");
$si->setOptions($options);
$si->setValue(2);
$this->form->addItem($si);
}
// save and cancel commands
if ($a_mode == "create")
{
$this->form->addCommandButton("create_list", $lng->txt("save"));
$this->form->addCommandButton("cancelCreate", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("cont_insert_list"));
}
else
{
$this->form->addCommandButton("saveProperties", $lng->txt("save"));
$this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("cont_list_properties"));
}
$this->form->setFormAction($this->ctrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPCListGUI::insert ( )

insert new list form

Definition at line 54 of file class.ilPCListGUI.php.

References ilPageContentGUI\displayValidationError(), and initListForm().

{
$this->initListForm("create");
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilPCListGUI::saveProperties ( )

Save properties.

Definition at line 113 of file class.ilPCListGUI.php.

References $_POST, $ilCtrl, ilPageContentGUI\$lng, ilPageContentGUI\$tpl, and initListForm().

{
global $lng, $ilCtrl, $tpl;
$this->initListForm("edit");
if ($this->form->checkInput())
{
$this->content_obj->setStartValue($_POST["start_value"]);
$this->content_obj->setListType($_POST["list_type"]);
if ($_POST["list_type"] == "Unordered")
{
$this->content_obj->setNumberingType("");
$this->content_obj->setStyleClass($_POST["bullet_style"]);
}
else
{
$this->content_obj->setNumberingType($_POST["numbering_type"]);
$this->content_obj->setStyleClass($_POST["number_style"]);
}
$this->updated = $this->pg_obj->update();
if ($this->updated === true)
{
$this->ctrl->returnToParent($this, "jump".$this->hier_id);
}
}
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}

+ Here is the call graph for this function:


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