Issues

ZF-7032: wrong string declaration in ajaxLink

Issue Type: Bug Created: 2009-06-16T16:07:10.000+0000 Last Updated: 2009-07-21T12:43:39.000+0000 Status: Resolved Fix version(s): - 1.9.0 (31/Jul/09)

Reporter: Ludwig Ruderstaller (rufinus) Assignee: Benjamin Eberlei (beberlei) Tags: - ZendX_JQuery

Related issues: Attachments:

Description

$callbacks['beforSend'] options using " for the effect string. others like 'complete' use ' for strings. so if it can hapen that zend_view_helper_htmlElement::_htmlAttribs Line 113 uses the false string marker. couse ajaxLink is using both.

for example:

<pre class="highlight">
<?php 
echo $this->ajaxLink("foobar",
"/index/dummy",
array(  'beforeSend'    => 'hideSlow', 
'complete'      => 'show',
'update'        => '#pageContent',
'dataType'      => 'html',
'inline'        =>  true)); 
?>

produces:

<pre class="highlight">
<a href="#">foobar</a>   

changing $callbacks['beforSend'] to:

<pre class="highlight">
        if($callbacks['beforeSend'] != null) {
            switch(strtolower($callbacks['beforeSend'])) {
                case 'fadeout':
                    $js[] = sprintf("%s(this).fadeOut();", $jqHandler);
                    break;
                case 'fadeoutslow':
                    $js[] = sprintf("%s(this).fadeOut('slow');", $jqHandler);
                    break;
                case 'fadeoutfast':
                    $js[] = sprintf("%s(this).fadeOut('fast');", $jqHandler);
                    break;
                case 'hide':
                    $js[] = sprintf("%s(this).hide();", $jqHandler);
                    break;
                case 'hideslow':
                    $js[] = sprintf("%s(this).hide('slow');", $jqHandler);
                    break;
                case 'hidefast':
                    $js[] = sprintf("%s(this).hide('fast');", $jqHandler);
                    break;
                case 'slideup':
                    $js[] = sprintf("%s(this).slideUp(1000);", $jqHandler);
                    break;
                default:
                    $js[] = $callbacks['beforeSend'];
                    break;
            }
        }

fixes the problem.

Comments

Posted by Benjamin Eberlei (beberlei) on 2009-07-21T12:43:38.000+0000

Fixed, will be included in the next minor version

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts