Skip to content

Commit

Permalink
Trunk revert (#271)
Browse files Browse the repository at this point in the history
* reverted merge 7fe45d2

* changes from @Amstutz
  • Loading branch information
chfsx authored Aug 24, 2016
1 parent 56fcaec commit 13bf1f0
Show file tree
Hide file tree
Showing 186 changed files with 7,141 additions and 21,746 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ db_template_writer.php

# Directories
/data
/Customizing/global
#/Customizing/global
/setup/sql/ilDBTemplate
virtual-data

Expand Down
5 changes: 0 additions & 5 deletions Modules/Glossary/classes/class.ilGlossaryDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,6 @@ function delete()

// delete meta data
$this->deleteMetaData();
/*
$nested = new ilNestedSetXML();
$nested->init($this->getId(), $this->getType());
$nested->deleteAllDBData();
*/
}


Expand Down
5 changes: 0 additions & 5 deletions Modules/Glossary/classes/class.ilObjGlossary.php
Original file line number Diff line number Diff line change
Expand Up @@ -1149,11 +1149,6 @@ function delete()

// delete meta data
$this->deleteMetaData();
/*
$nested = new ilNestedSetXML();
$nested->init($this->getId(), $this->getType());
$nested->deleteAllDBData();
*/

return true;
}
Expand Down
42 changes: 1 addition & 41 deletions Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class ilObjFileBasedLM extends ilObject

protected $online; // [bool]
protected $show_license; // [bool]
protected $show_bib; // [bool]

/**
* Constructor
Expand All @@ -38,7 +37,6 @@ function __construct($a_id = 0,$a_call_by_reference = true)
parent::__construct($a_id,$a_call_by_reference);

$this->setShowLicense(false);
$this->setShowBibliographicalData(false);
}


Expand All @@ -59,7 +57,6 @@ function update()
" is_online = ".$ilDB->quote(ilUtil::tf2yn($this->getOnline()), "text").
", startfile = ".$ilDB->quote($this->getStartFile(), "text")." ".
", show_lic = ".$ilDB->quote($this->getShowLicense(), "integer")." ".
", show_bib = ".$ilDB->quote($this->getShowBibliographicalData(), "integer")." ".
" WHERE id = ".$ilDB->quote($this->getId(), "integer"));
return true;
}
Expand All @@ -79,21 +76,8 @@ function read()
$this->setOnline(ilUtil::yn2tf($lm_rec["is_online"]));
$this->setStartFile((string) $lm_rec["startfile"]);
$this->setShowLicense($lm_rec["show_lic"]);
$this->setShowBibliographicalData($lm_rec["show_bib"]);
}

/**
* init bib object (contains all bib item data)
*/
function initBibItemObject()
{
include_once("./Modules/LearningModule/classes/class.ilBibItem.php");

$this->bib_obj = new ilBibItem($this);
$this->bib_obj->read();

return true;
}


/**
Expand Down Expand Up @@ -161,16 +145,6 @@ function getShowLicense()
return $this->show_license;
}

function setShowBibliographicalData($a_value)
{
$this->show_bib = (bool)$a_value;
}

function getShowBibliographicalData()
{
return $this->show_bib;
}

/**
* check wether content object is online
*/
Expand Down Expand Up @@ -203,7 +177,7 @@ function getDiskUsage()
* delete object and all related data
*
* this method has been tested on may 9th 2004
* data directory, meta data, file based lm data and bib items
* data directory, meta data, file based lm data
* have been deleted correctly as desired
*
* @access public
Expand All @@ -219,22 +193,9 @@ function delete()
return false;
}

// delete meta data of content object
/*
$nested = new ilNestedSetXML();
$nested->init($this->getId(), $this->getType());
$nested->deleteAllDBData();
*/

// Delete meta data
$this->deleteMetaData();

// delete bibliographical items of object
include_once("./Services/Xml/classes/class.ilNestedSetXML.php");
$nested = new ilNestedSetXML();
$nested->init($this->getId(), "bib");
$nested->deleteAllDBData();

// delete file_based_lm record
$ilDB->manipulate("DELETE FROM file_based_lm WHERE id = ".
$ilDB->quote($this->getID(), "integer"));
Expand Down Expand Up @@ -289,7 +250,6 @@ public function cloneObject($a_target_id,$a_copy_id = 0)
$new_obj->setTitle($this->getTitle());
$new_obj->setDescription($this->getDescription());
$new_obj->setShowLicense($this->getShowLicense());
$new_obj->setShowBibliographicalData($this->getShowBibliographicalData());

// copy content
$new_obj->populateByDirectoy($this->getDataDirectory());
Expand Down
187 changes: 1 addition & 186 deletions Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,6 @@ public function initSettingsForm()
$lic->setDisabled(true);
}
}

$bib = new ilCheckboxInputGUI($lng->txt("cont_biblio"), "bib");
$bib->setInfo($lng->txt("cont_biblio_info"));
$this->form->addItem($bib);

