Skip to content

Commit

Permalink
MDL-21240 shortened urls now start with / everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jan 18, 2010
1 parent f2ab0d0 commit 9dec75d
Show file tree
Hide file tree
Showing 87 changed files with 125 additions and 125 deletions.
2 changes: 1 addition & 1 deletion admin/report/capability/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

// Include the required JavaScript.
$PAGE->requires->yui2_lib('event');
$PAGE->requires->js('admin/report/capability/script.js');
$PAGE->requires->js('/admin/report/capability/script.js');
$PAGE->requires->js_function_call('capability_report.cap_filter_init', array(get_string('search')));

// Log.
Expand Down
2 changes: 1 addition & 1 deletion admin/report/spamcleaner/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ function print_user_entry($user, $keywords, $count) {

function print_spamcleaner_javascript() {
global $PAGE;
$PAGE->requires->js('admin/report/spamcleaner/spamcleaner.js');
$PAGE->requires->js('/admin/report/spamcleaner/spamcleaner.js');
$strings = Array('spaminvalidresult','spamdeleteallconfirm','spamcannotdelete','spamdeleteconfirm');
$PAGE->requires->strings_for_js($strings, 'report_spamcleaner');
$PAGE->requires->data_for_js('spamcleaner', Array('me'=>me()));
Expand Down
2 changes: 1 addition & 1 deletion admin/roles/assign.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@

/// Print the header and tabs
$PAGE->requires->yui2_lib('dom-event');
$PAGE->requires->js($CFG->admin . '/roles/roles.js');
$PAGE->requires->js('/admin/roles/roles.js');
if ($context->contextlevel == CONTEXT_USER) {
$user = $DB->get_record('user', array('id'=>$userid));
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', $context));
Expand Down
2 changes: 1 addition & 1 deletion admin/roles/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function display() {
if (count($this->capabilities) > capability_table_base::NUM_CAPS_FOR_SEARCH) {
global $CFG, $PAGE;
$PAGE->requires->yui2_lib('dom-event');
$PAGE->requires->js($CFG->admin . '/roles/roles.js');
$PAGE->requires->js('/admin/roles/roles.js');
$PAGE->requires->js_function_call('cap_table_filter.init',
array($this->id, get_string('filter'), get_string('clear')));
}
Expand Down
2 changes: 1 addition & 1 deletion admin/webservice/service_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
$id = required_param('id', PARAM_INT);

$PAGE->set_url('/admin/webservice/service_users.php', array('id'=>$id));
$PAGE->requires->js($CFG->admin.'/webservice/script.js');
$PAGE->requires->js('/admin/webservice/script.js');

admin_externalpage_setup('externalserviceusers');
admin_externalpage_print_header();
Expand Down
4 changes: 2 additions & 2 deletions admin/xmldb/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@
$script = $CFG->admin . '/xmldb/actions/' . $action . '/' . $action . '.js';
$file = $CFG->dirroot . '/' . $script;
if (file_exists($file) && is_readable($file)) {
$PAGE->requires->js($script);
$PAGE->requires->js('/'.$script);
} else if ($postaction) {
/// Try to load the postaction javascript if exists
$script = $CFG->admin . '/xmldb/actions/' . $postaction . '/' . $postaction . '.js';
$file = $CFG->dirroot . '/' . $script;
if (file_exists($file) && is_readable($file)) {
$PAGE->requires->js($script);
$PAGE->requires->js('/'.$script);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion blocks/admin_tree/block_admin_tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function get_content() {

if ($this->tempcontent !== '') {
$this->page->requires->yui2_lib('event');
$this->page->requires->js('blocks/admin_tree/admintree.js');
$this->page->requires->js('/blocks/admin_tree/admintree.js');
$this->page->requires->js_function_call('admin_tree.init',
array($this->divcounter - 1, $this->expandnodes,
$OUTPUT->pix_url('i/open'), $OUTPUT->pix_url('i/closed'),
Expand Down
2 changes: 1 addition & 1 deletion blocks/calendar_month/block_calendar_month.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function get_content() {
// Be VERY careful with the format for default courses arguments!
// Correct formatting is [courseid] => 1 to be concise with moodlelib.php functions.
calendar_set_filters($courses, $group, $user, $filtercourse, $groupeventsfrom, false);
$this->page->requires->js('calendar/calendar.js');
$this->page->requires->js('/calendar/calendar.js');
if ($courseshown == SITEID) {
// For the front page
$this->content->text .= calendar_top_controls('frontpage', array('id' => $courseshown, 'm' => $cal_m, 'y' => $cal_y));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function instance_allow_config() {

function get_required_javascript() {
$this->_initialise_dock();
$this->page->requires->js('blocks/global_navigation_tree/navigation.js');
$this->page->requires->js('/blocks/global_navigation_tree/navigation.js');
user_preference_allow_ajax_update('docked_block_instance_'.$this->instance->id, PARAM_INT);
}

Expand All @@ -96,7 +96,7 @@ function get_content() {
}
$this->page->requires->yui2_lib('dom');
// JS for navigation moved to the standard theme, the code will probably have to depend on the actual page structure
// $this->page->requires->js('lib/javascript-navigation.js');
// $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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function instance_allow_config() {

function get_required_javascript() {
$this->_initialise_dock();
$this->page->requires->js('blocks/global_navigation_tree/navigation.js');
$this->page->requires->js('/blocks/global_navigation_tree/navigation.js');
$args = array($this->instance->id, array('instance'=>$this->instance->id, 'candock'=>$this->instance_can_be_docked()));
$this->page->requires->js_function_call('blocks.navigation.setup_new_tree', $args)->on_dom_ready();
user_preference_allow_ajax_update('docked_block_instance_'.$this->instance->id, PARAM_INT);
Expand All @@ -96,7 +96,7 @@ function get_content() {
}
$this->page->requires->yui2_lib('dom');
// JS for navigation moved to the standard theme, the code will probably have to depend on the actual page structure
// $this->page->requires->js('lib/javascript-navigation.js');
// $this->page->requires->js('/lib/javascript-navigation.js');
block_settings_navigation_tree::$navcount++;

// Check if this block has been docked
Expand Down
2 changes: 1 addition & 1 deletion calendar/event.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
}

$PAGE->requires->yui2_lib('animation');
$PAGE->requires->js('calendar/calendar.js');
$PAGE->requires->js('/calendar/calendar.js');

$PAGE->navbar->add($strcalendar, $link);
$PAGE->navbar->add($title);
Expand Down
2 changes: 1 addition & 1 deletion calendar/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
$PAGE->set_button($prefsbutton);

$PAGE->requires->yui2_lib('animation');
$PAGE->requires->js('calendar/calendar.js');
$PAGE->requires->js('/calendar/calendar.js');

echo $OUTPUT->header();

Expand Down
2 changes: 1 addition & 1 deletion comment/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
$PAGE->requires->yui2_lib('animation');
$PAGE->requires->yui2_lib('json');
$PAGE->requires->yui2_lib('connection');
$PAGE->requires->js('comment/admin.js');
$PAGE->requires->js('/comment/admin.js');

$action = optional_param('action', '', PARAM_ALPHA);
$commentid = optional_param('commentid', 0, PARAM_INT);
Expand Down
2 changes: 1 addition & 1 deletion course/report/participation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@

echo '<h2>'.get_string('counteditems', '', $a).'</h2>'."\n";

echo $PAGE->requires->js('course/report/participation/participation.js')->asap();
echo $PAGE->requires->js('/course/report/participation/participation.js')->asap();

echo '<form action="'.$CFG->wwwroot.'/user/action_redir.php" method="post" id="studentsform" onsubmit="return checksubmit(this);">'."\n";
echo '<div>'."\n";
Expand Down
2 changes: 1 addition & 1 deletion course/report/progress/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function csv_quote($value) {

if($svgcleverness) {
$PAGE->requires->yui2_lib('event');
$PAGE->requires->js('course/report/progress/textrotate.js');
$PAGE->requires->js('/course/report/progress/textrotate.js');
}

// Handle groups (if enabled)
Expand Down
6 changes: 3 additions & 3 deletions course/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@
$PAGE->requires->yui2_lib('dragdrop');
$PAGE->requires->yui2_lib('connection');
$PAGE->requires->yui2_lib('selector');
$PAGE->requires->js('lib/ajax/block_classes.js');
$PAGE->requires->js('lib/ajax/section_classes.js');
$PAGE->requires->js('/lib/ajax/block_classes.js');
$PAGE->requires->js('/lib/ajax/section_classes.js');

// Okay, global variable alert. VERY UGLY. We need to create
// this object here before the <blockname>_print_block()
Expand All @@ -179,7 +179,7 @@
$completion = new completion_info($course);
if ($completion->is_enabled() && ajaxenabled()) {
$PAGE->requires->yui2_lib('connection');
$PAGE->requires->js('course/completion.js')->in_head();
$PAGE->requires->js('/course/completion.js')->in_head();
$PAGE->requires->js_function_call('completion_init')->on_dom_ready();
$PAGE->requires->data_for_js('completion_strsaved', get_string('saved', 'completion'));
$PAGE->requires->data_for_js('completion_strtitley', get_string('completion-title-manual-y', 'completion'));
Expand Down
2 changes: 1 addition & 1 deletion enrol/authorize/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function authorize_print_orders($courseid, $userid) {
if ($canmanagepayments) {
$popupmenu .= '<br />';
$checkbox = html_select_option::make_checkbox(1, $userid == $USER->id, get_string('mypaymentsonly', 'enrol_authorize'));
$PAGE->requires->js('enrol/authorize/authorize.js');
$PAGE->requires->js('/enrol/authorize/authorize.js');
$checkbox->add_action('click', 'authorize_jump_to_mypayments', array('userid' => $USER->id, 'status' => $status));
$popupmenu .= $OUTPUT->checkbox($checkbox, 'showonlymy');
}
Expand Down
8 changes: 4 additions & 4 deletions filter/mediaplugin/filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function filter($text) {
}

if (!$this->eolas_fix_applied) {
$PAGE->requires->js('filter/mediaplugin/eolas_fix.js');
$PAGE->requires->js('/filter/mediaplugin/eolas_fix.js');
$this->eolas_fix_applied = true;
}

Expand Down Expand Up @@ -148,7 +148,7 @@ function mediaplugin_filter_mp3_callback($link) {
$args['flashvars'] = $c;
$args['quality'] = 'high';

$jsoutput = $PAGE->requires->js('lib/ufo.js')->asap();
$jsoutput = $PAGE->requires->js('/lib/ufo.js')->asap();
$jsoutput .= $PAGE->requires->data_for_js('FO', $args)->asap();
$jsoutput .= $PAGE->requires->js_function_call('create_UFO_object', Array($id))->asap();

Expand All @@ -175,7 +175,7 @@ function mediaplugin_filter_swf_callback($link) {
$args['build'] = 40;
$args['allowscriptaccess'] = 'never';
$args['quality'] = 'high';
$jsoutput = $PAGE->requires->js('lib/ufo.js')->asap();
$jsoutput = $PAGE->requires->js('/lib/ufo.js')->asap();
$jsoutput .= $PAGE->requires->data_for_js('FO', $args)->asap();
$jsoutput .= $PAGE->requires->js_function_call('create_UFO_object', Array($id))->asap();

Expand Down Expand Up @@ -204,7 +204,7 @@ function mediaplugin_filter_flv_callback($link) {
$args['allowscriptaccess'] = 'never';
$args['quality'] = 'high';
$args['allowfullscreen'] = 'true';
$jsoutput = $PAGE->requires->js('lib/ufo.js')->asap();
$jsoutput = $PAGE->requires->js('/lib/ufo.js')->asap();
$jsoutput .= $PAGE->requires->data_for_js('FO', $args)->asap();
$jsoutput .= $PAGE->requires->js_function_call('create_UFO_object', Array($id))->asap();

Expand Down
2 changes: 1 addition & 1 deletion grade/edit/tree/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
$PAGE->requires->yui2_lib('element');
$PAGE->requires->yui2_lib('container');
$PAGE->requires->yui2_lib('animation');
$PAGE->requires->js('grade/edit/tree/functions.js');
$PAGE->requires->js('/grade/edit/tree/functions.js');

$courseid = required_param('id', PARAM_INT);
$action = optional_param('action', 0, PARAM_ALPHA);
Expand Down
8 changes: 4 additions & 4 deletions grade/report/grader/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@
$PAGE->requires->yui2_lib('dragdrop');
$PAGE->requires->yui2_lib('element');
$PAGE->requires->yui2_lib('container');
$PAGE->requires->js('grade/report/grader/functions.js');
$PAGE->requires->js('grade/report/grader/grader.js');
$PAGE->requires->js('lib/overlib/overlib.js')->in_head();
$PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
$PAGE->requires->js('/grade/report/grader/functions.js');
$PAGE->requires->js('/grade/report/grader/grader.js');
$PAGE->requires->js('/lib/overlib/overlib.js')->in_head();
$PAGE->requires->js('/lib/overlib/overlib_cssstyle.js')->in_head();

if ($report->get_pref('enableajax')) {
$report = new grade_report_grader_ajax($courseid, $gpr, $context, $page, $sortitemid);
Expand Down
2 changes: 1 addition & 1 deletion group/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
ini_set('include_path', $CFG->libdir.'/pear'.PATH_SEPARATOR.ini_get('include_path'));

$PAGE->requires->yui2_lib('connection');
$PAGE->requires->js('group/clientlib.js');
$PAGE->requires->js('/group/clientlib.js');

$courseid = required_param('id', PARAM_INT);
$groupid = optional_param('group', false, PARAM_INT);
Expand Down
2 changes: 1 addition & 1 deletion group/members.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

$groupname = format_string($group->name);

$PAGE->requires->js('group/clientlib.js');
$PAGE->requires->js('/group/clientlib.js');
$PAGE->navbar->add($strparticipants, new moodle_url('/user/index.php', array('id'=>$courseid)));
$PAGE->navbar->add($strgroups, new moodle_url('/group/index.php', array('id'=>$courseid)));
$PAGE->navbar->add($stradduserstogroup);
Expand Down
4 changes: 2 additions & 2 deletions group/overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@
$rs->close();
}

$PAGE->requires->js('lib/overlib/overlib.js')->in_head();
$PAGE->requires->js('lib/overlib/overlib_cssstyle.js')->in_head();
$PAGE->requires->js('/lib/overlib/overlib.js')->in_head();
$PAGE->requires->js('/lib/overlib/overlib_cssstyle.js')->in_head();

$PAGE->navbar->add($strparticipants, new moodle_url('/user/index.php', array('id'=>$courseid)));
$PAGE->navbar->add($strgroups);
Expand Down
8 changes: 4 additions & 4 deletions lib/ajax/ajaxlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
*
* Typical useage would be
* <pre>
* $PAGE->requires->css('mod/mymod/userstyles.php?id='.$id); // not overriddable via themes!
* $PAGE->requires->js('mod/mymod/script.js');
* $PAGE->requires->js('mod/mymod/small_but_urgent.js')->in_head();
* $PAGE->requires->css('/mod/mymod/userstyles.php?id='.$id); // not overriddable via themes!
* $PAGE->requires->js('/mod/mymod/script.js');
* $PAGE->requires->js('/mod/mymod/small_but_urgent.js')->in_head();
* $PAGE->requires->js_function_call('init_mymod', array($data))->on_dom_ready();
* </pre>
*
Expand Down Expand Up @@ -881,7 +881,7 @@ abstract public function get_html();
*
* The methods {@link asap()}, {@link in_head()} and {@link at_top_of_body()}
* are indented to be used as a fluid API, so you can say things like
* $PAGE->requires->js('mod/mymod/script.js')->in_head();
* $PAGE->requires->js('/mod/mymod/script.js')->in_head();
*
* However, by default JavaScript files are included at the end of the HTML.
* This is recommended practice because it means that the web browser will only
Expand Down
2 changes: 1 addition & 1 deletion lib/commentlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public static function js() {
$PAGE->requires->yui2_lib('animation');
$PAGE->requires->yui2_lib('json');
$PAGE->requires->yui2_lib('connection');
$PAGE->requires->js('comment/comment.js')->in_head();
$PAGE->requires->js('/comment/comment.js')->in_head();
$PAGE->requires->string_for_js('addcomment', 'moodle');
$PAGE->requires->string_for_js('deletecomment', 'moodle');
$PAGE->requires->string_for_js('comments', 'moodle');
Expand Down
2 changes: 1 addition & 1 deletion lib/deprecatedlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1698,7 +1698,7 @@ function require_js($lib) {
if (strpos($lib, 'yui_') === 0) {
$PAGE->requires->yui2_lib(substr($lib, 4));
} else if (preg_match('/^https?:/', $lib)) {
echo $PAGE->requires->js(str_replace($CFG->wwwroot, '', $lib))->asap();
echo $PAGE->requires->js(str_replace($CFG->wwwroot, '/', $lib))->asap();
} else {
echo $PAGE->requires->js($lib)->asap();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/form/editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element {

function MoodleQuickForm_editor($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
global $CFG, $PAGE;
$PAGE->requires->js('lib/form/filepicker.js');
$PAGE->requires->js('/lib/form/filepicker.js');

$options = (array)$options;
foreach ($options as $name=>$value) {
Expand Down
4 changes: 2 additions & 2 deletions lib/form/filemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ function MoodleQuickForm_filemanager($elementName=null, $elementLabel=null, $att
$this->_options['maxbytes'] = get_max_upload_file_size($CFG->maxbytes, $options['maxbytes']);
}
parent::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
$PAGE->requires->js('repository/filepicker.js');
$PAGE->requires->js('lib/form/filemanager.js');
$PAGE->requires->js('/repository/filepicker.js');
$PAGE->requires->js('/lib/form/filemanager.js');
}

function setName($name) {
Expand Down
2 changes: 1 addition & 1 deletion lib/form/filepicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function toHtml() {
}

$client_id = uniqid();
$PAGE->requires->js('lib/form/filepicker.js');
$PAGE->requires->js('/lib/form/filepicker.js');

$args = new stdclass;
// need these three to filter repositories list
Expand Down
2 changes: 1 addition & 1 deletion lib/form/passwordunmask.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function toHtml() {
$id = $this->getAttribute('id');
$unmask = get_string('unmaskpassword', 'form');
$unmaskjs = $PAGE->requires->data_for_js('punmask',Array('id'=>$id, 'unmaskstr'=>$unmask))->asap();
$unmaskjs .= $PAGE->requires->js('lib/form/passwordunmask.js')->asap();
$unmaskjs .= $PAGE->requires->js('/lib/form/passwordunmask.js')->asap();
return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' /><div class="unmask" id="'.$id.'unmaskdiv"></div>'.$unmaskjs;
}
} //end func toHtml
Expand Down
2 changes: 1 addition & 1 deletion lib/form/searchableselector.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function toHtml(){
// Javascript for the search/selection fields
global $PAGE;
$PAGE->requires->yui2_lib('event');
$PAGE->requires->js('lib/form/searchableselector.js');
$PAGE->requires->js('/lib/form/searchableselector.js');
$PAGE->requires->js_function_call('selector.filter_init', array(get_string('search'),$this->getAttribute('id')));

$strHtml = '';
Expand Down
2 changes: 1 addition & 1 deletion lib/form/url.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function toHtml(){

$repojs = repository_get_client($context, $client_id, '*', FILE_EXTERNAL);

$PAGE->requires->js('lib/form/url.js');
$PAGE->requires->js('/lib/form/url.js');
$str .= $repojs;
$str .= <<<EOD
<button id="filepicker-btn-{$client_id}" style="display:none" onclick="return url_launch_filepicker('$id', '$client_id', 0)">$straddlink</button>
Expand Down
Loading

0 comments on commit 9dec75d

Please sign in to comment.