Skip to content

Commit

Permalink
Fix cs code style
Browse files Browse the repository at this point in the history
  • Loading branch information
iszmais committed Jul 1, 2024
1 parent 5158c03 commit c381af3
Show file tree
Hide file tree
Showing 54 changed files with 197 additions and 197 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function export(string $format = self::EXPORT_EXCEL, string $filepath = n
foreach ($this->tables as $table) {
ilDclCache::resetCache();

$list = $table->getPartialRecords((string)$this->dcl->getRefId(), 'id', 'asc', null, 0, $this->filter);
$list = $table->getPartialRecords((string) $this->dcl->getRefId(), 'id', 'asc', null, 0, $this->filter);
$data_available = $data_available || ($list['total'] > 0);
$fields_available = $fields_available || (count($table->getExportableFields()) > 0);
if ($list['total'] > 0 && count($table->getExportableFields()) > 0) {
Expand Down
26 changes: 13 additions & 13 deletions Modules/DataCollection/classes/Content/class.ilDclRecordEditGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ public function confirmDelete(): void
$record_data .= $field->getTitle() . ": " . $record_representation->getConfirmationHTML() . "<br />";
}
}
$conf->addItem('record_id', (string)$record->getId(), $record_data);
$conf->addHiddenItem('table_id', (string)$this->table_id);
$conf->addHiddenItem('tableview_id', (string)$this->tableview_id);
$conf->addItem('record_id', (string) $record->getId(), $record_data);
$conf->addHiddenItem('table_id', (string) $this->table_id);
$conf->addHiddenItem('tableview_id', (string) $this->tableview_id);
$conf->setConfirm($this->lng->txt('delete'), 'delete');
$conf->setCancel($this->lng->txt('cancel'), 'cancelDelete');
$this->tpl->setContent($conf->getHTML());
Expand Down Expand Up @@ -276,14 +276,14 @@ public function initForm(): void
$this->form->setId($prefix . $this->table_id . $this->record_id);

$hidden_prop = new ilHiddenInputGUI("table_id");
$hidden_prop->setValue((string)$this->table_id);
$hidden_prop->setValue((string) $this->table_id);
$this->form->addItem($hidden_prop);
$hidden_prop = new ilHiddenInputGUI("tableview_id");
$hidden_prop->setValue((string)$this->tableview_id);
$hidden_prop->setValue((string) $this->tableview_id);
$this->form->addItem($hidden_prop);
if ($this->record_id) {
$hidden_prop = new ilHiddenInputGUI("record_id");
$hidden_prop->setValue((string)$this->record_id);
$hidden_prop->setValue((string) $this->record_id);
$this->form->addItem($hidden_prop);
}

Expand Down Expand Up @@ -315,9 +315,9 @@ public function initForm(): void

if ($default_value !== null) {
if ($item instanceof ilDclCheckboxInputGUI) {
$item->setChecked((bool)$default_value->getValue());
$item->setChecked((bool) $default_value->getValue());
} else {
$item->setValue((string)$default_value->getValue());
$item->setValue((string) $default_value->getValue());
}
} else {
if ($item instanceof ilDclTextInputGUI) {
Expand Down Expand Up @@ -443,7 +443,7 @@ public function saveConfirmation(ilDclBaseRecordModel $record_obj, string $fileh

$empty_fileuploads = [];
foreach ($all_fields as $field) {
$record_field = $record_obj->getRecordField((int)$field->getId());
$record_field = $record_obj->getRecordField((int) $field->getId());
/** @var ilDclBaseRecordFieldModel $record_field */
$record_field->addHiddenItemsToConfirmation($confirmation);

Expand All @@ -467,8 +467,8 @@ public function saveConfirmation(ilDclBaseRecordModel $record_obj, string $fileh

$confirmation->addHiddenItem('ilfilehash', $filehash);
$confirmation->addHiddenItem('empty_fileuploads', htmlspecialchars(json_encode($empty_fileuploads)));
$confirmation->addHiddenItem('table_id', (string)$this->table_id);
$confirmation->addHiddenItem('tableview_id', (string)$this->tableview_id);
$confirmation->addHiddenItem('table_id', (string) $this->table_id);
$confirmation->addHiddenItem('tableview_id', (string) $this->tableview_id);
$confirmation->addItem('save_confirmed', "1", $record_data);

if ($this->ctrl->isAsynch()) {
Expand Down Expand Up @@ -578,7 +578,7 @@ public function save(): void

//edit values, they are valid we already checked them above
foreach ($all_fields as $field) {
$record_obj->setRecordFieldValueFromForm((int)$field->getId(), $this->form);
$record_obj->setRecordFieldValueFromForm((int) $field->getId(), $this->form);
}

$this->saveConfirmation($record_obj, $hash);
Expand Down Expand Up @@ -607,7 +607,7 @@ public function save(): void
if ($field_setting->isVisibleInForm($create_mode) &&
(!$field_setting->isLocked($create_mode) || ilObjDataCollectionAccess::hasWriteAccess($this->parent_obj->getRefId()))) {
// set all visible fields
$record_obj->setRecordFieldValueFromForm((int)$field->getId(), $this->form);
$record_obj->setRecordFieldValueFromForm((int) $field->getId(), $this->form);
} elseif ($create_mode) {
// set default values when creating
$default_value = ilDclTableViewBaseDefaultValue::findSingle(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public function importExcel(): void
$file = $form->getInput("import_file");
$file_location = $file["tmp_name"];
$simulate = $form->getInput("simulate");
$this->importRecords($file_location, (bool)$simulate);
$this->importRecords($file_location, (bool) $simulate);
} else {
$this->showImportExcel($form);
}
Expand Down Expand Up @@ -408,9 +408,9 @@ public function confirmDeleteRecords(): void
$record_data .= $field->getTitle() . ": " . $record_representation->getConfirmationHTML() . "<br />";
}
}
$conf->addItem('record_ids[]', (string)$record->getId(), $record_data);
$conf->addItem('record_ids[]', (string) $record->getId(), $record_data);
}
$conf->addHiddenItem('table_id', (string)$this->table_id);
$conf->addHiddenItem('table_id', (string) $this->table_id);
$conf->setConfirm($this->lng->txt('dcl_delete_records'), self::CMD_DELETE_RECORDS);
$conf->setCancel($this->lng->txt('cancel'), self::CMD_CANCEL_DELETE);
$this->tpl->setContent($conf->getHTML());
Expand Down Expand Up @@ -514,7 +514,7 @@ protected function getRecordListTableGUI(bool $use_tableview_filter): ilDclRecor
$offset = $list->getOffset();

$num_records = count($table_obj->getPartialRecords(
(string)$this->getRefId(),
(string) $this->getRefId(),
$list->getOrderField(),
$list->getOrderDirection(),
$limit,
Expand All @@ -529,7 +529,7 @@ protected function getRecordListTableGUI(bool $use_tableview_filter): ilDclRecor
}

$data = $table_obj->getPartialRecords(
(string)$this->getRefId(),
(string) $this->getRefId(),
$list->getOrderField(),
$list->getOrderDirection(),
$limit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function __construct(
}
}
} else {
$default_sort_title = ilDclCache::getFieldCache((int)$fieldId)->getTitle();
$default_sort_title = ilDclCache::getFieldCache((int) $fieldId)->getTitle();
}
$this->setDefaultOrderField($default_sort_title);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function confirmDelete(): void
$conf->setFormAction($ilCtrl->getFormAction($this));
$conf->setHeaderText($lng->txt('dcl_confirm_delete_detailed_view_title'));

$conf->addItem('tableview', (string)$this->tableview_id, $lng->txt('dcl_confirm_delete_detailed_view_text'));
$conf->addItem('tableview', (string) $this->tableview_id, $lng->txt('dcl_confirm_delete_detailed_view_text'));

$conf->setConfirm($lng->txt('delete'), 'deleteView');
$conf->setCancel($lng->txt('cancel'), 'cancelDelete');
Expand Down Expand Up @@ -208,7 +208,7 @@ public function saveTable(): void
$data_type_id = intval($parts[2]);

// Delete all field values associated with this id
$existing_values = ilDclTableViewBaseDefaultValue::findAll($data_type_id, (int)$id);
$existing_values = ilDclTableViewBaseDefaultValue::findAll($data_type_id, (int) $id);

if (!is_null($existing_values)) {
foreach ($existing_values as $existing_value) {
Expand Down Expand Up @@ -237,7 +237,7 @@ public function saveTable(): void
} else {
$default_value->setValue($value);
}
$default_value->setTviewSetId((int)$id);
$default_value->setTviewSetId((int) $id);
$default_value->create();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ public function fillRowFromObject(ilDclTableViewFieldSetting $a_set): void

if (!is_null($match)) {
if ($item instanceof ilDclCheckboxInputGUI) {
$item->setChecked((bool)$match->getValue());
$item->setChecked((bool) $match->getValue());
} else {
$item->setValue((string)$match->getValue());
$item->setValue((string) $match->getValue());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function confirmDelete(): void
$conf->setFormAction($this->ctrl->getFormAction($this));
$conf->setHeaderText($this->lng->txt('dcl_confirm_delete_detailed_view_title'));

$conf->addItem('tableview', (string)$this->tableview_id, $this->lng->txt('dcl_confirm_delete_detailed_view_text'));
$conf->addItem('tableview', (string) $this->tableview_id, $this->lng->txt('dcl_confirm_delete_detailed_view_text'));

$conf->setConfirm($this->lng->txt('delete'), 'deleteView');
$conf->setCancel($this->lng->txt('cancel'), 'cancelDelete');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function confirmDelete(): void
$conf->setFormAction($ilCtrl->getFormAction($this));
$conf->setHeaderText($lng->txt('dcl_confirm_delete_detailed_view_title'));

$conf->addItem('tableview', (string)$this->tableview_id, $lng->txt('dcl_confirm_delete_detailed_view_text'));
$conf->addItem('tableview', (string) $this->tableview_id, $lng->txt('dcl_confirm_delete_detailed_view_text'));

$conf->setConfirm($lng->txt('delete'), 'deleteView');
$conf->setCancel($lng->txt('cancel'), 'cancelDelete');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function __construct(int $a_id = 0)
$this->lng = $DIC->language();

if ($a_id != 0) {
$this->id = (string)$a_id;
$this->id = (string) $a_id;
$this->doRead();
}
}
Expand Down Expand Up @@ -109,7 +109,7 @@ public static function _getFieldIdByTitle(string $title, int $table_id): int
*/
public function setId($a_id): void
{
$this->id = (string)$a_id;
$this->id = (string) $a_id;
}

/**
Expand Down Expand Up @@ -300,7 +300,7 @@ public function doRead(): void
$this->setDescription($rec["description"]);
}
$this->setDatatypeId($rec["datatype_id"]);
$this->setUnique((bool)$rec["is_unique"]);
$this->setUnique((bool) $rec["is_unique"]);
}

$this->loadProperties();
Expand Down Expand Up @@ -500,7 +500,7 @@ public function setProperty(string $key, $value): ?ilDclFieldProperty
} else {
$property = new ilDclFieldProperty();
$property->setName($key);
$property->setFieldId((int)$this->getId());
$property->setFieldId((int) $this->getId());
$property->setValue($value);

$this->property[$key] = $property;
Expand Down Expand Up @@ -572,7 +572,7 @@ public function cloneStructure(int $original_id): void
$this->cloneProperties($original);

// mandatory for all cloning functions
ilDclCache::setCloneOf($original_id, (int)$this->getId(), ilDclCache::TYPE_FIELD);
ilDclCache::setCloneOf($original_id, (int) $this->getId(), ilDclCache::TYPE_FIELD);
}

public function afterClone(array $records)
Expand All @@ -590,7 +590,7 @@ public function cloneProperties(ilDclBaseFieldModel $originalField): void
}
foreach ($orgProps as $prop_name) {
$fieldprop_obj = new ilDclFieldProperty();
$fieldprop_obj->setFieldId((int)$this->getId());
$fieldprop_obj->setFieldId((int) $this->getId());
$fieldprop_obj->setName($prop_name);

$value = $originalField->getProperty($prop_name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ protected function buildFieldCreationInput(ilObjDataCollection $dcl, string $mod
{
$opt = new ilRadioOption(
$this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle()),
(string)$this->getField()->getDatatypeId()
(string) $this->getField()->getDatatypeId()
);
$opt->setInfo($this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle() . '_desc'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function serializeData($value)
*/
public function deserializeData($value)
{
$deserialize = json_decode((string)$value, true);
$deserialize = json_decode((string) $value, true);
if (is_array($deserialize)) {
return $deserialize;
}
Expand Down Expand Up @@ -218,7 +218,7 @@ public function setValueFromForm(ilPropertyFormGUI $form): void

public function getFormulaValue(): string
{
return (string)$this->getExportValue();
return (string) $this->getExportValue();
}

/**
Expand All @@ -236,7 +236,7 @@ public function parseExportValue($value)
*/
public function getValueFromExcel(ilExcel $excel, int $row, int $col)
{
return (string)$excel->getCell($row, $col);
return (string) $excel->getCell($row, $col);
}

/**
Expand Down Expand Up @@ -287,7 +287,7 @@ public function addHiddenItemsToConfirmation(ilConfirmationGUI $confirmation)
{
;
if (!is_array($this->getValue())) {
$confirmation->addHiddenItem('field_' . $this->field->getId(), (string)$this->getValue());
$confirmation->addHiddenItem('field_' . $this->field->getId(), (string) $this->getValue());
} else {
foreach ($this->getValue() as $key => $value) {
$confirmation->addHiddenItem('field_' . $this->field->getId() . "[$key]", $value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ public function getStandardFieldHTML(string $field_id, array $options = []): str
{
switch ($field_id) {
case 'id':
return (string)$this->getId();
return (string) $this->getId();
case 'owner':
return ilUserUtil::getNamePresentation($this->getOwner());
case 'last_edit_by':
Expand Down Expand Up @@ -634,7 +634,7 @@ public function doDelete(bool $omit_notification = false): void
$this->loadRecordFields();
foreach ($this->recordfields as $recordfield) {
if ($recordfield->getField()->getDatatypeId() == ilDclDatatype::INPUTFORMAT_MOB) {
$this->deleteMob((int)$recordfield->getValue());
$this->deleteMob((int) $recordfield->getValue());
}

$recordfield->delete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected function getFormInput()
*/
public function getHTML(bool $link = true, array $options = []): string
{
return (string)$this->getRecordField()->getValue();
return (string) $this->getRecordField()->getValue();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function serializeData($value): string
$value = json_encode($value);
}

return (string)$value;
return (string) $value;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ilDclDateSelectionRecordFieldModel extends ilDclSelectionRecordFieldModel
public function parseExportValue($value): string
{
$dates = [];
foreach (ilDclSelectionOption::getValues((int)$this->getField()->getId(), $value) as $value) {
foreach (ilDclSelectionOption::getValues((int) $this->getField()->getId(), $value) as $value) {
$date = new ilDate($value, IL_CAL_DATE);
$dates[] = $date->get(IL_CAL_DATE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ilDclDatetimeRecordFieldModel extends ilDclBaseRecordFieldModel
*/
public function parseValue($value): string
{
return (string)$value;
return (string) $value;
}

public function getValueFromExcel(ilExcel $excel, int $row, int $col): ?string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function parseSortingValue($value, bool $link = true)

public function afterClone(): void
{
$field = ilDclCache::getCloneOf((int)$this->getField()->getId(), ilDclCache::TYPE_FIELD);
$field = ilDclCache::getCloneOf((int) $this->getField()->getId(), ilDclCache::TYPE_FIELD);
$record = ilDclCache::getCloneOf($this->getRecord()->getId(), ilDclCache::TYPE_RECORD);
$record_field = ilDclCache::getRecordFieldCache($record, $field);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function parseValue($value)

$file_id = $file_obj->getId();
$return = $file_id;
// handover for save-confirmation
// handover for save-confirmation
} else {
if (is_array($file) && isset($file['tmp_name']) && $file['tmp_name'] != "") {
$return = $file;
Expand Down Expand Up @@ -151,13 +151,13 @@ public function setValue($value, bool $omit_parsing = false): void
*/
public function parseExportValue($value): ?string
{
if (!$value || !ilObject2::_exists((int)$value) || ilObject2::_lookupType((int)$value) != "file") {
if (!$value || !ilObject2::_exists((int) $value) || ilObject2::_lookupType((int) $value) != "file") {
return null;
}

$file = $value;
if ($file != "-") {
$file_obj = new ilObjFile((int)$file, false);
$file_obj = new ilObjFile((int) $file, false);
return $file_obj->getFileName();
}

Expand Down Expand Up @@ -191,7 +191,7 @@ public function setValueFromForm(ilPropertyFormGUI $form): void
*/
public function afterClone(): void
{
$field = ilDclCache::getCloneOf((int)$this->getField()->getId(), ilDclCache::TYPE_FIELD);
$field = ilDclCache::getCloneOf((int) $this->getField()->getId(), ilDclCache::TYPE_FIELD);
$record = ilDclCache::getCloneOf($this->getRecord()->getId(), ilDclCache::TYPE_RECORD);
$record_field = ilDclCache::getRecordFieldCache($record, $field);

Expand Down
Loading

0 comments on commit c381af3

Please sign in to comment.