$this->page->requires->js('lib/javascript-navigation.js');
// Navcount is used to allow us to have multiple trees although I dont' know why
// you would want to trees the same
-
+
block_global_navigation_tree::$navcount++;
-
+
// Set the expansionlimit if one has been set in block config
if (!empty($this->config->expansionlimit) && $this->config->expansionlimit!='0') {
$this->page->navigation->expansionlimit = $this->config->expansionlimit;
$this->page->navigation->initialise();
// Remove empty branches if the user has selected to
-
+
if (empty($this->config->showemptybranches) || $this->config->showemptybranches=='no') {
$this->remove_empty_section_branches();
}
$this->showmyhistory();
}
- $tooglesidetabdisplay = get_string('tooglesidetabdisplay', $this->blockname);
- $toogleblockdisplay = get_string('toogleblockdisplay', $this->blockname);
+ $togglesidetabdisplay = get_string('togglesidetabdisplay', $this->blockname);
+ $toggleblockdisplay = get_string('toggleblockdisplay', $this->blockname);
// Get the expandable items so we can pass them to JS
$expandable = array();
$this->page->navigation->find_expandable($expandable);
$args = array('expansions'=>$expandable,'instance'=>$this->instance->id);
- $args['tooglesidetabdisplay'] = $tooglesidetabdisplay;
- $args['toogleblockdisplay'] = $toogleblockdisplay;
+ $args['togglesidetabdisplay'] = $togglesidetabdisplay;
+ $args['toggleblockdisplay'] = $toggleblockdisplay;
// Give JS some information we will use within the JS tree object
$this->page->requires->data_for_js('globalnav'.block_global_navigation_tree::$navcount, $args);
// Initialise the JS tree object
user_preference_allow_ajax_update('nav_in_tab_panel_globalnav'.block_global_navigation_tree::$navcount, PARAM_INT);
if (get_user_preferences('nav_in_tab_panel_globalnav'.block_global_navigation_tree::$navcount, 0)) {
$icon = $OUTPUT->old_icon_url('t/movetoblock');
- $string = $toogleblockdisplay;
+ $string = $toggleblockdisplay;
} else {
$icon = $OUTPUT->old_icon_url('t/movetosidetab');
- $string = $tooglesidetabdisplay;
+ $string = $togglesidetabdisplay;
}
$this->content->footer .= '<a class="moveto customcommand requiresjs"><img src="'.$icon.'" alt="'.$string.'" title="'.$string.'"></a>';
}
}
}
}
-}
\ No newline at end of file
+}
$this->page->requires->js('lib/javascript-navigation.js');
block_settings_navigation_tree::$navcount++;
- $tooglesidetabdisplay = get_string('tooglesidetabdisplay', $this->blockname);
- $toogleblockdisplay = get_string('toogleblockdisplay', $this->blockname);
+ $togglesidetabdisplay = get_string('togglesidetabdisplay', $this->blockname);
+ $toggleblockdisplay = get_string('toggleblockdisplay', $this->blockname);
$args = array('instance'=>$this->instance->id);
- $args['tooglesidetabdisplay'] = $tooglesidetabdisplay;
- $args['toogleblockdisplay'] = $toogleblockdisplay;
+ $args['togglesidetabdisplay'] = $togglesidetabdisplay;
+ $args['toggleblockdisplay'] = $toggleblockdisplay;
// Give JS some information we will use within the JS tree object
$this->page->requires->data_for_js('settingsnav'.block_settings_navigation_tree::$navcount, $args);
// only do search if you have moodle/site:config
if (count($this->content->items)>0) {
if (has_capability('moodle/site:config',get_context_instance(CONTEXT_SYSTEM)) ) {
- $this->content->footer =
- '<div class="adminsearchform">'.
- '<form action="'.$CFG->wwwroot.'/'.$CFG->admin.'/search.php" method="get"><div>'.
- '<label for="query" class="accesshide">'.get_string('searchinsettings', 'admin').'</label>'.
- '<input type="text" name="query" id="query" size="8" value="'.s(optional_param('query', '')).'" />'.
- '<input type="submit" value="'.get_string('search').'" /></div>'.
- '</form></div>';
+ $searchform = new html_form();
+ $searchform->url = new moodle_url("$CFG->wwwroot/$CFG->admin/search.php");
+ $searchform->method = 'get';
+ $searchform->button->text = get_string('search');
+
+ $searchfield = html_field::make_text('query', optional_param('query', '', PARAM_RAW));
+ $searchfield->id = 'query';
+ $searchfield->style .= 'width: 7em;';
+ $searchfield->set_label(get_string('searchinsettings', 'admin'), 'query');
+ $searchfield->label->add_class('accesshide');
+ $this->content->footer = $OUTPUT->container($OUTPUT->form($searchform, $OUTPUT->field($searchfield)), 'adminsearchform');
} else {
$this->content->footer = '';
}
+ $reloadicon = new moodle_action_icon();
$url = $this->page->url;
$url->param('regenerate','navigation');
- $reloadstr = get_string('reload');
- $this->content->footer .= '<a href="'.$url->out().'" class="customcommand"><img src="'.$OUTPUT->old_icon_url('t/reload').'" alt="'.$reloadstr.'" title="'.$reloadstr.'" /></a>';
+ $reloadicon->link->url = $url;
+ $reloadicon->link->add_class('customcommand');
+ $reloadicon->image->src = $OUTPUT->old_icon_url('t/reload');
+ $reloadicon->alt = get_string('reload');
+ $reloadicon->title = get_string('reload');
+
+ $this->content->footer .= $OUTPUT->action_icon($reloadicon);
+
if (!empty($this->config->enablesidebarpopout) && $this->config->enablesidebarpopout == 'yes') {
+ $moveicon = new moodle_action_icon();
+ $moveicon->link->add_classes('moveto customcommand requiresjs');
+ $moveicon->link->url = ' ';
+
user_preference_allow_ajax_update('nav_in_tab_panel_settingsnav'.block_settings_navigation_tree::$navcount, PARAM_INT);
if (get_user_preferences('nav_in_tab_panel_settingsnav'.block_settings_navigation_tree::$navcount, 0)) {
- $icon = $OUTPUT->old_icon_url('t/movetoblock');
- $string = $toogleblockdisplay;
+ $moveicon->image->src = $OUTPUT->old_icon_url('t/movetoblock');
+ $string = $toggleblockdisplay;
+ $moveicon->image->alt = $toggleblockdisplay;
+ $moveicon->image->title = $toggleblockdisplay;
} else {
- $icon = $OUTPUT->old_icon_url('t/movetosidetab');
- $string = $tooglesidetabdisplay;
+ $moveicon->image->src = $OUTPUT->old_icon_url('t/movetosidetab');
+ $moveicon->image->alt = $togglesidetabdisplay;
+ $moveicon->image->title = $togglesidetabdisplay;
}
- $this->content->footer .= '<a class="moveto customcommand requiresjs"><img src="'.$icon.'" alt="'.$string.'" title="'.$string.'"></a>';
+ $this->content->footer .= $OUTPUT->action_icon($moveicon);
}
}
}
return $attributes;
}
-}
\ No newline at end of file
+}
$string['enablesidebarpopoutdesc'] = 'Allow the user to switch the block to a sidbar popout';
$string['showmyhistorydesc'] = 'Show my history as a branch in the navigation';
$string['showmyhistorytitle'] = 'My history';
-$string['toogleblockdisplay'] = 'Move to block position';
-$string['tooglesidetabdisplay'] = 'Move to side panel tab';
+$string['toggleblockdisplay'] = 'Move to block position';
+$string['togglesidetabdisplay'] = 'Move to side panel tab';
$string['blockname'] = 'Settings';
$string['enablehoverexpansion'] = 'Enable mouseover expansion of this block';
$string['enablesidebarpopout'] = 'Allow the user to switch the block to a sidbar popout';
-$string['toogleblockdisplay'] = 'Move to block position';
-$string['tooglesidetabdisplay'] = 'Move to side panel tab';
\ No newline at end of file
+$string['toggleblockdisplay'] = 'Move to block position';
+$string['togglesidetabdisplay'] = 'Move to side panel tab';
hideMenu : function(e) {
var t = this;
- // Prevent double toogles by canceling the mouse click event to the button
+ // Prevent double toggles by canceling the mouse click event to the button
if (e && e.type == "mousedown" && (e.target.id == t.id + '_text' || e.target.id == t.id + '_open'))
return;
hideMenu : function(e) {
var t = this;
- // Prevent double toogles by canceling the mouse click event to the button
+ // Prevent double toggles by canceling the mouse click event to the button
if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id || e.id === t.id + '_open';}))
return;
hideMenu : function(e) {
var t = this;
- // Prevent double toogles by canceling the mouse click event to the button
+ // Prevent double toggles by canceling the mouse click event to the button
if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';}))
return;
this.cachedcontent = null;
this.cachedfooter = null;
this.position = 'block';
- this.tooglesidetabdisplay = '[[tooglesidetabdisplay]]';
- this.toogleblockdisplay = '[[toogleblockdisplay]]';
+ this.togglesidetabdisplay = '[[togglesidetabdisplay]]';
+ this.toggleblockdisplay = '[[toggleblockdisplay]]';
this.sideblockwidth = null;
if (window[this.name]) {
if (window[this.name].expansions) {
if (window[this.name].instance) {
this.instance = window[this.name].instance;
}
- if (window[this.name].tooglesidetabdisplay) {
- this.tooglesidetabdisplay = window[this.name].tooglesidetabdisplay;
+ if (window[this.name].togglesidetabdisplay) {
+ this.togglesidetabdisplay = window[this.name].togglesidetabdisplay;
}
- if (window[this.name].toogleblockdisplay) {
- this.toogleblockdisplay = window[this.name].toogleblockdisplay;
+ if (window[this.name].toggleblockdisplay) {
+ this.toggleblockdisplay = window[this.name].toggleblockdisplay;
}
}
}
/**
* Initialise function used to attach the initial events to the navigation tree
- * This function attachs toogles and ajax calls
+ * This function attachs toggles and ajax calls
*/
navigation_tree.prototype.initialise = function() {
if (!document.getElementById(this.name)) {
* @param {element} e Event object
*/
navigation_tree.prototype.toggle_block_display = function(e) {
+ YAHOO.util.Event.preventDefault(e);
if (e !== null) {
YAHOO.util.Event.stopPropagation(e);
}
if (moveicon.length>0) {
for (var j=0;j<moveicon.length;j++) {
moveicon[j].src = moveicon[j].src.replace(/movetosidetab/, 'movetoblock');
- moveicon[j].setAttribute('alt', this.toogleblockdisplay);
- moveicon[j].setAttribute('title', this.toogleblockdisplay);
+ moveicon[j].setAttribute('alt', this.toggleblockdisplay);
+ moveicon[j].setAttribute('title', this.toggleblockdisplay);
}
}
}
if (moveicon.length>0) {
for (var j=0;j<moveicon.length;j++) {
moveicon[j].src = moveicon[j].src.replace(/movetoblock/, 'movetosidetab');
- moveicon[j].setAttribute('alt', this.tooglesidetabdisplay);
- moveicon[j].setAttribute('title', this.tooglesidetabdisplay);
+ moveicon[j].setAttribute('alt', this.togglesidetabdisplay);
+ moveicon[j].setAttribute('title', this.togglesidetabdisplay);
}
}
}
shadows[i].parentNode.removeChild(shadows[i]);
}
return true;
-}
\ No newline at end of file
+}
*/
function show_xml ($xml) {
echo '<div class="xmlshow">';
- echo '<a onClick="document.getElementById(\'toogleme\').style.display = ' .
- '(document.getElementById(\'toogleme\').style.display!=\'none\')?\'none\':\'\';">Hide/Show XML</a>';
- echo "<div style=\"display:none;\" id=\"toogleme\">";
+ echo '<a onClick="document.getElementById(\'toggleme\').style.display = ' .
+ '(document.getElementById(\'toggleme\').style.display!=\'none\')?\'none\':\'\';">Hide/Show XML</a>';
+ echo "<div style=\"display:none;\" id=\"toggleme\">";
echo '<pre>';echo htmlentities($xml);echo '</pre>';
echo "</div>";
echo "</div>";
}
return $res;
}
-?>
\ No newline at end of file
+?>