From f6bb9a93a3783e55c964df61623ece999a569826 Mon Sep 17 00:00:00 2001 From: skodak Date: Fri, 12 Jan 2007 10:24:01 +0000 Subject: [PATCH] MDL-7013 disabeldIf implemented in resource settings --- mod/resource/type/file/resource.class.php | 6 +++--- mod/resource/type/html/resource.class.php | 6 +++--- mod/resource/type/ims/resource.class.php | 12 ++++++------ mod/resource/type/repository/resource.class.php | 6 +++--- mod/resource/type/text/resource.class.php | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mod/resource/type/file/resource.class.php b/mod/resource/type/file/resource.class.php index b335809042..72461a9cd9 100644 --- a/mod/resource/type/file/resource.class.php +++ b/mod/resource/type/file/resource.class.php @@ -583,17 +583,17 @@ function setup_elements(&$mform) { $mform->addElement('checkbox', 'framepage', get_string('frameifpossible', 'resource')); $mform->setDefault('framepage', 0); -// $mform->disabledIf('framepage', 'windowpopup', '', 0); + $mform->disabledIf('framepage', 'windowpopup', 'eq', 0); foreach ($RESOURCE_WINDOW_OPTIONS as $option) { if ($option == 'height' or $option == 'width') { $mform->addElement('text', $option, get_string('new'.$option, 'resource'), array('size'=>'4')); $mform->setDefault($option, $CFG->{'resource_popup'.$option}); -// $mform->disabledIf($option, 'windowpopup', '', 1); + $mform->disabledIf($option, 'windowpopup', 'eq', 1); } else { $mform->addElement('checkbox', $option, get_string('new'.$option, 'resource')); $mform->setDefault($option, $CFG->{'resource_popup'.$option}); -// $mform->disabledIf($option, 'windowpopup', '', 1); + $mform->disabledIf($option, 'windowpopup', 'eq', 1); } } diff --git a/mod/resource/type/html/resource.class.php b/mod/resource/type/html/resource.class.php index 3c25c51d0f..0df9474913 100644 --- a/mod/resource/type/html/resource.class.php +++ b/mod/resource/type/html/resource.class.php @@ -158,17 +158,17 @@ function setup_elements(&$mform) { $mform->addElement('checkbox', 'blockdisplay', get_string('showcourseblocks', 'resource')); $mform->setDefault('blockdisplay', 0); -// $mform->disabledIf('blockdisplay', 'windowpopup', '', 0); + $mform->disabledIf('blockdisplay', 'windowpopup', 'eq', '0'); foreach ($RESOURCE_WINDOW_OPTIONS as $option) { if ($option == 'height' or $option == 'width') { $mform->addElement('text', $option, get_string('new'.$option, 'resource'), array('size'=>'4')); $mform->setDefault($option, $CFG->{'resource_popup'.$option}); -// $mform->disabledIf($option, 'windowpopup', '', 1); + $mform->disabledIf($option, 'windowpopup', 'eq', '1'); } else { $mform->addElement('checkbox', $option, get_string('new'.$option, 'resource')); $mform->setDefault($option, $CFG->{'resource_popup'.$option}); -// $mform->disabledIf($option, 'windowpopup', '', 1); + $mform->disabledIf($option, 'windowpopup', 'eq', '1'); } } } diff --git a/mod/resource/type/ims/resource.class.php b/mod/resource/type/ims/resource.class.php index 42b3af8ecb..a022517d86 100644 --- a/mod/resource/type/ims/resource.class.php +++ b/mod/resource/type/ims/resource.class.php @@ -641,11 +641,11 @@ class resource_ims extends resource_base { if ($option == 'height' or $option == 'width') { $mform->addElement('text', $option, get_string('new'.$option, 'resource'), array('size'=>'4')); $mform->setDefault($option, $CFG->{'resource_popup'.$option}); - // $mform->disabledIf($option, 'windowpopup', '', 1); + $mform->disabledIf($option, 'windowpopup', 'eq', 1); } else { $mform->addElement('checkbox', $option, get_string('new'.$option, 'resource')); $mform->setDefault($option, $CFG->{'resource_popup'.$option}); - // $mform->disabledIf($option, 'windowpopup', '', 1); + $mform->disabledIf($option, 'windowpopup', 'eq', 1); } } @@ -654,17 +654,17 @@ class resource_ims extends resource_base { $mform->addElement('selectyesno', 'param_navigationmenu', get_string('navigationmenu', 'resource')); $mform->setDefault('param_navigationmenu', 1); $mform->addElement('selectyesno', 'param_tableofcontents', get_string('tableofcontents', 'resource')); - // $mform->disabledIf($option, 'param_navigationmenu', '', 1); + $mform->disabledIf($option, 'param_navigationmenu', 'eq', 1); $mform->setDefault('param_tableofcontents', 0); $mform->addElement('selectyesno', 'param_navigationbuttons', get_string('navigationbuttons', 'resource')); $mform->setDefault('param_navigationbuttons', 0); $mform->addElement('selectyesno', 'param_skipsubmenus', get_string('skipsubmenus', 'resource')); $mform->setDefault('param_skipsubmenus', 1); - // $mform->disabledIf($option, 'param_navigationmenu', '', 1); + $mform->disabledIf($option, 'param_navigationmenu', 'eq', 1); $mform->addElement('selectyesno', 'param_navigationupbutton', get_string('navigationup', 'resource')); $mform->setDefault('param_navigationup', 1); - // $mform->disabledIf($option, 'param_navigationmenu', '', 1); - // $mform->disabledIf($option, 'param_navigationmenu', '', 0);//???????? + $mform->disabledIf($option, 'param_navigationmenu', 'eq', 1); + $mform->disabledIf($option, 'param_navigationmenu', 'eq', 0);//???????? } diff --git a/mod/resource/type/repository/resource.class.php b/mod/resource/type/repository/resource.class.php index 63a524c815..027603b767 100644 --- a/mod/resource/type/repository/resource.class.php +++ b/mod/resource/type/repository/resource.class.php @@ -576,17 +576,17 @@ function setup_elements(&$mform) { $mform->addElement('checkbox', 'framepage', get_string('frameifpossible', 'resource')); $mform->setDefault('framepage', 0); -// $mform->disabledIf('framepage', 'windowpopup', '', 0); + $mform->disabledIf('framepage', 'windowpopup', 'eq', 0); foreach ($RESOURCE_WINDOW_OPTIONS as $option) { if ($option == 'height' or $option == 'width') { $mform->addElement('text', $option, get_string('new'.$option, 'resource'), array('size'=>'4')); $mform->setDefault($option, $CFG->{'resource_popup'.$option}); -// $mform->disabledIf($option, 'windowpopup', '', 1); + $mform->disabledIf($option, 'windowpopup', 'eq', 1); } else { $mform->addElement('checkbox', $option, get_string('new'.$option, 'resource')); $mform->setDefault($option, $CFG->{'resource_popup'.$option}); -// $mform->disabledIf($option, 'windowpopup', '', 1); + $mform->disabledIf($option, 'windowpopup', 'eq', 1); } } diff --git a/mod/resource/type/text/resource.class.php b/mod/resource/type/text/resource.class.php index 94257f0b55..82d81627a1 100644 --- a/mod/resource/type/text/resource.class.php +++ b/mod/resource/type/text/resource.class.php @@ -165,17 +165,17 @@ function setup_elements(&$mform) { $mform->addElement('checkbox', 'blockdisplay', get_string('showcourseblocks', 'resource')); $mform->setDefault('blockdisplay', 0); -// $mform->disabledIf('blockdisplay', 'windowpopup', '', 0); + $mform->disabledIf('blockdisplay', 'windowpopup', 'eq', 0); foreach ($RESOURCE_WINDOW_OPTIONS as $option) { if ($option == 'height' or $option == 'width') { $mform->addElement('text', $option, get_string('new'.$option, 'resource'), array('size'=>'4')); $mform->setDefault($option, $CFG->{'resource_popup'.$option}); -// $mform->disabledIf($option, 'windowpopup', '', 1); + $mform->disabledIf($option, 'windowpopup', 'eq', 1); } else { $mform->addElement('checkbox', $option, get_string('new'.$option, 'resource')); $mform->setDefault($option, $CFG->{'resource_popup'.$option}); -// $mform->disabledIf($option, 'windowpopup', '', 1); + $mform->disabledIf($option, 'windowpopup', 'eq', 1); } } } -- 2.39.5