ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjStyleSheetFolderGUI Class Reference

Class ilObjStyleSheetFolderGUI. More...

+ Inheritance diagram for ilObjStyleSheetFolderGUI:
+ Collaboration diagram for ilObjStyleSheetFolderGUI:

Public Member Functions

 ilObjStyleSheetFolderGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor public.
 saveObject ()
 save object public
 viewObject ()
 view list of styles
 deleteStyleObject ($a_error=false)
 display deletion confirmation screen
 confirmedDeleteObject ()
 delete selected style objects
 toggleGlobalDefaultObject ()
 toggle global default style
 toggleGlobalFixedObject ()
 toggle global fixed style
 showActions ($with_subobjects=false)
 show possible action (form buttons)
 getTabs (&$tabs_gui)
 get tabs public
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
executeCommand ()
 execute command
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui
 getCreationMode ()
 get creation mode
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 undeleteObject ()
 Get objects back from trash.
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false
const CFORM_NEW = 1
const CFORM_IMPORT = 2
const CFORM_CLONE = 3
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 showUpperIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 initCreationForms ($a_new_type)
 Init creation froms.
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initCreateForm ($a_new_type)
 Init object creation form.
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 initEditForm ()
 Init object edit form.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormValues ()
 Get values for edit form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 afterUpdate ()
 Post (successful) object update hook.
 initImportForm ($a_new_type)
 Init object import form.
 importFileObject ($parent_id=null)
 Import.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 __showButton ($a_cmd, $a_text, $a_target= '')
 hitsperpageObject ()
__initTableGUI ()
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error.
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission.

Detailed Description

Class ilObjStyleSheetFolderGUI.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilObjStyleSheetFolderGUI.php 27165 2011-01-04 13:48:35Z jluetzen

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

Member Function Documentation

ilObjStyleSheetFolderGUI::confirmedDeleteObject ( )

delete selected style objects

Reimplemented from ilObjectGUI.

Definition at line 258 of file class.ilObjStyleSheetFolderGUI.php.

References $_SESSION, ilObjectGUI\$ilias, ilObjectGUI\getReturnLocation(), and ilUtil\redirect().

{
global $ilias;
foreach($_SESSION["saved_post"] as $id)
{
$this->object->removeStyle($id);
$style_obj =& $ilias->obj_factory->getInstanceByObjId($id);
$style_obj->delete();
}
$this->object->update();
ilUtil::redirect($this->getReturnLocation("delete",$this->ctrl->getLinkTarget($this,"","",false,false)));
}

+ Here is the call graph for this function:

ilObjStyleSheetFolderGUI::deleteStyleObject (   $a_error = false)

display deletion confirmation screen

public

Definition at line 200 of file class.ilObjStyleSheetFolderGUI.php.

References $_POST, $_SESSION, ilObject\_lookupTitle(), ilUtil\getImagePath(), ilUtil\sendInfo(), and ilUtil\switchColor().

