Index: trunk/library/ZendX/Application/Resource/Jquery.php =================================================================== --- trunk/library/ZendX/Application/Resource/Jquery.php (revision 23282) +++ trunk/library/ZendX/Application/Resource/Jquery.php (working copy) @@ -155,9 +155,8 @@ } } - if ((isset($options['uienable']) && (bool) $options['uienable']) - || (isset($options['ui_enable']) && (bool) $options['ui_enable']) - || (!isset($options['ui_enable']) && !isset($options['uienable']))) + if ((array_key_exists('uienable', $options) && (bool) $options['uienable']) + || (array_key_exists('ui_enable', $options) && (bool) $options['ui_enable'])) { $this->_view->JQuery()->uiEnable(); } else { @@ -163,5 +162,11 @@ } else { $this->_view->JQuery()->uiDisable(); } + + if (array_key_exists('enable', $options) && (bool) $options['enable']) { + $this->_view->JQuery()->enable(); + } else { + $this->_view->JQuery()->disable(); + } } } Index: trunk/tests/ZendX/Application/Resource/JqueryTest.php =================================================================== --- trunk/tests/ZendX/Application/Resource/JqueryTest.php (revision 23283) +++ trunk/tests/ZendX/Application/Resource/JqueryTest.php (working copy) @@ -154,6 +154,39 @@ $this->assertEquals('/f00/b4r/', $res->getUiLocalPath()); $this->assertEquals(187, $res->getRenderMode()); } + + /** + * @group ZF-10254 + */ + public function testIfUiDisableEnableViewHelperJquery() + { + $options = array( + 'uienable' => false, + 'enable' => true + ); + + $this->bootstrap->registerPluginResource('view'); + $resource = new ZendX_Application_Resource_Jquery(array()); + $resource->setBootstrap($this->bootstrap); + $resource->setOptions($options); + + $res = $resource->init(); + $this->assertTrue($res->isEnabled()); + $this->assertFalse($res->uiIsEnabled()); + + $resource = new ZendX_Application_Resource_Jquery(array()); + $resource->setBootstrap($this->bootstrap); + $res = $resource->init(); + $this->assertFalse($res->isEnabled()); + $this->assertFalse($res->uiIsEnabled()); + + $resource = new ZendX_Application_Resource_Jquery(array()); + $resource->setBootstrap($this->bootstrap); + $resource->setOptions(array('enable' => true)); + $res = $resource->init(); + $this->assertTrue($res->isEnabled()); + $this->assertFalse($res->uiIsEnabled()); + } } if (PHPUnit_MAIN_METHOD == 'Zend_Application_Resource_LocaleTest::main') {