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 /app | |
| parent | bb2278c43c4992c2cc0fc2d468ad98a395e13962 (diff) | |
relocate flexi, fixes #4101
Closes #4101
Merge request studip/studip!2977
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/admin/courses.php | 25 | ||||
| -rw-r--r-- | app/controllers/calendar/schedule.php | 2 | ||||
| -rw-r--r-- | app/controllers/file.php | 4 | ||||
| -rw-r--r-- | app/controllers/resources/booking.php | 4 | ||||
| -rw-r--r-- | app/controllers/room_management/planning.php | 2 | ||||
| -rw-r--r-- | app/controllers/shared/download.php | 4 | ||||
| -rw-r--r-- | app/controllers/start.php | 2 | ||||
| -rw-r--r-- | app/views/file/file_details.php | 20 | ||||
| -rw-r--r-- | app/views/file/folder_details.php | 2 | ||||
| -rw-r--r-- | app/views/file/new_edit_folder_form.php | 2 | ||||
| -rw-r--r-- | app/views/files/_fileref_tr.php | 2 | ||||
| -rw-r--r-- | app/views/files/_folder_tr.php | 2 | ||||
| -rw-r--r-- | app/views/files/flat.php | 2 | ||||
| -rw-r--r-- | app/views/files/index.php | 2 | ||||
| -rw-r--r-- | app/views/start/index.php | 3 |
15 files changed, 43 insertions, 35 deletions
diff --git a/app/controllers/admin/courses.php b/app/controllers/admin/courses.php index 82c389b..27b6ca6 100644 --- a/app/controllers/admin/courses.php +++ b/app/controllers/admin/courses.php @@ -22,6 +22,7 @@ * @category Stud.IP * @since 3.1 */ + require_once 'lib/meine_seminare_func.inc.php'; require_once 'lib/object.inc.php'; require_once 'lib/archiv.inc.php'; //for lastActivity in getCourses() method @@ -420,7 +421,7 @@ class Admin_CoursesController extends AuthenticatedController } } } - $tf = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH'] . '/app/views'); + $tf = new Flexi\Factory($GLOBALS['STUDIP_BASE_PATH'] . '/app/views'); switch ($GLOBALS['user']->cfg->MY_COURSES_ACTION_AREA) { case 1: case 2: @@ -495,7 +496,7 @@ class Admin_CoursesController extends AuthenticatedController $multimode = $plugin->useMultimode(); if ($multimode) { $data['buttons_top'] = '<label>'._('Alle auswählen').'<input type="checkbox" data-proxyfor=".course-admin td:last-child :checkbox"></label>'; - if ($multimode instanceof Flexi_Template) { + if ($multimode instanceof Flex\Template) { $data['buttons_bottom'] = $multimode->render(); } elseif ($multimode instanceof \Studip\Button) { $data['buttons_bottom'] = (string) $multimode; @@ -715,11 +716,14 @@ class Admin_CoursesController extends AuthenticatedController foreach ($plugin->adminAvailableContents() as $index => $label) { if (in_array($plugin->getPluginId() . '_' . $index, $activated_fields)) { $content = $plugin->adminAreaGetCourseContent($course, $index); - $d[$plugin->getPluginId()."_".$index] = $content instanceof Flexi_Template ? $content->render() : $content; + if ($content instanceof Flexi\Template) { + $content = $content->render(); + } + $d[$plugin->getPluginId()."_".$index] = $content; } } } - $tf = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH'].'/app/views'); + $tf = new Flexi\Factory($GLOBALS['STUDIP_BASE_PATH'].'/app/views'); switch ($GLOBALS['user']->cfg->MY_COURSES_ACTION_AREA) { case 1: @@ -840,7 +844,10 @@ class Admin_CoursesController extends AuthenticatedController foreach (PluginManager::getInstance()->getPlugins(AdminCourseAction::class) as $plugin) { if ($GLOBALS['user']->cfg->MY_COURSES_ACTION_AREA === get_class($plugin)) { $output = $plugin->getAdminCourseActionTemplate($course->getId()); - $d['action'] = $output instanceof Flexi_Template ? $output->render() : (string) $output; + if ($output instanceof Flexi\Template) { + $output = $output->render(); + } + $d['action'] = (string) $output; break; } } @@ -1033,10 +1040,10 @@ class Admin_CoursesController extends AuthenticatedController foreach ($plugin->adminAvailableContents() as $index => $label) { if (in_array($plugin->getPluginId() . "_" . $index, $filter_config)) { $content = $plugin->adminAreaGetCourseContent($course, $index); - $row[$plugin->getPluginId() . "_" . $index] = strip_tags(is_a($content, 'Flexi_Template') - ? $content->render() - : $content - ); + if ($content instanceof Flexi\Template) { + $content = $content->render(); + } + $row[$plugin->getPluginId() . "_" . $index] = strip_tags($content); } } } diff --git a/app/controllers/calendar/schedule.php b/app/controllers/calendar/schedule.php index 88c4304..5d9a26e 100644 --- a/app/controllers/calendar/schedule.php +++ b/app/controllers/calendar/schedule.php @@ -143,7 +143,7 @@ class Calendar_ScheduleController extends AuthenticatedController 'entry_height' => $this->calendar_view->getHeight() ]; - $factory = new Flexi_TemplateFactory($this->dispatcher->trails_root . '/views'); + $factory = new Flexi\Factory($this->dispatcher->trails_root . '/views'); PageLayout::addStyle($factory->render('calendar/schedule/stylesheet', $style_parameters), 'screen, print'); if (Request::option('printview')) { diff --git a/app/controllers/file.php b/app/controllers/file.php index 11b1949..095e295 100644 --- a/app/controllers/file.php +++ b/app/controllers/file.php @@ -980,7 +980,7 @@ class FileController extends AuthenticatedController ); } else { $this->top_folder = $this->filesystemplugin->getFolder($folder_id, true); - if (is_a($this->top_folder, 'Flexi_Template')) { + if ($this->top_folder instanceof Flexi\Template) { $this->top_folder->select = true; $this->top_folder->to_folder = $this->to_folder; $this->render_text($this->top_folder); @@ -1505,7 +1505,7 @@ class FileController extends AuthenticatedController $folder_id = substr($folder_id, 0, strpos($folder_id, "?")); } $this->top_folder = $this->filesystemplugin->getFolder($folder_id, true); - if (is_a($this->top_folder, 'Flexi_Template')) { + if ($this->top_folder instanceof Flexi\Template) { $this->top_folder->select = true; $this->top_folder->to_folder = $this->to_folder; $this->render_text($this->top_folder->render()); diff --git a/app/controllers/resources/booking.php b/app/controllers/resources/booking.php index 294aeaa..45ccb16 100644 --- a/app/controllers/resources/booking.php +++ b/app/controllers/resources/booking.php @@ -242,9 +242,7 @@ class Resources_BookingController extends AuthenticatedController return true; } - $template_factory = new Flexi_TemplateFactory( - $GLOBALS['STUDIP_BASE_PATH'] . '/locale/' - ); + $template_factory = new Flexi\Factory($GLOBALS['STUDIP_BASE_PATH'] . '/locale/'); $derived_resource = $booking->resource->getDerivedClassInstance(); $system_lang = $_SESSION['_language']; diff --git a/app/controllers/room_management/planning.php b/app/controllers/room_management/planning.php index 1484bbb..3da7904 100644 --- a/app/controllers/room_management/planning.php +++ b/app/controllers/room_management/planning.php @@ -1371,7 +1371,7 @@ class RoomManagement_PlanningController extends AuthenticatedController $export = Request::get('export'); if ($export == 'html') { //Load the export template: - $factory = new Flexi_TemplateFactory( + $factory = new Flexi\Factory( $GLOBALS['STUDIP_BASE_PATH'] . '/app/views/room_management/planning/' ); diff --git a/app/controllers/shared/download.php b/app/controllers/shared/download.php index 92d15d9..f94bc86 100644 --- a/app/controllers/shared/download.php +++ b/app/controllers/shared/download.php @@ -158,7 +158,7 @@ class Shared_DownloadController extends AuthenticatedController } $path = $GLOBALS['STUDIP_BASE_PATH'] . '/app/views/shared/modul/'; - $factory = new Flexi_TemplateFactory($path); + $factory = new Flexi\Factory($path); $template = $factory->open('_modul'); $template->_ = function ($string) { return $this->_($string); }; @@ -166,7 +166,7 @@ class Shared_DownloadController extends AuthenticatedController $template->display_language = $display_language; $content = $template->render(); - $factory = new \Flexi_TemplateFactory($path); + $factory = new Flexi\Factory($path); $type = 1; if (count($modul->modulteile) == 1) { $modulteil = $modul->modulteile->first(); diff --git a/app/controllers/start.php b/app/controllers/start.php index 87c493e..3040d58 100644 --- a/app/controllers/start.php +++ b/app/controllers/start.php @@ -53,6 +53,8 @@ class StartController extends AuthenticatedController } } + $this->widget_layout = $this->get_template_factory()->open('start/_widget.php'); + $sidebar = Sidebar::get(); $nav = $sidebar->addWidget(new NavigationWidget()); diff --git a/app/views/file/file_details.php b/app/views/file/file_details.php index 76f996a..ddbd7e4 100644 --- a/app/views/file/file_details.php +++ b/app/views/file/file_details.php @@ -1,21 +1,21 @@ <?php /** - * @var Flexi_Template $this - * @var FileController $controller - * @var Flexi_Template|null $file_info_template - * @var array $fullpath - * @var FileType $file - * @var string|null $previous_file_ref_id - * @var string|null $next_file_ref_id - * @var string|null $from_plugin - * @var bool $include_navigation + * @var Flexi\Template $this + * @var FileController $controller + * @var Flexi\Template|null $file_info_template + * @var array $fullpath + * @var FileType $file + * @var string|null $previous_file_ref_id + * @var string|null $next_file_ref_id + * @var string|null $from_plugin + * @var bool $include_navigation */ ?> <div id="file_details_window"> <?= $this->render_partial('file/_file_aside.php') ?> <div id="preview_container"> - <? if ($file_info_template instanceof Flexi_Template) : ?> + <? if ($file_info_template instanceof Flexi\Template) : ?> <?= $file_info_template->render() ?> <? endif ?> <h3><?=_('Pfad')?></h3> diff --git a/app/views/file/folder_details.php b/app/views/file/folder_details.php index 5bd6574..7d1fe04 100644 --- a/app/views/file/folder_details.php +++ b/app/views/file/folder_details.php @@ -10,7 +10,7 @@ $folder_template = $folder->getDescriptionTemplate(); <? if (!empty($folder_template)) : ?> <h3><?= _('Beschreibung') ?></h3> <article> - <? if ($folder_template instanceof Flexi_Template): ?> + <? if ($folder_template instanceof Flexi\Template): ?> <?= $folder_template->render() ?> <? else: ?> <?= $folder_template ?> diff --git a/app/views/file/new_edit_folder_form.php b/app/views/file/new_edit_folder_form.php index d2dd931..32b9800 100644 --- a/app/views/file/new_edit_folder_form.php +++ b/app/views/file/new_edit_folder_form.php @@ -32,7 +32,7 @@ <div class="text"> <?= htmlReady($folder_type['name']) ?> <? if ($template = $folder_type['instance']->getDescriptionTemplate()): ?> - <?= tooltipIcon($template instanceof Flexi_Template ? $template->render() : $template, false, true) ?> + <?= tooltipIcon($template instanceof Flexi\Template ? $template->render() : $template, false, true) ?> <? endif ?> </div> <div class="icon"> diff --git a/app/views/files/_fileref_tr.php b/app/views/files/_fileref_tr.php index f282f79..fc486ae 100644 --- a/app/views/files/_fileref_tr.php +++ b/app/views/files/_fileref_tr.php @@ -75,7 +75,7 @@ if ($file->isDownloadable($GLOBALS['user']->id)) { data-sort-value="<?= htmlReady($file->getAdditionalColumnOrderWeigh($index)) ?>"> <? $content = $file->getContentForAdditionalColumn($index) ?> <? if ($content) : ?> - <?= is_a($content, "Flexi_Template") ? $content->render() : $content ?> + <?= $content instanceof Flexi\Template ? $content->render() : $content ?> <? endif ?> </td> <? endforeach ?> diff --git a/app/views/files/_folder_tr.php b/app/views/files/_folder_tr.php index 09cd295..c3f77f6 100644 --- a/app/views/files/_folder_tr.php +++ b/app/views/files/_folder_tr.php @@ -61,7 +61,7 @@ if ($folder->isReadable($GLOBALS['user']->id)) { data-sort-value="<?= htmlReady($folder->getAdditionalColumnOrderWeigh($index)) ?>"> <? $content = $folder->getContentForAdditionalColumn($index) ?> <? if ($content) : ?> - <?= is_a($content, "Flexi_Template") ? $content->render() : $content ?> + <?= $content instanceof Flexi\Template ? $content->render() : $content ?> <? endif ?> </td> <? endforeach ?> diff --git a/app/views/files/flat.php b/app/views/files/flat.php index a7d0c93..1440117 100644 --- a/app/views/files/flat.php +++ b/app/views/files/flat.php @@ -13,7 +13,7 @@ $vue_topFolder = [ 'description' => $topFolder->getDescriptionTemplate(), 'additionalColumns' => $topFolder->getAdditionalColumns(), ]; -if (is_a($vue_topFolder['description'], "Flexi_Template")) { +if ($vue_topFolder['description'] instanceof Flexi\Template) { $vue_topFolder['description'] = $vue_topFolder['description']->render(); } $vue_topFolder['buttons'] = '<span class="multibuttons">'; diff --git a/app/views/files/index.php b/app/views/files/index.php index 94ae3f4..6bf28f7 100644 --- a/app/views/files/index.php +++ b/app/views/files/index.php @@ -23,7 +23,7 @@ 'additionalColumns' => $topFolder->getAdditionalColumns(), 'buttons' => null ]; - if (is_a($vue_topFolder['description'], "Flexi_Template")) { + if ($vue_topFolder['description'] instanceof Flexi\Template) { $vue_topFolder['description'] = $vue_topFolder['description']->render(); } $vue_files = []; diff --git a/app/views/start/index.php b/app/views/start/index.php index f4e7fcc..1fa65ca 100644 --- a/app/views/start/index.php +++ b/app/views/start/index.php @@ -1,6 +1,7 @@ <?php /** * @var array $columns + * @var Flexi\Template $widget_layout */ ?> <h1 class="sr-only"> @@ -29,7 +30,7 @@ if (Config::get()->BANNER_ADS_ENABLE) { <li class="studip-widget-wrapper" id="<?= $widget->getPluginId() ?>"> <div class="ui-widget-content studip-widget"> <? if ($template = $widget->getPortalTemplate()): ?> - <? $template->set_layout($this->_factory->open('start/_widget')) ?> + <? $template->set_layout($widget_layout) ?> <?= $this->render_partial($template, compact('widget')) ?> <? else: ?> <?= $this->render_partial('start/_widget', compact('widget')) ?> |
