Sophie

Sophie

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

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

<html>
    <head>
        <script
            type="text/javascript"
            src="../../../../js/jquery-1.4.2.min.js">
        </script>
        <script
            type="text/javascript"
            src="../../../../syntax_highlighter/scripts/shCore.js">
        </script>
        <script
            type="text/javascript"
            src="../../../../syntax_highlighter/scripts/shBrushJScript.js">
        </script>
        <script
            type="text/javascript"
            src="../../../../syntax_highlighter/scripts/shBrushPhp.js">
        </script>
        <script
            type="text/javascript"
            src="../../../../syntax_highlighter/scripts/shBrushXml.js">
        </script>
        <link
            href="../../../../syntax_highlighter/styles/shCore.css" rel="stylesheet"
            type="text/css"
        />
        <link
            href="../../../../syntax_highlighter/styles/shCoreEclipse.css"
            rel="stylesheet" type="text/css"
        />
        <link
            href="../../../../syntax_highlighter/styles/shThemeWordpress.css"
            rel="stylesheet" type="text/css"
        />
    </head>
    <body>
        <pre class="brush: php">&lt;?php
/**
 * 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 &quot;Zend/Form/Decorator/Abstract.php&quot;;

/**
 * Abstract Form Decorator for all jQuery UI Pane View Helpers
 *
 * @package    ZendX_JQuery
 * @subpackage Form
 * @copyright  Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
abstract class ZendX_JQuery_Form_Decorator_UiWidgetPane extends Zend_Form_Decorator_Abstract
{
    /**
     * View helper
     * @var string
     */
    protected $_helper;

    /**
     * Element attributes
     * @var array
     */
    protected $_attribs;

    /**
     * jQuery option parameters
     * @var array
     */
    protected $_jQueryParams;

    /**
     * Container title
     * @var string
     */
    protected $_title;

    /**
     * Get view helper for rendering container
     *
     * @return string
     */
    public function getHelper()
    {
        if (null === $this-&gt;_helper) {
            require_once 'Zend/Form/Decorator/Exception.php';
            throw new Zend_Form_Decorator_Exception('No view helper specified fo UiWidgetContainer decorator');
        }
        return $this-&gt;_helper;
    }

    /**
     * Get element attributes
     *
     * @return array
     */
    public function getAttribs()
    {
        if (null === $this-&gt;_attribs) {
            $attribs = $this-&gt;getElement()-&gt;getAttribs();
            if (array_key_exists('jQueryParams', $attribs)) {
                $this-&gt;getJQueryParams();
                unset($attribs['jQueryParams']);
            }
            $this-&gt;_attribs = $attribs;
        }
        return $this-&gt;_attribs;
    }

    /**
     * Get jQuery option parameters
     *
     * @return array
     */
    public function getJQueryParams()
    {
        if (null === $this-&gt;_jQueryParams) {
            $attribs = $this-&gt;getElement()-&gt;getAttribs();
            $this-&gt;_jQueryParams = array();
            if (array_key_exists('jQueryParams', $attribs)) {
                $this-&gt;_jQueryParams = $attribs['jQueryParams'];
            }

            $options = $this-&gt;getOptions();
            if (array_key_exists('jQueryParams', $options)) {
                $this-&gt;_jQueryParams = array_merge($this-&gt;_jQueryParams, $options['jQueryParams']);
                $this-&gt;removeOption('jQueryParams');
            }
        }

        // Ensure we have a title param
        if (!array_key_exists('title', $this-&gt;_jQueryParams)) {
            require_once &quot;Zend/Form/Decorator/Exception.php&quot;;
            throw new Zend_Form_Decorator_Exception(&quot;UiWidgetPane Decorators have to have a jQueryParam 'title' to render. This title can been set via setJQueryParam('title') on the parent element.&quot;);
        }

        return $this-&gt;_jQueryParams;
    }

    /**
     * Render an jQuery UI Widget Pane using its associated view helper
     *
     * @throws Zend_Form_Decorator_Exception
     * @param  string $content
     * @return string
     * @throws Zend_Form_Decorator_Exception if element or view are not registered
     */
    public function render($content)
    {
        $element = $this-&gt;getElement();
        $view    = $element-&gt;getView();
        if (null === $view) {
            return $content;
        }

        $jQueryParams = $this-&gt;getJQueryParams();
        $attribs     = array_merge($this-&gt;getAttribs(), $this-&gt;getOptions());

        if(isset($jQueryParams['title']) &amp;&amp; !empty($jQueryParams['title'])) {
            if (null !== ($translator = $element-&gt;getTranslator())) {
                $jQueryParams['title'] = $translator-&gt;translate($jQueryParams['title']);
            }
        }

        if(isset($jQueryParams['containerId'])) {
            $id = $jQueryParams['containerId'].&quot;-container&quot;;
        } else {
            require_once &quot;Zend/Form/Decorator/Exception.php&quot;;
            throw new Zend_Form_Decorator_Exception(&quot;UiWidgetPane Decorators have to have a jQueryParam 'containerId', to point at their parent container. This containerId has been set via setAttrib('id') on the parent element.&quot;);
        }

        $helper = $this-&gt;getHelper();

        return $view-&gt;$helper($id, $content, $jQueryParams, $attribs);
    }
}
</pre>
        <script type="text/javascript">
             SyntaxHighlighter.all();
             jQuery('.gutter div').each(function(key, data){
                jQuery(data).prepend('<a name="L'+jQuery(data).text()+'"/>');
             });
        </script>
    </body>
</html>