Public Member Functions | Data Fields

ilLPFilterGUI Class Reference

Public Member Functions

 ilLPFilterGUI ($a_usr_id)
executeCommand ()
 execute command
 getUserId ()
 getHTML ()
 getFO ()
 hideSelected ()
 hide ()
 updateHidden ()
 refresh ()
 selector ()
 selectRoot ()
 __initFilter ()
 __getPossibleTypes ()
 __prepareHidden ()

Data Fields

 $usr_id = null
 $tpl = null
 $lng = null
 $ctrl = null

Detailed Description

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


Member Function Documentation

ilLPFilterGUI::__getPossibleTypes (  ) 

Definition at line 262 of file class.ilLPFilterGUI.php.

Referenced by getHTML().

        {
                return array('lm' => $this->lng->txt('learning_resources'),
                                         'crs' => $this->lng->txt('objs_crs'),
                                         'tst' => $this->lng->txt('objs_tst'),
                                         'grp' => $this->lng->txt('objs_grp'),
                                         'exc' => $this->lng->txt('objs_exc'));
                                         
        }

Here is the caller graph for this function:

ilLPFilterGUI::__initFilter (  ) 

Definition at line 254 of file class.ilLPFilterGUI.php.

Referenced by ilLPFilterGUI().

        {
                global $ilUser;

                $this->filter = new ilLPFilter($ilUser->getId());
                return true;
        }

Here is the caller graph for this function:

ilLPFilterGUI::__prepareHidden (  ) 

Definition at line 272 of file class.ilLPFilterGUI.php.

References $obj_id.

Referenced by getHTML().

        {
                $types = $this->filter->prepareType();


                global $ilObjDataCache;

                foreach($this->filter->getHidden() as $obj_id)
                {
                        if(in_array($ilObjDataCache->lookupType($obj_id),$types))
                        {
                                $hidden[$obj_id] = $ilObjDataCache->lookupTitle($obj_id);
                        }
                }
                return $hidden ? $hidden : array();
        }

Here is the caller graph for this function:

& ilLPFilterGUI::executeCommand (  ) 

execute command

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

References $cmd.

        {
                $this->ctrl->setReturn($this, "");
                switch($this->ctrl->getNextClass())
                {
                        default:
                                $cmd = $this->ctrl->getCmd() ? $this->ctrl->getCmd() : 'show';
                                $this->$cmd();

                }
                return true;
        }

ilLPFilterGUI::getFO (  ) 

Definition at line 138 of file class.ilLPFilterGUI.php.

References $tpl, and ilXmlWriter::_xmlEscapeData().

        {
                global $ilObjDataCache,$ilUser;

                $tpl = new ilTemplate('tpl.lp_filter.xml',true,true,'Services/Tracking');

                if(strlen($this->filter->getQueryString()))
                {
                        $tpl->setCurrentBlock("filter_title");
                        $tpl->setVariable("TXT_TITLE",ilXmlWriter::_xmlEscapeData($this->lng->txt('trac_query')));
                        $tpl->setVariable("TITLE",ilXmlWriter::_xmlEscapeData($this->filter->getQueryString()));
                        $tpl->parseCurrentBlock();
                }

                $tpl->setVariable("TXT_FILTER",ilXmlWriter::_xmlEscapeData($this->lng->txt('trac_lp_filter')));
                $tpl->setVariable("TXT_TYPE",ilXmlWriter::_xmlEscapeData($this->lng->txt('obj_types')));
                $tpl->setVariable("TYPE",ilXmlWriter::_xmlEscapeData($this->lng->txt('objs_'.$this->filter->getFilterType())));
                $tpl->setVariable("TXT_AREA",ilXmlWriter::_xmlEscapeData($this->lng->txt('trac_filter_area')));
                $tpl->setVariable("FILTER_LANG",ilXmlWriter::_xmlEscapeData($ilUser->getLanguage()));
                if($this->filter->getRootNode() == ROOT_FOLDER_ID)
                {
                        $tpl->setVariable("AREA",ilXmlWriter::_xmlEscapeData($this->lng->txt('trac_filter_repository')));
                }
                else
                {
                        $text = $this->lng->txt('trac_below')." '";
                        $text .= $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($this->filter->getRootNode()));
                        $text .= "'";
                        $tpl->setVariable("AREA",ilXmlWriter::_xmlEscapeData($text));
                }
                return $tpl->get();
        }

