Skip to content

Commit

Permalink
follow-up fixes for DICTrait refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
ferishili committed Aug 22, 2023
1 parent d0ed663 commit 9689283
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
7 changes: 5 additions & 2 deletions classes/Conf/Metadata/class.xoctMetadataConfigGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
use srag\Plugins\Opencast\Model\Metadata\Definition\MDFieldDefinition;
use srag\Plugins\Opencast\UI\Metadata\Config\MDConfigTable;
use srag\Plugins\Opencast\Model\Metadata\Definition\MDDataType;
use srag\Plugins\Opencast\LegacyHelpers\OutputTrait;

abstract class xoctMetadataConfigGUI extends xoctGUI
{
use OutputTrait;

public const CMD_STORE = 'store';
public const CMD_REORDER = 'reorder';

Expand Down Expand Up @@ -140,7 +143,7 @@ protected function add()
{
$field_id = filter_input(INPUT_GET, 'field_id', FILTER_SANITIZE_STRING);
$form = $this->buildForm($field_id);
self::output()->output($this->renderer->render($form));
$this->output($this->renderer->render($form));
}

/**
Expand All @@ -152,7 +155,7 @@ protected function edit()
{
$field_id = filter_input(INPUT_GET, 'field_id', FILTER_SANITIZE_STRING);
$form = $this->buildForm($field_id);
self::output()->output($this->renderer->render($form));
$this->output($this->renderer->render($form));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class xoctPermissionTemplateTableGUI extends ilTable2GUI

public function __construct(xoctPermissionTemplateGUI $a_parent_obj, $a_parent_cmd = "", $a_template_context = "")
{
global $DIC;
global $DIC, $opencastContainer;
$this->ctrl = $DIC->ctrl();
$this->main_tpl = $DIC->ui()->mainTemplate();
$this->plugin = ilOpenCastPlugin::getInstance();
$this->plugin = $opencastContainer[ilOpenCastPlugin::class];
$this->user = $DIC->user();
$this->parent_obj = $a_parent_obj;

Expand Down
10 changes: 5 additions & 5 deletions classes/Conf/Reports/class.xoctReportOverviewTableGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class xoctReportOverviewTableGUI extends TableGUI
/**
* @var ilLanguage
*/
private $lng;
protected $lng;
/**
* @var ilOpenCastPlugin
*/
Expand All @@ -30,11 +30,11 @@ class xoctReportOverviewTableGUI extends TableGUI
public function __construct($parent, string $parent_cmd)
{
global $DIC, $opencastContainer;
$this->plugin = $opencastContainer->getPlugin(ilOpenCastPlugin::class);
$this->plugin = $opencastContainer[ilOpenCastPlugin::class];
$this->lng = $DIC->language();
parent::__construct($parent, $parent_cmd);
$this->addMultiCommand(xoctReportOverviewGUI::CMD_DELETE, $language->txt(xoctReportOverviewGUI::CMD_DELETE));
$this->addMultiCommand(xoctReportOverviewGUI::CMD_DELETE, $this->lng->txt(xoctReportOverviewGUI::CMD_DELETE));
$this->setSelectAllCheckbox('id[]');
parent::__construct($parent, $parent_cmd);
}

/**
Expand All @@ -58,7 +58,7 @@ protected function initColumns(): void
{
$this->addColumn('', '', '', true);
$this->addColumn($this->lng->txt('message'));
$this->addColumn($this->plugin->txt('sender_sender'));
$this->addColumn($this->plugin->txt('sender'));
$this->addColumn($this->lng->txt('date'), 'created_at');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class xoctWorkflowParameterTableGUI extends TableGUI
/**
* @var ilLanguage
*/
private $lng;
protected $lng;
/**
* @var ilOpenCastPlugin
*/
Expand All @@ -31,11 +31,11 @@ public function __construct($parent, string $parent_cmd, WorkflowParameterReposi
{
global /** @var Container $opencastContainer */
$DIC, $opencastContainer;
parent::__construct($parent, $parent_cmd);
$this->lng = $DIC->language();
$this->plugin = $opencastContainer->get(ilOpenCastPlugin::class);
$this->setEnableNumInfo(false);
$this->workflowParameterRepository = $workflowParameterRepository;
parent::__construct($parent, $parent_cmd);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/Conf/Workflows/class.xoctWorkflowGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ protected function delete()
if (is_array($items) && count($items) === 1) {
$id = array_shift($items);
$this->workflow_repository->delete($id);
ilUtil::sendSuccess($this->plugin->txt('msg_workflow_deleted'), true);
ilUtil::sendSuccess($this->plugin->txt('workflow_msg_workflow_deleted'), true);
$this->ctrl->redirect($this, self::CMD_STANDARD);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class xoctSeriesWorkflowParameterTableGUI extends TableGUI
*/
public function __construct($parent, string $parent_cmd, WorkflowParameterRepository $workflowParameterRepository)
{
global $DIC;
$this->plugin = ilOpenCastPlugin::getInstance();
global $DIC, $opencastContainer;
$this->plugin = $opencastContainer[ilOpenCastPlugin::class];
$this->lng = $DIC->language();
parent::__construct($parent, $parent_cmd);
$this->setEnableNumInfo(false);
Expand All @@ -60,8 +60,6 @@ protected function initCommands(): void
protected function getColumnValue(string $column, /*array*/ $row, int $format = self::DEFAULT_FORMAT): string
{
$column = $row[$column];

break;
}

protected function getSelectableColumns2(): array
Expand Down

0 comments on commit 9689283

Please sign in to comment.