ILIAS  Release_5_0_x_branch Revision 61816
 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

 __construct ($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id="")
 Constructor public.
 executeCommand ()
 execute command
 edit ()
 Handle Editing.
 setStyleId ($a_styleid)
 Set Style Id.
 getStyleId ()
 Get Style Id.
 cancel ()
 Cancel.
- Public Member Functions inherited from ilPageContentGUI
 ilPageContentGUI ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor public.
 setContentObject ($a_val)
 Set content object.
 getContentObject ()
 Get content object.
 setPage ($a_val)
 Set page.
 getPage ()
 Get page.
 setPageConfig ($a_val)
 Set Page Config.
 getPageConfig ()
 Get Page Config.
 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
 cut ()
 Cut single element.
 copy ()
 Copy single element.
 getTemplateOptions ($a_type)
 Get table templates.

Data Fields

 $pg_obj
 $content_obj
 $hier_id
 $pc_id
const TYPE_TEXT = "Text"
const TYPE_QUESTION = "Question"
const TYPE_MEDIA = "Media"
const TYPE_VERIFICATION = "Verification"
- 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

 insert ()
 Handle Insert.
 create ()
 create new table in dom and update page in db
 edit_object ()
 Handle Editing Private Methods.
 forward_edit ()
 saveProperties ()
 save placeholder properties in db and return to page edit screen
 propertyGUI ($a_action, $a_type, $a_height, $a_mode)
 Object Property GUI.
 textCOSelectionGUI ()
 Text Item Selection.
 insertPCText ()
 Forwards Text Item Selection to GUI classes.
 getAvailableTypes ()
 getTypeCaptions ()
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style.

Protected Attributes

 $styleid

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons.
- Static Public Attributes inherited from ilPageContentGUI
static $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
- 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 20 of file class.ilPCPlaceHolderGUI.php.

Constructor & Destructor Documentation

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

Constructor public.

Definition at line 37 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:

Member Function Documentation

ilPCPlaceHolderGUI::cancel ( )

Cancel.

Reimplemented from ilPageContentGUI.

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

{
$this->ctrl->returnToParent($this, "jump".$this->hier_id);
}
ilPCPlaceHolderGUI::create ( )
protected

create new table in dom and update page in db

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

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

