ILIAS
Release_4_0_x_branch Revision 61816
|
This class provides processing control methods. More...
Public Member Functions | |
ilCtrl () | |
control class constructor | |
debug ($str) | |
getDebug () | |
init () | |
initialisation | |
callBaseClass () | |
Calls base class of current request. | |
getModuleDir () | |
get directory of current module | |
& | forwardCommand (&$a_gui_object) |
forward flow of control to next gui class this invokes the executeCommand() method of the gui object that is passed via reference | |
& | getHTML (&$a_gui_object) |
Gets an HTML output from another GUI class and returns the flow of control to the calling class. | |
setContext ($a_obj_id, $a_obj_type, $a_sub_obj_id=0, $a_sub_obj_type="") | |
Set context of current user interface. | |
getContextObjId () | |
Get ContextObjId. | |
getContextObjType () | |
Get ContextObjType. | |
getContextSubObjId () | |
Get ContextSubObjId. | |
getContextSubObjType () | |
Get ContextSubObjType. | |
getNodeIdForTargetClass ($a_par_node, $a_class) | |
Searchs a node for a given class ($a_class) "near" the another node ($a_par_node). | |
getCmdNode () | |
get command target node | |
addLocation ($a_title, $a_link, $a_target="", $a_ref_id=0) | |
add a location to the locator array | |
getLocations () | |
get locations array | |
addTab ($a_lang_var, $a_link, $a_cmd, $a_class) | |
add a tab to tabs array | |
getTabs () | |
get tabs array | |
getCallHistory () | |
Get controller call history. | |
getCallStructure ($a_class, $a_nr=0, $a_parent=0) | |
Get call structure of class context. | |
storeCommonStructures () | |
stores often used common call structures (called from db_update script!!!) | |
readCallStructure ($a_class, $a_nr=0, $a_parent=0) | |
reads call structure from db | |
forwards ($a_from_class, $a_to_class) | |
Stores which classes forwards commands to which other classes. | |
saveParameter (&$a_obj, $a_parameter) | |
Set parameters that should be passed in every form and link of a gui class. | |
saveParameterByClass ($a_class, $a_parameter) | |
setParameter (&$a_obj, $a_parameter, $a_value) | |
Set parameters that should be passed a form and link of a gui class. | |
setParameterByClass ($a_class, $a_parameter, $a_value) | |
Same as setParameterByClass, except that a class name is passed. | |
clearParameters (&$a_obj) | |
Clears all parameters that have been set via setParameter for a GUI class. | |
clearParametersByClass ($a_class) | |
Clears all parameters that have been set via setParameter for a GUI class. | |
getNextClass () | |
Get next class in the control path from the current class to the target command class. | |
lookupClassPath ($a_class_name) | |
Get class path that can be used in include statements for a given class name. | |
getClassForClasspath ($a_class_path) | |
this method assumes that the class path has the format "dir/class.<class_name>.php" | |
getPathNew ($a_source_node, $a_target_node) | |
get path in call structure | |
setTargetScript ($a_target_script) | |
set target script name | |
getTargetScript () | |
get target script name | |
initBaseClass ($a_base_class) | |
initialises new base class | |
getCmd ($a_default_cmd="", $a_safe_commands="") | |
determines current get/post command | |
setCmd ($a_cmd) | |
set the current command | |
setCmdClass ($a_cmd_class) | |
set the current command class | |
getCmdClass () | |
determines responsible class for current command | |
getFormAction (&$a_gui_obj, $a_fallback_cmd="", $a_anchor="", $a_asynch=false) | |
get form action url for gui class object | |
getFormActionByClass ($a_class, $a_fallback_cmd="", $a_anchor="", $a_asynch=false) | |
get form action url for gui class name | |
appendRequestTokenParameterString ($a_url) | |
append request token as url parameter | |
getRequestToken () | |
Get request token. | |
verifyToken () | |
Verify Token. | |
redirect (&$a_gui_obj, $a_cmd="", $a_anchor="") | |
redirectByClass ($a_class, $a_cmd="") | |
redirect to other gui class | |
isAsynch () | |
getLinkTarget (&$a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false) | |
get link target for (current) gui class | |
getLinkTargetByClass ($a_class, $a_cmd="", $a_anchor="", $a_asynch=false) | |
get link target for a target class | |
setReturn (&$a_gui_obj, $a_cmd) | |
set return command | |
setReturnByClass ($a_class, $a_cmd) | |
set return command | |
returnToParent (&$a_gui_obj, $a_anchor="") | |
redirects to next parent class that used setReturn | |
getRedirectSource () | |
get current redirect source | |
getParentReturn (&$a_gui_obj) | |
getParentReturnByClass ($a_class) | |
searchReturnClass ($a_class) | |
get current return class | |
getUrlParameters ($a_class, $a_str, $a_cmd="", $a_transits="") | |
appendTransitClasses ($a_str) | |
getTransitArray () | |
addTransit ($a_class) | |
getParameterArray (&$a_gui_obj, $a_cmd="", $a_incl_transit=true) | |
getParameterArrayByClass ($a_class, $a_cmd="", $a_transits="") |
Data Fields | |
const | IL_RTOKEN_NAME = 'rtoken' |
$target_script | |
$forward | |
$parent | |
$save_parameter | |
$return | |
$call_hist = array() | |
$debug = array() |
This class provides processing control methods.
A global instance is available via variable $ilCtrl
Definition at line 11 of file class.ilCtrl.php.
ilCtrl::addLocation | ( | $a_title, | |
$a_link, | |||
$a_target = "" , |
|||
$a_ref_id = 0 |
|||
) |
add a location to the locator array
string | $a_title | link text |
string | $a_link | link |
string | $a_target | target frame |
Definition at line 380 of file class.ilCtrl.php.
ilCtrl::addTab | ( | $a_lang_var, | |
$a_link, | |||
$a_cmd, | |||
$a_class | |||
) |
add a tab to tabs array
string | $a_lang_var | language variable |
string | $a_link | link |
string | $a_cmd | command (must be same as in link) |
string | $a_class | command class (must be same as in link) |
Definition at line 404 of file class.ilCtrl.php.
ilCtrl::addTransit | ( | $a_class | ) |
Definition at line 1389 of file class.ilCtrl.php.
References $_GET.
ilCtrl::appendRequestTokenParameterString | ( | $a_url | ) |
append request token as url parameter
public
Definition at line 1023 of file class.ilCtrl.php.
References ilUtil\appendUrlParameterString(), and getRequestToken().
ilCtrl::appendTransitClasses | ( | $a_str | ) |
Definition at line 1362 of file class.ilCtrl.php.
References $_GET, and ilUtil\appendUrlParameterString().
ilCtrl::callBaseClass | ( | ) |
Calls base class of current request.
The base class is passed via $_GET["baseClass"] and is the first class in the call sequence of the request. Do not call this method within other scripts than ilias.php.
public
Definition at line 83 of file class.ilCtrl.php.
References $_GET, $ilDB, exit, forwardCommand(), and getCallStructure().
ilCtrl::clearParameters | ( | & | $a_obj | ) |
Clears all parameters that have been set via setParameter for a GUI class.
object | $a_obj | gui object |
Definition at line 709 of file class.ilCtrl.php.
References clearParametersByClass().
ilCtrl::clearParametersByClass | ( | $a_class | ) |
Clears all parameters that have been set via setParameter for a GUI class.
string | $a_class | gui class name |
Definition at line 720 of file class.ilCtrl.php.
Referenced by clearParameters().
ilCtrl::debug | ( | $str | ) |
Definition at line 42 of file class.ilCtrl.php.
& ilCtrl::forwardCommand | ( | & | $a_gui_object | ) |
forward flow of control to next gui class this invokes the executeCommand() method of the gui object that is passed via reference
object | $a_gui_object | gui object that should receive the flow of control public |
Reimplemented in ilCtrl2.
Definition at line 156 of file class.ilCtrl.php.
References exit, getCmd(), and getNodeIdForTargetClass().
Referenced by callBaseClass().
ilCtrl::forwards | ( | $a_from_class, | |
$a_to_class | |||
) |
Stores which classes forwards commands to which other classes.
string | $a_from_class | source class name |
string | $a_to_class | target class name |
private
Definition at line 576 of file class.ilCtrl.php.
Referenced by init(), and readCallStructure().
ilCtrl::getCallHistory | ( | ) |
Get controller call history.
Definition at line 425 of file class.ilCtrl.php.
References $call_hist.
ilCtrl::getCallStructure | ( | $a_class, | |
$a_nr = 0 , |
|||
$a_parent = 0 |
|||
) |
Get call structure of class context.
This method must be called for the top level gui class in the leading php script. It must be called before the the current command is forwarded to the top level gui class. Example:
include_once "classes/class.ilRepositoryGUI.php"; $ilCtrl->setTargetScript("repository.php"); $ilCtrl->getCallStructure("ilrepositorygui"); $repository_gui =& new ilRepositoryGUI(); $ilCtrl->forwardCommand($repository_gui);
string | $a_class | gui class name |
int | $a_nr | internal counter (don't pass a value here) |
int | $a_parent | internal counter (don't pass a value here) |
public
Definition at line 448 of file class.ilCtrl.php.
References $_GET, $ilDB, $ilLog, readCallStructure(), redirect(), and ilUtil\sendFailure().
Referenced by callBaseClass().
ilCtrl::getClassForClasspath | ( | $a_class_path | ) |
this method assumes that the class path has the format "dir/class.<class_name>.php"
string | $a_class_path | class path public |
Definition at line 792 of file class.ilCtrl.php.
References $file.
ilCtrl::getCmd | ( | $a_default_cmd = "" , |
|
$a_safe_commands = "" |
|||
) |
determines current get/post command
string | default command |
array | safe commands: for these commands no token is checked for post requests |
Definition at line 886 of file class.ilCtrl.php.
References $_GET, $_POST, $cmd, and verifyToken().
Referenced by forwardCommand(), ilCtrl2\forwardCommand(), getHTML(), and ilCtrl2\getHTML().
ilCtrl::getCmdClass | ( | ) |
determines responsible class for current command
Definition at line 971 of file class.ilCtrl.php.
References $_GET.
ilCtrl::getCmdNode | ( | ) |
get command target node
Definition at line 368 of file class.ilCtrl.php.
References $_GET.
Referenced by ilCtrl2\getNextClass(), and getNextClass().
ilCtrl::getContextObjId | ( | ) |
Get ContextObjId.
Definition at line 240 of file class.ilCtrl.php.
ilCtrl::getContextObjType | ( | ) |
Get ContextObjType.
Definition at line 250 of file class.ilCtrl.php.
ilCtrl::getContextSubObjId | ( | ) |
Get ContextSubObjId.
Definition at line 260 of file class.ilCtrl.php.
ilCtrl::getContextSubObjType | ( | ) |
Get ContextSubObjType.
Definition at line 270 of file class.ilCtrl.php.
ilCtrl::getDebug | ( | ) |
ilCtrl::getFormAction | ( | & | $a_gui_obj, |
$a_fallback_cmd = "" , |
|||
$a_anchor = "" , |
|||
$a_asynch = false |
|||
) |
get form action url for gui class object
object | $a_gui_obj | gui object |
string | $a_fallback_cmd | fallback command |
string | $a_anchor | anchor |
bool | $a_asnych | async |
Definition at line 984 of file class.ilCtrl.php.
References getFormActionByClass().
ilCtrl::getFormActionByClass | ( | $a_class, | |
$a_fallback_cmd = "" , |
|||
$a_anchor = "" , |
|||
$a_asynch = false |
|||
) |
get form action url for gui class name
string | $a_class | gui class name |
Definition at line 996 of file class.ilCtrl.php.
References ilUtil\appendUrlParameterString(), getLinkTargetByClass(), and getRequestToken().
Referenced by getFormAction().
& ilCtrl::getHTML | ( | & | $a_gui_object | ) |
Gets an HTML output from another GUI class and returns the flow of control to the calling class.
object | $a_gui_object | gui object that returns the HTML block public |
Reimplemented in ilCtrl2.
Definition at line 194 of file class.ilCtrl.php.
References exit, getCmd(), and getNodeIdForTargetClass().
ilCtrl::getLinkTarget | ( | & | $a_gui_obj, |
$a_cmd = "" , |
|||
$a_anchor = "" , |
|||
$a_asynch = false |
|||
) |
get link target for (current) gui class
object | $a_gui_obj | (current) gui object (usually $this) |
string | $a_cmd | command |
Definition at line 1205 of file class.ilCtrl.php.
References getLinkTargetByClass().
ilCtrl::getLinkTargetByClass | ( | $a_class, | |
$a_cmd = "" , |
|||
$a_anchor = "" , |
|||
$a_asynch = false |
|||
) |
get link target for a target class
string | $a_class | command target class |
string | $a_cmd | command |
array | $a_anchor | # anchor |
array | $a_asynch | asynchronous mode |
Definition at line 1223 of file class.ilCtrl.php.
References getTargetScript(), and getUrlParameters().
Referenced by getFormActionByClass(), getLinkTarget(), redirect(), and redirectByClass().
ilCtrl::getLocations | ( | ) |
get locations array
Definition at line 391 of file class.ilCtrl.php.
References $location.
ilCtrl::getModuleDir | ( | ) |
get directory of current module
Definition at line 140 of file class.ilCtrl.php.
ilCtrl::getNextClass | ( | ) |
Get next class in the control path from the current class to the target command class.
This is the class that should be instantiated and be invoked via $ilCtrl->forwardCommand($class) next.
Reimplemented in ilCtrl2.
Definition at line 733 of file class.ilCtrl.php.
References getCmdNode(), and getPathNew().
ilCtrl::getNodeIdForTargetClass | ( | $a_par_node, | |
$a_class | |||
) |
Searchs a node for a given class ($a_class) "near" the another node ($a_par_node).
It first looks if the given class is a child class of the current node. If such a child node has been found, its id is returned.
If not, this method determines wether the given class is a sibling of the current node within the call structure. If this is the case then the corresponding id is returned.
At last the methode searchs for the given class along the path from the current node to the root class of the call structure.
$a_par_node | id of starting node for the search |
$a_class | class that should be searched |
private
Reimplemented in ilCtrl2.
Definition at line 296 of file class.ilCtrl.php.
References exit.
Referenced by forwardCommand(), getHTML(), getParameterArrayByClass(), searchReturnClass(), and setCmdClass().
ilCtrl::getParameterArray | ( | & | $a_gui_obj, |
$a_cmd = "" , |
|||
$a_incl_transit = true |
|||
) |
Definition at line 1395 of file class.ilCtrl.php.
References getParameterArrayByClass().
ilCtrl::getParameterArrayByClass | ( | $a_class, | |
$a_cmd = "" , |
|||
$a_transits = "" |
|||
) |
Definition at line 1406 of file class.ilCtrl.php.
References $_GET, $params, getNodeIdForTargetClass(), and getPathNew().
Referenced by getParameterArray(), and getUrlParameters().
ilCtrl::getParentReturn | ( | & | $a_gui_obj | ) |
Definition at line 1303 of file class.ilCtrl.php.
References getParentReturnByClass().
Referenced by returnToParent().
ilCtrl::getParentReturnByClass | ( | $a_class | ) |
Definition at line 1309 of file class.ilCtrl.php.
References searchReturnClass().
Referenced by getParentReturn().
ilCtrl::getPathNew | ( | $a_source_node, | |
$a_target_node | |||
) |
get path in call structure
string | $a_source_node | source node id |
string | $a_source_node | target node id |
private
Reimplemented in ilCtrl2.
Definition at line 809 of file class.ilCtrl.php.
References exit.
Referenced by getNextClass(), getParameterArrayByClass(), and searchReturnClass().
ilCtrl::getRedirectSource | ( | ) |
get current redirect source
Definition at line 1295 of file class.ilCtrl.php.
References $_GET.
ilCtrl::getRequestToken | ( | ) |
Get request token.
Definition at line 1031 of file class.ilCtrl.php.
Referenced by appendRequestTokenParameterString(), and getFormActionByClass().
ilCtrl::getTabs | ( | ) |
get tabs array
Definition at line 417 of file class.ilCtrl.php.
References $tab.
ilCtrl::getTargetScript | ( | ) |
get target script name
Definition at line 858 of file class.ilCtrl.php.
References $target_script.
Referenced by getLinkTargetByClass(), setReturn(), and setReturnByClass().
ilCtrl::getTransitArray | ( | ) |
ilCtrl::getUrlParameters | ( | $a_class, | |
$a_str, | |||
$a_cmd = "" , |
|||
$a_transits = "" |
|||
) |
Definition at line 1344 of file class.ilCtrl.php.
References $params, ilUtil\appendUrlParameterString(), and getParameterArrayByClass().
Referenced by getLinkTargetByClass(), setReturn(), and setReturnByClass().
ilCtrl::ilCtrl | ( | ) |
control class constructor
Definition at line 26 of file class.ilCtrl.php.
References $ilBench, and init().
ilCtrl::init | ( | ) |
initialisation
Definition at line 56 of file class.ilCtrl.php.
References forwards().
Referenced by ilCtrl(), and initBaseClass().
ilCtrl::initBaseClass | ( | $a_base_class | ) |
initialises new base class
Note: this resets the whole current ilCtrl context completely. You can call setTargetScript() and callBaseClass() after that.
Definition at line 870 of file class.ilCtrl.php.
ilCtrl::isAsynch | ( | ) |
Definition at line 1184 of file class.ilCtrl.php.
References $_GET.
ilCtrl::lookupClassPath | ( | $a_class_name | ) |
Get class path that can be used in include statements for a given class name.
string | $a_class_name | class name |
Definition at line 765 of file class.ilCtrl.php.
References $ilDB.
ilCtrl::readCallStructure | ( | $a_class, | |
$a_nr = 0 , |
|||
$a_parent = 0 |
|||
) |
reads call structure from db
Definition at line 536 of file class.ilCtrl.php.
References $ilDB, and forwards().
Referenced by getCallStructure(), and storeCommonStructures().
ilCtrl::redirect | ( | & | $a_gui_obj, |
$a_cmd = "" , |
|||
$a_anchor = "" |
|||
) |
Definition at line 1148 of file class.ilCtrl.php.
References $ilBench, and getLinkTargetByClass().
Referenced by getCallStructure(), redirectByClass(), and returnToParent().
ilCtrl::redirectByClass | ( | $a_class, | |
$a_cmd = "" |
|||
) |
redirect to other gui class
string | $a_class | command target class |
string | $a_cmd | command |
Definition at line 1173 of file class.ilCtrl.php.
References getLinkTargetByClass(), and redirect().
ilCtrl::returnToParent | ( | & | $a_gui_obj, |
$a_anchor = "" |
|||
) |
redirects to next parent class that used setReturn
Definition at line 1273 of file class.ilCtrl.php.
References $_GET, ilUtil\appendUrlParameterString(), getParentReturn(), and redirect().
ilCtrl::saveParameter | ( | & | $a_obj, |
$a_parameter | |||
) |
Set parameters that should be passed in every form and link of a gui class.
All links that relate to the specified gui object class and are build e.g. by using getLinkTarger() or getFormAction() will include this parameter. This is the mechanism to add url parameters to the standard url (which is set by the setTargetScript() method) target everytime.
A typical example is the "ref_id" that should be included in almost every link or form action url. So the constructor of ilRepositoryGUI includes the command:
$this->ctrl->saveParameter($this, array("ref_id"));
object | $a_obj | gui object that will process the parameter |
mixed | $a_parameter | parameter name (string) or array of parameter names |
public
Definition at line 634 of file class.ilCtrl.php.
References saveParameterByClass().
ilCtrl::saveParameterByClass | ( | $a_class, | |
$a_parameter | |||
) |
Definition at line 642 of file class.ilCtrl.php.
Referenced by saveParameter().
ilCtrl::searchReturnClass | ( | $a_class | ) |
get current return class
Reimplemented in ilCtrl2.
Definition at line 1324 of file class.ilCtrl.php.
References getNodeIdForTargetClass(), and getPathNew().
Referenced by getParentReturnByClass().
ilCtrl::setCmd | ( | $a_cmd | ) |
set the current command
IMPORTANT NOTE:
please use this function only in exceptional cases it is not intended for setting commands in forms or links! use the corresponding parameters of getFormAction() and getLinkTarget() instead.
Definition at line 945 of file class.ilCtrl.php.
References $_GET.
ilCtrl::setCmdClass | ( | $a_cmd_class | ) |
set the current command class
IMPORTANT NOTE:
please use this function only in exceptional cases it is not intended for setting the command class in forms or links! use the corresponding parameters of getFormAction() and getLinkTarget() instead.
Definition at line 960 of file class.ilCtrl.php.
References $_GET, and getNodeIdForTargetClass().
ilCtrl::setContext | ( | $a_obj_id, | |
$a_obj_type, | |||
$a_sub_obj_id = 0 , |
|||
$a_sub_obj_type = "" |
|||
) |
Set context of current user interface.
Definition at line 227 of file class.ilCtrl.php.
ilCtrl::setParameter | ( | & | $a_obj, |
$a_parameter, | |||
$a_value | |||
) |
Set parameters that should be passed a form and link of a gui class.
All links that relate to the specified gui object class and are build e.g. by using getLinkTarger() or getFormAction() will include this parameter. This is the mechanism to add url parameters to the standard url (which is set by the setTargetScript() method) target. The difference to the saveParameter() method is, that setParameter() does not simply forward the url parameter of the last request. You can set a spefific value.
If this parameter is also a "saved parameter" (set by saveParameter() method) the saved value will be overwritten.
The method is usually used in conjunction with a getFormAction() or getLinkTarget() call. E.g.:
$this->ctrl->setParameter($this, "obj_id", $data_row["obj_id"]); $obj_link = $this->ctrl->getLinkTarget($this, "view");
object | $a_obj | gui object |
string | $a_parameter | parameter name |
string | $a_parameter | parameter value |
public
Definition at line 682 of file class.ilCtrl.php.
ilCtrl::setParameterByClass | ( | $a_class, | |
$a_parameter, | |||
$a_value | |||
) |
Same as setParameterByClass, except that a class name is passed.
string | $a_class | gui class name |
string | $a_parameter | parameter name |
string | $a_parameter | parameter value |
public
Definition at line 697 of file class.ilCtrl.php.
ilCtrl::setReturn | ( | & | $a_gui_obj, |
$a_cmd | |||
) |
set return command
Definition at line 1248 of file class.ilCtrl.php.
References getTargetScript(), and getUrlParameters().
ilCtrl::setReturnByClass | ( | $a_class, | |
$a_cmd | |||
) |
set return command
Definition at line 1259 of file class.ilCtrl.php.
References getTargetScript(), and getUrlParameters().
ilCtrl::setTargetScript | ( | $a_target_script | ) |
set target script name
string | $a_target_script | target script name |
Definition at line 847 of file class.ilCtrl.php.
ilCtrl::storeCommonStructures | ( | ) |
stores often used common call structures (called from db_update script!!!)
Definition at line 507 of file class.ilCtrl.php.
References $ilDB, and readCallStructure().
ilCtrl::verifyToken | ( | ) |
Verify Token.
Definition at line 1076 of file class.ilCtrl.php.
References $_GET, $_SESSION, and $ilDB.
Referenced by getCmd().
ilCtrl::$call_hist = array() |
Definition at line 20 of file class.ilCtrl.php.
Referenced by getCallHistory().
ilCtrl::$debug = array() |
Definition at line 21 of file class.ilCtrl.php.
Referenced by getDebug().
ilCtrl::$forward |
Definition at line 16 of file class.ilCtrl.php.
ilCtrl::$parent |
Definition at line 17 of file class.ilCtrl.php.
ilCtrl::$return |
Definition at line 19 of file class.ilCtrl.php.
ilCtrl::$save_parameter |
Definition at line 18 of file class.ilCtrl.php.
ilCtrl::$target_script |
Definition at line 15 of file class.ilCtrl.php.
Referenced by getTargetScript().
const ilCtrl::IL_RTOKEN_NAME = 'rtoken' |
Definition at line 13 of file class.ilCtrl.php.
Referenced by ilObjFileBasedLMGUI\addBibItem(), ilObjContentObjectGUI\addBibItem(), ilObjFileBasedLMGUI\deleteBibItem(), ilObjContentObjectGUI\deleteBibItem(), ilObjFileBasedLMGUI\editBibItem(), ilObjContentObjectGUI\editBibItem(), ilObjFileBasedLMGUI\saveBibItem(), and ilObjContentObjectGUI\saveBibItem().