--- /dev/null
+<?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/>.
+
+/**
+ * This file contains functions used by the admin pages
+ *
+ * @since 2.1
+ * @package admin
+ * @copyright 2011 Andrew Davis
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+/**
+ * Return a list of page types
+ * @param string $pagetype current page type
+ * @param stdClass $parentcontext Block's parent context
+ * @param stdClass $currentcontext Current context of block
+ */
+function admin_page_type_list($pagetype, $parentcontext, $currentcontext) {
+ $array = array(
+ 'admin-setting-*' => get_string('page-admin-setting-x', 'pagetype'),
+ $pagetype => get_string('page-admin-setting', 'pagetype')
+ );
+ return $array;
+}
\ No newline at end of file
$contextoptions = array();
if ( ($parentcontext->contextlevel == CONTEXT_COURSE && $parentcontext->instanceid == SITEID) ||
($parentcontext->contextlevel == CONTEXT_SYSTEM)) { // Home page
- if ($bits[0] == 'tag') {
- // tag always use system context, the contexts options don't make differences, so we use
+ if ($bits[0] == 'tag' || ($bits[0] == 'admin' && $bits[1] == 'setting')) {
+ // tag and admin settings always use system context
+ // the contexts options don't make differences, so we use
// page type patterns only
$mform->addElement('hidden', 'bui_contexts', BUI_CONTEXTS_ENTIRE_SITE);
} else {
$mform->addElement('select', 'bui_contexts', get_string('contexts', 'block'), $contextoptions);
}
+ $displaypagetypewarning = false;
if ($this->page->pagetype == 'site-index') { // No need for pagetype list on home page
$pagetypelist = array('*'=>get_string('page-x', 'pagetype'));
} else {
// Pushing block's existing page type pattern
$pagetypestringname = 'page-'.str_replace('*', 'x', $this->block->instance->pagetypepattern);
if (get_string_manager()->string_exists($pagetypestringname, 'pagetype')) {
- $pagetyelist[$this->block->instance->pagetypepattern] = get_string($pagetypestringname, 'pagetype');
+ $pagetypelist[$this->block->instance->pagetypepattern] = get_string($pagetypestringname, 'pagetype');
+ } else {
+ //as a last resort we could put the page type pattern in the select box
+ //however this causes mod-data-view to be added if the only option available is mod-data-*
+
+ //as a last resort we could put the page type pattern in the select box
+ //however this causes mod-data-view to be added if the only option available is mod-data-*
+ // so we are just showing a warning to users about their prev setting being reset
+ $displaypagetypewarning = true;
}
}
}
// hide page type pattern select box if there is only one choice
if (count($pagetypelist) > 1) {
+ if ($displaypagetypewarning) {
+ $mform->addElement('static', 'pagetypewarning', '', get_string('pagetypewarning','block'));
+ }
+
$mform->addElement('select', 'bui_pagetypepattern', get_string('restrictpagetypes', 'block'), $pagetypelist);
} else {
$value = array_pop(array_keys($pagetypelist));
} else {
return array('*'=>get_string('page-x', 'pagetype'),
'course-*'=>get_string('page-course-x', 'pagetype'),
- 'course-view-*'=>get_string('page-course-view-x', 'pagetype'),
- 'mod-*'=>get_string('page-mod-x', 'pagetype')
+ 'course-view-*'=>get_string('page-course-view-x', 'pagetype')
);
}
}
\ No newline at end of file
$string['flashvideo'] = 'Flash video';
$string['flashvideo_help'] = 'Files with extension *.flv and *.f4v. Plays video clips using Flowplayer, requires Flash plugin and javascript. Uses HTML 5 video fallback if multiple sources psecified.';
$string['html5audio'] = 'HTML 5 audio';
-$string['html5audio_help'] = 'Audio files with extension *.ogg, *.acc and others. It is compatible with latest web browsers only, unfortunately there is no format that is supported by all browsers.
-Workaround is to specify fallbacks separated with # (ex: http://example.org/audio.acc#http://example.org/audio.acc#http://example.org/audio.mp3#), QuickTime player is used as a fallback for old browsers, fallback can be any audio type.';
+$string['html5audio_help'] = 'Audio files with extension *.ogg, *.aac and others. It is compatible with latest web browsers only, unfortunately there is no format that is supported by all browsers.
+Workaround is to specify fallbacks separated with # (ex: http://example.org/audio.aac#http://example.org/audio.aac#http://example.org/audio.mp3#), QuickTime player is used as a fallback for old browsers, fallback can be any audio type.';
$string['html5video'] = 'HTML 5 video';
$string['html5video_help'] = 'Video files with extension *.webm, *.m4v, *.ogv, *.mp4 and others. It is compatible with latest web browsers only, unfortunately there is no format that is supported by all browsers.
-Workaround is to specify fallbacks sources separated with # (ex: http://example.org/video.m4v#http://example.org/video.acc#http://example.org/video.ogv#d=640x480), QuickTime player is used as a fallback for old browsers.';
+Workaround is to specify fallbacks sources separated with # (ex: http://example.org/video.m4v#http://example.org/video.aac#http://example.org/video.ogv#d=640x480), QuickTime player is used as a fallback for old browsers.';
$string['mp3audio'] = 'MP3 audio';
$string['mp3audio_help'] = 'Files with extension *.mp3. Plays audio using Flowplayer, requires Flash plugin.';
$string['legacyquicktime'] = 'QuickTime player';
/**
* Filters
*/
-.mediaplugin_html5video, .mediaplugin_swf, .mediaplugin_flv, .mediaplugin_real, .mediaplugin_youtube, .mediaplugin_vimeo, .mediaplugin_wmp, .mediaplugin_qt
+.mediaplugin_html5audio, .mediaplugin_html5video, .mediaplugin_swf, .mediaplugin_flv, .mediaplugin_real, .mediaplugin_youtube, .mediaplugin_vimeo, .mediaplugin_wmp, .mediaplugin_qt
{display:block;margin-top:5px;margin-bottom:5px;text-align: center;}
.mediaplugin.mediaplugin_mp3 object {display:inline;height:15px;width:180px;margin-left:0.5em;}
$string['movingthisblockcancel'] = 'Moving this block ({$a})';
$string['onthispage'] = 'On this page';
$string['pagetypes'] = 'Page types';
+$string['pagetypewarning'] = 'The previously specified page type is no longer selectable. Please choose the most appropriate page type below.';
$string['region'] = 'Region';
$string['showoncontextandsubs'] = 'Display on \'{$a}\' and any pages within it';
$string['showoncontextonly'] = 'Display on \'{$a}\' only';
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * Strings for component 'pagetype', language 'en', branch 'MOODLE_20_STABLE'
+ * Strings for component 'pagetype', language 'en'
*
* @package pagetype
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+$string['page-admin-setting'] = 'The current admin setting page';
+$string['page-admin-setting-x'] = 'Any admin setting page';
$string['page-course-view-x'] = 'Any type of course main page';
$string['page-course-x'] = 'Any course page';
$string['page-course-report-x'] = 'Any course report';
<node ID="_Freemind_Link_313976796" TEXT=".ra"/>
<node ID="_Freemind_Link_709595453" TEXT=".wma"/>
<node TEXT=".ogg"/>
+<node ID="ID_421461117" TEXT=".aac"/>
</node>
<node ID="_Freemind_Link_1800832653" TEXT="non_web_audio">
<node ID="_Freemind_Link_1772266185" TEXT=".ape"/>