diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-05-16 11:05:47 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2024-05-16 11:05:47 +0000 |
| commit | efaeea07319c63be2f2c6a8bd076e4de8ac8f11d (patch) | |
| tree | b6c4f4f976cee1e156f8f9dd0fec39a9f09e6242 /lib/models | |
| parent | bb2278c43c4992c2cc0fc2d468ad98a395e13962 (diff) | |
relocate flexi, fixes #4101
Closes #4101
Merge request studip/studip!2977
Diffstat (limited to 'lib/models')
| -rw-r--r-- | lib/models/Courseware/BlockTypes/BlockType.php | 4 | ||||
| -rw-r--r-- | lib/models/Courseware/ContainerTypes/ContainerType.php | 4 | ||||
| -rw-r--r-- | lib/models/Freetext.php | 15 | ||||
| -rw-r--r-- | lib/models/LikertScale.php | 6 | ||||
| -rw-r--r-- | lib/models/OERMaterial.php | 2 | ||||
| -rw-r--r-- | lib/models/QuestionnaireInfo.php | 4 | ||||
| -rw-r--r-- | lib/models/RangeScale.php | 6 | ||||
| -rw-r--r-- | lib/models/Vote.php | 4 | ||||
| -rw-r--r-- | lib/models/calendar/CalendarDate.class.php | 2 | ||||
| -rw-r--r-- | lib/models/calendar/CalendarDateAssignment.class.php | 6 | ||||
| -rw-r--r-- | lib/models/resources/ResourceBooking.class.php | 4 | ||||
| -rw-r--r-- | lib/models/resources/ResourcePropertyDefinition.class.php | 2 | ||||
| -rw-r--r-- | lib/models/resources/ResourceRequest.class.php | 8 |
13 files changed, 35 insertions, 32 deletions
diff --git a/lib/models/Courseware/BlockTypes/BlockType.php b/lib/models/Courseware/BlockTypes/BlockType.php index b87a219..37e617b 100644 --- a/lib/models/Courseware/BlockTypes/BlockType.php +++ b/lib/models/Courseware/BlockTypes/BlockType.php @@ -438,9 +438,9 @@ abstract class BlockType * It turns the classname into snakecase in order to find the * template file in templates/courseware/block_types. * - * @return mixed the \Flexi_Template instance if exists, otherwise null. + * @return \Flexi\Template|null the \Flexi\Template instance if exists, otherwise null. */ - public function getPdfHtmlTemplate(): ?\Flexi_Template + public function getPdfHtmlTemplate(): ?\Flexi\Template { $template = null; try { diff --git a/lib/models/Courseware/ContainerTypes/ContainerType.php b/lib/models/Courseware/ContainerTypes/ContainerType.php index baddaab..4e816be 100644 --- a/lib/models/Courseware/ContainerTypes/ContainerType.php +++ b/lib/models/Courseware/ContainerTypes/ContainerType.php @@ -249,9 +249,9 @@ abstract class ContainerType * It turns the classname into snakecase in order to find the * template file in templates/courseware/container_types. * - * @return mixed the \Flexi_Template instance if exists, otherwise null. + * @return \Flexi\Template|null the \Flexi\Template instance if exists, otherwise null. */ - public function getPdfHtmlTemplate(): ?\Flexi_Template + public function getPdfHtmlTemplate(): ?\Flexi\Template { $template = null; try { diff --git a/lib/models/Freetext.php b/lib/models/Freetext.php index 52182de..66b93c5 100644 --- a/lib/models/Freetext.php +++ b/lib/models/Freetext.php @@ -65,12 +65,13 @@ class Freetext extends QuestionnaireQuestion implements QuestionType /** * Returns the template of this question to answer the question. - * @return Flexi_Template - * @throws Flexi_TemplateNotFoundException if there is no template. + * + * @return Flexi\Template + * @throws Flexi\TemplateNotFoundException if there is no template. */ public function getDisplayTemplate() { - $factory = new Flexi_TemplateFactory(realpath(__DIR__ . '/../../app/views')); + $factory = new Flexi\Factory(realpath(__DIR__ . '/../../app/views')); $template = $factory->open('questionnaire/question_types/freetext/freetext_answer.php'); $template->vote = $this; return $template; @@ -97,9 +98,11 @@ class Freetext extends QuestionnaireQuestion implements QuestionType /** * Returns the template with the answers of the question so far. + * * @param null $only_user_ids : array of user_ids - * @return Flexi_Template - * @throws Flexi_TemplateNotFoundException if there is no template. + * + * @return Flexi\Template + * @throws Flexi\TemplateNotFoundException if there is no template. */ public function getResultTemplate($only_user_ids = null) { @@ -111,7 +114,7 @@ class Freetext extends QuestionnaireQuestion implements QuestionType } } } - $factory = new Flexi_TemplateFactory(realpath(__DIR__ . '/../../app/views')); + $factory = new Flexi\Factory(realpath(__DIR__ . '/../../app/views')); $template = $factory->open('questionnaire/question_types/freetext/freetext_evaluation.php'); $template->vote = $this; $template->set_attribute('answers', $answers); diff --git a/lib/models/LikertScale.php b/lib/models/LikertScale.php index 8ac7823..833d794 100644 --- a/lib/models/LikertScale.php +++ b/lib/models/LikertScale.php @@ -53,7 +53,7 @@ class LikertScale extends QuestionnaireQuestion implements QuestionType public function getDisplayTemplate() { - $factory = new Flexi_TemplateFactory(realpath(__DIR__.'/../../app/views')); + $factory = new Flexi\Factory(realpath(__DIR__.'/../../app/views')); $template = $factory->open('questionnaire/question_types/likert/likert_answer'); $template->set_attribute('vote', $this); return $template; @@ -73,7 +73,7 @@ class LikertScale extends QuestionnaireQuestion implements QuestionType public function getUserIdsOfFilteredAnswer($answer_option) { $user_ids = []; - list($statement_key, $options_key) = explode('_', $answer_option); + [$statement_key, $options_key] = explode('_', $answer_option); foreach ($this->answers as $answer) { $answerData = $answer['answerdata']->getArrayCopy(); if ($answerData['answers'][$statement_key] == $options_key) { @@ -93,7 +93,7 @@ class LikertScale extends QuestionnaireQuestion implements QuestionType } } } - $factory = new Flexi_TemplateFactory(realpath(__DIR__.'/../../app/views')); + $factory = new Flexi\Factory(realpath(__DIR__.'/../../app/views')); $template = $factory->open('questionnaire/question_types/likert/likert_evaluation'); $template->set_attribute('vote', $this); $template->set_attribute('answers', $answers); diff --git a/lib/models/OERMaterial.php b/lib/models/OERMaterial.php index 8411d14..604f845 100644 --- a/lib/models/OERMaterial.php +++ b/lib/models/OERMaterial.php @@ -198,7 +198,7 @@ class OERMaterial extends SimpleORMap return $output; } - $tf = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH']."/app/views"); + $tf = new Flexi\Factory($GLOBALS['STUDIP_BASE_PATH']."/app/views"); if ($material->hasValidPreviewUrl() || $material->isPDF()) { $template = $tf->open("oer/embed/url"); } elseif ($material->isVideo()) { diff --git a/lib/models/QuestionnaireInfo.php b/lib/models/QuestionnaireInfo.php index fc6efc7..2bcf25d 100644 --- a/lib/models/QuestionnaireInfo.php +++ b/lib/models/QuestionnaireInfo.php @@ -50,7 +50,7 @@ class QuestionnaireInfo extends QuestionnaireQuestion implements QuestionType public function getDisplayTemplate() { - $factory = new Flexi_TemplateFactory(realpath(__DIR__.'/../../app/views')); + $factory = new Flexi\Factory(realpath(__DIR__.'/../../app/views')); $template = $factory->open('questionnaire/question_types/info/info'); $template->set_attribute('vote', $this); return $template; @@ -68,7 +68,7 @@ class QuestionnaireInfo extends QuestionnaireQuestion implements QuestionType public function getResultTemplate($only_user_ids = null) { - $factory = new Flexi_TemplateFactory(realpath(__DIR__.'/../../app/views')); + $factory = new Flexi\Factory(realpath(__DIR__.'/../../app/views')); $template = $factory->open('questionnaire/question_types/info/info'); $template->set_attribute('vote', $this); return $template; diff --git a/lib/models/RangeScale.php b/lib/models/RangeScale.php index 78bc65b..44b946b 100644 --- a/lib/models/RangeScale.php +++ b/lib/models/RangeScale.php @@ -53,7 +53,7 @@ class RangeScale extends QuestionnaireQuestion implements QuestionType public function getDisplayTemplate() { - $factory = new Flexi_TemplateFactory(realpath(__DIR__.'/../../app/views')); + $factory = new Flexi\Factory(realpath(__DIR__.'/../../app/views')); $template = $factory->open('questionnaire/question_types/rangescale/rangescale_answer'); $template->set_attribute('vote', $this); return $template; @@ -72,7 +72,7 @@ class RangeScale extends QuestionnaireQuestion implements QuestionType public function getUserIdsOfFilteredAnswer($answer_option) { $user_ids = []; - list($statement_key, $options_key) = explode('_', $answer_option); + [$statement_key, $options_key] = explode('_', $answer_option); foreach ($this->answers as $answer) { $answerData = $answer['answerdata']->getArrayCopy(); if ($answerData['answers'][$statement_key] == $options_key) { @@ -92,7 +92,7 @@ class RangeScale extends QuestionnaireQuestion implements QuestionType } } } - $factory = new Flexi_TemplateFactory(realpath(__DIR__.'/../../app/views')); + $factory = new Flexi\Factory(realpath(__DIR__.'/../../app/views')); $template = $factory->open('questionnaire/question_types/rangescale/rangescale_evaluation'); $template->set_attribute('vote', $this); $template->set_attribute('answers', $answers); diff --git a/lib/models/Vote.php b/lib/models/Vote.php index 0520401..ede0cea 100644 --- a/lib/models/Vote.php +++ b/lib/models/Vote.php @@ -53,7 +53,7 @@ class Vote extends QuestionnaireQuestion implements QuestionType public function getDisplayTemplate() { - $factory = new Flexi_TemplateFactory(realpath(__DIR__.'/../../app/views')); + $factory = new Flexi\Factory(realpath(__DIR__.'/../../app/views')); $template = $factory->open('questionnaire/question_types/vote/vote_answer'); $template->set_attribute('vote', $this); return $template; @@ -100,7 +100,7 @@ class Vote extends QuestionnaireQuestion implements QuestionType } } } - $factory = new Flexi_TemplateFactory(realpath(__DIR__.'/../../app/views')); + $factory = new Flexi\Factory(realpath(__DIR__.'/../../app/views')); $template = $factory->open('questionnaire/question_types/vote/vote_evaluation'); $template->set_attribute('vote', $this); $template->set_attribute('answers', $answers); diff --git a/lib/models/calendar/CalendarDate.class.php b/lib/models/calendar/CalendarDate.class.php index 7026ece..d901cf1 100644 --- a/lib/models/calendar/CalendarDate.class.php +++ b/lib/models/calendar/CalendarDate.class.php @@ -114,7 +114,7 @@ class CalendarDate extends SimpleORMap implements PrivacyObject public function cbSendDateModificationMail() { - $template_factory = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH'] . '/locale/'); + $template_factory = new Flexi\Factory($GLOBALS['STUDIP_BASE_PATH'] . '/locale/'); foreach ($this->calendars as $calendar) { if ($calendar->range_id === $this->editor_id) { diff --git a/lib/models/calendar/CalendarDateAssignment.class.php b/lib/models/calendar/CalendarDateAssignment.class.php index bd99dd3..e0bf467 100644 --- a/lib/models/calendar/CalendarDateAssignment.class.php +++ b/lib/models/calendar/CalendarDateAssignment.class.php @@ -79,7 +79,7 @@ class CalendarDateAssignment extends SimpleORMap implements Event return; } - $template_factory = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH'] . '/locale/'); + $template_factory = new Flexi\Factory($GLOBALS['STUDIP_BASE_PATH'] . '/locale/'); setTempLanguage($this->range_id); $lang_path = getUserLanguagePath($this->range_id); @@ -112,7 +112,7 @@ class CalendarDateAssignment extends SimpleORMap implements Event return; } - $template_factory = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH'] . '/locale/'); + $template_factory = new Flexi\Factory($GLOBALS['STUDIP_BASE_PATH'] . '/locale/'); setTempLanguage($this->range_id); $lang_path = getUserLanguagePath($this->range_id); @@ -160,7 +160,7 @@ class CalendarDateAssignment extends SimpleORMap implements Event return; } - $template_factory = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH'] . '/locale/'); + $template_factory = new Flexi\Factory($GLOBALS['STUDIP_BASE_PATH'] . '/locale/'); setTempLanguage($this->range_id); $lang_path = getUserLanguagePath($this->range_id); diff --git a/lib/models/resources/ResourceBooking.class.php b/lib/models/resources/ResourceBooking.class.php index f55b3b3..fadf92f 100644 --- a/lib/models/resources/ResourceBooking.class.php +++ b/lib/models/resources/ResourceBooking.class.php @@ -876,7 +876,7 @@ class ResourceBooking extends SimpleORMap implements PrivacyObject, Studip\Calen $deleted_c = 0; - $template_factory = new Flexi_TemplateFactory( + $template_factory = new Flexi\Factory( $GLOBALS['STUDIP_BASE_PATH'] . '/locale/' ); @@ -1917,7 +1917,7 @@ class ResourceBooking extends SimpleORMap implements PrivacyObject, Studip\Calen return; } - $template_factory = new Flexi_TemplateFactory( + $template_factory = new Flexi\Factory( $GLOBALS['STUDIP_BASE_PATH'] . '/locale/' ); setTempLanguage($booking_user->id); diff --git a/lib/models/resources/ResourcePropertyDefinition.class.php b/lib/models/resources/ResourcePropertyDefinition.class.php index 82d29c9..450ec00 100644 --- a/lib/models/resources/ResourcePropertyDefinition.class.php +++ b/lib/models/resources/ResourcePropertyDefinition.class.php @@ -221,7 +221,7 @@ class ResourcePropertyDefinition extends SimpleORMap ); } } elseif ($type === 'position') { - $factory = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH']); + $factory = new Flexi\Factory($GLOBALS['STUDIP_BASE_PATH']); $template = $factory->open('templates/resources/position_attribute_form_part.php'); $template->set_attribute( 'input_name', diff --git a/lib/models/resources/ResourceRequest.class.php b/lib/models/resources/ResourceRequest.class.php index 6b22b44..9cad900 100644 --- a/lib/models/resources/ResourceRequest.class.php +++ b/lib/models/resources/ResourceRequest.class.php @@ -1963,7 +1963,7 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen return; } - $factory = new Flexi_TemplateFactory( + $factory = new Flexi\Factory( $GLOBALS['STUDIP_BASE_PATH'] . '/locale/' ); @@ -2020,7 +2020,7 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen */ public function sendCloseRequestMailToRequester($bookings = []) { - $factory = new Flexi_TemplateFactory( + $factory = new Flexi\Factory( $GLOBALS['STUDIP_BASE_PATH'] . '/locale/' ); @@ -2110,7 +2110,7 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen ); if ($lecturers) { - $factory = new Flexi_TemplateFactory( + $factory = new Flexi\Factory( $GLOBALS['STUDIP_BASE_PATH'] . '/locale/' ); @@ -2199,7 +2199,7 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen } //Load the mail template: - $factory = new Flexi_TemplateFactory( + $factory = new Flexi\Factory( $GLOBALS['STUDIP_BASE_PATH'] . '/locale/' ); $user_lang_path = getUserLanguagePath($user->id); |
