block editing now uses PARAM_BOOL
This commit is contained in:
+5
-5
@@ -62,7 +62,7 @@
|
||||
$pageblocks = blocks_setup($PAGE,BLOCKS_PINNED_BOTH);
|
||||
|
||||
if (!isset($USER->editing)) {
|
||||
$USER->editing = false;
|
||||
$USER->editing = 0;
|
||||
}
|
||||
|
||||
if (!isset($USER->studentview)) {
|
||||
@@ -76,9 +76,9 @@
|
||||
|
||||
if ($PAGE->user_allowed_editing()) {
|
||||
if (($edit == 1) and confirm_sesskey()) {
|
||||
$USER->editing = true;
|
||||
$USER->editing = 1;
|
||||
} else if (($edit == 0) and confirm_sesskey()) {
|
||||
$USER->editing = false;
|
||||
$USER->editing = 0;
|
||||
if(!empty($USER->activitycopy) && $USER->activitycopycourse == $course->id) {
|
||||
$USER->activitycopy = false;
|
||||
$USER->activitycopycourse = NULL;
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
if (($studentview == 1) and confirm_sesskey()) {
|
||||
$USER->studentview = true;
|
||||
$USER->editing = false;
|
||||
$USER->editing = 0;
|
||||
}
|
||||
|
||||
if ($hide && confirm_sesskey()) {
|
||||
@@ -106,7 +106,7 @@
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$USER->editing = false;
|
||||
$USER->editing = 0;
|
||||
}
|
||||
|
||||
$SESSION->fromdiscussion = $CFG->wwwroot .'/course/view.php?id='. $course->id;
|
||||
|
||||
+4
-4
@@ -3372,10 +3372,10 @@ function update_course_icon($courseid) {
|
||||
if (isteacheredit($courseid)) {
|
||||
if (!empty($USER->editing)) {
|
||||
$string = get_string('turneditingoff');
|
||||
$edit = 'off';
|
||||
$edit = '0';
|
||||
} else {
|
||||
$string = get_string('turneditingon');
|
||||
$edit = 'on';
|
||||
$edit = '1';
|
||||
}
|
||||
return "<form target=\"$CFG->framename\" method=\"get\" action=\"$CFG->wwwroot/course/view.php\">".
|
||||
"<input type=\"hidden\" name=\"id\" value=\"$courseid\" />".
|
||||
@@ -3429,10 +3429,10 @@ function update_mymoodle_icon() {
|
||||
|
||||
if (!empty($USER->editing)) {
|
||||
$string = get_string('updatemymoodleoff');
|
||||
$edit = 'off';
|
||||
$edit = '0';
|
||||
} else {
|
||||
$string = get_string('updatemymoodleon');
|
||||
$edit = 'on';
|
||||
$edit = '1';
|
||||
}
|
||||
return "<form target=\"$CFG->framename\" method=\"get\" action=\"$CFG->wwwroot/my/index.php\">".
|
||||
"<input type=\"hidden\" name=\"edit\" value=\"$edit\" />".
|
||||
|
||||
+5
-9
@@ -7,9 +7,9 @@
|
||||
require_once($CFG->libdir.'/blocklib.php');
|
||||
require_once('pagelib.php');
|
||||
|
||||
$id = optional_param('id', 0, PARAM_INT);
|
||||
$c = optional_param('c', 0, PARAM_INT);
|
||||
$edit = optional_param('edit', '');
|
||||
$id = optional_param('id', 0, PARAM_INT);
|
||||
$c = optional_param('c', 0, PARAM_INT);
|
||||
$edit = optional_param('edit', -1, PARAM_BOOL);
|
||||
|
||||
if ($id) {
|
||||
if (! $cm = get_record('course_modules', 'id', $id)) {
|
||||
@@ -57,12 +57,8 @@
|
||||
$strcurrentusers = get_string('currentusers', 'chat');
|
||||
$strnextsession = get_string('nextsession', 'chat');
|
||||
|
||||
if (!empty($edit) && $PAGE->user_allowed_editing()) {
|
||||
if ($edit == 'on') {
|
||||
$USER->editing = true;
|
||||
} else if ($edit == 'off') {
|
||||
$USER->editing = false;
|
||||
}
|
||||
if (($edit != -1) and $PAGE->user_allowed_editing()) {
|
||||
$USER->editing = $edit;
|
||||
}
|
||||
|
||||
$PAGE->print_header($course->shortname.': %fullname%');
|
||||
|
||||
+3
-6
@@ -37,6 +37,7 @@
|
||||
|
||||
$mode = optional_param('mode', '', PARAM_ALPHA); // Force the browse mode ('single')
|
||||
|
||||
$edit = optional_param('edit', -1, PARAM_BOOL);
|
||||
|
||||
/// These can be added to perform an action on a record
|
||||
$approve = optional_param('approve', 0, PARAM_INT); //approval recordid
|
||||
@@ -142,12 +143,8 @@
|
||||
$pageblocks = blocks_setup($PAGE);
|
||||
$blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]), 210);
|
||||
|
||||
if (!empty($edit) && $PAGE->user_allowed_editing()) {
|
||||
if ($edit == 'on') {
|
||||
$USER->editing = true;
|
||||
} else if ($edit == 'off') {
|
||||
$USER->editing = false;
|
||||
}
|
||||
if (($edit != -1) and $PAGE->user_allowed_editing()) {
|
||||
$USER->editing = $edit;
|
||||
}
|
||||
|
||||
/// RSS and CSS meta
|
||||
|
||||
+5
-9
@@ -7,9 +7,9 @@
|
||||
require_once($CFG->libdir.'/blocklib.php');
|
||||
require_once('pagelib.php');
|
||||
|
||||
$id = optional_param('id', 0, PARAM_INT); // Course Module ID, or
|
||||
$q = optional_param('q', 0, PARAM_INT); // quiz ID
|
||||
$edit = optional_param('edit', '');
|
||||
$id = optional_param('id', 0, PARAM_INT); // Course Module ID, or
|
||||
$q = optional_param('q', 0, PARAM_INT); // quiz ID
|
||||
$edit = optional_param('edit', -1, PARAM_BOOL);
|
||||
|
||||
if ($id) {
|
||||
if (! $cm = get_record("course_modules", "id", $id)) {
|
||||
@@ -56,12 +56,8 @@
|
||||
|
||||
// Print the page header
|
||||
|
||||
if (!empty($edit) && $PAGE->user_allowed_editing()) {
|
||||
if ($edit == 'on') {
|
||||
$USER->editing = true;
|
||||
} else if ($edit == 'off') {
|
||||
$USER->editing = false;
|
||||
}
|
||||
if (($edit != -1) and $PAGE->user_allowed_editing()) {
|
||||
$USER->editing = $edit;
|
||||
}
|
||||
|
||||
//only check pop ups if the user is not a teacher, and popup is set
|
||||
|
||||
@@ -148,13 +148,12 @@ function display_course_blocks_start() {
|
||||
|
||||
/// Print the page header
|
||||
|
||||
if (!empty($edit) && $PAGE->user_allowed_editing()) {
|
||||
if ($edit == 'on') {
|
||||
$USER->editing = true;
|
||||
} else if ($edit == 'off') {
|
||||
$USER->editing = false;
|
||||
}
|
||||
$edit = optional_param('edit', -1, PARAM_BOOL);
|
||||
|
||||
if (($edit != -1) and $PAGE->user_allowed_editing()) {
|
||||
$USER->editing = $edit;
|
||||
}
|
||||
|
||||
$morebreadcrumbs = array($this->strresources => 'index.php?id='.$this->course->id,
|
||||
$this->resource->name => '');
|
||||
|
||||
|
||||
+4
-8
@@ -24,19 +24,15 @@
|
||||
}
|
||||
|
||||
|
||||
$edit = optional_param('edit', '');
|
||||
$blockaction = optional_param('blockaction');
|
||||
$edit = optional_param('edit', -1, PARAM_BOOL);
|
||||
$blockaction = optional_param('blockaction', '', PARAM_ALPHA);
|
||||
|
||||
$PAGE = page_create_instance($USER->id);
|
||||
|
||||
$pageblocks = blocks_setup($PAGE,BLOCKS_PINNED_BOTH);
|
||||
|
||||
if (!empty($edit) && $PAGE->user_allowed_editing()) {
|
||||
if ($edit == 'on') {
|
||||
$USER->editing = true;
|
||||
} else if ($edit == 'off') {
|
||||
$USER->editing = false;
|
||||
}
|
||||
if (($edit != -1) and $PAGE->user_allowed_editing()) {
|
||||
$USER->editing = $edit;
|
||||
}
|
||||
|
||||
$PAGE->print_header($mymoodlestr);
|
||||
|
||||
Reference in New Issue
Block a user