Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 9a6c625b6bc20c999d27cb2d035ea8c5 > files > 150

php-ZendFramework-extras-1.12.7-1.mga4.noarch.rpm

伺㌹㨢灨灄潣畭敮瑯牜䑥獣物灴潲屆楬敄敳捲楰瑯爢㨲ㄺ筳㨷㨢*h慳栢㭳㨳㈺∹㌰愶㠴㍤㔱てㅢ㐹㘰㈱㘹挸㤵㈴㐶攢㭳㨷㨢*p慴栢㭳㨴㠺≊兵敲礯䍯湴牯汬敲⽁捴楯港䡥汰敲⽁畴潃潭灬整攮灨瀢㭳㨹㨢*s潵牣攢㭳㨲〵ㄺ∼㽰桰
/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category    ZendX
 * @package     ZendX_JQuery
 * @subpackage  View
 * @copyright  Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
 * @license     http://framework.zend.com/license/new-bsd     New BSD License
 * @version     $Id$
 */

require_once "Zend/Controller/Action/Helper/AutoComplete/Abstract.php";

class ZendX_JQuery_Controller_Action_Helper_AutoComplete
extends Zend_Controller_Action_Helper_AutoComplete_Abstract
{
    /**
     * Validate autocompletion data
     *
     * @param  mixed $data
     * @return boolean
     */
    public function validateData($data)
    {
        if (!is_array($data)) {
            return false;
        }

        return true;
    }

    /**
     * Prepare autocompletion data
     *
     * @param  mixed   $data
     * @param  boolean $keepLayouts
     * @return mixed
     */
    public function prepareAutoCompletion($data, $keepLayouts = false)
    {
        if (!$this->validateData($data)) {
            /**
             * @see Zend_Controller_Action_Exception
             */
            require_once 'Zend/Controller/Action/Exception.php';
            throw new Zend_Controller_Action_Exception('Invalid data passed for autocompletion');
        }

        $data = (array) $data;
        $output = "";
        foreach($data AS $k => $v) {
            if(is_numeric($k)) {
                $output .= $v."\n";
            } else {
                $output .= $k."|".$v."\n";
            }
        }

        if (!$keepLayouts) {
            $this->disableLayouts();
        }

        return $output;
    }
}
";s:19:"