{
if (!isset($_POST["id"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
// SAVE POST VALUES
$_SESSION["saved_post"] = $_POST["id"];
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.confirm_deletion.html");
if(!$a_error)
{
ilUtil::sendInfo($this->lng->txt("info_delete_sure"));
}
// $this->tpl->setVariable("FORMACTION", $this->getFormAction("delete",
// "adm_object.php?ref_id=".$_GET["ref_id"]."&cmd=gateway"));
// BEGIN TABLE HEADER
$this->tpl->setCurrentBlock("table_header");
$this->tpl->setVariable("TEXT", $this->lng->txt("objects"));
$this->tpl->parseCurrentBlock();
// END TABLE HEADER
// BEGIN TABLE DATA
$counter = 0;
foreach ($_POST["id"] as $id)
{
$this->tpl->setCurrentBlock("table_row");
$this->tpl->setVariable("IMG_OBJ",ilUtil::getImagePath("icon_styf.gif"));
$this->tpl->setVariable("CSS_ROW",ilUtil::switchColor(++$counter,"tblrow1","tblrow2"));
$this->tpl->setVariable("TEXT_CONTENT",ilObject::_lookupTitle($id));
$this->tpl->parseCurrentBlock();
}
// END TABLE DATA
// BEGIN OPERATION_BTN
$buttons = array("confirmedDelete" => $this->lng->txt("confirm"),
"cancelDelete" => $this->lng->txt("cancel"));
foreach ($buttons as $name => $value)
{
$this->tpl->setCurrentBlock("operation_btn");
$this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
$this->tpl->setVariable("BTN_NAME",$name);
$this->tpl->setVariable("BTN_VALUE",$value);
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

ilObjStyleSheetFolderGUI::getTabs ( $tabs_gui)

get tabs public

Parameters
objecttabs gui object

Reimplemented from ilObjectGUI.

Definition at line 382 of file class.ilObjStyleSheetFolderGUI.php.

{
// tabs are defined manually here. The autogeneration via objects.xml will be deprecated in future
// for usage examples see ilObjGroupGUI or ilObjSystemFolderGUI
}
ilObjStyleSheetFolderGUI::ilObjStyleSheetFolderGUI (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

Constructor public.

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

References ilObjectGUI\ilObjectGUI().

{
$this->type = "styf";
$this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
}

+ Here is the call graph for this function:

ilObjStyleSheetFolderGUI::saveObject ( )

save object public

Reimplemented from ilObjectGUI.

Definition at line 57 of file class.ilObjStyleSheetFolderGUI.php.

References ilObjectGUI\getReturnLocation(), ilUtil\redirect(), and ilUtil\sendInfo().

{
global $rbacadmin;
// create and insert forum in objecttree
$newObj = parent::saveObject();
// put here object specific stuff
// always send a message
ilUtil::sendInfo($this->lng->txt("object_added"),true);
ilUtil::redirect($this->getReturnLocation("save",$this->ctrl->getLinkTarget($this,"","",false,false)));
}

+ Here is the call graph for this function:

ilObjStyleSheetFolderGUI::showActions (   $with_subobjects = false)

show possible action (form buttons)

Parameters
booleanpublic

Definition at line 345 of file class.ilObjStyleSheetFolderGUI.php.

References ilUtil\getImagePath(), and ilObjectGUI\showPossibleSubObjects().

Referenced by viewObject().

{
// delete
$this->tpl->setCurrentBlock("tbl_action_btn");
$this->tpl->setVariable("BTN_NAME", "deleteStyle");
$this->tpl->setVariable("BTN_VALUE", $this->lng->txt("delete"));
$this->tpl->parseCurrentBlock();
// set global default
$this->tpl->setCurrentBlock("tbl_action_btn");
$this->tpl->setVariable("BTN_NAME", "toggleGlobalDefault");
$this->tpl->setVariable("BTN_VALUE", $this->lng->txt("toggleGlobalDefault"));
$this->tpl->parseCurrentBlock();
// set global default
$this->tpl->setCurrentBlock("tbl_action_btn");
$this->tpl->setVariable("BTN_NAME", "toggleGlobalFixed");
$this->tpl->setVariable("BTN_VALUE", $this->lng->txt("toggleGlobalFixed"));
$this->tpl->parseCurrentBlock();
if ($with_subobjects === true)
{
}
$this->tpl->setCurrentBlock("tbl_action_row");
$this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheetFolderGUI::toggleGlobalDefaultObject ( )

toggle global default style

public

Definition at line 279 of file class.ilObjStyleSheetFolderGUI.php.

References $_POST, ilObjectGUI\$ilias, and ilUtil\redirect().

{
global $ilias;
if (!isset($_POST["id"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
if(count($_POST["id"]) > 1)
{
$this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
}
$ilias->deleteSetting("fixed_content_style_id");
$def_style = $ilias->getSetting("default_content_style_id");
if ($def_style != $_POST["id"][0])
{
$ilias->setSetting("default_content_style_id", $_POST["id"][0]);
}
else
{
$ilias->deleteSetting("default_content_style_id");
}
ilUtil::redirect($this->ctrl->getLinkTarget($this,"view","",false,false));
}

+ Here is the call graph for this function:

ilObjStyleSheetFolderGUI::toggleGlobalFixedObject ( )

toggle global fixed style

public

Definition at line 312 of file class.ilObjStyleSheetFolderGUI.php.

References $_POST, ilObjectGUI\$ilias, and ilUtil\redirect().

{
global $ilias;
if (!isset($_POST["id"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
if(count($_POST["id"]) > 1)
{
$this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
}
$ilias->deleteSetting("default_content_style_id");
$fixed_style = $ilias->getSetting("fixed_content_style_id");
if ($fixed_style == $_POST["id"][0])
{
$ilias->deleteSetting("fixed_content_style_id");
}
else
{
$ilias->setSetting("fixed_content_style_id", $_POST["id"][0]);
}
ilUtil::redirect($this->ctrl->getLinkTarget($this,"view","",false,false));
}

+ Here is the call graph for this function:

ilObjStyleSheetFolderGUI::viewObject ( )

view list of styles

Reimplemented from ilObjectGUI.

Definition at line 75 of file class.ilObjStyleSheetFolderGUI.php.

References $_GET, ilObjectGUI\$ilias, ilObject\_lookupDescription(), and showActions().

{
global $rbacsystem, $ilias;
if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
include_once "./Services/Table/classes/class.ilTableGUI.php";
// load template for table
$this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
// load template for table content data
$this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.styf_row.html");
$num = 0;
// $this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=".$this->ref_id."$obj_str&cmd=gateway");
// create table
$tbl = new ilTableGUI();
// title & header columns
$tbl->setTitle($this->object->getTitle(),"icon_styf.gif",
$this->lng->txt("obj_".$this->object->getType()));
//$tbl->setHelp("tbl_help.php","icon_help.gif",$this->lng->txt("help"));
// title
$header_names = array("", $this->lng->txt("title"),
$this->lng->txt("purpose"));
$tbl->setHeaderNames($header_names);
$header_params = array("ref_id" => $this->ref_id);
$tbl->setHeaderVars(array("", "title", "purpose"), $header_params);
$tbl->setColumnWidth(array("0%", "80%", "20%"));
// control
$tbl->setOrderColumn($_GET["sort_by"]);
$tbl->setOrderDirection($_GET["sort_order"]);
$tbl->setLimit($_GET["limit"]);
$tbl->setOffset($_GET["offset"]);
// get style ids
$style_entries = array();
$styles = $this->object->getStyles();
foreach($styles as $style)
{
$style_entries[$style["title"].":".$style["id"]]
= $style;
}
ksort($style_entries);
// todo
$tbl->setMaxCount(count($style_entries));
$this->tpl->setVariable("COLUMN_COUNTS", 3);
// footer
$tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
$this->showActions(true);
include_once ("./Services/Style/classes/class.ilObjStyleSheet.php");
$fixed_style = $ilias->getSetting("fixed_content_style_id");
$default_style = $ilias->getSetting("default_content_style_id");
foreach ($style_entries as $style)
{
$this->tpl->setCurrentBlock("style_row");
// color changing
$css_row = ($css_row == "tblrow2")
? "tblrow1"
: "tblrow2";
$this->tpl->setVariable("CHECKBOX_ID", $style["id"]);
$this->tpl->setVariable("TXT_TITLE", $style["title"]);
$this->tpl->setVariable("TXT_DESC", ilObject::_lookupDescription($style["id"]));
// $this->tpl->setVariable("LINK_STYLE",
// "adm_object.php?ref_id=".$_GET["ref_id"].
// "&obj_id=".$style["id"]);
$this->tpl->setVariable("ROWCOL", $css_row);
if ($style["id"] == $fixed_style)
{
$this->tpl->setVariable("TXT_PURPOSE", $this->lng->txt("global_fixed"));
}
if ($style["id"] == $default_style)
{
$this->tpl->setVariable("TXT_PURPOSE", $this->lng->txt("global_default"));
}
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("tbl_content");
$this->tpl->parseCurrentBlock();
} //if is_array
if (count($style_entries) == 0)
{
$tbl->disable("header");
$tbl->disable("footer");
$this->tpl->setCurrentBlock("text");
$this->tpl->setVariable("TXT_CONTENT", $this->lng->txt("obj_not_found"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("tbl_content");
$this->tpl->parseCurrentBlock();
}
// render table
$tbl->render();
}

+ Here is the call graph for this function:


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