Added new field 'ajax' to user table, to store AJAX preference
This commit is contained in:
@@ -1087,6 +1087,7 @@
|
||||
fwrite ($bf,full_tag("MAILDIGEST",4,false,$user_data->maildigest));
|
||||
fwrite ($bf,full_tag("MAILDISPLAY",4,false,$user_data->maildisplay));
|
||||
fwrite ($bf,full_tag("HTMLEDITOR",4,false,$user_data->htmleditor));
|
||||
fwrite ($bf,full_tag("AJAX",4,false,$user_data->ajax));
|
||||
fwrite ($bf,full_tag("AUTOSUBSCRIBE",4,false,$user_data->autosubscribe));
|
||||
fwrite ($bf,full_tag("TRACKFORUMS",4,false,$user_data->trackforums));
|
||||
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$user_data->timemodified));
|
||||
|
||||
@@ -3990,6 +3990,9 @@
|
||||
case "HTMLEDITOR":
|
||||
$this->info->tempuser->htmleditor = $this->getContents();
|
||||
break;
|
||||
case "AJAX":
|
||||
$this->info->tempuser->ajax = $this->getContents();
|
||||
break;
|
||||
case "AUTOSUBSCRIBE":
|
||||
$this->info->tempuser->autosubscribe = $this->getContents();
|
||||
break;
|
||||
|
||||
+2
-1
@@ -573,7 +573,8 @@
|
||||
<FIELD NAME="mailformat" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="description" NEXT="maildigest"/>
|
||||
<FIELD NAME="maildigest" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="mailformat" NEXT="maildisplay"/>
|
||||
<FIELD NAME="maildisplay" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="2" SEQUENCE="false" ENUM="false" PREVIOUS="maildigest" NEXT="htmleditor"/>
|
||||
<FIELD NAME="htmleditor" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="maildisplay" NEXT="autosubscribe"/>
|
||||
<FIELD NAME="htmleditor" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="maildisplay" NEXT="ajax"/>
|
||||
<FIELD NAME="ajax" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="htmleditor" NEXT="autosubscribe"/>
|
||||
<FIELD NAME="autosubscribe" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="htmleditor" NEXT="trackforums"/>
|
||||
<FIELD NAME="trackforums" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="autosubscribe" NEXT="timemodified"/>
|
||||
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="trackforums"/>
|
||||
|
||||
@@ -2137,6 +2137,10 @@ function main_upgrade($oldversion=0) {
|
||||
if ($oldversion < 2006082200) {
|
||||
table_column('timezone', 'rule', 'tzrule', 'varchar', '20', '', '', 'not null', '');
|
||||
}
|
||||
|
||||
if ($oldversion < 2006082800) {
|
||||
table_column('user', '', 'ajax', 'integer', '1', 'unsigned', '1', '', 'htmleditor');
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -618,6 +618,7 @@ CREATE TABLE `prefix_user` (
|
||||
`maildigest` tinyint(1) unsigned NOT NULL default '0',
|
||||
`maildisplay` tinyint(2) unsigned NOT NULL default '2',
|
||||
`htmleditor` tinyint(1) unsigned NOT NULL default '1',
|
||||
`ajax` tinyint(1) unsigned NOT NULL default '1',
|
||||
`autosubscribe` tinyint(1) unsigned NOT NULL default '1',
|
||||
`trackforums` tinyint(1) unsigned NOT NULL default '0',
|
||||
`timemodified` int(10) unsigned NOT NULL default '0',
|
||||
|
||||
@@ -1737,6 +1737,10 @@ function main_upgrade($oldversion=0) {
|
||||
table_column('timezone', 'rule', 'tzrule', 'varchar', '20', '', '', 'not null', '');
|
||||
}
|
||||
|
||||
if ($oldversion < 2006082800) {
|
||||
table_column('user', '', 'ajax', 'integer', '1', 'unsigned', '1', '', 'htmleditor');
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@@ -437,6 +437,7 @@ CREATE TABLE prefix_user (
|
||||
maildigest integer NOT NULL default '0',
|
||||
maildisplay integer NOT NULL default '2',
|
||||
htmleditor integer NOT NULL default '1',
|
||||
ajax integer NOT NULL default '1',
|
||||
autosubscribe integer NOT NULL default '1',
|
||||
trackforums integer NOT NULL default '0',
|
||||
timemodified integer NOT NULL default '0'
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
if (!isset($user->htmleditor)) {
|
||||
$user->htmleditor = 1;
|
||||
}
|
||||
if (!isset($user->ajax)) {
|
||||
$user->ajax = 1;
|
||||
}
|
||||
if (!isset($user->picture)) {
|
||||
$user->picture = NULL;
|
||||
}
|
||||
@@ -193,6 +196,15 @@ if (has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM, SI
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<th><?php print_string("ajaxuse") ?>:</th>
|
||||
<td><?php
|
||||
unset($choices);
|
||||
$choices["0"] = get_string("ajaxno");
|
||||
$choices["1"] = get_string("ajaxyes");
|
||||
choose_from_menu ($choices, 'ajax', $user->ajax, "") ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php print_string("city") ?>:</th>
|
||||
<td>
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
// This is compared against the values stored in the database to determine
|
||||
// whether upgrades should be performed (see lib/db/*.php)
|
||||
|
||||
$version = 2006082600; // YYYYMMDD = date
|
||||
$version = 2006082800; // YYYYMMDD = date
|
||||
// XY = increments within a single day
|
||||
|
||||
$release = '1.7 dev'; // Human-friendly version name
|
||||
|
||||
Reference in New Issue
Block a user