Hi,

I am facing a problem with Dojo: I set up Dojo to be disabled by default but
it is still enabled in my login form.


I've put in my bootstrap file those two lines (set up Dojo environment but
disable it by default):

      Zend_Dojo::enableView($view);
      $view->dojo()->disable();


Then, in my authentication controller:

      class AuthController extends Zend_Controller_Action
      {
          function loginAction()
          {
              $form = new Form_Login();
              // ...
              $this->view->dojo()->disable(); // just to be sure
              $this->view->title = "Authentication";
              $this->view->form = $form;
          }
      }

My form extends Zend_Form (NOT Zend_Dojo_Form). Furthermore, I only use
plain elements that are not Dijits : Zend_Form_Element_Text,
Zend_Form_Element_Password et Zend_Form_Element_Submit. 

My view script is very short:

      <?php
$this->headLink()->appendStylesheet($this->staticUrl('style/form.css'));
?>
      <h1><?php echo $this->escape($this->title); ?></h1>
      <?php echo $this->form; ?>


And this view script is invoked by the layout where one can find:

      <?php
      if ($this->dojo()->isEnabled()) {
          $this->dojo()->addStyleSheetModule('dijit.themes.tundra');
          echo $this->dojo();
      }
      ?>



But, in the generated HTML page, I find in the HEAD tag:

<style type="text/css">
<!--
    @import
"http://ajax.googleapis.com/ajax/libs/dojo/1.2.0/dijit/themes/tundra/tundra.css";;
-->
</style>

<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/dojo/1.2.0/dojo/dojo.xd.js"></script>

<script type="text/javascript">
//<![CDATA[
dojo.require("dijit.form.Form");
    dojo.require("dojo.parser");
dojo.addOnLoad(function() {
    dojo.forEach(zendDijits, function(info) {
        var n = dojo.byId(info.id);
        if (null != n) {
            dojo.attr(n, dojo.mixin({ id: info.id }, info.params));
        }
    });
    dojo.parser.parse();
});
var zendDijits = [{"id":"auth","params":{"dojoType":"dijit.form.Form"}}];
//]]>

</script>

What's wrong?

-----
Guillaume ORIOL
Sofware architect
Technema
-- 
View this message in context: 
http://www.nabble.com/unable-to-disable-Dojo-tp20830062p20830062.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to