ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjStyleSheetGUI Class Reference

Class ilObjStyleSheetGUI. More...

+ Inheritance diagram for ilObjStyleSheetGUI:
+ Collaboration diagram for ilObjStyleSheetGUI:

Public Member Functions

 ilObjStyleSheetGUI ($a_data, $a_id, $a_call_by_reference, $a_prep=true)
 Constructor public.
executeCommand ()
 execute command
 viewObject ()
 list childs of current object
 createObject ()
 create
 editObject ()
 edit style sheet
 editTagStyleObject ()
 edit style of single tag
 refreshTagStyleObject ()
 save and refresh tag editing
 updateTagStyleObject ()
 save and refresh tag editing
 exportStyleObject ()
 export style
 extractParametersOfTag ($a_tag, $a_class, $a_style)
 newStyleParameterObject ()
 add style parameter
 refreshObject ()
 refresh style sheet
 deleteObject ($a_error=false)
 display deletion confirmation screen
 cancelDeleteObject ()
 cancel oobject deletion
 confirmedDeleteObject ()
 delete selected style objects
 deleteStyleParameterObject ()
 delete style parameters
 saveObject ()
 save style sheet
 updateObject ()
 update style sheet
 copyStyleObject ()
 save style sheet
 importStyleObject ()
 import style sheet
 cancelObject ()
 update style sheet
 getAdminTabs (&$tabs_gui)
 admin and normal tabs are equal for roles
 setTabs ()
 output tabs
 getTabs (&$tabs_gui)
 adds tabs to tab gui object
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 showUpperIcon ()
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 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
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showMountWebfolderIcon ()
 setAdminTabs ()
 set admin tabs public
 getHTML ()
 setActions ($a_actions="")
 set possible actions for objects in list.
 setSubObjects ($a_sub_objects="")
 set possible subobjects for this object.
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 undeleteObject ()
 get object back from trash
 insertSavedNodes ($a_source_id, $a_dest_id, $a_tree_id, &$a_affected_ids)
 recursive method to insert all saved nodes of the clipboard (maybe this function could be moved to a rbac class ?)
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 removeDeletedNodes ($a_node_id, $a_checked, $a_delete_objects, &$a_affected_ids)
 remove already deleted objects within the objects in trash recursive function
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 importObject ()
 import new object form
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 permObject ()
 show permissions of current node
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 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
 permSaveObject ()
 save permissions
 isVisible ($a_ref_id, $a_type)
 displayList ()
 display object list
 trashObject ()
 show trash content of object
 addRoleObject ()
 adds a local role This method is only called when choose the option 'you may add local roles'.
 showActions ($with_subobjects=false)
 show possible action (form buttons)
 getActions ()
 Get Actions.
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 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="")
 infoObject ()
 __buildRoleFilterSelect ()
 __filterRoles ($a_roles, $a_filter)
 ownerObject ()
 changeOwnerObject ()
 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.
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 Add an object search in case the number of existing objects is too big to offer a selection list.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Data Fields

 $cmd_update
 $cmd_new_par
 $cmd_refresh
 $cmd_delete
- 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

Additional Inherited Members

- Protected Member Functions inherited from ilObjectGUI
 searchCloneSourceObject ()
 Search clone source by title.
 buildCloneSelect ($existing_objs)
 Build a select box for clonable objects (permission write)

Detailed Description

Class ilObjStyleSheetGUI.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Id:
class.ilObjStyleSheetGUI.php 15682 2008-01-07 22:33:54Z akill

ilObjStyleSheetGUI:

Definition at line 39 of file class.ilObjStyleSheetGUI.php.

Member Function Documentation

ilObjStyleSheetGUI::addAdminLocatorItems ( )

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

Definition at line 785 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilFrameTargetInfo\_getFrame(), ilObject\_lookupObjId(), and ilObject\_lookupTitle().

