Codigo del fichero-vista .phtml
Código PHP :
<div class="dropdown-menu" id="dropdown-login" > <?php if ($this->escapeHtml($this->level) == "annon") { printf("<li><a href=''>Registrate</a></li>"); printf("<li class='divider'></li>"); printf("<li id='dropdown-login' class='nav-header'><p id='title-log-menu'><span id='icn-log-menu' class='glyphicon glyphicon-log-in'></span> Inicia sesion</p>", $this->url('login')); $form = $this->form; $form->prepare(); $form->setAttribute('action', $this->url( 'login/process', array( 'action' => 'authenticate', ) )); // Set the method attribute for the form $form->setAttribute('method', 'post'); ?> <?php $formLabel = $this->plugin('formLabel'); echo $this->form()->openTag($form); ?> <li> <div class="input-group"> <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span> </span> <?php $name = $form->get('username'); //echo $formLabel->openTag() . $name->getOption('label'); echo $this->formInput($name); echo $this->formElementErrors($name); //echo $formLabel->closeTag(); ?></div> </li> <li> <div class="input-group"> <span class="input-group-addon"><span class="glyphicon glyphicon-asterisk"></span> </span> <?php $pass = $form->get('password'); echo $this->formInput($pass); echo $this->formElementErrors($pass); ?></div> </li> <li> <div class="input-group"> <span class="input-group-addon"> <?php echo $this->formElement($form->get('rememberme')) ?> </span> <input type="text" class="form-control" placeholder="Recuerdame !" disabled> </div> </li> <li> <?php echo $this->formElement($form->get('submit')); ?></li> <?php echo $this->form()->closeTag(); echo '</li>';//Fin dropdown con formulario } else if ($this->escapeHtml($this->level) == "user") { printf("<li><a href='%s'>Cerrar sesion</a></li>", $this->url('login/process', array('action' => 'logout'))); //,$this->url('register_usu') } ?> <!-- dropdown menu links --> </div> </div>
Esto funciona perfectamente y ahora el cacho de codigo de javaScript que se supone que deberia controlar este efecto que lo he metido en el layout.phtml de la aplicacion entre eqtiquetas <script>
Código Javascript :
$('#dropdown-login').find('form').click(function (e) { e.stopPropagation(); });
Espero que me podais ayudar, un saludo !