Skip to content

Commit

Permalink
PSR-2 (+X) Big Bang
Browse files Browse the repository at this point in the history
As announced on 2019-05-19 via developers@ and PR, this commit introduces the
[new ILIAS coding style](https://github.com/ILIAS-TechnicalBoard/ILIAS/blob/trunk_coding_style/docs/documentation/coding-style.md)
to release_6.
  • Loading branch information
klees committed Dec 11, 2019
1 parent 5a3535f commit 3b73412
Show file tree
Hide file tree
Showing 4,149 changed files with 769,286 additions and 800,046 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
*/
class ilBiblLibrary extends ActiveRecord implements ilBiblLibraryInterface
{

const TABLE_NAME = 'il_bibl_settings';


/**
* @return string
*/
static function returnDbTableName()
public static function returnDbTableName()
{
return self::TABLE_NAME;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
class ilBiblLibraryFormGUI extends ilPropertyFormGUI
{

use \ILIAS\Modules\OrgUnit\ARHelper\DIC;
/**
* @var \ilBiblLibraryInterface
Expand Down Expand Up @@ -96,4 +95,4 @@ public function saveObject()

return true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/
class ilBiblLibraryGUI
{

const F_LIB_ID = 'lib_id';
use \ILIAS\Modules\OrgUnit\ARHelper\DIC;
const CMD_DELETE = 'delete';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/
class ilBiblLibraryTableGUI extends ilTable2GUI
{

use \ILIAS\Modules\OrgUnit\ARHelper\DIC;


Expand Down Expand Up @@ -45,10 +44,16 @@ public function fillRow($a_set)
$current_selection_list = new ilAdvancedSelectionListGUI();
$current_selection_list->setListTitle($this->lng->txt("actions"));
$current_selection_list->setId($a_set['id']);
$current_selection_list->addItem($this->lng->txt(ilBiblLibraryGUI::CMD_EDIT), "",
$this->ctrl()->getLinkTarget($this->parent_obj, ilBiblLibraryGUI::CMD_EDIT));
$current_selection_list->addItem($this->lng->txt(ilBiblLibraryGUI::CMD_DELETE), "",
$this->ctrl()->getLinkTarget($this->parent_obj, ilBiblLibraryGUI::CMD_DELETE));
$current_selection_list->addItem(
$this->lng->txt(ilBiblLibraryGUI::CMD_EDIT),
"",
$this->ctrl()->getLinkTarget($this->parent_obj, ilBiblLibraryGUI::CMD_EDIT)
);
$current_selection_list->addItem(
$this->lng->txt(ilBiblLibraryGUI::CMD_DELETE),
"",
$this->ctrl()->getLinkTarget($this->parent_obj, ilBiblLibraryGUI::CMD_DELETE)
);
$this->tpl->setVariable('VAL_ACTIONS', $current_selection_list->getHTML());
} else {
$this->tpl->setVariable('VAL_ACTIONS', " ");
Expand All @@ -63,4 +68,4 @@ protected function initColumns()
$this->addColumn($this->lng()->txt('bibl_library_img'), '', '30%');
$this->addColumn($this->lng()->txt('actions'), '', '8%');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@
*/
class ilObjBibliographicAdminAccess extends ilObjectAccess
{

}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ilBiblAttribute extends ActiveRecord implements ilBiblAttributeInterface
/**
* @return string
*/
static function returnDbTableName()
public static function returnDbTableName()
{
return 'il_bibl_attribute';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ public function createAttribute($name, $value, $entry_id)

$this->field_factory->findOrCreateFieldOfAttribute($ilBiblAttribute);
}
}
}
5 changes: 2 additions & 3 deletions Modules/Bibliographic/classes/Data/class.ilBiblData.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@

class ilBiblData extends ActiveRecord implements ilBiblDataInterface
{

const TABLE_NAME = 'il_bibl_data';


/**
* @return string
*/
static function returnDbTableName()
public static function returnDbTableName()
{
return self::TABLE_NAME;
}
Expand Down Expand Up @@ -140,4 +139,4 @@ public function setFileType($file_type)
{
$this->file_type = $file_type;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@

class ilBiblDataFactory implements ilBiblDataFactoryInterface
{

public function getIlBiblDataById($id)
{
return ilBiblData::where(["id" => $id])->first();
}
}
}
3 changes: 1 addition & 2 deletions Modules/Bibliographic/classes/Entry/class.ilBiblEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
*/
class ilBiblEntry extends ActiveRecord implements ilBiblEntryInterface
{

const TABLE_NAME = 'il_bibl_entry';


/**
* @return string
*/
static function returnDbTableName()
public static function returnDbTableName()
{
return self::TABLE_NAME;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/
class ilBiblEntryDetailPresentationGUI
{

use \ILIAS\Modules\OrgUnit\ARHelper\DIC;
/**
* @var \ilBiblEntry
Expand Down Expand Up @@ -49,7 +48,8 @@ private function initTabs()
{
$this->tabs()->clearTargets();
$this->tabs()->setBackTarget(
$this->lng()->txt("back"), $this->ctrl()->getLinkTargetByClass(ilObjBibliographicGUI::class, ilObjBibliographicGUI::CMD_SHOW_CONTENT)
$this->lng()->txt("back"),
$this->ctrl()->getLinkTargetByClass(ilObjBibliographicGUI::class, ilObjBibliographicGUI::CMD_SHOW_CONTENT)
);
}

Expand All @@ -69,7 +69,9 @@ public function getHTML()
$this->renderLibraries($form);

$this->tpl()->setPermanentLink(
"bibl", $this->facade->iliasRefId(), "_" . (int) $_GET[ilObjBibliographicGUI::P_ENTRY_ID]
"bibl",
$this->facade->iliasRefId(),
"_" . (int) $_GET[ilObjBibliographicGUI::P_ENTRY_ID]
);

return $form->getHTML();
Expand Down Expand Up @@ -132,4 +134,4 @@ public static function prepareLatex($string)

return $ilMathJax->insertLatexImages($string);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
class ilBiblEntryTableGUI extends ilTable2GUI
{

use \ILIAS\Modules\OrgUnit\ARHelper\DIC;
/**
* @var \ilBiblFieldFilterInterface[]
Expand Down Expand Up @@ -87,7 +86,8 @@ protected function addAndReadFilterItem(ilTableFilterItem $field)
$this->addFilterItem($field);
$field->readFromSession();
if ($field instanceof ilCheckboxInputGUI) {
$this->applied_filter[$field->getPostVar()] = $field->getChecked();;
$this->applied_filter[$field->getPostVar()] = $field->getChecked();
;
} else {
$this->applied_filter[$field->getPostVar()] = $field->getValue();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,3 @@ public function setEntry($entry)
$this->entry = $entry;
}
}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@

class ilBiblAdminBibtexFieldGUI extends ilBiblAdminFieldGUI
{

}
}
31 changes: 19 additions & 12 deletions Modules/Bibliographic/classes/Field/class.ilBiblAdminFieldGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/
abstract class ilBiblAdminFieldGUI
{

use \ILIAS\Modules\OrgUnit\ARHelper\DIC;
const CMD_INIT_OVERVIEW_MODELS = 'initOverviewModels';
const CMD_INIT_DEFAULT_FIELDS_AND_SORTING = 'initDefaultFieldsAndSorting';
Expand Down Expand Up @@ -133,9 +132,11 @@ private function initOverviewModels()
while ($d = $ilDB->fetchObject($res)) {
$type_id = (int) $type($d->filetype);
$ilDB->update(
"il_bibl_overview_model", [
"il_bibl_overview_model",
[
"file_type_id" => ["integer", $type_id],
], ["ovm_id" => ["integer", $d->ovm_id]]
],
["ovm_id" => ["integer", $d->ovm_id]]
);
}
// $ilDB->dropTableColumn('il_bibl_overview_model', 'filetype');
Expand Down Expand Up @@ -191,29 +192,35 @@ protected function index()
protected function setSubTabs()
{
$this->tabs()->addSubTab(
self::SUBTAB_RIS, $this->lng()->txt('ris'), $this->ctrl()->getLinkTargetByClass(
array(
self::SUBTAB_RIS,
$this->lng()->txt('ris'),
$this->ctrl()->getLinkTargetByClass(
array(
ilObjBibliographicAdminGUI::class,
ilBiblAdminRisFieldGUI::class,
), ilBiblAdminRisFieldGUI::CMD_STANDARD
),
ilBiblAdminRisFieldGUI::CMD_STANDARD
)

);
$this->tabs()->activateSubTab(self::SUBTAB_RIS);

$this->tabs()->addSubTab(
self::SUBTAB_BIBTEX, $this->lng()->txt('bibtex'), $this->ctrl()->getLinkTargetByClass(
array(
self::SUBTAB_BIBTEX,
$this->lng()->txt('bibtex'),
$this->ctrl()->getLinkTargetByClass(
array(
ilObjBibliographicAdminGUI::class,
ilBiblAdminBibtexFieldGUI::class,
), ilBiblAdminBibtexFieldGUI::CMD_STANDARD
),
ilBiblAdminBibtexFieldGUI::CMD_STANDARD
)
);
switch ($this->facade->type()->getId()) {
case ilBiblTypeFactoryInterface::DATA_TYPE_BIBTEX;
case ilBiblTypeFactoryInterface::DATA_TYPE_BIBTEX:
$this->tabs()->activateSubTab(self::SUBTAB_BIBTEX);
break;
case ilBiblTypeFactoryInterface::DATA_TYPE_RIS;
case ilBiblTypeFactoryInterface::DATA_TYPE_RIS:
$this->tabs()->activateSubTab(self::SUBTAB_RIS);
break;
}
Expand Down Expand Up @@ -251,4 +258,4 @@ protected function resetFilter()
$ilBiblAdminFieldTableGUI->resetOffset();
$this->ctrl()->redirect($this, self::CMD_STANDARD);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

class ilBiblAdminFieldTableGUI extends ilTable2GUI
{

use \ILIAS\Modules\OrgUnit\ARHelper\DIC;
const TBL_ID = 'tbl_bibl_fields';
/**
Expand Down Expand Up @@ -183,4 +182,4 @@ protected function parseData()

$this->setData($data);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@

class ilBiblAdminRisFieldGUI extends ilBiblAdminFieldGUI
{

}
}
5 changes: 2 additions & 3 deletions Modules/Bibliographic/classes/Field/class.ilBiblField.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@

class ilBiblField extends ActiveRecord implements ilBiblFieldInterface
{

const TABLE_NAME = 'il_bibl_field';


/**
* @return string
*/
static function returnDbTableName()
public static function returnDbTableName()
{
return self::TABLE_NAME;
}
Expand Down Expand Up @@ -166,4 +165,4 @@ public function setDataType($data_type)
{
$this->data_type = $data_type;
}
}
}
14 changes: 10 additions & 4 deletions Modules/Bibliographic/classes/Field/class.ilBiblFieldFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ class ilBiblFieldFactory implements ilBiblFieldFactoryInterface
*
* @param \ilBiblTypeInterface $type
*/
public function __construct(\ilBiblTypeInterface $type) { $this->type = $type; }
public function __construct(\ilBiblTypeInterface $type)
{
$this->type = $type;
}


/**
Expand Down Expand Up @@ -158,15 +161,19 @@ public function forcePosition(ilBiblFieldInterface $field) : int
$tablename = ilBiblField::TABLE_NAME;
$q = "UPDATE {$tablename} SET position = position + 1 WHERE data_type = %s AND position >= %s;";
$DIC->database()->manipulateF(
$q, ['integer', 'integer'], [
$q,
['integer', 'integer'],
[
$field->getDataType(),
$field->getPosition(),
]
);
$field->store();
$DIC->database()->query("SET @i=0");
$DIC->database()->manipulateF(
"UPDATE {$tablename} SET position = (@i := @i + 1) WHERE data_type = %s ORDER BY position", ['integer'], [
"UPDATE {$tablename} SET position = (@i := @i + 1) WHERE data_type = %s ORDER BY position",
['integer'],
[
$field->getDataType(),
]
);
Expand Down Expand Up @@ -257,4 +264,3 @@ private function getCollectionForFilter(ilBiblTypeInterface $type, ilBiblTableQu
return $collection;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@

class ilBiblFieldFilter extends ActiveRecord implements ilBiblFieldFilterInterface
{

const TABLE_NAME = 'il_bibl_filter';


/**
* @return string
*/
static function returnDbTableName()
public static function returnDbTableName()
{
return self::TABLE_NAME;
}
Expand Down Expand Up @@ -141,4 +140,4 @@ public function setFilterType($filter_type)
{
$this->filter_type = $filter_type;
}
}
}
Loading

0 comments on commit 3b73412

Please sign in to comment.