Permalink
Browse files

MDL-9392 resource_popup: not working

  • Loading branch information...
1 parent ddb5da6 commit 4b4a3f4d40587e9e829dd06e0bc2dfc1afa09fb6 skodak committed May 16, 2007
@@ -586,7 +586,11 @@ function set_encrypted_parameter() {
}
function setup_preprocessing(&$defaults){
- if (!empty($defaults['popup'])) {
+
+ if (!isset($defaults['popup'])) {
+ // use form defaults
+
+ } else if (!empty($defaults['popup'])) {
$defaults['windowpopup'] = 1;
if (array_key_exists('popup', $defaults)) {
$rawoptions = explode(',', $defaults['popup']);
@@ -72,7 +72,7 @@ function display() {
$pagetitle = strip_tags($course->shortname.': '.format_string($resource->name));
$inpopup = optional_param('inpopup', '', PARAM_BOOL);
- // fix for MDL-9021, thanks Etienne Rozé
+ // fix for MDL-9021, thanks Etienne Roz�
add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id);
if ($resource->popup) {
@@ -127,7 +127,11 @@ function display() {
}
function setup_preprocessing(&$defaults){
- if (!empty($defaults['popup'])) {
+
+ if (!isset($defaults['popup'])) {
+ // use form defaults
+
+ } else if (!empty($defaults['popup'])) {
$defaults['windowpopup'] = 1;
if (array_key_exists('popup', $defaults)) {
$rawoptions = explode(',', $defaults['popup']);
@@ -156,7 +160,7 @@ function setup_elements(&$mform) {
$woptions = array(0 => get_string('pagewindow', 'resource'), 1 => get_string('newwindow', 'resource'));
$mform->addElement('select', 'windowpopup', get_string('display', 'resource'), $woptions);
- $mform->setDefault('windowpopup', !empty($CFG->resource_popup));
+ $mform->setDefault('windowpopup', (int)!empty($CFG->resource_popup));
$mform->addElement('checkbox', 'blockdisplay', get_string('showcourseblocks', 'resource'));
$mform->setDefault('blockdisplay', 0);
@@ -602,7 +602,11 @@ function print_nav($items, $resource, $page) {
function setup_preprocessing(&$defaults){
- if (!empty($defaults['popup'])) {
+
+ if (!isset($defaults['popup'])) {
+ // use form defaults
+
+ } else if (!empty($defaults['popup'])) {
$defaults['windowpopup'] = 1;
if (array_key_exists('popup', $defaults)) {
$rawoptions = explode(',', $defaults['popup']);
@@ -512,7 +512,11 @@ function set_encrypted_parameter() {
function setup_preprocessing(&$defaults){
- if (!empty($defaults['popup'])) {
+
+ if (!isset($defaults['popup'])) {
+ // use form defaults
+
+ } else if (!empty($defaults['popup'])) {
$defaults['windowpopup'] = 1;
if (array_key_exists('popup', $defaults)) {
$rawoptions = explode(',', $defaults['popup']);
@@ -129,7 +129,11 @@ function display() {
function setup_preprocessing(&$defaults){
- if (!empty($defaults['popup'])) {
+
+ if (!isset($defaults['popup'])) {
+ // use form defaults
+
+ } else if (!empty($defaults['popup'])) {
$defaults['windowpopup'] = 1;
if (array_key_exists('popup', $defaults)) {
$rawoptions = explode(',', $defaults['popup']);

0 comments on commit 4b4a3f4

Please sign in to comment.