// 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',
$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)) {
'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
$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';
* @return bool
*/
function ajaxenabled(array $browsers = null) {
- global $CFG, $USER;
+ global $CFG;
if (!empty($browsers)) {
$valid = false;
return false;
}
- if (!empty($CFG->enableajax) && (!empty($USER->ajax) || !isloggedin())) {
+ if (!empty($CFG->enableajax)) {
return true;
} else {
return false;
}
-}
\ No newline at end of file
+}
* 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'];
<?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"
>
<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"/>
</KEYS>
</TABLE>
</TABLES>
-</XMLDB>
+</XMLDB>
\ No newline at end of file
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;
}
$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');
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