Skip to content

Commit

Permalink
Remove references to ajaxenabled() [M2.7] #11323
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-platts authored and sammarshallou committed Aug 8, 2014
1 parent 67e7622 commit c79efd0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 33 deletions.
30 changes: 9 additions & 21 deletions annotate.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,16 +286,6 @@
// Tabs
ouwiki_print_tabs('annotate', $pagename, $subwiki, $cm, $context, $pageversion->versionid ? true : false, $pageversion->locked);

// check to see if ajax is enabled in the user profile. It is required for the annotate page
if (!ajaxenabled()) {
print '<div class="ouwiki_nojs_message"><p>'.get_string('ajaxnotenabled', 'ouwiki').'</p></div>'.
'<div class="ouwiki_jsrequired"><p>'.get_string('jsajaxrequired', 'ouwiki').'</p></div>';

// print the footer and stop
ouwiki_print_footer($course, $cm, $subwiki, $pagename);
exit();
}

// prints the div that contains a message when js is disabled in the browser so cannot annotate.
print '<div id="ouwiki_belowtabs_annotate_nojs"><p>'.get_string('jsnotenabled', 'ouwiki').'</p>'.
'<div class="ouwiki_jsrequired"><p>'.get_string('jsajaxrequired', 'ouwiki').'</p></div></div>';
Expand Down Expand Up @@ -348,17 +338,15 @@
echo '</div>';

// init JS module
if (ajaxenabled()) {
$stringlist[] = array('add', 'ouwiki');
$stringlist[] = array('cancel', 'ouwiki');
$jsmodule = array('name' => 'mod_ouwiki_annotate',
'fullpath' => '/mod/ouwiki/module.js',
'requires' => array('base', 'event', 'io', 'node', 'anim', 'panel',
'yui2-container', 'yui2-dragdrop'),
'strings' => $stringlist
);
$PAGE->requires->js_init_call('M.mod_ouwiki_annotate.init', array(), true, $jsmodule);
}
$stringlist[] = array('add', 'ouwiki');
$stringlist[] = array('cancel', 'ouwiki');
$jsmodule = array('name' => 'mod_ouwiki_annotate',
'fullpath' => '/mod/ouwiki/module.js',
'requires' => array('base', 'event', 'io', 'node', 'anim', 'panel',
'yui2-container', 'yui2-dragdrop'),
'strings' => $stringlist
);
$PAGE->requires->js_init_call('M.mod_ouwiki_annotate.init', array(), true, $jsmodule);

// close <div id="#ouwiki_belowtabs_annotate">
print '</div>';
Expand Down
22 changes: 10 additions & 12 deletions view.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,16 @@
}

// init JS module
if (ajaxenabled()) {
$stringlist[] = array('typeinsectionname', 'ouwiki');
$stringlist[] = array('typeinpagename', 'ouwiki');
$stringlist[] = array('collapseannotation', 'ouwiki');
$stringlist[] = array('expandannotation', 'ouwiki');
$jsmodule = array('name' => 'mod_ouwiki_view',
'fullpath' => '/mod/ouwiki/module.js',
'requires' => array('base', 'event', 'io', 'node', 'anim', 'panel'),
'strings' => $stringlist
);
$PAGE->requires->js_init_call('M.mod_ouwiki_view.init', array(), true, $jsmodule);
}
$stringlist[] = array('typeinsectionname', 'ouwiki');
$stringlist[] = array('typeinpagename', 'ouwiki');
$stringlist[] = array('collapseannotation', 'ouwiki');
$stringlist[] = array('expandannotation', 'ouwiki');
$jsmodule = array('name' => 'mod_ouwiki_view',
'fullpath' => '/mod/ouwiki/module.js',
'requires' => array('base', 'event', 'io', 'node', 'anim', 'panel'),
'strings' => $stringlist
);
$PAGE->requires->js_init_call('M.mod_ouwiki_view.init', array(), true, $jsmodule);

// Footer
ouwiki_print_footer($course, $cm, $subwiki, $pagename);

0 comments on commit c79efd0

Please sign in to comment.