Issues

ZF-7032: wrong string declaration in ajaxLink

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:


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

produces:


foobar   

changing $callbacks['beforSend'] to:


        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

Fixed, will be included in the next minor version