MDL-33084 grade: made localize() and unlocalize() in lib/mathslib.php static as they are used as if they were static

This commit is contained in:
Andrew Davis 2012-05-20 09:47:18 +07:00
parent 4f7f2a8828
commit 8c222e1768

View File

@ -115,7 +115,7 @@ class calc_formula {
* @param string $formula
* @return string localised formula
*/
function localize($formula) {
public static function localize($formula) {
$formula = str_replace('.', '$', $formula); // temp placeholder
$formula = str_replace(',', get_string('listsep', 'langconfig'), $formula);
$formula = str_replace('$', get_string('decsep', 'langconfig'), $formula);
@ -127,7 +127,7 @@ class calc_formula {
* @param string $formula localised formula
* @return string
*/
function unlocalize($formula) {
public static function unlocalize($formula) {
$formula = str_replace(get_string('decsep', 'langconfig'), '$', $formula);
$formula = str_replace(get_string('listsep', 'langconfig'), ',', $formula);
$formula = str_replace('$', '.', $formula); // temp placeholder