ILIAS
Release_3_10_x_branch Revision 61812
|
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 31 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 408 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 432 of file class.ilCtrl.php.
ilCtrl::addTransit | ( | $a_class | ) |
Definition at line 1382 of file class.ilCtrl.php.
References $_GET.
ilCtrl::appendRequestTokenParameterString | ( | $a_url | ) |
append request token as url parameter
public
Definition at line 1020 of file class.ilCtrl.php.
References ilUtil\appendUrlParameterString(), and getRequestToken().
ilCtrl::appendTransitClasses | ( | $a_str | ) |
Definition at line 1355 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 103 of file class.ilCtrl.php.
References $_GET, DB_FETCHMODE_ASSOC, 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 714 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 725 of file class.ilCtrl.php.
Referenced by clearParameters().
ilCtrl::debug | ( | $str | ) |
Definition at line 62 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 |
Definition at line 184 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 600 of file class.ilCtrl.php.
Referenced by init(), and readCallStructure().
ilCtrl::getCallHistory | ( | ) |
Get controller call history.
Definition at line 453 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 476 of file class.ilCtrl.php.
References $_GET, $ilLog, DB_FETCHMODE_ASSOC, readCallStructure(), redirect(), and ilUtil\sendInfo().
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 790 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 887 of file class.ilCtrl.php.
References $_GET, $cmd, and verifyToken().
Referenced by forwardCommand(), and getHTML().
ilCtrl::getCmdClass | ( | ) |
determines responsible class for current command
Definition at line 968 of file class.ilCtrl.php.
References $_GET.
ilCtrl::getCmdNode | ( | ) |
get command target node
Definition at line 396 of file class.ilCtrl.php.
References $_GET.
Referenced by getNextClass().
ilCtrl::getContextObjId | ( | ) |
Get ContextObjId.
Definition at line 268 of file class.ilCtrl.php.
ilCtrl::getContextObjType | ( | ) |
Get ContextObjType.
Definition at line 278 of file class.ilCtrl.php.
ilCtrl::getContextSubObjId | ( | ) |
Get ContextSubObjId.
Definition at line 288 of file class.ilCtrl.php.
ilCtrl::getContextSubObjType | ( | ) |
Get ContextSubObjType.
Definition at line 298 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 981 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 993 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 |
Definition at line 222 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 1198 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 1216 of file class.ilCtrl.php.
References getTargetScript(), and getUrlParameters().
Referenced by getFormActionByClass(), getLinkTarget(), redirect(), and redirectByClass().
ilCtrl::getLocations | ( | ) |
get locations array
Definition at line 419 of file class.ilCtrl.php.
References $location.
ilCtrl::getModuleDir | ( | ) |
get directory of current module
Definition at line 168 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.
Definition at line 738 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
Definition at line 324 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 1388 of file class.ilCtrl.php.
References getParameterArrayByClass().
ilCtrl::getParameterArrayByClass | ( | $a_class, | |
$a_cmd = "" , |
|||
$a_transits = "" |
|||
) |
Definition at line 1399 of file class.ilCtrl.php.
References $_GET, getNodeIdForTargetClass(), and getPathNew().
Referenced by getParameterArray(), and getUrlParameters().
ilCtrl::getParentReturn | ( | & | $a_gui_obj | ) |
Definition at line 1295 of file class.ilCtrl.php.
References getParentReturnByClass().
Referenced by returnToParent().
ilCtrl::getParentReturnByClass | ( | $a_class | ) |
Definition at line 1301 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
Definition at line 807 of file class.ilCtrl.php.
References exit.
Referenced by getNextClass(), getParameterArrayByClass(), and searchReturnClass().
ilCtrl::getRedirectSource | ( | ) |
get current redirect source
Definition at line 1287 of file class.ilCtrl.php.
References $_GET.
ilCtrl::getRequestToken | ( | ) |
Get request token.
Definition at line 1028 of file class.ilCtrl.php.
References $res.
Referenced by appendRequestTokenParameterString(), and getFormActionByClass().
ilCtrl::getTabs | ( | ) |
get tabs array
Definition at line 445 of file class.ilCtrl.php.
References $tab.
ilCtrl::getTargetScript | ( | ) |
get target script name
Definition at line 859 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 1337 of file class.ilCtrl.php.
References ilUtil\appendUrlParameterString(), and getParameterArrayByClass().
Referenced by getLinkTargetByClass(), setReturn(), and setReturnByClass().
ilCtrl::ilCtrl | ( | ) |
control class constructor
Definition at line 46 of file class.ilCtrl.php.
References $ilBench, and init().
ilCtrl::init | ( | ) |
initialisation
Definition at line 76 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 871 of file class.ilCtrl.php.
ilCtrl::isAsynch | ( | ) |
Definition at line 1177 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 769 of file class.ilCtrl.php.
References DB_FETCHMODE_ASSOC.
ilCtrl::readCallStructure | ( | $a_class, | |
$a_nr = 0 , |
|||
$a_parent = 0 |
|||
) |
reads call structure from db
Definition at line 557 of file class.ilCtrl.php.
References DB_FETCHMODE_ASSOC, and forwards().
Referenced by getCallStructure(), and storeCommonStructures().
ilCtrl::redirect | ( | & | $a_gui_obj, |
$a_cmd = "" , |
|||
$a_anchor = "" |
|||
) |
Definition at line 1142 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 1166 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 1266 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 642 of file class.ilCtrl.php.
References saveParameterByClass().
ilCtrl::saveParameterByClass | ( | $a_class, | |
$a_parameter | |||
) |
Definition at line 647 of file class.ilCtrl.php.
Referenced by saveParameter().
ilCtrl::searchReturnClass | ( | $a_class | ) |
get current return class
Definition at line 1316 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 942 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 957 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 255 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 687 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 702 of file class.ilCtrl.php.
ilCtrl::setReturn | ( | & | $a_gui_obj, |
$a_cmd | |||
) |
set return command
Definition at line 1241 of file class.ilCtrl.php.
References getTargetScript(), and getUrlParameters().
ilCtrl::setReturnByClass | ( | $a_class, | |
$a_cmd | |||
) |
set return command
Definition at line 1252 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 848 of file class.ilCtrl.php.
ilCtrl::storeCommonStructures | ( | ) |
stores often used common call structures (called from db_update script!!!)
Definition at line 532 of file class.ilCtrl.php.
References readCallStructure().
ilCtrl::verifyToken | ( | ) |
Verify Token.
Definition at line 1070 of file class.ilCtrl.php.
References $_GET, and $_SESSION.
Referenced by getCmd().
ilCtrl::$call_hist = array() |
Definition at line 40 of file class.ilCtrl.php.
Referenced by getCallHistory().
ilCtrl::$debug = array() |
Definition at line 41 of file class.ilCtrl.php.
Referenced by getDebug().
ilCtrl::$forward |
Definition at line 36 of file class.ilCtrl.php.
ilCtrl::$parent |
Definition at line 37 of file class.ilCtrl.php.
ilCtrl::$return |
Definition at line 39 of file class.ilCtrl.php.
ilCtrl::$save_parameter |
Definition at line 38 of file class.ilCtrl.php.
ilCtrl::$target_script |
Definition at line 35 of file class.ilCtrl.php.
Referenced by getTargetScript().
const ilCtrl::IL_RTOKEN_NAME = 'rtoken' |
Definition at line 33 of file class.ilCtrl.php.
Referenced by ilObjContentObjectGUI\addBibItem(), ilObjContentObjectGUI\deleteBibItem(), ilObjContentObjectGUI\editBibItem(), and ilObjContentObjectGUI\saveBibItem().