contributions/javascript.jqueryui/start.inc.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * @defgroup JQueryUI 00004 * @ingroup JavaScript 00005 * 00006 * Include JQueryUI components on all or some pages. 00007 * 00008 * @section Usage 00009 * 00010 * On install, the module copies JQuery UI Javascript and CSS files folders below web root. 00011 * 00012 * To define the version of JQueryUI to use, use the constant APP_JQUERYUI_VERSION. 00013 * Valid values are "1.7" for JQueryUI 1.7.2, and "1.8" for JQueryUI 1.8.11. 00014 * Default is "1.8": 00015 * 00016 * @code 00017 * define('APP_JQUERYUI_VERSION', '1.8'); 00018 * @endcode 00019 * 00020 * @attention The default version policy changed to "newest", so if you do not define a JQuery UI version, 00021 * you will automaticalyy get the latest release 00022 * 00023 * @attention 00024 * Note that javascript and css files get prefixed by "jquery." since version 1.8. For example 00025 * "ui.accordion" became "jquery.ui.accordion". When updating from 1.7 to a higher version, 00026 * make sure to delete the old files. 00027 * 00028 * To enable components, you may call JQueryUI::enable_components() and pass either an array 00029 * or a single component: 00030 * 00031 * @code 00032 * JQueryUI::enable_components(JQueryUI::WIDGET_DATEPICKER); 00033 * JQueryUI::enable_components(array(JQueryUI::WIDGET_DATEPICKER, JQueryUI::WIDGET_PROGRESSBAR)); 00034 * @endcode 00035 * 00036 * This module resolves any dependencies for the components selected, so no need to worry about 00037 * that. 00038 * 00039 * To enable localization for a given language use 00040 * 00041 * @code 00042 * JQueryUI::enable_locales('de'); 00043 * @endcode 00044 * 00045 * This module will automatically include localization files, if available. Note it's still up to you 00046 * to correctly initialize the accordings components, e.g. within the document.ready() event. 00047 * 00048 * To include components on each page and to have them compressed by JCSSManager, its best to 00049 * include according code in the file start.inc.php in your app directory. 00050 * 00051 * You must use WidgetJCSS of JCSSManager module to render head data for this module to work. 00052 * 00053 * @section Theming 00054 * 00055 * Themes can be downloaded on http://jqueryui.com/download. Just drop the css files 00056 * (or just ui.theme.css) and image folder in app/www/css/jqueryui/ 00057 * 00058 * @section Notes Additional notes 00059 * 00060 * The 1.7 release includes the autocomplete plugin by Jörn Zaefferer, which became a 00061 * part of JQueryUI in 1.8 release. For details see http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ 00062 * 00063 * The JS and CSS file have been renamed to ui.autocomplete for consistency. 00064 * 00065 * The autocomplete plugin for 1.7 is not themed, since it is not part of the original 00066 * JQuery UI package. 00067 * 00068 * JQueryUI and the autocomplete plugin are released under MIT license. 00069 00070 * @see http://jqueryui.com/ for details about JQueryUI 00071 */ 00072 00073 EventSource::Instance()->register(new JavascriptJQueryUIEventSink()); 00074 00075 /** 00076 * JQueryUI Config options 00077 * 00078 * @author Gerd Riesselmann 00079 * @ingroup JQueryUI 00080 */ 00081 class ConfigJQueryUI { 00082 /** @deprecated Use VERSION instead */ 00083 const JQUERYUI_VERSION = 'JQUERYUI_VERSION'; 00084 const VERSION = 'JQUERYUI_VERSION'; 00085 00086 /** 00087 * JQueryUI CDN URL. Either an URL with %version% as placeholder for version OR 00088 * 00089 * - "google" for the Google CDN 00090 * - "ms" for the Microsoft CDN 00091 * 00092 * @attention %version% will be always 3 digits (e.g. 1.6.0). Use %version_min% to force this to 1.6 00093 * 00094 * Using a CDN will always load the full jQueryUI but serve local styles and localizations 00095 * 00096 * Files will be loaded using https with both Google and Microsoft CDN 00097 */ 00098 const CDN = 'JQUERYUI_CDN'; 00099 } 00100 00101 // To be changed on new releases 00102 define('JQUERYUI_VERSION_1_7', '1.7.3'); 00103 define('JQUERYUI_VERSION_1_8', '1.8.16'); 00104 00105 Config::set_value_from_constant(ConfigJQueryUI::CDN, 'APP_JQUERYUI_CDN', ''); 00106 Config::set_value_from_constant(ConfigJQueryUI::VERSION, 'APP_JQUERYUI_VERSION', '1.8'); 00107 00108 JQueryUI::enable_locales(GyroLocale::get_language());