ILIAS  Release_3_10_x_branch Revision 61812
 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 ()
 create new table in dom and update page in db
 edit ()
 edit properties form
 saveProperties ()
 save table properties in db and return to page edit screen
- Public Member Functions inherited from ilPageContentGUI
 ilPageContentGUI (&$a_pg_obj, &$a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor public.
 getHierId ()
 get hierarchical id in dom object
 setHierId ($a_hier_id)
 get hierarchical id in dom object
 getBBMenu ()
 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

Additional Inherited Members

- Data Fields inherited from ilPageContentGUI
 $content_obj
 $ilias
 $tpl
 $lng
 $ctrl
 $pg_obj
 $hier_id
 $dom
 $updated
 $target_script
 $return_location

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 17171 2008-08-19 08:09:35Z akill

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

Member Function Documentation

ilPCListGUI::create ( )

create new table in dom and update page in db

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

References insert().

{
$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->setOrderType($_POST["list_order"]);
$this->updated = $this->pg_obj->update();
if ($this->updated === true)
{
$this->ctrl->returnToParent($this, "jump".$this->hier_id);
}
else
{
$this->insert();
}
}

+ Here is the call graph for this function:

ilPCListGUI::edit ( )

edit properties form

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

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

Referenced by saveProperties().

{
// add paragraph edit template
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.list_properties.html", "Services/COPage");
$this->tpl->setVariable("TXT_ACTION", $this->lng->txt("cont_edit_list_properties"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
// content is in utf-8, todo: set globally
//header('Content-type: text/html; charset=UTF-8');
// list
$this->tpl->setVariable("TXT_LIST", $this->lng->txt("cont_list_properties"));
$this->tpl->setVariable("TXT_ORDER", $this->lng->txt("cont_order"));
$order = array("Unordered" => $this->lng->txt("cont_Unordered"),
"Number" => $this->lng->txt("cont_Number"),
"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"));
$select_order = ilUtil::formSelect ("","list_order",$order,false,true);
$this->tpl->setVariable("SELECT_ORDER", $select_order);
// operations
$this->tpl->setCurrentBlock("commands");
$this->tpl->setVariable("BTN_NAME", "saveProperties");
$this->tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
$this->tpl->setVariable("BTN_CANCEL", "cancelUpdate");
$this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilPCListGUI::executeCommand ( )

execute command

Definition at line 52 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::ilPCListGUI ( $a_pg_obj,
$a_content_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Constructor public.

Definition at line 44 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::insert ( )

insert new list form

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

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

Referenced by create().

{
// new list form (list item number)
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.list_new.html", "Services/COPage");
$this->tpl->setVariable("TXT_ACTION", $this->lng->txt("cont_insert_list"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
for($i=1; $i<=10; $i++)
{
$nr[$i] = $i;
}
// select fields for number of columns
$this->tpl->setVariable("TXT_ORDER", $this->lng->txt("cont_order"));
$order = array("Unordered" => $this->lng->txt("cont_Unordered"),
"Number" => $this->lng->txt("cont_Number"),
"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"));
$select_order = ilUtil::formSelect ("","list_order",$order,false,true);
$this->tpl->setVariable("SELECT_ORDER", $select_order);
$this->tpl->setVariable("TXT_NR_ITEMS", $this->lng->txt("cont_nr_items"));
$select_items = ilUtil::formSelect ("2","nr_items",$nr,false,true);
$this->tpl->setVariable("SELECT_NR_ITEMS", $select_items);
// $this->tpl->parseCurrentBlock();
// operations
$this->tpl->setCurrentBlock("commands");
$this->tpl->setVariable("BTN_NAME", "create_list");
$this->tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
$this->tpl->setVariable("BTN_CANCEL", "cancelCreate");
$this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPCListGUI::saveProperties ( )

save table properties in db and return to page edit screen

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

References edit().

{
$this->content_obj->setOrderType($_POST["list_order"]);
$this->updated = $this->pg_obj->update();
if ($this->updated === true)
{
$this->ctrl->returnToParent($this, "jump".$this->hier_id);
}
else
{
$this->pg_obj->addHierIDs();
$this->edit();
}
}

+ Here is the call graph for this function:


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