Skip to content

Commit

Permalink
Merge branch 'feature/langvar_custom_field' into 'main'
Browse files Browse the repository at this point in the history
use language variable for custom field title

See merge request fluxlabs/ilias/plugins/RepositoryObjects/ViMP!44
  • Loading branch information
mstuder committed Mar 31, 2022
2 parents 54af9d7 + 9de1131 commit dd47a5a
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
7 changes: 7 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
flux-publish-utils:
stage: build
image: docker-registry.fluxpublisher.ch/flux-publish-utils:latest
script:
- "false"
only:
- main
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.8.0]
- Ability to use language variables for custom container fields obtained from ViMP. Contributed by <3 Ilja Lukin
- Added flux-publish-utils

## [1.7.0]
- ILIAS 7 supported
- dropped ILIAS 5.4 support
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,22 @@ git clone https://github.com/fluxapps/ViMP.git

Please also install and enable [ViMPCron](https://github.com/fluxapps/ViMPCron).

# Contributing :purple_heart:
## Maintainer
fluxlabs ag, [email protected]

## Contributors
* Theo, fluxlabs
* Martin, fluxlabs
* Johannes Heim, Albert-Ludwigs-Universität Freiburg
* Ilja Lukin, Fachhochschule Dortmund

## Contributing :purple_heart:
Please ...
1. ... register an account at https://git.fluxlabs.ch
2. ... write us an email: [email protected]
3. ... we give you access to the projects you like to contribute :fire:


# Adjustment suggestions / bug reporting :feet:
## Adjustment suggestions / bug reporting :feet:
Please ...
1. ... register an account at https://git.fluxlabs.ch
2. ... ask us for a sla: [email protected] :kissing_heart:
Expand Down
9 changes: 7 additions & 2 deletions classes/GUI/Form/class.xvmpUploadVideoFormGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,15 @@ protected function addCustomInputs()
if (!$field[xvmpConf::F_FORM_FIELD_ID]) {
continue;
}

$title = $this->lng->exists($this->pl->getPrefix() . "_" . $field[xvmpConf::F_FORM_FIELD_ID])
? $this->lng->txt($this->pl->getPrefix() . "_" . $field[xvmpConf::F_FORM_FIELD_ID])
: $field[xvmpConf::F_FORM_FIELD_TITLE];

if ($field[xvmpConf::F_FORM_FIELD_TYPE]) {
$input = new ilCheckboxInputGUI($field[xvmpConf::F_FORM_FIELD_TITLE], $field[xvmpConf::F_FORM_FIELD_ID]);
$input = new ilCheckboxInputGUI($title, $field[xvmpConf::F_FORM_FIELD_ID]);
} else {
$input = new ilTextInputGUI($field[xvmpConf::F_FORM_FIELD_TITLE], $field[xvmpConf::F_FORM_FIELD_ID]);
$input = new ilTextInputGUI($title, $field[xvmpConf::F_FORM_FIELD_ID]);
}
$input->setRequired($field[xvmpConf::F_FORM_FIELD_REQUIRED]);
if ($field[xvmpConf::F_FORM_FIELD_FILL_USER_DATA]) {
Expand Down
10 changes: 7 additions & 3 deletions classes/GUI/Form/class.xvmpVideoFormGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,15 @@ protected function addCustomInputs()
if (!$field[xvmpConf::F_FORM_FIELD_ID]) {
continue;
}

$title = $this->lng->exists($this->pl->getPrefix() . "_" . $field[xvmpConf::F_FORM_FIELD_ID])
? $this->lng->txt($this->pl->getPrefix() . "_" . $field[xvmpConf::F_FORM_FIELD_ID])
: $field[xvmpConf::F_FORM_FIELD_TITLE];

if ($field[xvmpConf::F_FORM_FIELD_TYPE]) {
$input = new ilCheckboxInputGUI($field[xvmpConf::F_FORM_FIELD_TITLE],
$field[xvmpConf::F_FORM_FIELD_ID]);
$input = new ilCheckboxInputGUI($title, $field[xvmpConf::F_FORM_FIELD_ID]);
} else {
$input = new ilTextInputGUI($field[xvmpConf::F_FORM_FIELD_TITLE], $field[xvmpConf::F_FORM_FIELD_ID]);
$input = new ilTextInputGUI($title, $field[xvmpConf::F_FORM_FIELD_ID]);
}
$input->setRequired($field[xvmpConf::F_FORM_FIELD_REQUIRED]);
$this->addItem($input);
Expand Down
21 changes: 13 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
{
"name": "studer-raimann.ch/vimp",
"description": "ILIAS 5.x ViMP plugin",
"type": "project",
"name": "fluxapps/vimp",
"description": "ILIAS ViMP Plugin",
"type": "plugin",
"license": "GPL-3.0+",
"keywords": [
"ilias",
"fluxlabs",
"vimp"
],
"authors": [
{
"name": "Theodor Truffer",
"email": "tt@studer-raimann.ch",
"homepage": "https://studer-raimann.ch",
"role": "Project Manager, Software Engineer"
"name": "fluxlabs ag",
"email": "support@fluxlabs.ch",
"homepage": "https://fluxlabs.ch",
"role": "Maintainer, Developer"
}
],
"support": {
"issues": "https://plugins.studer-raimann.ch/goto.php?target=uihk_srsu_PLVIMP"
"issues": "https://git.fluxlabs.ch"
},
"minimum-stability": "beta",
"prefer-stable": true,
Expand Down
6 changes: 3 additions & 3 deletions plugin.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
$id = 'xvmp';
$version = '1.6.0';
$version = '1.8.0';
$ilias_min_version = '6.0';
$ilias_max_version = '7.999';
$responsible = 'Theodor Truffer';
$responsible_mail = 'support@studer-raimann.ch';
$responsible = 'fluxlabs ag';
$responsible_mail = 'support@fluxlabs.ch';
$learning_progress = true;
7 changes: 6 additions & 1 deletion src/UIComponents/Content/MediumMetadataDTOBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class MediumMetadataDTOBuilder
*/
private $dic;

private $lng;
/**
* VideoMetadataDTOBuilder constructor.
* @param ilViMPPlugin $plugin
Expand All @@ -31,6 +32,7 @@ public function __construct(Container $dic, ilViMPPlugin $plugin)
{
$this->plugin = $plugin;
$this->dic = $dic;
$this->lng = $dic->language();
}

/**
Expand Down Expand Up @@ -72,7 +74,10 @@ protected function buildMediumInfos(xvmpMedium $medium, bool $short, bool $show_
foreach (xvmpConf::getConfig(xvmpConf::F_FORM_FIELDS) as $field) {
if ($field[xvmpConf::F_FORM_FIELD_SHOW_IN_PLAYER]
&& ($value = $medium->getField($field[xvmpConf::F_FORM_FIELD_ID]))) {
$medium_infos[] = new MediumAttribute($value, $field[xvmpConf::F_FORM_FIELD_TITLE]);
$title = $this->lng->exists($this->plugin->getPrefix() . "_" . $field[xvmpConf::F_FORM_FIELD_ID])
? $this->lng->txt($this->plugin->getPrefix() . "_" . $field[xvmpConf::F_FORM_FIELD_ID])
: $field[xvmpConf::F_FORM_FIELD_TITLE];
$medium_infos[] = new MediumAttribute($value, $title);
}
}
}
Expand Down

0 comments on commit dd47a5a

Please sign in to comment.