|
2802 | 2802 | // Add tab to settings page.
|
2803 | 2803 | $page->add($tab);
|
2804 | 2804 |
|
2805 |
| - |
2806 | 2805 | // Create administration tab.
|
2807 | 2806 | $tab = new admin_settingpage('theme_boost_union_functionality_administration',
|
2808 | 2807 | get_string('administrationtab', 'theme_boost_union', null, true));
|
|
2830 | 2829 | // Add settings page to the admin settings category.
|
2831 | 2830 | $ADMIN->add('theme_boost_union', $page);
|
2832 | 2831 |
|
2833 |
| - // Create SCSS snippets settings page with tabs (and external pages). |
2834 |
| - // (and allow users with the theme/boost_union:configure capability to access it). |
2835 |
| - $page = new admin_settingspage_tabs_with_external('theme_boost_union_snippets', |
2836 |
| - get_string('configtitlesnippets', 'theme_boost_union', null, true), |
2837 |
| - 'theme/boost_union:configure'); |
2838 |
| - |
2839 |
| - // Create SCSS snippets overview tab |
2840 |
| - // (and allow users with the theme/boost_union:configure capability to access it). |
2841 |
| - $tab = new admin_externalpage_in_tab('theme_boost_union_snippets_overview', |
2842 |
| - get_string('snippetsoverview', 'theme_boost_union', null, true), |
2843 |
| - new moodle_url('/theme/boost_union/snippets/overview.php'), |
2844 |
| - 'theme/boost_union:configure'); |
2845 |
| - |
2846 |
| - // Add tab to settings page. |
2847 |
| - $page->add($tab); |
2848 |
| - |
2849 |
| - // Add settings page to the admin settings category. |
2850 |
| - $ADMIN->add('theme_boost_union', $page); |
2851 | 2832 |
|
2852 | 2833 | // Create Accessibility settings page with tabs
|
2853 | 2834 | // (and allow users with the theme/boost_union:configure capability to access it).
|
|
2921 | 2902 | // Add tab to settings page.
|
2922 | 2903 | $page->add($tab);
|
2923 | 2904 |
|
2924 |
| - // Create SCSS snippets settings tab. |
2925 |
| - $tab = new admin_settingpage('theme_boost_union_snippets_settings', |
2926 |
| - get_string('snippetssettings', 'theme_boost_union', null, true)); |
2927 |
| - |
2928 |
| - // Create built-in snippets heading. |
2929 |
| - $name = 'theme_boost_union/builtinsnippetsheading'; |
2930 |
| - $title = get_string('snippetsbuiltinsnippetsheading', 'theme_boost_union', null, true); |
2931 |
| - $setting = new admin_setting_heading($name, $title, null); |
2932 |
| - $tab->add($setting); |
2933 |
| - |
2934 |
| - // Setting: Enable built-in snippets. |
2935 |
| - $name = 'theme_boost_union/enablebuiltinsnippets'; |
2936 |
| - $title = get_string('enablebuiltinsnippets', 'theme_boost_union', null, true); |
2937 |
| - $description = get_string('enablebuiltinsnippets_desc', 'theme_boost_union', null, true); |
2938 |
| - $setting = new admin_setting_configselect($name, $title, $description, THEME_BOOST_UNION_SETTING_SELECT_NO, $yesnooption); |
2939 |
| - $setting->set_updatedcallback('theme_reset_all_caches'); |
2940 |
| - $tab->add($setting); |
2941 |
| - |
2942 |
| - // Create uploaded snippets heading. |
2943 |
| - $name = 'theme_boost_union/uploadedsnippetsheading'; |
2944 |
| - $title = get_string('snippetsuploadedsnippetsheading', 'theme_boost_union', null, true); |
2945 |
| - $setting = new admin_setting_heading($name, $title, null); |
2946 |
| - $tab->add($setting); |
2947 |
| - |
2948 |
| - // Setting: Enable uploaded snippets. |
2949 |
| - $name = 'theme_boost_union/enableuploadedsnippets'; |
2950 |
| - $title = get_string('enableuploadedsnippets', 'theme_boost_union', null, true); |
2951 |
| - $description = get_string('enableuploadedsnippets_desc', 'theme_boost_union', null, true); |
2952 |
| - $setting = new admin_setting_configselect($name, $title, $description, THEME_BOOST_UNION_SETTING_SELECT_NO, $yesnooption); |
2953 |
| - $setting->set_updatedcallback('theme_reset_all_caches'); |
2954 |
| - $tab->add($setting); |
2955 |
| - |
2956 |
| - // Setting: Uploaded snippets. |
2957 |
| - $name = 'theme_boost_union/uploadedsnippets'; |
2958 |
| - $title = get_string('uploadedsnippets', 'theme_boost_union', null, true); |
2959 |
| - $snippetrepourl = 'https://github.com/moodle-an-hochschulen/moodle-theme_boost_union_snippets'; |
2960 |
| - $description = get_string('uploadedsnippets_desc', 'theme_boost_union', ['url' => $snippetrepourl], true); |
2961 |
| - $uploadedsnippetsextensions = array_map(function($item) { |
2962 |
| - return '.'.$item; |
2963 |
| - }, snippets::ALLOWED_PREVIEW_FILE_EXTENSIONS);; |
2964 |
| - $uploadedsnippetsextensions[] = '.scss'; |
2965 |
| - $uploadedsnippetsextensions[] = '.zip'; |
2966 |
| - $setting = new admin_setting_configstoredfile($name, $title, $description, 'snippets', 0, |
2967 |
| - ['maxfiles' => -1, 'subdirs' => 1, 'accepted_types' => $uploadedsnippetsextensions]); |
2968 |
| - $tab->add($setting); |
2969 |
| - $page->hide_if('theme_boost_union/uploadedsnippets', 'theme_boost_union/enableuploadedsnippets', 'neq', |
2970 |
| - THEME_BOOST_UNION_SETTING_SELECT_YES); |
2971 |
| - |
2972 | 2905 | // Create Support tab.
|
2973 | 2906 | $tab = new admin_settingpage('theme_boost_union_content_accessibilitysupport',
|
2974 | 2907 | get_string('accessibilitysupporttab', 'theme_boost_union', null, true));
|
|
3119 | 3052 |
|
3120 | 3053 | // Add settings page to the admin settings category.
|
3121 | 3054 | $ADMIN->add('theme_boost_union', $page);
|
| 3055 | + |
| 3056 | + // Create SCSS snippets settings page with tabs (and external pages). |
| 3057 | + // (and allow users with the theme/boost_union:configure capability to access it). |
| 3058 | + $page = new admin_settingspage_tabs_with_external('theme_boost_union_snippets', |
| 3059 | + get_string('configtitlesnippets', 'theme_boost_union', null, true), |
| 3060 | + 'theme/boost_union:configure'); |
| 3061 | + |
| 3062 | + // Create SCSS snippets overview tab |
| 3063 | + // (and allow users with the theme/boost_union:configure capability to access it). |
| 3064 | + $tab = new admin_externalpage_in_tab('theme_boost_union_snippets_overview', |
| 3065 | + get_string('snippetsoverview', 'theme_boost_union', null, true), |
| 3066 | + new moodle_url('/theme/boost_union/snippets/overview.php'), |
| 3067 | + 'theme/boost_union:configure'); |
| 3068 | + |
| 3069 | + // Add tab to settings page. |
| 3070 | + $page->add($tab); |
| 3071 | + |
| 3072 | + // Create SCSS snippets settings tab. |
| 3073 | + $tab = new admin_settingpage('theme_boost_union_snippets_settings', |
| 3074 | + get_string('snippetssettings', 'theme_boost_union', null, true)); |
| 3075 | + |
| 3076 | + // Create built-in snippets heading. |
| 3077 | + $name = 'theme_boost_union/builtinsnippetsheading'; |
| 3078 | + $title = get_string('snippetsbuiltinsnippetsheading', 'theme_boost_union', null, true); |
| 3079 | + $setting = new admin_setting_heading($name, $title, null); |
| 3080 | + $tab->add($setting); |
| 3081 | + |
| 3082 | + // Setting: Enable built-in snippets. |
| 3083 | + $name = 'theme_boost_union/enablebuiltinsnippets'; |
| 3084 | + $title = get_string('enablebuiltinsnippets', 'theme_boost_union', null, true); |
| 3085 | + $description = get_string('enablebuiltinsnippets_desc', 'theme_boost_union', null, true); |
| 3086 | + $setting = new admin_setting_configselect($name, $title, $description, THEME_BOOST_UNION_SETTING_SELECT_NO, $yesnooption); |
| 3087 | + $setting->set_updatedcallback('theme_reset_all_caches'); |
| 3088 | + $tab->add($setting); |
| 3089 | + |
| 3090 | + // Create uploaded snippets heading. |
| 3091 | + $name = 'theme_boost_union/uploadedsnippetsheading'; |
| 3092 | + $title = get_string('snippetsuploadedsnippetsheading', 'theme_boost_union', null, true); |
| 3093 | + $setting = new admin_setting_heading($name, $title, null); |
| 3094 | + $tab->add($setting); |
| 3095 | + |
| 3096 | + // Setting: Enable uploaded snippets. |
| 3097 | + $name = 'theme_boost_union/enableuploadedsnippets'; |
| 3098 | + $title = get_string('enableuploadedsnippets', 'theme_boost_union', null, true); |
| 3099 | + $description = get_string('enableuploadedsnippets_desc', 'theme_boost_union', null, true); |
| 3100 | + $setting = new admin_setting_configselect($name, $title, $description, THEME_BOOST_UNION_SETTING_SELECT_NO, $yesnooption); |
| 3101 | + $setting->set_updatedcallback('theme_reset_all_caches'); |
| 3102 | + $tab->add($setting); |
| 3103 | + |
| 3104 | + // Setting: Uploaded snippets. |
| 3105 | + $name = 'theme_boost_union/uploadedsnippets'; |
| 3106 | + $title = get_string('uploadedsnippets', 'theme_boost_union', null, true); |
| 3107 | + $snippetrepourl = 'https://github.com/moodle-an-hochschulen/moodle-theme_boost_union_snippets'; |
| 3108 | + $description = get_string('uploadedsnippets_desc', 'theme_boost_union', ['url' => $snippetrepourl], true); |
| 3109 | + $uploadedsnippetsextensions = array_map(function($item) { |
| 3110 | + return '.'.$item; |
| 3111 | + }, snippets::ALLOWED_PREVIEW_FILE_EXTENSIONS);; |
| 3112 | + $uploadedsnippetsextensions[] = '.scss'; |
| 3113 | + $uploadedsnippetsextensions[] = '.zip'; |
| 3114 | + $setting = new admin_setting_configstoredfile($name, $title, $description, 'snippets', 0, |
| 3115 | + ['maxfiles' => -1, 'subdirs' => 1, 'accepted_types' => $uploadedsnippetsextensions]); |
| 3116 | + $tab->add($setting); |
| 3117 | + $page->hide_if('theme_boost_union/uploadedsnippets', 'theme_boost_union/enableuploadedsnippets', 'neq', |
| 3118 | + THEME_BOOST_UNION_SETTING_SELECT_YES); |
| 3119 | + |
| 3120 | + // Add tab to settings page. |
| 3121 | + $page->add($tab); |
| 3122 | + |
| 3123 | + // Add settings page to the admin settings category. |
| 3124 | + $ADMIN->add('theme_boost_union', $page); |
3122 | 3125 | }
|
3123 | 3126 |
|
3124 | 3127 | // Add JS to remember the active admin tab to the page.
|
|
0 commit comments