{
if ($_POST["plach_height"]=="" ||
!preg_match("/[0-9]+/",$_POST["plach_height"]))
{
return $this->insert();
}
$this->content_obj = new ilPCPlaceHolder($this->getPage());
$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 110 of file class.ilPCPlaceHolderGUI.php.

References edit_object(), forward_edit(), and ilPageContentGUI\getPageConfig().

Referenced by saveProperties().

{
if($this->getPageConfig()->getEnablePCType("PlaceHolder"))
{
$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 ( )
protected

Handle Editing Private Methods.

Definition at line 145 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 50 of file class.ilPCPlaceHolderGUI.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)
{
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 = $this->ctrl->forwardCommand($media_gui);
break;
default:
$ret = $this->$cmd();
break;
}
return $ret;
}
ilPCPlaceHolderGUI::forward_edit ( )
protected

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

References textCOSelectionGUI().

Referenced by edit().

{
switch ($this->content_obj->getContentClass())
{
case self::TYPE_MEDIA:
include_once("./Services/COPage/classes/class.ilPCMediaObjectGUI.php");
$this->ctrl->setCmdClass("ilpcmediaobjectgui");
$this->ctrl->setCmd("insert");
$media_gui = new ilPCMediaObjectGUI($this->pg_obj, null);
$this->ctrl->forwardCommand($media_gui);
break;
case self::TYPE_TEXT:
break;
case self::TYPE_QUESTION:
include_once("./Services/COPage/classes/class.ilPCQuestionGUI.php");
$this->ctrl->setCmdClass("ilpcquestiongui");
$this->ctrl->setCmd("insert");
$question_gui = new ilPCQuestionGUI($this->pg_obj, $this->content_obj, $this->hier_id, $this->pc_id);
$question_gui->setSelfAssessmentMode(true);
$this->ctrl->forwardCommand($question_gui);
break;
case self::TYPE_VERIFICATION:
include_once("./Services/COPage/classes/class.ilPCVerificationGUI.php");
$this->ctrl->setCmdClass("ilpcverificationgui");
$this->ctrl->setCmd("insert");
$cert_gui = new ilPCVerificationGUI($this->pg_obj, $this->content_obj, $this->hier_id, $this->pc_id);
$this->ctrl->forwardCommand($cert_gui);
break;
default:
break;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPCPlaceHolderGUI::getAvailableTypes ( )
protected

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

References ilPageContentGUI\getPageConfig().

Referenced by propertyGUI().

{
// custom config?
if(method_exists($this->getPageConfig(), "getAvailablePlaceholderTypes"))
{
return $this->getPageConfig()->getAvailablePlaceholderTypes();
}
// default
return array(self::TYPE_TEXT, self::TYPE_MEDIA, self::TYPE_QUESTION);
}

+ 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 137 of file class.ilPCPlaceHolderGUI.php.

References $styleid.

Referenced by insertPCText().

{
}

+ Here is the caller graph for this function:

ilPCPlaceHolderGUI::getTypeCaptions ( )
protected

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

References ilPageContentGUI\$lng.

Referenced by propertyGUI().

{
global $lng;
return array(
self::TYPE_TEXT => $lng->txt("cont_ed_plachtext"),
self::TYPE_MEDIA => $lng->txt("cont_ed_plachmedia"),
self::TYPE_QUESTION => $lng->txt("cont_ed_plachquestion"),
self::TYPE_VERIFICATION => $lng->txt("cont_ed_plachverification")
);
}

+ Here is the caller graph for this function:

ilPCPlaceHolderGUI::insert ( )
protected

Handle Insert.

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

References propertyGUI().

Referenced by create().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPCPlaceHolderGUI::insertPCText ( )
protected

Forwards Text Item Selection to GUI classes.

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

References $_POST, ilPageEditorGUI\_doJSEditing(), ilPageContentGUI\getPageConfig(), and getStyleId().

{
switch ($_POST['pctext_type'])
{
case 0: //Paragraph / Text
// js editing? -> redirect to js page editor
// if ($ilSetting->get("enable_js_edit", 1) && ilPageEditorGUI::_doJSEditing())
{
$ret_class = $this->ctrl->getReturnClass($this);
$this->ctrl->setParameterByClass($ret_class, "pl_hier_id", $this->hier_id);
$this->ctrl->setParameterByClass($ret_class, "pl_pc_id", $this->pc_id);
$this->ctrl->redirectByClass($ret_class,
"insertJSAtPlaceholder");
}
include_once("./Services/COPage/classes/class.ilPCParagraphGUI.php");
$this->ctrl->setCmdClass("ilpcparagraphgui");
$this->ctrl->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->setPageConfig($this->getPageConfig());
$this->ctrl->forwardCommand($paragraph_gui);
break;
case 1: //DataTable
include_once("./Services/COPage/classes/class.ilPCDataTableGUI.php");
$this->ctrl->setCmdClass("ilpcdatatablegui");
$this->ctrl->setCmd("insert");
$dtable_gui = new ilPCDataTableGUI($this->pg_obj, $this->content_obj, $this->hier_id, $this->pc_id);
$this->ctrl->forwardCommand($dtable_gui);
break;
case 2: //Advanced Table
include_once("./Services/COPage/classes/class.ilPCTableGUI.php");
$this->ctrl->setCmdClass("ilpctablegui");
$this->ctrl->setCmd("insert");
$atable_gui = new ilPCTableGUI($this->pg_obj, $this->content_obj, $this->hier_id, $this->pc_id);
$this->ctrl->forwardCommand($atable_gui);
break;
case 3: //Advanced List
include_once("./Services/COPage/classes/class.ilPCListGUI.php");
$this->ctrl->setCmdClass("ilpclistgui");
$this->ctrl->setCmd("insert");
$list_gui = new ilPCListGUI($this->pg_obj, $this->content_obj, $this->hier_id, $this->pc_id);
$this->ctrl->forwardCommand($list_gui);
break;
case 4: //File List
include_once ("./Services/COPage/classes/class.ilPCFileListGUI.php");
$this->ctrl->setCmdClass("ilpcfilelistgui");
$this->ctrl->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());
$this->ctrl->forwardCommand($file_list_gui);
break;
case 5: //Tabs
include_once ("./Services/COPage/classes/class.ilPCTabsGUI.php");
$this->ctrl->setCmdClass("ilpctabsgui");
$this->ctrl->setCmd("insert");
$tabs_gui = new ilPCTabsGUI($this->pg_obj, $this->content_obj, $this->hier_id, $this->pc_id);
$tabs_gui->setStyleId($this->getStyleId());
$this->ctrl->forwardCommand($tabs_gui);
break;
default:
break;
}
}

+ Here is the call graph for this function:

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

Object Property GUI.

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

References ilPageContentGUI\$lng, getAvailableTypes(), getTypeCaptions(), and ilTextInputGUI\setSize().

Referenced by edit_object(), and insert().

{
global $lng;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setFormAction($this->ctrl->getFormAction($this));
$this->form_gui->setTitle($lng->txt("cont_ed_plachprop"));
$ttype_input = new ilRadioGroupInputGUI($lng->txt("type"), "plach_type");
$type_captions = $this->getTypeCaptions();
foreach($this->getAvailableTypes() as $type)
{
$ttype_input->addOption(new ilRadioOption($type_captions[$type], $type));
}
$ttype_input->setRequired(true);
$this->form_gui->addItem($ttype_input);
$theight_input = new ilTextInputGUI($lng->txt("height"),"plach_height");
$theight_input->setSize(4);
$theight_input->setMaxLength(3);
$theight_input->setTitle($lng->txt("height")." (px)");
$theight_input->setRequired(true);
$this->form_gui->addItem($theight_input);
$theight_input->setValue(preg_replace("/px/","",$a_height));
$ttype_input->setValue($a_type);
$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 ( )
protected

save placeholder properties in db and return to page edit screen

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

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

{
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 127 of file class.ilPCPlaceHolderGUI.php.

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

Text Item Selection.

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

References ilPageContentGUI\$lng, and ilRadioGroupInputGUI\addOption().

Referenced by forward_edit().

{
global $lng;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setFormAction($this->ctrl->getFormAction($this));
$this->form_gui->setTitle($lng->txt("cont_ed_select_pctext"));
// Select Question Type
$ttype_input = new ilRadioGroupInputGUI($lng->txt("cont_ed_textitem"), "pctext_type");
$ttype_input->addOption(new ilRadioOption($lng->txt("cont_ed_par"), 0));
$ttype_input->addOption(new ilRadioOption($lng->txt("cont_ed_dtable"), 1));
$ttype_input->addOption(new ilRadioOption($lng->txt("cont_ed_atable"), 2));
$ttype_input->addOption(new ilRadioOption($lng->txt("cont_ed_list"), 3));
$ttype_input->addOption(new ilRadioOption($lng->txt("cont_ed_flist"), 4));
$ttype_input->addOption(new ilRadioOption($lng->txt("cont_tabs"), 5));
$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 23 of file class.ilPCPlaceHolderGUI.php.

ilPCPlaceHolderGUI::$hier_id

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

ilPCPlaceHolderGUI::$pc_id

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

ilPCPlaceHolderGUI::$pg_obj

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

ilPCPlaceHolderGUI::$styleid
protected

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

Referenced by getStyleId().

const ilPCPlaceHolderGUI::TYPE_MEDIA = "Media"
const ilPCPlaceHolderGUI::TYPE_QUESTION = "Question"

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

const ilPCPlaceHolderGUI::TYPE_TEXT = "Text"
const ilPCPlaceHolderGUI::TYPE_VERIFICATION = "Verification"

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