Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle_local_hsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle_local_hsh
Commits
487bc967
Commit
487bc967
authored
1 year ago
by
Elke Kreim
Browse files
Options
Downloads
Patches
Plain Diff
Decrease amount of categories in request form
parent
a96665f3
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
lang/de/local_hsh.php
+4
-0
4 additions, 0 deletions
lang/de/local_hsh.php
lang/en/local_hsh.php
+4
-0
4 additions, 0 deletions
lang/en/local_hsh.php
request_form.php
+7
-3
7 additions, 3 deletions
request_form.php
settings.php
+64
-0
64 additions, 0 deletions
settings.php
with
79 additions
and
3 deletions
lang/de/local_hsh.php
+
4
−
0
View file @
487bc967
...
...
@@ -7,6 +7,10 @@
$string
[
'pluginname'
]
=
'HsH Anpassungen'
;
// request
$string
[
'settingslabel'
]
=
'HSH Kursantrag'
;
$string
[
'categoriesenabledvisiblename'
]
=
'Kursbereiche'
;
$string
[
'categoriesenabledhelper'
]
=
'Kurskategorien für HSH Kursantrag auswählen'
;
$string
[
'categoriesenableddefault'
]
=
'Keine Kursbereiche ausgewählt'
;
$string
[
'courserequest'
]
=
'Kursbeantragung'
;
$string
[
'courserequestsuccess'
]
=
'<p>Ihr Kursantrag wurde an das E-Learning Center übertragen und wird so schnell wie
möglich (i.d.R. in den nächsten drei Werktagen) bearbeitet. Sie werden umgehend per E-Mail über die Freischaltung informiert.</p>
...
...
This diff is collapsed.
Click to expand it.
lang/en/local_hsh.php
+
4
−
0
View file @
487bc967
...
...
@@ -5,6 +5,10 @@
* Time: 10:48
*/
$string
[
'pluginname'
]
=
'HSH Edits'
;
$string
[
'settingslabel'
]
=
'HSH course request'
;
$string
[
'categoriesenabledvisiblename'
]
=
'Course categories'
;
$string
[
'categoriesenabledhelper'
]
=
'Select course categories for hsh course request form'
;
$string
[
'categoriesenableddefault'
]
=
'No course category selected'
;
$string
[
'courserequest'
]
=
'Course request'
;
$string
[
'courserequestsuccess'
]
=
'Your course request has been saved successfully. You will be sent an email to inform you whether your request was approved.'
;
// request_form
...
...
This diff is collapsed.
Click to expand it.
request_form.php
+
7
−
3
View file @
487bc967
...
...
@@ -132,8 +132,12 @@ class course_request_hsh_form extends moodleform {
* @return array
*/
private
function
get_short_categories_list
()
{
$courselist
=
core_course_category
::
make_categories_list
(
''
,
0
,
'$$$'
);
foreach
(
$courselist
as
&
$actCourse
)
{
$selectedcatecorieids
=
get_config
(
'local_hsh'
,
'categoriesenabled'
);
$selectedcatecories
=
core_course_category
::
get_many
(
explode
(
','
,
$selectedcatecorieids
));
$categorylist
=
core_course_category
::
make_categories_list
(
''
,
0
,
'$$$'
);
$selected
=
array_intersect_key
(
$categorylist
,
$selectedcatecories
);
var_dump
(
$selected
);
foreach
(
$selected
as
&
$actCourse
)
{
$actCourseArr
=
explode
(
'$$$'
,
$actCourse
);
$actCourseSize
=
sizeof
(
$actCourseArr
);
if
(
$actCourseSize
>
1
)
{
...
...
@@ -144,7 +148,7 @@ class course_request_hsh_form extends moodleform {
$actCourse
.
=
$actCourseArr
[
$actCourseSize
-
1
];
}
}
return
$
courselist
;
return
$
selected
;
}
// < HsH
...
...
This diff is collapsed.
Click to expand it.
settings.php
0 → 100644
+
64
−
0
View file @
487bc967
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Plugin settings for the local_hsh plugin.
*
* @package local_hsh
* @copyright 2023, Elke Kreim <elke.kreim@hs-hannover.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// Ensure the configurations for this site are set
if
(
$hassiteconfig
)
{
// Create the new settings page
// - in a local plugin this is not defined as standard, so normal $settings->methods will throw an error as
// $settings will be null
$settings
=
new
admin_settingpage
(
'local_hsh'
,
get_string
(
'settingslabel'
,
'local_hsh'
));
// Create
$ADMIN
->
add
(
'localplugins'
,
$settings
);
$settings
->
add
(
new
admin_setting_configmultiselect
(
'local_hsh/categoriesenabled'
,
get_string
(
'categoriesenabledvisiblename'
,
'local_hsh'
),
get_string
(
'categoriesenabledhelper'
,
'local_hsh'
),
array
(),
core_course_category
::
make_categories_list
()
));
// Add a setting field to the settings for this page
// $settings->add(new admin_setting_configtext(
// // This is the reference you will use to your configuration
// 'local_hsh/categoriesenabled',
//
// // This is the friendly title for the config, which will be displayed
// get_string('categoriesenabledvisiblename', 'local_hsh' ),
//
// // This is helper text for this config field
// get_string('categoriesenabledhelper', 'local_hsh' ),
//
// // This is the default value
// get_string('categoriesenableddefault', 'local_hsh' ),
//
// // This is the type of Parameter this config is
// PARAM_TEXT
// ));
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment