Public Member Functions | Data Fields

ilObjStyleSheetGUI Class Reference

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
 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
 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 ()

Data Fields

 $cmd_update
 $cmd_new_par
 $cmd_refresh
 $cmd_delete

Detailed Description

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 443 of file class.ilObjStyleSheetGUI.php.

References $_GET, $ilLocator, 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"),
                                ilFrameTargetInfo::_getFrame("MainContent"));
                                
                        $ilLocator->addItem(ilObject::_lookupTitle(
                                ilObject::_lookupObjId($_GET["ref_id"])),
                                $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 289 of file class.ilObjStyleSheetGUI.php.

        {
                $this->ctrl->returnToParent($this);
        }

ilObjStyleSheetGUI::cancelObject (  ) 

update style sheet

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

References ilObjectGUI::$lng, and sendInfo().

        {
                global $lng;

                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 297 of file class.ilObjStyleSheetGUI.php.

References ilObjectGUI::$ilias.

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

ilObjStyleSheetGUI::createObject (  ) 

create

Reimplemented from ilObjectGUI.

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

References ilObjectGUI::$lng, $rbacsystem, ilObjectGUI::$tpl, 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("create_stylesheet"));
                $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
                $this->tpl->setVariable("TXT_DESC", $this->lng->txt("description"));
                $this->tpl->parseCurrentBlock();
                $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_CANCEL", $this->lng->txt("cancel"));
                $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
                //$this->tpl->parseCurrentBlock();
        }

Here is the call graph for this function:

ilObjStyleSheetGUI::deleteObject ( a_error = false  ) 

display deletion confirmation screen

public

Reimplemented from ilObjectGUI.

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

References $counter, ilObject::_lookupTitle(), ilUtil::getImagePath(), sendInfo(), and ilUtil::switchColor().

        {
                //$this->setTabs();

                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.confirm_deletion.html");

                if(!$a_error)
                {
                        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 309 of file class.ilObjStyleSheetGUI.php.

References $_POST, $id, and 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 113 of file class.ilObjStyleSheetGUI.php.

References $key, ilObjectGUI::$lng, $rbacsystem, formSelect(), and ilObjectGUI::getTemplateFile().

Referenced by deleteStyleParameterObject(), newStyleParameterObject(), refreshObject(), 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"));

                // 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"]);
                                $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");
                        $this->tpl->setVariable("TXT_TAG", $tag[0]["tag"].".".$tag[0]["class"]);
                        $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::executeCommand (  ) 

execute command

Reimplemented from ilObjectGUI.

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

References $cmd, 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::getAdminTabs ( &$  tabs_gui  ) 

admin and normal tabs are equal for roles

Reimplemented from ilObjectGUI.

Definition at line 398 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_gui ilTabsGUI object

Reimplemented from ilObjectGUI.

Definition at line 431 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->type = "sty";
                $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, false);
        }

Here is the call graph for this function:

ilObjStyleSheetGUI::newStyleParameterObject (  ) 

add style parameter

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

References $_POST, and 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 221 of file class.ilObjStyleSheetGUI.php.

References $_POST, $id, and 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::saveObject (  ) 

save style sheet

Reimplemented from ilObjectGUI.

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

References $_GET, $_POST, $class_name, and ilObjectFactory::getInstanceByRefId().

        {
//echo "HH"; exit;
                $class_name = "ilObjStyleSheet";
                require_once("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)
                {

                        $fold =& ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
                        if ($fold->getType() == "stys")
                        {
                                $fold->addStyle($newObj->getId());
                                $fold->update();
                                
                                $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 406 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 470 of file class.ilObjStyleSheetGUI.php.

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

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

ilObjStyleSheetGUI::updateObject (  ) 

update style sheet

Reimplemented from ilObjectGUI.

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

References $_GET, $_POST, $id, 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)
                {

                        $fold =& ilObjectFactory::getInstanceByRefId($_GET["ref_id"]);
                        if ($fold->getType() == "stys")
                        {
                                $this->ctrl->redirectByClass("ilobjstylesettingsgui",
                                        "editContentStyles");
                        }
                }

                $this->ctrl->returnToParent($this);
        }

Here is the call graph for this function:

ilObjStyleSheetGUI::viewObject (  ) 

list childs of current object

public

Reimplemented from ilObjectGUI.

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