Here is the call graph for this function:

ilLPFilterGUI::getHTML (  ) 

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

References $tpl, __getPossibleTypes(), __prepareHidden(), ilUtil::formSelect(), ilUtil::getImagePath(), and ilUtil::prepareFormOutput().

        {
                global $ilObjDataCache;

                $tpl = new ilTemplate('tpl.lp_filter.html',true,true,'Services/Tracking');

                $tpl->setVariable("FILTER_ACTION",$this->ctrl->getFormAction($this));
                $tpl->setVariable("TBL_TITLE",$this->lng->txt('trac_lp_filter'));
                $tpl->setVariable("TXT_AREA",$this->lng->txt('trac_filter_area'));


                // Area
                if($this->filter->getRootNode() == ROOT_FOLDER_ID)
                {
                        $tpl->setVariable("FILTER_AREA",$this->lng->txt('trac_filter_repository'));
                }
                else
                {
                        $text = $this->lng->txt('trac_below')." '";
                        $text .= $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($this->filter->getRootNode()));
                        $text .= "'";
                        $tpl->setVariable("FILTER_AREA",$text);
                }

                $tpl->setVariable("TXT_QUERY",$this->lng->txt('trac_query'));
                $tpl->setVariable("QUERY",ilUtil::prepareFormOutput($this->filter->getQueryString()));

                $tpl->setVariable("UPDATE_AREA",$this->lng->txt('change'));
                $tpl->setVariable("TYPES",$this->lng->txt('obj_types'));
                $tpl->setVariable("TYPE_SELECTOR",ilUtil::formSelect($this->filter->getFilterType(),
                                                                                                                         'type',
                                                                                                                         $this->__getPossibleTypes(),
                                                                                                                         false,
                                                                                                                         true));
                $tpl->setVariable("TXT_HIDDEN",$this->lng->txt('trac_filter_hidden'));

                if(count($hidden = $this->__prepareHidden()))
                {
                        $tpl->setVariable("HIDDEN_SELECTOR",ilUtil::formSelect(0,'hide',$hidden,false,true));
                        $tpl->setCurrentBlock("editable");
                        $tpl->setVariable("BTN_SHOW",$this->lng->txt('trac_show_hidden'));
                        $tpl->parseCurrentBlock();
                }
                else
                {
                        $tpl->setVariable("HIDDEN_SELECTOR",$this->lng->txt('trac_filter_none'));
                }
                $tpl->setVariable("HREF_UPDATE_AREA",$this->ctrl->getLinkTargetByClass('illpfiltergui','selector'));
                $tpl->setVariable("DOWNRIGHT",ilUtil::getImagePath('arrow_downright.gif'));
                $tpl->setVariable("BTN_REFRESH",$this->lng->txt('trac_refresh'));

                return $tpl->get();
        }

Here is the call graph for this function:

ilLPFilterGUI::getUserId (  ) 

Definition at line 78 of file class.ilLPFilterGUI.php.

        {
                return $this->usr_id;
        }

ilLPFilterGUI::hide (  ) 

Definition at line 189 of file class.ilLPFilterGUI.php.

References $_GET, and sendInfo().

        {
                $this->filter->addHidden((int) $_GET['hide']);
                $this->filter->update();
                sendInfo($this->lng->txt('trac_added_no_shown_list'),true);
                $this->ctrl->returnToParent($this);
        }

Here is the call graph for this function:

ilLPFilterGUI::hideSelected (  ) 

