mirror of
https://github.com/moodle/moodle.git
synced 2025-06-02 06:05:31 +02:00
MDL-6544
resolved issue by passing strings into new main.portal.strings for delocalization.
This commit is contained in:
parent
94e65cc36c
commit
e78a3505c5
@ -43,7 +43,6 @@ function main_class(){
|
||||
//this.logview = new YAHOO.widget.LogReader('header');
|
||||
|
||||
|
||||
|
||||
this.icons = [];
|
||||
this.marker = null;
|
||||
|
||||
@ -138,7 +137,7 @@ main_class.prototype.mk_button = function(tag,imgSrc,attributes,imgAttributes){
|
||||
var container = document.createElement(tag);
|
||||
container.style.cursor = 'pointer';
|
||||
var image = document.createElement('img');
|
||||
image.setAttribute('src',main.portal.wwwroot+imgSrc);
|
||||
image.setAttribute('src',main.portal.strings['wwwroot']+imgSrc);
|
||||
container.appendChild(image);
|
||||
|
||||
if(attributes != null)
|
||||
@ -157,7 +156,7 @@ main_class.prototype.connect = function(method,urlStub,callback,body){
|
||||
if(callback == null){
|
||||
callback = {}
|
||||
}
|
||||
return YAHOO.util.Connect.asyncRequest(method,this.portal.wwwroot+"/course/format/topics/commands.php?courseId="+main.portal.id+"&"+urlStub,callback,body);
|
||||
return YAHOO.util.Connect.asyncRequest(method,this.portal.strings['wwwroot']+"/course/format/topics/commands.php?courseId="+main.portal.id+"&"+urlStub,callback,body);
|
||||
|
||||
|
||||
}
|
||||
@ -219,6 +218,9 @@ function php_portal_class(){
|
||||
|
||||
//flag for week fomat
|
||||
this.isWeek = false;
|
||||
|
||||
//strings
|
||||
this.strings = [];
|
||||
|
||||
YAHOO.log("instantiated php_portal_class","info");
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Library functions for using ajax with moodle
|
||||
**/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*Print require statements for javascript libraries
|
||||
*Takes in an array of either full paths or shortnames and it will translate them to full paths
|
||||
@ -63,11 +63,12 @@
|
||||
$blocksoutput.=",";
|
||||
}
|
||||
|
||||
global $CFG;
|
||||
global $CFG;
|
||||
$output .="<script language='javascript'>\r";
|
||||
$output .=" main.portal.id = ".$id."\r";
|
||||
$output .=" main.portal.id = ".$id."\r";
|
||||
$output .=" main.portal.blocks = new Array(".$blocksoutput.");\r";
|
||||
$output .=" main.portal.wwwroot = '".$CFG->wwwroot."';\r";
|
||||
$output .=" main.portal.strings['wwwroot']='".$CFG->wwwroot."';\r";
|
||||
$output .=" main.portal.strings['update']='".get_string('update')."';\r";
|
||||
$output .=" onload.load()\r";
|
||||
$output .=" main.process_blocks();\r";
|
||||
$output .="</script>";
|
||||
|
@ -499,7 +499,7 @@ resource_class.prototype.init_buttons = function(){
|
||||
var updateButton = null;
|
||||
var buttons = commandContainer.getElementsByTagName('a');
|
||||
for (var x=0;x<buttons.length;x++) {
|
||||
if (buttons[x].title == '<?php print_string('update'); ?>') {
|
||||
if (buttons[x].title == main.portal.strings['update']) {
|
||||
updateButton = buttons[x];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user