Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 3db768d18269d77bd83866c9513dd4e6 > files > 182

php-ZendFramework-extras-1.12.9-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_Application
 * @subpackage Resource
 * @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: Jquery.php 20240 2010-01-13 04:51:56Z matthew $
 */

/**
 * JQuery application resource
 *
 * Example configuration:
 * &lt;pre&gt;
 *   resources.Jquery.noconflictmode = false        ; default
 *   resources.Jquery.version = 1.7.1               ; &lt;null&gt;
 *   resources.Jquery.localpath = &quot;/foo/bar&quot;
 *   resources.Jquery.enable = true
 *   resources.Jquery.uienable = true;
 *   resources.Jquery.ui_enable = true;
 *   resources.Jquery.uiversion = 0.7.7;
 *   resources.Jquery.ui_version = 0.7.7;
 *   resources.Jquery.uilocalpath = &quot;/bar/foo&quot;;
 *   resources.Jquery.ui_localpath = &quot;/bar/foo&quot;;
 *   resources.Jquery.cdn_ssl = false
 *   resources.Jquery.render_mode = 255 ; default
 *   resources.Jquery.rendermode = 255 ; default
 *
 *   resources.Jquery.javascriptfile = &quot;/some/file.js&quot;
 *   resources.Jquery.javascriptfiles.0 = &quot;/some/file.js&quot;
 *   resources.Jquery.stylesheet = &quot;/some/file.css&quot;
 *   resources.Jquery.stylesheets.0 = &quot;/some/file.css&quot;
 * &lt;/pre&gt;
 *
 * Resource for settings JQuery options
 *
 * @uses       Zend_Application_Resource_ResourceAbstract
 * @category   ZendX
 * @package    ZendX_Application
 * @subpackage Resource
 * @copyright  Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class ZendX_Application_Resource_Jquery
    extends Zend_Application_Resource_ResourceAbstract
{
    /**
     * @var ZendX_JQuery_View_Helper_JQuery_Container
     */
    protected $_jquery;

    /**
     * @var Zend_View
     */
    protected $_view;

    /**
     * Defined by Zend_Application_Resource_Resource
     *
     * @return ZendX_JQuery_View_Helper_JQuery_Container
     */
    public function init()
    {
        return $this-&gt;getJquery();
    }

    /**
     * Retrieve JQuery View Helper
     *
     * @return ZendX_JQuery_View_Helper_JQuery_Container
     */
    public function getJquery()
    {
        if (null === $this-&gt;_jquery) {
            $this-&gt;getBootstrap()-&gt;bootstrap('view');
            $this-&gt;_view = $this-&gt;getBootstrap()-&gt;view;

            ZendX_JQuery::enableView($this-&gt;_view);
            $this-&gt;_parseOptions($this-&gt;getOptions());

            $this-&gt;_jquery = $this-&gt;_view-&gt;jQuery();
        }

        return $this-&gt;_jquery;
    }

    /**
     * Parse options to find those pertinent to jquery helper and invoke them
     *
     * @param  array $options
     * @return void
     */
    protected function _parseOptions(array $options)
    {
        foreach ($options as $key =&gt; $value) {
            switch(strtolower($key)) {
                case 'noconflictmode':
                    if (!(bool)$value) {
                        ZendX_JQuery_View_Helper_JQuery::disableNoConflictMode();
                    } else {
                        ZendX_JQuery_View_Helper_JQuery::enableNoConflictMode();
                    }
                    break;
                case 'version':
                    $this-&gt;_view-&gt;JQuery()-&gt;setVersion($value);
                    break;
                case 'localpath':
                    $this-&gt;_view-&gt;JQuery()-&gt;setLocalPath($value);
                    break;
                case 'uiversion':
                case 'ui_version':
                    $this-&gt;_view-&gt;JQuery()-&gt;setUiVersion($value);
                    break;
                case 'uilocalpath':
                case 'ui_localpath':
                    $this-&gt;_view-&gt;JQuery()-&gt;setUiLocalPath($value);
                    break;
                case 'cdn_ssl':
                    $this-&gt;_view-&gt;JQuery()-&gt;setCdnSsl($value);
                    break;
                case 'render_mode':
                case 'rendermode':
                    $this-&gt;_view-&gt;JQuery()-&gt;setRenderMode($value);
                    break;
                case 'javascriptfile':
                    $this-&gt;_view-&gt;JQuery()-&gt;addJavascriptFile($value);
                    break;
                case 'javascriptfiles':
                    foreach($options['javascriptfiles'] as $file) {
                        $this-&gt;_view-&gt;JQuery()-&gt;addJavascriptFile($file);
                    }
                    break;
                case 'stylesheet':
                    $this-&gt;_view-&gt;JQuery()-&gt;addStylesheet($value);
                    break;
                case 'stylesheets':
                    foreach ($value as $stylesheet) {
                        $this-&gt;_view-&gt;JQuery()-&gt;addStylesheet($stylesheet);
                    }
                    break;
            }
        }

        if ((isset($options['uienable']) &amp;&amp; (bool) $options['uienable'])
            || (isset($options['ui_enable']) &amp;&amp; (bool) $options['ui_enable'])
            || (!isset($options['ui_enable']) &amp;&amp; !isset($options['uienable'])))
        {
            $this-&gt;_view-&gt;JQuery()-&gt;uiEnable();
        } else {
            $this-&gt;_view-&gt;JQuery()-&gt;uiDisable();
        }

        if ((isset($options['enable']) &amp;&amp; (bool) $options['enable'])
           || !isset($options['enable']))
        {
            $this-&gt;_view-&gt;JQuery()-&gt;enable();
        } else {
            $this-&gt;_view-&gt;JQuery()-&gt;disable();
        }
    }
}
</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>