Skip to content

Commit

Permalink
Cleanup, docu and refactoring in ilCtrl, thanks to rklees, see ILIAS-…
Browse files Browse the repository at this point in the history
  • Loading branch information
alex40724 committed Nov 2, 2018
1 parent 42fab50 commit 0fce550
Show file tree
Hide file tree
Showing 28 changed files with 180 additions and 390 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ public static function _goto($a_target) {
global $DIC;

$id = explode("_", $a_target);
$DIC->ctrl()->setTargetScript("ilias.php");
$DIC->ctrl()->initBaseClass(ilRepositoryGUI::class);
$DIC->ctrl()->setParameterByClass(ilObjBibliographicGUI::class, "ref_id", $id[0]);
// Detail-View
Expand Down
11 changes: 0 additions & 11 deletions Modules/Course/classes/class.ilObjCourseGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -2212,17 +2212,6 @@ function getTabs()
array("perm","info","owner"), 'ilpermissiongui');
}

if ($this->ctrl->getTargetScript() == "adm_object.php")
{
$this->tabs_gui->addTarget("show_owner",
$this->ctrl->getLinkTarget($this, "owner"), "owner", get_class($this));

if ($this->tree->getSavedNodeData($this->ref_id))
{
$this->tabs_gui->addTarget("trash",
$this->ctrl->getLinkTarget($this, "trash"), "trash", get_class($this));
}
}
// Join/Leave
if($ilAccess->checkAccess('join','',$this->ref_id)
and !$this->object->getMemberObject()->isAssigned())
Expand Down
1 change: 0 additions & 1 deletion Modules/OrgUnit/classes/class.ilObjOrgUnitGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,6 @@ public static function _goto($ref_id) {
global $DIC;
$ilCtrl = $DIC['ilCtrl'];
$ilCtrl->initBaseClass("ilAdministrationGUI");
$ilCtrl->setTargetScript("ilias.php");
$ilCtrl->setParameterByClass("ilObjOrgUnitGUI", "ref_id", $ref_id);
$ilCtrl->setParameterByClass("ilObjOrgUnitGUI", "admin_mode", self::TAB_SETTINGS);
$ilCtrl->setParameterByClass("IlObjPluginDispatchGUI", "admin_mode", self::TAB_SETTINGS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ public function getAdminTabs() {

public function _goto($ref_id) {
$this->ctrl->initBaseClass("ilAdministrationGUI");
$this->ctrl->setTargetScript("ilias.php");
$this->ctrl->setParameterByClass("ilObjStudyProgrammeAdminGUI", "ref_id", $ref_id);
$this->ctrl->setParameterByClass("ilObjStudyProgrammeAdminGUI", "admin_mode", "settings");
$this->ctrl->redirectByClass(array( "ilAdministrationGUI", "ilObjStudyProgrammeAdminGUI" ), "view");
Expand All @@ -153,4 +152,4 @@ public function _goto($ref_id) {
protected function save(ilPropertyFormGUI $a_form) {
return true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,6 @@ public static function _goto($a_target) {
$ilErr = $DIC['ilErr'];
$ilCtrl = $DIC['ilCtrl'];
$id = explode("_", $a_target);
$ilCtrl->setTargetScript("ilias.php");
$ilCtrl->initBaseClass("ilRepositoryGUI");
$ilCtrl->setParameterByClass("ilobjstudyprogrammegui", "ref_id", $id[0]);

Expand Down
3 changes: 1 addition & 2 deletions Modules/Wiki/classes/class.ilWikiUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,6 @@ static function makeLink( &$nt, $a_wiki_id, $text = '', $query = '', $trail = ''
}
}

//$ilCtrl->debug("ilWikiUtil::makeLink:-$inside-$trail-");
/* if ( $nt->isExternal() ) {
$nr = array_push( $this->mInterwikiLinkHolders['texts'], $prefix.$text.$inside );
$this->mInterwikiLinkHolders['titles'][] = $nt;
Expand Down Expand Up @@ -779,4 +778,4 @@ static function sendNotification($a_action, $a_type, $a_wiki_ref_id, $a_page_id,
}
}

?>
?>
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ protected function update(ilPlugin $plugin) {
$ilCtrl->setParameterByClass("iladministrationgui", "cname", $_GET["cname"]);
$ilCtrl->setParameterByClass("iladministrationgui", "slot_id", $_GET["slot_id"]);
$ilCtrl->setParameterByClass("iladministrationgui", "plugin_id", $_GET["plugin_id"]);
$ilCtrl->setTargetScript("ilias.php");
ilUtil::redirect("ilias.php?admin_mode=settings&baseClass=ilAdministrationGUI".
"&cmd=jumpToPluginSlot&ref_id=".$_GET["ref_id"]."&ctype=".$_GET["ctype"].
"&cname=".$_GET["cname"]."&slot_id=".$_GET["slot_id"]."&plugin_id=".$_GET["plugin_id"]);
Expand Down Expand Up @@ -700,4 +699,4 @@ protected function uninstallPlugin()
$ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
$ilCtrl->redirect($this, "listPlugins");
}
}
}
7 changes: 2 additions & 5 deletions Services/Component/classes/class.ilPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -993,11 +993,8 @@ public function update() {
// load control structure
include_once("./setup/classes/class.ilCtrlStructureReader.php");
$structure_reader = new ilCtrlStructureReader();
$structure_reader->readStructure(
true, "./" . $this->getDirectory(), $this->getPrefix(),
$this->getDirectory()
);
// $ilCtrl->storeCommonStructures();
$structure_reader->readStructure(true, "./".$this->getDirectory(), $this->getPrefix(),
$this->getDirectory());

// add config gui to the ctrl calls
$ilCtrl->insertCtrlCalls(
Expand Down
3 changes: 0 additions & 3 deletions Services/Init/classes/class.ilStartUpGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,6 @@ protected function showLoginPage(ilPropertyFormGUI $form = null)
$tpl->setVariable("PAGETITLE", "- ".$this->lng->txt("startpage"));
$tpl->setVariable("ILIAS_RELEASE", $ilSetting->get("ilias_version"));

$this->ctrl->setTargetScript("ilias.php");

// check expired session and send message
if($GLOBALS['DIC']['ilAuthSession']->isExpired())
{
Expand Down Expand Up @@ -474,7 +472,6 @@ protected function showLogin()
$tpl->setVariable("PAGETITLE", "- ".$lng->txt("startpage"));
$tpl->setVariable("ILIAS_RELEASE", $ilSetting->get("ilias_version"));

$this->ctrl->setTargetScript("ilias.php");
$tpl->setVariable("PHP_SELF", $_SERVER['PHP_SELF']);

// browser does not accept cookies
Expand Down
4 changes: 0 additions & 4 deletions Services/MainMenu/classes/class.ilMainMenuGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,16 +565,12 @@ private function renderHelpButtons() {


// always set ajax url
$ts = $ilCtrl->getTargetScript();
$ilCtrl->setTargetScript("ilias.php");

$ilHelp->setCtrlPar();
$this->main_tpl->addOnLoadCode(
"il.Help.setAjaxUrl('" .
$ilCtrl->getLinkTargetByClass("ilhelpgui", "", "", true)
. "');"
);
$ilCtrl->setTargetScript($ts);
}
}

Expand Down
2 changes: 0 additions & 2 deletions Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1874,7 +1874,6 @@ function setTabs()
// catch feedback message
$this->getTabs();

//$tabs_gui->setTargetScript($this->ctrl->getLinkTarget($this));
$this->tpl->clearHeader();
if (is_object($this->object) && strtolower(get_class($this->object)) == "ilobjmediaobject")
{
Expand All @@ -1899,7 +1898,6 @@ function getTabs()

$ilHelp->setScreenIdComponent("mob");

//$this->tabs_gui->setTargetScript($this->ctrl->getLinkTarget($this));
if (is_object($this->object) && strtolower(get_class($this->object)) == "ilobjmediaobject"
&& $this->object->getId() > 0)
{
Expand Down
2 changes: 1 addition & 1 deletion Services/News/classes/class.ilNewsItemGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ function setTabs()

$ilTabs->clearTargets();
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getParentReturnByClass("ilnewsitemgui"));
$ilCtrl->getParentReturn($this));
}

/**
Expand Down
8 changes: 0 additions & 8 deletions Services/Repository/classes/class.ilObjectPluginGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,14 +382,8 @@ function afterSave(ilObject $newObj)
ilUtil::sendSuccess($this->lng->txt("object_added"),true);

$ilCtrl->initBaseClass("ilObjPluginDispatchGUI");
$ilCtrl->setTargetScript("ilias.php");
$ilCtrl->getCallStructure(strtolower("ilObjPluginDispatchGUI"));

//var_dump($ilCtrl->call_node);
//var_dump($ilCtrl->forward);
//var_dump($ilCtrl->parent);
//var_dump($ilCtrl->root_class);

$ilCtrl->setParameterByClass(get_class($this), "ref_id", $newObj->getRefId());
$ilCtrl->redirectByClass(array("ilobjplugindispatchgui", get_class($this)), $this->getAfterCreationCmd());
}
Expand Down Expand Up @@ -509,15 +503,13 @@ public static function _goto($a_target)
if ($ilAccess->checkAccess("read", "", $ref_id))
{
$ilCtrl->initBaseClass("ilObjPluginDispatchGUI");
$ilCtrl->setTargetScript("ilias.php");
$ilCtrl->getCallStructure(strtolower("ilObjPluginDispatchGUI"));
$ilCtrl->setParameterByClass($class_name, "ref_id", $ref_id);
$ilCtrl->redirectByClass(array("ilobjplugindispatchgui", $class_name), "");
}
else if($ilAccess->checkAccess("visible", "", $ref_id))
{
$ilCtrl->initBaseClass("ilObjPluginDispatchGUI");
$ilCtrl->setTargetScript("ilias.php");
$ilCtrl->getCallStructure(strtolower("ilObjPluginDispatchGUI"));
$ilCtrl->setParameterByClass($class_name, "ref_id", $ref_id);
$ilCtrl->redirectByClass(array("ilobjplugindispatchgui", $class_name), "infoScreen");
Expand Down
2 changes: 0 additions & 2 deletions Services/Repository/classes/class.ilRepositoryExplorer.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ function buildLinkTarget($a_node_id, $a_type)
{
$ilCtrl = $this->ctrl;

$ilCtrl->setTargetScript("ilias.php");

switch($a_type)
{
case "cat":
Expand Down
Loading

0 comments on commit 0fce550

Please sign in to comment.