Public Member Functions

ilPCFileListGUI Class Reference

Inheritance diagram for ilPCFileListGUI:
Collaboration diagram for ilPCFileListGUI:

Public Member Functions

 ilPCFileListGUI (&$a_pg_obj, &$a_content_obj, $a_hier_id)
 Constructor public.
executeCommand ()
 execute command
 insert ()
 insert new file list form
 create ()
 create new file list in dom and update page in db
 edit ()
 edit properties form
 saveProperties ()
 save table properties in db and return to page edit screen
 setTabs ()
 output tabs
 getTabs (&$tabs_gui)
 adds tabs to tab gui object

Detailed Description

Definition at line 37 of file class.ilPCFileListGUI.php.


Member Function Documentation

ilPCFileListGUI::create (  ) 

create new file list in dom and update page in db

Definition at line 124 of file class.ilPCFileListGUI.php.

References $_POST, $_SESSION, insert(), and ilUtil::stripSlashes().

        {
                include_once("classes/class.ilObjFile.php");
                $fileObj = new ilObjFile();
                $fileObj->setType("file");
                $fileObj->setTitle($_FILES["Fobject"]["name"]["file"]);
                $fileObj->setDescription("");
                $fileObj->setFileName($_FILES["Fobject"]["name"]["file"]);
                $fileObj->setFileType($_FILES["Fobject"]["type"]["file"]);
                $fileObj->setMode("filelist");
                $fileObj->create();
                // upload file to filesystem
                $fileObj->createDirectory();
                $fileObj->raiseUploadError(false);
                $fileObj->getUploadFile($_FILES["Fobject"]["tmp_name"]["file"],
                        $_FILES["Fobject"]["name"]["file"]);

                $_SESSION["il_text_lang_".$_GET["ref_id"]] = $_POST["flst_language"];

//echo "::".is_object($this->dom).":";
                $this->content_obj = new ilPCFileList($this->dom);
                $this->content_obj->create($this->pg_obj, $this->hier_id);
                $this->content_obj->setListTitle(ilUtil::stripSlashes($_POST["flst_title"]), $_POST["flst_language"]);
                $this->content_obj->appendItem($fileObj->getId(), $fileObj->getFileName(),
                        $fileObj->getFileType());
                $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:

ilPCFileListGUI::edit (  ) 

edit properties form

Definition at line 163 of file class.ilPCFileListGUI.php.

References $lang, ilPageContentGUI::displayValidationError(), formSelect(), ilMetaData::getLanguages(), and setTabs().

Referenced by saveProperties().

        {
                $this->setTabs();

                // add paragraph edit template
                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.file_list_edit.html", "content");
                $this->tpl->setVariable("TXT_ACTION", $this->lng->txt("cont_edit_file_list_properties"));
                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));

                $this->displayValidationError();

                // select fields for number of columns
                $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
                $this->tpl->setVariable("INPUT_TITLE", "flst_title");

                // todo: this doesnt work if title contains " quotes
                // ... addslashes doesnt work
                $this->tpl->setVariable("VALUE_TITLE", $this->content_obj->getListTitle());

                // language
                $this->tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language"));
                $lang = ilMetaData::getLanguages();
                $select_lang = ilUtil::formSelect ($this->content_obj->getLanguage(),"flst_language",$lang,false,true);
                $this->tpl->setVariable("SELECT_LANGUAGE", $select_lang);


                $this->tpl->parseCurrentBlock();

                // operations
                $this->tpl->setCurrentBlock("commands");
                $this->tpl->setVariable("BTN_NAME", "saveProperties");
                $this->tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
                $this->tpl->setVariable("BTN_CANCEL", "cancelUpdate");
                $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
                $this->tpl->parseCurrentBlock();

        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilPCFileListGUI::executeCommand (  ) 

execute command

Definition at line 52 of file class.ilPCFileListGUI.php.

References $cmd.

        {
                // 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)
                {
                        default:
                                $ret =& $this->$cmd();
                                break;
                }

                return $ret;
        }

ilPCFileListGUI::getTabs ( &$  tabs_gui  ) 

adds tabs to tab gui object

Parameters:
object $tabs_gui ilTabsGUI object

Definition at line 240 of file class.ilPCFileListGUI.php.

Referenced by setTabs().

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

Here is the caller graph for this function:

ilPCFileListGUI::ilPCFileListGUI ( &$  a_pg_obj,
&$  a_content_obj,
a_hier_id 
)

Constructor public.

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

References ilPageContentGUI::ilPageContentGUI().

        {
                parent::ilPageContentGUI($a_pg_obj, $a_content_obj, $a_hier_id);
        }

Here is the call graph for this function:

ilPCFileListGUI::insert (  ) 

insert new file list form

Definition at line 73 of file class.ilPCFileListGUI.php.

References $_GET, $_SESSION, $lang, ilPageContentGUI::displayValidationError(), formSelect(), ilMetaData::getLanguages(), and setTabs().

Referenced by create().

        {
                global $ilUser;

                $this->setTabs();

                // new file list form
                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.file_list_new.html", "content");
                $this->tpl->setVariable("TXT_ACTION", $this->lng->txt("cont_insert_file_list"));
                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));

                $this->displayValidationError();

                if ($_SESSION["il_text_lang_".$_GET["ref_id"]] != "")
                {
                        $s_lang = $_SESSION["il_text_lang_".$_GET["ref_id"]];
                }
                else
                {
                        $s_lang = $ilUser->getLanguage();
                }


                // select fields for number of columns
                $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("title"));
                $this->tpl->setVariable("INPUT_TITLE", "flst_title");
                $this->tpl->setVariable("TXT_FILE", $this->lng->txt("file"));

                // language
                $this->tpl->setVariable("TXT_LANGUAGE", $this->lng->txt("language"));
                $lang = ilMetaData::getLanguages();
                $select_lang = ilUtil::formSelect ($s_lang, "flst_language",$lang,false,true);
                $this->tpl->setVariable("SELECT_LANGUAGE", $select_lang);


                $this->tpl->parseCurrentBlock();

                // operations
                $this->tpl->setCurrentBlock("commands");
                $this->tpl->setVariable("BTN_NAME", "create_flst");
                $this->tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
                $this->tpl->setVariable("BTN_CANCEL", "cancelCreate");
                $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
                $this->tpl->parseCurrentBlock();

        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilPCFileListGUI::saveProperties (  ) 

save table properties in db and return to page edit screen

Definition at line 205 of file class.ilPCFileListGUI.php.

References $_POST, edit(), and ilUtil::stripSlashes().

        {
                $this->content_obj->setListTitle(ilUtil::stripSlashes($_POST["flst_title"]),
                        $_POST["flst_language"]);
                $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:

ilPCFileListGUI::setTabs (  ) 

output tabs

Definition at line 224 of file class.ilPCFileListGUI.php.

References getTabs().

Referenced by edit(), and insert().

        {
                global $ilTabs;

                // catch feedback message
                #include_once("classes/class.ilTabsGUI.php");
                #$tabs_gui =& new ilTabsGUI();
                $this->getTabs($ilTabs);
                #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
        }

Here is the call graph for this function:

Here is the caller graph for this function:


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