{
global $ilLocator;
if ($_GET["admin_mode"] == "settings") // system settings
{
$ilLocator->addItem($this->lng->txt("administration"),
$this->ctrl->getLinkTargetByClass("iladministrationgui", "frameset"),
$ilLocator->addItem(ilObject::_lookupTitle(
$this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui", "view"));
if ($_GET["obj_id"] > 0)
{
$ilLocator->addItem($this->object->getTitle(),
$this->ctrl->getLinkTarget($this, "edit"));
}
}
else // repository administration
{
//?
}
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::cancelDeleteObject ( )

cancel oobject deletion

Reimplemented from ilObjectGUI.

Definition at line 558 of file class.ilObjStyleSheetGUI.php.

{
$this->ctrl->returnToParent($this);
}
ilObjStyleSheetGUI::cancelObject ( )

update style sheet

Definition at line 729 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$lng, and ilUtil\sendInfo().

{
global $lng;
ilUtil::sendInfo($lng->txt("msg_cancel"), true);
$this->ctrl->returnToParent($this);
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::confirmedDeleteObject ( )

delete selected style objects

Reimplemented from ilObjectGUI.

Definition at line 566 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$ilias.

{
global $ilias;
$this->object->delete();
$this->ctrl->returnToParent($this);
}
ilObjStyleSheetGUI::copyStyleObject ( )

save style sheet

Definition at line 656 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$ilias, ilObjStyleSheet\_writeStandard(), and ilObjectFactory\getInstanceByRefId().

{
global $ilias;
if ($_POST["source_style"] > 0)
$style_obj =& $ilias->obj_factory->getInstanceByObjId($_POST["source_style"]);
$new_id = $style_obj->ilClone();
// assign style to style sheet folder,
// if parent is style sheet folder
if ($_GET["ref_id"] > 0)
{
if ($fold->getType() == "stys")
{
$fold->addStyle($new_id);
$fold->update();
$this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
}
}
return $new_id;
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::createObject ( )

create

Reimplemented from ilObjectGUI.

Definition at line 90 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjStyleSheet\_getClonableContentStyles(), formSelect(), and ilObjectGUI\getTemplateFile().

{
global $rbacsystem, $lng, $tpl;
//$this->setTabs();
$this->lng =& $lng;
//$this->ctrl->setParameter($this,'new_type',$this->type);
$this->getTemplateFile("create", "sty");
$this->tpl->setVariable("TXT_ACTION", $this->lng->txt("sty_create_new_stylesheet"));
$this->tpl->setVariable("TXT_STYLE_BY_IMPORT", $this->lng->txt("sty_import_stylesheet"));
$this->tpl->setVariable("TXT_STYLE_BY_COPY", $this->lng->txt("sty_copy_other_stylesheet"));
$this->tpl->setVariable("TXT_SELECT_FILE", $this->lng->txt("import_file"));
$this->tpl->setVariable("TXT_SOURCE", $this->lng->txt("sty_source"));
$this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
$this->tpl->setVariable("TXT_DESC", $this->lng->txt("description"));
$this->ctrl->setParameter($this, "new_type", "sty");
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
$this->tpl->setVariable("TXT_IMPORT", $this->lng->txt("import"));
$this->tpl->setVariable("TXT_COPY", $this->lng->txt("copy"));
$this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
$this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
// get all learning module styles
$select = ilUtil::formSelect("", "source_style", $clonable_styles, false, true);
$this->tpl->setVariable("SOURCE_SELECT", $select);
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::deleteObject (   $a_error = false)

display deletion confirmation screen

public

Reimplemented from ilObjectGUI.

Definition at line 510 of file class.ilObjStyleSheetGUI.php.

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

{
//$this->setTabs();
$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->ctrl->getFormAction($this));
// 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;
$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($this->object->getId()));
$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:

ilObjStyleSheetGUI::deleteStyleParameterObject ( )

delete style parameters

Definition at line 578 of file class.ilObjStyleSheetGUI.php.

References editObject().

{
if (is_array($_POST["sty_select"]))
{
foreach($_POST["sty_select"] as $id => $dummy)
{
$this->object->deleteParameter($id);
}
}
$this->object->read();
$this->object->writeCSSFile();
$this->editObject();
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::editObject ( )

edit style sheet

Reimplemented from ilObjectGUI.

Definition at line 128 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$lng, $location, formSelect(), and ilObjectGUI\getTemplateFile().

Referenced by deleteStyleParameterObject(), newStyleParameterObject(), refreshObject(), updateTagStyleObject(), and viewObject().

{
global $rbacsystem, $lng;
//$this->setTabs();
// set style sheet
$this->tpl->setCurrentBlock("ContentStyle");
$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
$this->object->getContentStylePath($this->object->getId()));
$this->tpl->parseCurrentBlock();
$this->getTemplateFile("edit", "sty");
$this->tpl->setVariable("TXT_ACTION", $this->lng->txt("edit_stylesheet"));
// add button button
$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
// export button
$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "exportStyle"));
$this->tpl->setVariable("BTN_TXT",$this->lng->txt("export"));
$this->tpl->parseCurrentBlock();
// output style parameters
$avail_pars = $this->object->getAvailableParameters();
$style = $this->object->getStyle();
foreach($style as $tag)
{
foreach($tag as $par)
{
$this->tpl->setCurrentBlock("StyleParameter");
$this->tpl->setVariable("PAR_ID", $par["id"]);
$var = str_replace("-", "_", $par["parameter"]);
// replace _bottom, _top, _left, _right
$add = "";
$location = array("bottom", "top", "left", "right");
foreach ($location as $loc)
{
if (is_int(strpos($var, "_".$loc)))
{
$var = str_replace("_".$loc, "", $var);
$add = ", ".$this->lng->txt("sty_".$loc);
}
}
$this->tpl->setVariable("TXT_PAR",
$this->lng->txt("sty_".$var).$add);
if (count($avail_pars[$par["parameter"]]) == 0)
{
$input = "<input type=\"text\" size=\"30\" maxlength=\"100\" ".
"name=\"styval[".$par["id"]."]\" value=\"".$par["value"]."\"";
}
else
{
$sel_avail_vals = array();
foreach($avail_pars[$par["parameter"]] as $key => $val)
{
$sel_avail_vals[$val] = $val;
}
$input = ilUtil::formSelect($par["value"], "styval[".$par["id"]."]", $sel_avail_vals, false, true);
}
$this->tpl->setVariable("INPUT_VAL", $input);
$this->tpl->parseCurrentBlock();
}
if ((!is_int(strpos($tag[0]["class"], ":hover"))) &&
(!is_int(strpos($tag[0]["class"], ":visited"))) &&
(!is_int(strpos($tag[0]["class"], ":active")))
)
{
$this->tpl->setCurrentBlock("Example_".$tag[0]["tag"]);
$this->tpl->setVariable("EX_CLASS", "ilc_".$tag[0]["class"]);
$this->tpl->setVariable("EX_TEXT", "ABC abc 123");
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("StyleTag");
$tag_str = $tag[0]["tag"].".".$tag[0]["class"];
$this->tpl->setVariable("TXT_TAG", $tag_str);
$this->tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
$this->ctrl->setParameter($this, "tag", $tag_str);
$this->tpl->setVariable("LINK_EDIT_TAG_STYLE",
$this->ctrl->getLinkTarget($this, "editTagStyle"));
$this->tpl->setVariable("STY_ROWSPAN", (count($tag) + 1));
$this->tpl->setVariable("TXT_PARAMETER", $this->lng->txt("parameter"));
$this->tpl->setVariable("TXT_VALUE", $this->lng->txt("value"));
$this->tpl->parseCurrentBlock();
}
// title and description
$this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
$this->tpl->setVariable(strtoupper("TITLE"), $this->object->getTitle());
$this->tpl->setVariable("TXT_DESC", $this->lng->txt("description"));
$this->tpl->setVariable(strtoupper("DESCRIPTION"), $this->object->getDescription());
$this->tpl->parseCurrentBlock();
// new parameter
$temptags = $this->object->getAvailableTags();
$tags = array();
foreach($temptags as $key => $val)
{
$tags[$val] = $val;
}
$tag_select = ilUtil::formSelect("", "tag", $tags, false, true);
foreach($avail_pars as $key => $val)
{
$sel_avail_pars[$key] = $key;
}
$this->tpl->setVariable("SELECT_TAG", $tag_select);
$par_select = ilUtil::formSelect("", "parameter", $sel_avail_pars, false, true);
$this->tpl->setVariable("SELECT_PAR", $par_select);
$this->tpl->setVariable("TXT_NEW_PAR", $this->lng->txt("add"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save_return"));
$this->tpl->setVariable("BTN_SAVE", "update");
$this->tpl->setVariable("TXT_REFRESH", $this->lng->txt("save_refresh"));
$this->tpl->setVariable("BTN_REFRESH", "refresh");
$this->tpl->setVariable("TXT_DELETE", $this->lng->txt("delete_selected"));
$this->tpl->setVariable("BTN_DELETE", "deleteStyleParameter");
$this->tpl->setVariable("BTN_NEW_PAR", "newStyleParameter");
$this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::editTagStyleObject ( )

edit style of single tag

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

References $_GET, ilObjectGUI\$lng, extractParametersOfTag(), and formSelect().

Referenced by refreshTagStyleObject().

{
global $rbacsystem, $lng;
//$this->setTabs();
// set style sheet
$this->tpl->setCurrentBlock("ContentStyle");
$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
$this->object->getContentStylePath($this->object->getId()));
$this->tpl->parseCurrentBlock();
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content",
"tpl.sty_tag_edit.html", false, false);
$this->tpl->setVariable("TXT_ACTION", $this->lng->txt("edit_stylesheet"));
// output style parameters
$avail_pars = $this->object->getAvailableParameters();
$style = $this->object->getStyle();
$this->tpl->setVariable("TXT_TEXT", $this->lng->txt("sty_text"));
$this->tpl->setVariable("TXT_MARGIN_AND_PADDING", $this->lng->txt("sty_margin_and_padding"));
$this->tpl->setVariable("TXT_ALL", $this->lng->txt("sty_all"));
$this->tpl->setVariable("TXT_TOP", $this->lng->txt("sty_top"));
$this->tpl->setVariable("TXT_BOTTOM", $this->lng->txt("sty_bottom"));
$this->tpl->setVariable("TXT_LEFT", $this->lng->txt("sty_left"));
$this->tpl->setVariable("TXT_RIGHT", $this->lng->txt("sty_right"));
$this->tpl->setVariable("TXT_BORDER", $this->lng->txt("sty_border"));
$this->tpl->setVariable("TXT_BACKGROUND", $this->lng->txt("sty_background"));
$this->tpl->setVariable("TXT_SPECIAL", $this->lng->txt("sty_special"));
$cur = explode(".",$_GET["tag"]);
$cur_tag = $cur[0];
$cur_class = $cur[1];
$parameters = $this->extractParametersOfTag($cur_tag, $cur_class, $style);
$this->tpl->setCurrentBlock("Example_".$cur_tag);
$this->tpl->setVariable("EX_CLASS", "ilc_".$cur_class);
$this->tpl->setVariable("EX_TEXT", "ABC abc 123");
$this->tpl->parseCurrentBlock();
// for all tag parameters
foreach ($avail_pars as $par => $vals)
{
$var = str_replace("-", "_", $par);
$up_par = strtoupper($var);
$this->tpl->setVariable("TXT_".$up_par, $this->lng->txt("sty_".$var));
// output select lists
if (count($avail_pars[$par]) > 0)
{
$sel_avail_vals = array("" => "");
foreach($avail_pars[$par] as $key => $val)
{
$sel_avail_vals[$val] = $val;
}
$sel_str = ilUtil::formSelect($parameters[$par], $var, $sel_avail_vals, false, true);
$this->tpl->setVariable("SEL_".$up_par, $sel_str);
}
else
{
$this->tpl->setVariable("VAL_".$up_par, $parameters[$par]);
}
}
/*
foreach($style as $tag)
{
foreach($tag as $par)
{
$this->tpl->setCurrentBlock("StyleParameter");
$this->tpl->setVariable("PAR_ID", $par["id"]);
$this->tpl->setVariable("TXT_PAR", $par["parameter"]);
if (count($avail_pars[$par["parameter"]]) == 0)
{
$input = "<input type=\"text\" size=\"30\" maxlength=\"100\" ".
"name=\"styval[".$par["id"]."]\" value=\"".$par["value"]."\"";
}
else
{
$sel_avail_vals = array();
foreach($avail_pars[$par["parameter"]] as $key => $val)
{
$sel_avail_vals[$val] = $val;
}
$input = ilUtil::formSelect($par["value"], "styval[".$par["id"]."]", $sel_avail_vals, false, true);
}
$this->tpl->setVariable("INPUT_VAL", $input);
$this->tpl->parseCurrentBlock();
}
if ((!is_int(strpos($tag[0]["class"], ":hover"))) &&
(!is_int(strpos($tag[0]["class"], ":visited"))) &&
(!is_int(strpos($tag[0]["class"], ":active")))
)
{
$this->tpl->setCurrentBlock("Example_".$tag[0]["tag"]);
$this->tpl->setVariable("EX_CLASS", "ilc_".$tag[0]["class"]);
$this->tpl->setVariable("EX_TEXT", "ABC abc 123");
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("StyleTag");
$tag_str = $tag[0]["tag"].".".$tag[0]["class"];
$this->tpl->setVariable("TXT_TAG", $tag_str);
$this->ctrl->setParameter($this, "tag", $tag_str);
$this->tpl->setVariable("LINK_EDIT_TAG_STYLE",
$this->ctrl->getLinkTarget($this, "editTagStyle"));
$this->tpl->setVariable("STY_ROWSPAN", (count($tag) + 1));
$this->tpl->setVariable("TXT_PARAMETER", $this->lng->txt("parameter"));
$this->tpl->setVariable("TXT_VALUE", $this->lng->txt("value"));
$this->tpl->parseCurrentBlock();
}
// title and description
$this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
$this->tpl->setVariable(strtoupper("TITLE"), $this->object->getTitle());
$this->tpl->setVariable("TXT_DESC", $this->lng->txt("description"));
$this->tpl->setVariable(strtoupper("DESCRIPTION"), $this->object->getDescription());
$this->tpl->parseCurrentBlock();
// new parameter
$temptags = $this->object->getAvailableTags();
$tags = array();
foreach($temptags as $key => $val)
{
$tags[$val] = $val;
}
$tag_select = ilUtil::formSelect("", "tag", $tags, false, true);
foreach($avail_pars as $key => $val)
{
$sel_avail_pars[$key] = $key;
}
$this->tpl->setVariable("SELECT_TAG", $tag_select);
$par_select = ilUtil::formSelect("", "parameter", $sel_avail_pars, false, true);
$this->tpl->setVariable("SELECT_PAR", $par_select);
$this->tpl->setVariable("TXT_NEW_PAR", $this->lng->txt("add"));
*/
$this->ctrl->setParameter($this, "tag", $_GET["tag"]);
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save_return"));
$this->tpl->setVariable("BTN_SAVE", "updateTagStyle");
$this->tpl->setVariable("TXT_REFRESH", $this->lng->txt("save_refresh"));
$this->tpl->setVariable("BTN_REFRESH", "refreshTagStyle");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilObjStyleSheetGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 65 of file class.ilObjStyleSheetGUI.php.

References $cmd, $ret, and ilObjectGUI\prepareOutput().

{
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd("edit");
$this->prepareOutput();
switch($next_class)
{
default:
$cmd.= "Object";
$ret =& $this->$cmd();
break;
}
return $ret;
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::exportStyleObject ( )

export style

Definition at line 457 of file class.ilObjStyleSheetGUI.php.

References ilUtil\deliverData().

{
ilUtil::deliverData($this->object->getXML(), "style_".$this->object->getId().".xml");
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::extractParametersOfTag (   $a_tag,
  $a_class,
  $a_style 
)

Definition at line 462 of file class.ilObjStyleSheetGUI.php.

Referenced by editTagStyleObject().

{
$parameters = array();
foreach($a_style as $tag)
{
foreach($tag as $par)
{
if ($par["tag"] == $a_tag && $par["class"] == $a_class)
{
$parameters[$par["parameter"]] = $par["value"];
}
}
}
return $parameters;
}

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::getAdminTabs ( $tabs_gui)

admin and normal tabs are equal for roles

Reimplemented from ilObjectGUI.

Definition at line 740 of file class.ilObjStyleSheetGUI.php.

References getTabs().

{
$this->getTabs($tabs_gui);
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::getTabs ( $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Reimplemented from ilObjectGUI.

Definition at line 773 of file class.ilObjStyleSheetGUI.php.

Referenced by getAdminTabs(), and setTabs().

{
// back to upper context
$tabs_gui->addTarget("cont_back",
$this->ctrl->getParentReturn($this), "",
"");
}

+ Here is the caller graph for this function:

ilObjStyleSheetGUI::ilObjStyleSheetGUI (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prep = true 
)

Constructor public.

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

References $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and ilObjectGUI\ilObjectGUI().

{
global $ilCtrl, $lng, $tpl;
$this->ctrl =& $ilCtrl;
$this->lng =& $lng;
$this->lng->loadLanguageModule("style");
$this->type = "sty";
$this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, false);
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::importStyleObject ( )

import style sheet

Definition at line 685 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjStyleSheet\_writeStandard(), and ilObjectFactory\getInstanceByRefId().

{
// check file
$source = $_FILES["stylefile"]["tmp_name"];
if (($source == 'none') || (!$source))
{
$this->ilias->raiseError("No file selected!",$this->ilias->error_obj->MESSAGE);
}
// check correct file type
$info = pathinfo($_FILES["stylefile"]["name"]);
if (strtolower($info["extension"]) != "xml")
{
$this->ilias->raiseError("File must be a xml file!",$this->ilias->error_obj->MESSAGE);
}
$class_name = "ilObjStyleSheet";
require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$newObj = new ilObjStyleSheet();
//$newObj->setTitle();
//$newObj->setDescription($_POST["style_description"]);
$newObj->createFromXMLFile($_FILES["stylefile"]["tmp_name"]);
// assign style to style sheet folder,
// if parent is style sheet folder
if ($_GET["ref_id"] > 0)
{
if ($fold->getType() == "stys")
{
$fold->addStyle($newObj->getId());
$fold->update();
ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
$this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
}
}
return $newObj->getId();
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::newStyleParameterObject ( )

add style parameter

Definition at line 481 of file class.ilObjStyleSheetGUI.php.

References editObject().

{
$this->object->addParameter($_POST["tag"], $_POST["parameter"]);
$this->editObject();
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::refreshObject ( )

refresh style sheet

Definition at line 490 of file class.ilObjStyleSheetGUI.php.

References editObject().

{
//$class_name = "ilObjStyleSheet";
//require_once("classes/class.ilObjStyleSheet.php");
$this->object->setTitle($_POST["style_title"]);
$this->object->setDescription($_POST["style_description"]);
foreach($_POST["styval"] as $id => $value)
{
$this->object->updateStyleParameter($id, $value);
}
$this->object->update();
$this->editObject();
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::refreshTagStyleObject ( )

save and refresh tag editing

Definition at line 403 of file class.ilObjStyleSheetGUI.php.

References $_GET, and editTagStyleObject().

{
$avail_pars = $this->object->getAvailableParameters();
$cur = explode(".",$_GET["tag"]);
$cur_tag = $cur[0];
$cur_class = $cur[1];
foreach ($avail_pars as $par => $vals)
{
$var = str_replace("-", "_", $par);
if ($_POST[$var] != "")
{
$this->object->replaceStylePar($cur_tag, $cur_class, $par, $_POST[$var]);
}
else
{
$this->object->deleteStylePar($cur_tag, $cur_class, $par);
}
//$this->object->updateStyleParameter($id, $value);
}
$this->object->update();
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::saveObject ( )

save style sheet

Reimplemented from ilObjectGUI.

Definition at line 595 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjStyleSheet\_writeStandard(), and ilObjectFactory\getInstanceByRefId().

{
//echo "HH"; exit;
$class_name = "ilObjStyleSheet";
require_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$newObj = new ilObjStyleSheet();
$newObj->setTitle($_POST["style_title"]);
$newObj->setDescription($_POST["style_description"]);
$newObj->create();
// assign style to style sheet folder,
// if parent is style sheet folder
if ($_GET["ref_id"] > 0)
{
if ($fold->getType() == "stys")
{
$fold->addStyle($newObj->getId());
$fold->update();
ilObjStyleSheet::_writeStandard($newObj->getId(), "1");
$this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles");
}
}
return $newObj->getId();
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::setTabs ( )

output tabs

Reimplemented from ilObjectGUI.

Definition at line 748 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI\$lng, and getTabs().

{
global $lng;
// catch feedback message
#include_once("classes/class.ilTabsGUI.php");
#$tabs_gui =& new ilTabsGUI();
$this->getTabs($this->tabs_gui);
#$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
if (strtolower(get_class($this->object)) == "ilobjstylesheet")
{
$this->tpl->setVariable("HEADER", $this->object->getTitle());
}
else
{
$this->tpl->setVariable("HEADER", $lng->txt("create_stylesheet"));
}
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::showUpperIcon ( )

Reimplemented from ilObjectGUI.

Definition at line 812 of file class.ilObjStyleSheetGUI.php.

References $_GET, ilObjectGUI\$objDefinition, ilObjectGUI\$tpl, and ilObjectGUI\$tree.

{
if (strtolower($_GET["baseClass"]) == "iladministrationgui")
{
$tpl->setUpperIcon(
$this->ctrl->getLinkTargetByClass("ilobjstylesettingsgui",
"editContentStyles"));
}
else
{
// ?
}
}
ilObjStyleSheetGUI::updateObject ( )

update style sheet

Reimplemented from ilObjectGUI.

Definition at line 626 of file class.ilObjStyleSheetGUI.php.

References $_GET, and ilObjectFactory\getInstanceByRefId().

{
//$class_name = "ilObjStyleSheet";
//require_once("classes/class.ilObjStyleSheet.php");
$this->object->setTitle($_POST["style_title"]);
$this->object->setDescription($_POST["style_description"]);
foreach($_POST["styval"] as $id => $value)
{
$this->object->updateStyleParameter($id, $value);
}
$this->object->update();
if ($_GET["ref_id"] > 0)
{
if ($fold->getType() == "stys")
{
$this->ctrl->redirectByClass("ilobjstylesettingsgui",
"editContentStyles");
}
}
$this->ctrl->returnToParent($this);
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::updateTagStyleObject ( )

save and refresh tag editing

Definition at line 430 of file class.ilObjStyleSheetGUI.php.

References $_GET, and editObject().

{
$avail_pars = $this->object->getAvailableParameters();
$cur = explode(".", $_GET["tag"]);
$cur_tag = $cur[0];
$cur_class = $cur[1];
foreach ($avail_pars as $par => $vals)
{
$var = str_replace("-", "_", $par);
if ($_POST[$var] != "")
{
$this->object->replaceStylePar($cur_tag, $cur_class, $par, $_POST[$var]);
}
else
{
$this->object->deleteStylePar($cur_tag, $cur_class, $par);
}
//$this->object->updateStyleParameter($id, $value);
}
$this->object->update();
$this->editObject();
}

+ Here is the call graph for this function:

ilObjStyleSheetGUI::viewObject ( )

list childs of current object

public

Reimplemented from ilObjectGUI.

Definition at line 82 of file class.ilObjStyleSheetGUI.php.

References editObject().

{
$this->editObject();
}

+ Here is the call graph for this function:

Field Documentation

ilObjStyleSheetGUI::$cmd_delete

Definition at line 44 of file class.ilObjStyleSheetGUI.php.

ilObjStyleSheetGUI::$cmd_new_par

Definition at line 42 of file class.ilObjStyleSheetGUI.php.

ilObjStyleSheetGUI::$cmd_refresh

Definition at line 43 of file class.ilObjStyleSheetGUI.php.

ilObjStyleSheetGUI::$cmd_update

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


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