ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPCPlaceHolderGUI Class Reference

Class ilPCPlaceHolderGUI. More...

+ Inheritance diagram for ilPCPlaceHolderGUI:
+ Collaboration diagram for ilPCPlaceHolderGUI:

Public Member Functions

 ilPCPlaceHolderGUI (&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
executeCommand ()
 execute command
 insert ()
 Handle Insert.
 create ()
 create new table in dom and update page in db
 edit ()
 Handle Editing.
 setStyleId ($a_styleid)
 Set Style Id.
 getStyleId ()
 Get Style Id.
 saveProperties ()
 save placeholder properties in db and return to page edit screen
 insertPCText ()
 Forwards Text Item Selection to GUI classes.
- Public Member Functions inherited from ilPageContentGUI
 ilPageContentGUI (&$a_pg_obj, &$a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor public.
 setEnableInternalLinks ($a_val)
 Set enable internal links.
 getEnableInternalLinks ()
 Get enable internal links.
 setEnableKeywords ($a_val)
 Set enable keywords handling.
 getEnableKeywords ()
 Get enable keywords handling.
 setEnableAnchors ($a_val)
 Set enable anchors.
 getEnableAnchors ()
 Get enable anchors.
 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.

Data Fields

 $pg_obj
 Constructor public.
 $content_obj
 $hier_id
 $pc_id
 $styleid
- Data Fields inherited from ilPageContentGUI
 $content_obj
 $ilias
 $tpl
 $lng
 $ctrl
 $pg_obj
 $hier_id
 $dom
 $updated
 $target_script
 $return_location

Private Member Functions

 edit_object ()
 Handle Editing Private Methods.
 forward_edit ()
 propertyGUI ($a_action, $a_type, $a_height, $a_mode)
 Object Property GUI.
 textCOSelectionGUI ()
 Text Item Selection.

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons.
- 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 ilPCPlaceHolderGUI.

User Interface for Place Holder Management

Author
Hendrik Holtmann holtm.nosp@m.ann@.nosp@m.me.co.nosp@m.m
Version
Id:
class.ilPCListGUI.php 17506 2008-09-24 13:48:46Z akill

ilPCPlaceHolderGUI: ilPCMediaObjectGUI

Definition at line 41 of file class.ilPCPlaceHolderGUI.php.

Member Function Documentation

ilPCPlaceHolderGUI::create ( )

create new table in dom and update page in db

Definition at line 106 of file class.ilPCPlaceHolderGUI.php.

References $_POST, exit, and insert().

{
if ($_POST["plach_height"]=="" || !preg_match("/[0-9]+/",$_POST["plach_height"])) {
return $this->insert();
}
$this->content_obj = new ilPCPlaceHolder($this->dom);
$this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
$this->content_obj->setHeight($_POST["plach_height"]."px");
$this->content_obj->setContentClass($_POST['plach_type']);
$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:

ilPCPlaceHolderGUI::edit ( )

Handle Editing.

Definition at line 132 of file class.ilPCPlaceHolderGUI.php.

References edit_object(), and forward_edit().

Referenced by saveProperties().

{
if ($this->pg_obj->getLayoutMode() == true) {
$this->edit_object();
} else {
$this->forward_edit();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPCPlaceHolderGUI::edit_object ( )
private

Handle Editing Private Methods.

Definition at line 166 of file class.ilPCPlaceHolderGUI.php.

References propertyGUI().

Referenced by edit(), and saveProperties().

{
$this->propertyGUI("saveProperties",$this->content_obj->getContentClass(),$this->content_obj->getHeight(),"save");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilPCPlaceHolderGUI::executeCommand ( )

execute command

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

References $cmd, $ilCtrl, and $ret.

{
global $ilCtrl;
// 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)
{
case 'ilpcmediaobjectgui': //special handling
include_once("./Services/COPage/classes/class.ilPCMediaObjectGUI.php");
$media_gui = new ilPCMediaObjectGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
$ret = $ilCtrl->forwardCommand($media_gui);
break;
default:
$ret =& $this->$cmd();
break;
}
return $ret;
}
ilPCPlaceHolderGUI::forward_edit ( )
private

Definition at line 171 of file class.ilPCPlaceHolderGUI.php.

References $ilCtrl, $ret, and textCOSelectionGUI().

Referenced by edit().

{
global $ilCtrl;
switch ($this->content_obj->getContentClass()) {
case 'Media':
include_once("./Services/COPage/classes/class.ilPCMediaObjectGUI.php");
$ilCtrl->setCmdClass("ilpcmediaobjectgui");
$ilCtrl->setCmd("insert");
$media_gui = new ilPCMediaObjectGUI($this->pg_obj,$null);
$ret = $ilCtrl->forwardCommand($media_gui);
break;
case 'Text':
break;
case 'Question':
include_once("./Services/COPage/classes/class.ilPCQuestionGUI.php");
$ilCtrl->setCmdClass("ilpcquestiongui");
$ilCtrl->setCmd("insert");
$question_gui = new ilPCQuestionGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
$question_gui -> setSelfAssessmentMode(true);
$ret = $ilCtrl->forwardCommand($question_gui);
break;
default:
break;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPCPlaceHolderGUI::getStyleId ( )

Get Style Id.

Returns
int Style Id

Reimplemented from ilPageContentGUI.

Definition at line 156 of file class.ilPCPlaceHolderGUI.php.

References $styleid.

Referenced by insertPCText().

{
}

+ Here is the caller graph for this function:

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

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

References ilPageContentGUI\ilPageContentGUI().

{
$this->pg_obj = $a_pg_obj;
$this->content_obj = $a_content_obj;
$this->hier_id = $a_hier_id;
$this->pc_id = $a_pc_id;
parent::ilPageContentGUI($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
}

+ Here is the call graph for this function:

ilPCPlaceHolderGUI::insert ( )

Handle Insert.

Definition at line 98 of file class.ilPCPlaceHolderGUI.php.

References propertyGUI().

Referenced by create().

{
$this->propertyGUI("create","Text","100px","insert");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPCPlaceHolderGUI::insertPCText ( )

Forwards Text Item Selection to GUI classes.

Definition at line 292 of file class.ilPCPlaceHolderGUI.php.

References $_POST, $ilCtrl, $ret, ilPageContentGUI\getEnableAnchors(), ilPageContentGUI\getEnableInternalLinks(), ilPageContentGUI\getEnableKeywords(), and getStyleId().

{
global $ilCtrl;
switch ($_POST['pctext_type']) {
case '0': //Paragraph / Text
include_once("./Services/COPage/classes/class.ilPCParagraphGUI.php");
$ilCtrl->setCmdClass("ilpcparagraphgui");
$ilCtrl->setCmd("insert");
$paragraph_gui = new ilPCParagraphGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
$paragraph_gui->setStyleId($this->getStyleId());
$paragraph_gui->setEnableInternalLinks($this->getEnableInternalLinks());
$paragraph_gui->setEnableKeywords($this->getEnableKeywords());
$paragraph_gui->setEnableAnchors($this->getEnableAnchors());
$ret = $ilCtrl->forwardCommand($paragraph_gui);
break;
case '1': //DataTable
include_once("./Services/COPage/classes/class.ilPCDataTableGUI.php");
$ilCtrl->setCmdClass("ilpcdatatablegui");
$ilCtrl->setCmd("insert");
$dtable_gui = new ilPCDataTableGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
$ret = $ilCtrl->forwardCommand($dtable_gui);
break;
case '2': //Advanced Table
include_once("./Services/COPage/classes/class.ilPCTableGUI.php");
$ilCtrl->setCmdClass("ilpctablegui");
$ilCtrl->setCmd("insert");
$atable_gui = new ilPCTableGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
$ret = $ilCtrl->forwardCommand($atable_gui);
break;
case '3': //Advanced List
include_once("./Services/COPage/classes/class.ilPCListGUI.php");
$ilCtrl->setCmdClass("ilpclistgui");
$ilCtrl->setCmd("insert");
$list_gui = new ilPCListGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
$ret = $ilCtrl->forwardCommand($list_gui);
break;
case '4': //File List
include_once ("./Services/COPage/classes/class.ilPCFileListGUI.php");
$ilCtrl->setCmdClass("ilpcfilelistgui");
$ilCtrl->setCmd("insert");
$file_list_gui = new ilPCFileListGUI($this->pg_obj,$this->content_obj,$this->hier_id,$this->pc_id);
$file_list_gui->setStyleId($this->getStyleId());
$ret = $this->ctrl->forwardCommand($file_list_gui);
break;
default:
break;
}
}

+ Here is the call graph for this function:

ilPCPlaceHolderGUI::propertyGUI (   $a_action,
  $a_type,
  $a_height,
  $a_mode 
)
private

Object Property GUI.

Definition at line 229 of file class.ilPCPlaceHolderGUI.php.

References $ilCtrl, ilPageContentGUI\$lng, ilRadioMatrixInputGUI\setOptions(), and ilTextInputGUI\setSize().

Referenced by edit_object(), and insert().

{
global $ilCtrl, $lng;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setFormAction($ilCtrl->getFormAction($this));
$this->form_gui->setTitle($lng->txt("cont_ed_plachprop"));
include_once("Services/Form/classes/class.ilRadioMatrixInputGUI.php");
$ttype_input = new ilRadioMatrixInputGUI($lng->txt("type"), "plach_type");
$options =array("Text"=>$lng->txt("cont_ed_plachtext"),"Media"=>$lng->txt("cont_ed_plachmedia"),
"Question"=>$lng->txt("cont_ed_plachquestion"));
$ttype_input->setOptions($options);
$ttype_input->setValue($a_type);
$ttype_input->setRequired(true);
$theight_input = new ilTextInputGUI($lng->txt("height"),"plach_height");
$theight_input->setSize(4);
$theight_input->setMaxLength(3);
$a_height = preg_replace("/px/","",$a_height);
$theight_input->setValue($a_height);
$theight_input->setTitle($lng->txt("height")." (px)");
$theight_input->setRequired(true);
$this->form_gui->addItem($ttype_input);
$this->form_gui->addItem($theight_input);
$this->form_gui->addCommandButton($a_action, $lng->txt($a_mode));
$this->form_gui->addCommandButton("cancelCreate", $lng->txt("cancel"));
$this->tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPCPlaceHolderGUI::saveProperties ( )

save placeholder properties in db and return to page edit screen

Definition at line 203 of file class.ilPCPlaceHolderGUI.php.

References $_POST, edit(), edit_object(), and exit.

{
if ($_POST["plach_height"]=="" || !preg_match("/[0-9]+/",$_POST["plach_height"])) {
return $this->edit_object();
}
$this->content_obj->setContentClass($_POST['plach_type']);
$this->content_obj->setHeight($_POST["plach_height"]."px");
$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:

ilPCPlaceHolderGUI::setStyleId (   $a_styleid)

Set Style Id.

Parameters
int$a_styleidStyle Id

Reimplemented from ilPageContentGUI.

Definition at line 146 of file class.ilPCPlaceHolderGUI.php.

{
$this->styleid = $a_styleid;
}
ilPCPlaceHolderGUI::textCOSelectionGUI ( )
private

Text Item Selection.

Definition at line 265 of file class.ilPCPlaceHolderGUI.php.

References $ilCtrl, ilPageContentGUI\$lng, and ilRadioMatrixInputGUI\setOptions().

Referenced by forward_edit().

{
global $ilCtrl, $lng;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setFormAction($ilCtrl->getFormAction($this));
$this->form_gui->setTitle($lng->txt("cont_ed_select_pctext"));
// Select Question Type
include_once("Services/Form/classes/class.ilRadioMatrixInputGUI.php");
$ttype_input = new ilRadioMatrixInputGUI($lng->txt("cont_ed_textitem"), "pctext_type");
$options = array($lng->txt("cont_ed_par"),$lng->txt("cont_ed_dtable"),
$lng->txt("cont_ed_atable"),$lng->txt("cont_ed_list"),$lng->txt("cont_ed_flist"));
$ttype_input->setOptions($options);
$this->form_gui->addItem($ttype_input);
$this->form_gui->addCommandButton("insertPCText", $lng->txt("insert"));
$this->form_gui->addCommandButton("cancelCreate", $lng->txt("cancel"));
$this->tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilPCPlaceHolderGUI::$content_obj

Definition at line 48 of file class.ilPCPlaceHolderGUI.php.

ilPCPlaceHolderGUI::$hier_id

Definition at line 49 of file class.ilPCPlaceHolderGUI.php.

ilPCPlaceHolderGUI::$pc_id

Definition at line 50 of file class.ilPCPlaceHolderGUI.php.

ilPCPlaceHolderGUI::$pg_obj

Constructor public.

Definition at line 47 of file class.ilPCPlaceHolderGUI.php.

ilPCPlaceHolderGUI::$styleid

Definition at line 51 of file class.ilPCPlaceHolderGUI.php.

Referenced by getStyleId().


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