Merge branch 'MDL-32908' of git://github.com/danpoltawski/moodle

This commit is contained in:
Sam Hemelryk
2012-06-20 10:31:52 +12:00
10 changed files with 27 additions and 34 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ $today = make_timestamp(date('Y', $today), date('m', $today), date('d', $today),
// array of all valid fields for validation
$STD_FIELDS = array('id', 'firstname', 'lastname', 'username', 'email',
'city', 'country', 'lang', 'timezone', 'mailformat',
'maildisplay', 'maildigest', 'htmleditor', 'ajax', 'autosubscribe',
'maildisplay', 'maildigest', 'htmleditor', 'autosubscribe',
'institution', 'department', 'idnumber', 'skype',
'msn', 'aim', 'yahoo', 'icq', 'phone1', 'phone2', 'address',
'url', 'description', 'descriptionformat', 'password',
-9
View File
@@ -248,15 +248,6 @@ class admin_uploaduser_form2 extends moodleform {
$mform->setType('htmleditor', PARAM_INT);
}
if (empty($CFG->enableajax)) {
$mform->addElement('static', 'ajax', get_string('ajaxuse'), get_string('ajaxno'));
} else {
$choices = array( 0 => get_string('ajaxno'), 1 => get_string('ajaxyes'));
$mform->addElement('select', 'ajax', get_string('ajaxuse'), $choices);
$mform->setDefault('ajax', 1);
}
$mform->setAdvanced('ajax');
$mform->addElement('text', 'city', get_string('city'), 'maxlength="100" size="25"');
$mform->setType('city', PARAM_MULTILANG);
if (empty($CFG->defaultcity)) {
+1 -1
View File
@@ -1069,7 +1069,7 @@ class backup_users_structure_step extends backup_structure_step {
'lang', 'theme', 'timezone', 'firstaccess',
'lastaccess', 'lastlogin', 'currentlogin',
'mailformat', 'maildigest', 'maildisplay', 'htmleditor',
'ajax', 'autosubscribe', 'trackforums', 'timecreated',
'autosubscribe', 'trackforums', 'timecreated',
'timemodified', 'trustbitmask', 'screenreader');
// Then, the fields potentially needing anonymization
-2
View File
@@ -114,9 +114,7 @@ $string['advancedfilter'] = 'Advanced search';
$string['advancedsettings'] = 'Advanced settings';
$string['again'] = 'again';
$string['aimid'] = 'AIM ID';
$string['ajaxno'] = 'No: use basic web features';
$string['ajaxuse'] = 'AJAX and Javascript';
$string['ajaxyes'] = 'Yes: use advanced web features';
$string['all'] = 'All';
$string['allactions'] = 'All actions';
$string['allactivities'] = 'All activities';
+3 -3
View File
@@ -49,7 +49,7 @@ function user_preference_allow_ajax_update($name, $paramtype) {
* @return bool
*/
function ajaxenabled(array $browsers = null) {
global $CFG, $USER;
global $CFG;
if (!empty($browsers)) {
$valid = false;
@@ -77,9 +77,9 @@ function ajaxenabled(array $browsers = null) {
return false;
}
if (!empty($CFG->enableajax) && (!empty($USER->ajax) || !isloggedin())) {
if (!empty($CFG->enableajax)) {
return true;
} else {
return false;
}
}
}
+1 -2
View File
@@ -65,12 +65,11 @@ class ajax_testcase extends advanced_testcase {
* Uses the array of user agents to test ajax_lib::ajaxenabled
*/
function test_ajaxenabled() {
global $CFG, $USER;
global $CFG;
$this->resetAfterTest(true);
$CFG->enableajax = 1;
$USER->ajax = 1;
// Should be true
$_SERVER['HTTP_USER_AGENT'] = $this->user_agents['Firefox']['2.0']['Windows XP'];
Regular → Executable
+4 -5
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20120531" COMMENT="XMLDB file for core Moodle tables"
<XMLDB PATH="lib/db" VERSION="20120618" COMMENT="XMLDB file for core Moodle tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
>
@@ -754,9 +754,8 @@
<FIELD NAME="mailformat" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="descriptionformat" NEXT="maildigest"/>
<FIELD NAME="maildigest" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="mailformat" NEXT="maildisplay"/>
<FIELD NAME="maildisplay" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="2" SEQUENCE="false" PREVIOUS="maildigest" NEXT="htmleditor"/>
<FIELD NAME="htmleditor" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="maildisplay" NEXT="ajax"/>
<FIELD NAME="ajax" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="htmleditor" NEXT="autosubscribe"/>
<FIELD NAME="autosubscribe" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="ajax" NEXT="trackforums"/>
<FIELD NAME="htmleditor" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="maildisplay" NEXT="autosubscribe"/>
<FIELD NAME="autosubscribe" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="htmleditor" NEXT="trackforums"/>
<FIELD NAME="trackforums" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="autosubscribe" NEXT="timecreated"/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="trackforums" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timecreated" NEXT="trustbitmask"/>
@@ -2874,4 +2873,4 @@
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
</XMLDB>
+16
View File
@@ -830,5 +830,21 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2012060600.04);
}
if ($oldversion < 2012061800.01) {
// Define field screenreader to be dropped from user
$table = new xmldb_table('user');
$field = new xmldb_field('ajax');
// Conditionally launch drop field screenreader
if ($dbman->field_exists($table, $field)) {
$dbman->drop_field($table, $field);
}
// Main savepoint reached
upgrade_main_savepoint(true, 2012061800.01);
}
return true;
}
-10
View File
@@ -196,16 +196,6 @@ function useredit_shared_definition(&$mform, $editoroptions = null) {
$mform->setType('htmleditor', PARAM_INT);
}
if (empty($CFG->enableajax)) {
$mform->addElement('static', 'ajaxdisabled', get_string('ajaxuse'), get_string('ajaxno'));
} else {
$choices = array();
$choices['0'] = get_string('ajaxno');
$choices['1'] = get_string('ajaxyes');
$mform->addElement('select', 'ajax', get_string('ajaxuse'), $choices);
$mform->setDefault('ajax', 1);
}
$choices = array();
$choices['0'] = get_string('screenreaderno');
$choices['1'] = get_string('screenreaderyes');
+1 -1
View File
@@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2012061800.00; // YYYYMMDD = weekly release date of this DEV branch
$version = 2012061800.01; // YYYYMMDD = weekly release date of this DEV branch
// RR = release increments - 00 in DEV branches
// .XX = incremental changes