$this->form->addCommandButton("saveProperties", $lng->txt("save"));
$this->form->addCommandButton("toFilesystem", $lng->txt("cont_set_start_file"));
Expand Down Expand Up @@ -342,7 +338,6 @@ public function getSettingsFormValues()
$values["title"] = $this->object->getTitle();
$values["desc"] = $this->object->getDescription();
$values["lic"] = $this->object->getShowLicense();
$values["bib"] = $this->object->getShowBibliographicalData();

$this->form->setValuesByArray($values);
}
Expand Down Expand Up @@ -373,8 +368,7 @@ public function saveProperties()
$this->object->setTitle($this->form->getInput("title"));
$this->object->setDescription($this->form->getInput("desc"));
$this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
$this->object->setShowBibliographicalData($this->form->getInput("bib"));


$lic = $this->form->getItemByPostVar("lic");
if($lic && !$lic->getDisabled())
{
Expand Down Expand Up @@ -509,179 +503,6 @@ function perm()
$this->permObject();
}

/**
* save bib item (admin call)
*/
function saveBibItemObject($a_target = "")
{
global $ilTabs;

$ilTabs->activateTab("id_bib_data");

include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
$bib_gui = new ilBibItemGUI();
$bib_gui->setObject($this->object);
$bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
$bibItemIndex *= 1;
if ($bibItemIndex < 0)
{
$bibItemIndex = 0;
}
$bibItemIndex = $bib_gui->save($bibItemIndex);

if ($a_target == "")
{
$a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
}

$bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
}

/**
* save bib item (module call)
*/
function saveBibItem()
{
// questionable workaround to make this old stuff work
$this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());

//$this->setTabs();
$this->saveBibItemObject($this->ctrl->getLinkTarget($this));
}

/**
* edit bib items (admin call)
*/
function editBibItemObject($a_target = "")
{
global $ilTabs;

$ilTabs->activateTab("id_bib_data");

include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
$bib_gui = new ilBibItemGUI();
$bib_gui->setObject($this->object);
$bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
$bibItemIndex *= 1;
if ($bibItemIndex < 0)
{
$bibItemIndex = 0;
}
if ($a_target == "")
{
$a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
}

$bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
}

/**
* edit bib items (module call)
*/
function editBibItem()
{
// questionable workaround to make this old stuff work
$this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());

//$this->setTabs();
$this->editBibItemObject($this->ctrl->getLinkTarget($this));
}

/**
* delete bib item (admin call)
*/
function deleteBibItemObject($a_target = "")
{
global $ilTabs;

$ilTabs->activateTab("id_bib_data");

include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
$bib_gui = new ilBibItemGUI();
$bib_gui->setObject($this->object);
$bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
$bib_gui->bib_obj->delete($_GET["bibItemName"], $_GET["bibItemPath"], $bibItemIndex);
if (strpos($bibItemIndex, ",") > 0)
{
$bibItemIndex = substr($bibItemIndex, 0, strpos($bibItemIndex, ","));
}
if ($a_target == "")
{
$a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
}

$bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, max(0, $bibItemIndex - 1));
}

/**
* delete bib item (module call)
*/
function deleteBibItem()
{
// questionable workaround to make this old stuff work
$this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());

//$this->setTabs();
$this->deleteBibItemObject($this->ctrl->getLinkTarget($this));
}

/**
* add bib item (admin call)
*/
function addBibItemObject($a_target = "")
{
global $ilTabs;

$ilTabs->activateTab("id_bib_data");

$bibItemName = $_POST["bibItemName"] ? $_POST["bibItemName"] : $_GET["bibItemName"];
$bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
if ($bibItemName == "BibItem")
{
include_once "./Modules/LearningModule/classes/class.ilBibItem.php";
$bib_item = new ilBibItem();
$bib_item->setId($this->object->getId());
$bib_item->setType($this->object->getType());
$bib_item->read();
}

include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
$bib_gui = new ilBibItemGUI();
$bib_gui->setObject($this->object);
if ($bibItemIndex == "")
$bibItemIndex = 0;
$bibItemPath = $_POST["bibItemPath"] ? $_POST["bibItemPath"] : $_GET["bibItemPath"];

//if ($bibItemName != "" && $bibItemName != "BibItem")
if ($bibItemName != "")
{
$bib_gui->bib_obj->add($bibItemName, $bibItemPath, $bibItemIndex);
$data = $bib_gui->bib_obj->getElement("BibItem");
$bibItemIndex = (count($data) - 1);
}
else
{
ilUtil::sendInfo($this->lng->txt("bibitem_choose_element"), true);
}
if ($a_target == "")
{
$a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
}

$bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
}

/**
* add bib item (module call)
*/
function addBibItem()
{
// questionable workaround to make this old stuff work
$this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());

//$this->setTabs();
$this->addBibItemObject($this->ctrl->getLinkTarget($this));
}

/**
* Frameset -> Output list of files
Expand Down Expand Up @@ -876,12 +697,6 @@ function getTabs()
$mdtab);
}

if($this->object->getShowBibliographicalData())
{
$ilTabs->addTab("id_bib_data",
$lng->txt("bib_data"),
$this->ctrl->getLinkTarget($this, "editBibItem"));
}
}


Expand Down
Loading

0 comments on commit 13bf1f0

Please sign in to comment.