Definition at line 172 of file class.ilLPFilterGUI.php.

References $_POST, and sendInfo().

        {
                if(!count($_POST['item_id']))
                {
                        sendInfo($this->lng->txt('trac_select_one'),true);
                        $this->ctrl->returnToParent($this);
                }
                foreach($_POST['item_id'] as $item_id)
                {
                        $this->filter->addHidden((int) $item_id);
                }
                $this->filter->update();
                sendInfo($this->lng->txt('trac_added_no_shown_list'),true);
                $this->ctrl->returnToParent($this);
        }                       

Here is the call graph for this function:

ilLPFilterGUI::ilLPFilterGUI ( a_usr_id  ) 

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

References $ilCtrl, $lng, $tpl, and __initFilter().

        {
                global $lng,$ilCtrl,$tpl;

                $this->ctrl =& $ilCtrl;
                $this->lng =& $lng;
                $this->tpl =& $tpl;
                $this->usr_id = $a_usr_id;
                $this->__initFilter();
        }

Here is the call graph for this function:

ilLPFilterGUI::refresh (  ) 

Definition at line 211 of file class.ilLPFilterGUI.php.

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

        {
                $this->filter->setFilterType($_POST['type']);
                $this->filter->setQueryString(ilUtil::stripSlashes($_POST['query']));
                $this->filter->update();
                $this->ctrl->returnToParent($this);

                return true;
        }

Here is the call graph for this function:

ilLPFilterGUI::selector (  ) 

Definition at line 221 of file class.ilLPFilterGUI.php.

References $_GET, $exp, $tree, and sendInfo().

        {
                global $tree;

                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.trac_root_selector.html','Services/Tracking');

                include_once 'Services/Search/classes/class.ilSearchRootSelector.php';

                sendInfo($this->lng->txt('search_area_info'));

                $exp = new ilSearchRootSelector($this->ctrl->getLinkTargetByClass('illpfiltergui','selector'));
                $exp->setExpand($_GET["search_root_expand"] ? $_GET["search_root_expand"] : $tree->readRootId());
                $exp->setExpandTarget($this->ctrl->getLinkTargetByClass('illpfiltergui','selector'));
                $exp->setTargetClass('illpfiltergui');
                $exp->setCmd('selectRoot');

                // build html-output
                $exp->setOutput(0);

                $this->tpl->setVariable("EXPLORER",$exp->getOutput());

                
        }

Here is the call graph for this function:

ilLPFilterGUI::selectRoot (  ) 

Definition at line 245 of file class.ilLPFilterGUI.php.

References $_GET, and sendInfo().

        {
                $this->filter->setRootNode((int) $_GET['root_id']);
                $this->filter->update();
                sendInfo($this->lng->txt('trac_modifications_saved'),true);
                $this->ctrl->returnToParent($this);
        }

Here is the call graph for this function:

ilLPFilterGUI::updateHidden (  ) 

Definition at line 197 of file class.ilLPFilterGUI.php.

References $_POST, and sendInfo().

        {
                if(!$_POST['hide'])
                {
                        sendInfo($this->lng->txt('trac_select_one'),true);
                        $this->ctrl->returnToParent($this);
                }
                $this->filter->removeHidden((int) $_POST['hide']);
                $this->filter->update();
                sendInfo($this->lng->txt('trac_modifications_saved'),true);
                $this->ctrl->returnToParent($this);

        }

Here is the call graph for this function:


Field Documentation

ilLPFilterGUI::$ctrl = null

Definition at line 48 of file class.ilLPFilterGUI.php.

ilLPFilterGUI::$lng = null

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

Referenced by ilLPFilterGUI().

ilLPFilterGUI::$tpl = null

Definition at line 46 of file class.ilLPFilterGUI.php.

Referenced by getFO(), getHTML(), and ilLPFilterGUI().

ilLPFilterGUI::$usr_id = null

Definition at line 45 of file class.ilLPFilterGUI.php.


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