JQueryUI Class Reference
[JQueryUI]
Helper for using JQueryUI, defines widgets and dependencies. More...
Static Public Member Functions |
|
static | enable_components ($components) |
Enable some components. |
|
static | enable_locales ($locales) |
Enable some locales. |
|
static | get_all_widgets () |
Returns an array with all widgets. |
|
static | get_cdn_url () |
static | get_css_paths ($components) |
Returns css paths for selected components.
|
|
static | get_enabled_components () |
Returns array of enabled components.
|
|
static | get_enabled_locales () |
Returns array of enabled locales. |
|
static | get_js_paths ($components) |
Returns paths for selected components.
|
|
static | uses_cdn () |
Returns true, if CDN should be used.
|
|
Public Attributes |
|
const | CDN_GOOGLE = 'https://ajax.googleapis.com/ajax/libs/jqueryui/%version%/jquery-ui.min.js' |
const | CDN_MS = 'https://ajax.aspnetcdn.com/ajax/jquery.ui/%version_min%/jquery-ui.min.js' |
const | CORE = 'ui.core' |
const | CORE_WIDGET = 'ui.widget' |
const | EFFECTS_BLIND = 'effects.blind' |
const | EFFECTS_BOUNCE = 'effects.bounce' |
const | EFFECTS_CLIP = 'effects.clip' |
const | EFFECTS_CORE = 'effects.core' |
const | EFFECTS_DROP = 'effects.drop' |
const | EFFECTS_EXPLODE = 'effects.explode' |
const | EFFECTS_FADE = 'effects.fade' |
const | EFFECTS_FOLD = 'effects.fold' |
const | EFFECTS_HIGHLIGHT = 'effects.highlight' |
const | EFFECTS_PULSATE = 'effects.pulsate' |
const | EFFECTS_SCALE = 'effects.scale' |
const | EFFECTS_SHAKE = 'effects.shake' |
const | EFFECTS_SLIDE = 'effects.slide' |
const | EFFECTS_TRANSFER = 'effects.transfer' |
const | FEATURE_DRAGGABLE = 'ui.draggable' |
const | FEATURE_DROPPABLE = 'ui.droppable' |
const | FEATURE_MOUSE = 'ui.mouse' |
const | FEATURE_POSITION = 'ui.position' |
const | FEATURE_RESIZABLE = 'ui.resizable' |
const | FEATURE_SELECTABLE = 'ui.selectable' |
const | FEATURE_SORTABLE = 'ui.sortable' |
const | WIDGET_ACCORDION = 'ui.accordion' |
const | WIDGET_AUTOCOMPLETE = 'ui.autocomplete' |
const | WIDGET_BUTTON = 'ui.button' |
const | WIDGET_DATEPICKER = 'ui.datepicker' |
const | WIDGET_DIALOG = 'ui.dialog' |
const | WIDGET_PROGRESSBAR = 'ui.progressbar' |
const | WIDGET_SLIDER = 'ui.slider' |
const | WIDGET_TABS = 'ui.tabs' |
Detailed Description
Helper for using JQueryUI, defines widgets and dependencies.
Definition at line 8 of file jqueryui.cls.php.
Member Function Documentation
static JQueryUI::enable_components | ( | $ | components | ) | [static] |
Enable some components.
- Parameters:
-
array|string $components
Definition at line 69 of file jqueryui.cls.php.
00069 { 00070 self::$enabled_components = array_merge(self::$enabled_components, Arr::force($components, false)); 00071 self::$enabled_components = array_unique(self::$enabled_components); 00072 }
static JQueryUI::enable_locales | ( | $ | locales | ) | [static] |
Enable some locales.
- Parameters:
-
array|string $locales
Definition at line 88 of file jqueryui.cls.php.
00088 { 00089 self::$enabled_locales = array_merge(self::$enabled_locales, Arr::force($locales, false)); 00090 self::$enabled_locales = array_unique(self::$enabled_locales); 00091 }
static JQueryUI::get_all_widgets | ( | ) | [static] |
Returns an array with all widgets.
- Returns:
- array
Definition at line 232 of file jqueryui.cls.php.
00232 { 00233 $ret = array( 00234 self::WIDGET_ACCORDION, 00235 self::WIDGET_DATEPICKER, 00236 self::WIDGET_DIALOG, 00237 self::WIDGET_PROGRESSBAR, 00238 self::WIDGET_SLIDER, 00239 self::WIDGET_TABS, 00240 self::WIDGET_AUTOCOMPLETE 00241 ); 00242 if (self::is_version_1_8()) { 00243 $ret[] = self::WIDGET_BUTTON; 00244 } 00245 return $ret; 00246 }
static JQueryUI::get_cdn_url | ( | ) | [static] |
Definition at line 167 of file jqueryui.cls.php.
00167 { 00168 $cdn = trim(Config::get_value(ConfigJQueryUI::CDN)); 00169 if (empty($cdn)) { 00170 return ''; 00171 } 00172 00173 // Resolve CDN 00174 if ($cdn == 'google') { $cdn = self::CDN_GOOGLE; } 00175 elseif ($cdn == 'ms') { $cdn = self::CDN_MS; } 00176 00177 $version = ''; 00178 switch(Config::get_value(ConfigJQueryUI::VERSION)) { 00179 case '1.7': 00180 $version = JQUERYUI_VERSION_1_7; 00181 break; 00182 case '1.8': 00183 $version = JQUERYUI_VERSION_1_8; 00184 break; 00185 } 00186 if (empty($version)) { 00187 throw new Exception('Unknown JQueryUI Version ' . Config::get_value(ConfigJQueryUI::VERSION)); 00188 } 00189 00190 $cdn = str_replace('%version%', $version, $cdn); 00191 $version_min = preg_replace('|\.0$|', '', $version); 00192 $cdn = str_replace('%version_min%', $version_min, $cdn); 00193 00194 return $cdn; 00195 }
static JQueryUI::get_css_paths | ( | $ | components | ) | [static] |
Returns css paths for selected components.
- Parameters:
-
array $component
- Returns:
- array
Definition at line 203 of file jqueryui.cls.php.
00203 { 00204 $css_components = array( 00205 self::CORE 00206 ); 00207 $css_having = self::get_components_having_css(); 00208 00209 foreach($components as $c) { 00210 if (in_array($c, $css_having)) { 00211 $css_components[] = $c; 00212 } 00213 } 00214 $css_components[] = 'ui.theme'; 00215 00216 $ret = array(); 00217 $prefix = self::is_version_1_8() ? 'jquery.' : ''; 00218 foreach($css_components as $c) { 00219 $path = 'css/jqueryui/' . $prefix . $c . '.css'; 00220 if (!in_array($path, $ret)) { 00221 $ret[] = $path; 00222 } 00223 } 00224 return $ret; 00225 }
static JQueryUI::get_enabled_components | ( | ) | [static] |
static JQueryUI::get_enabled_locales | ( | ) | [static] |
static JQueryUI::get_js_paths | ( | $ | components | ) | [static] |
Returns paths for selected components.
- Parameters:
-
array $component
- Returns:
- array
Definition at line 108 of file jqueryui.cls.php.
00108 { 00109 $resolved = array(); 00110 $deps = self::get_dependencies(); 00111 $locs = self::get_supported_locales(); 00112 foreach($components as $c) { 00113 self::collect_dependencies($c, $resolved, $deps, $locs); 00114 } 00115 00116 $ret = array(); 00117 $prefix = self::is_version_1_8() ? 'jquery.' : ''; 00118 foreach($resolved as $c) { 00119 $c = explode('/', $c); 00120 $file = array_pop($c); 00121 $file = $prefix . $file; 00122 $c[] = $file; 00123 $path = 'js/jqueryui/' . implode('/', $c) . '.js'; 00124 if (!in_array($path, $ret)) { 00125 $ret[] = $path; 00126 } 00127 } 00128 return $ret; 00129 }
static JQueryUI::uses_cdn | ( | ) | [static] |
Returns true, if CDN should be used.
- Returns:
- bool
Definition at line 163 of file jqueryui.cls.php.
00163 { 00164 return Config::get_value(ConfigJQueryUI::CDN) != ''; 00165 }
Member Data Documentation
const JQueryUI::CDN_GOOGLE = 'https://ajax.googleapis.com/ajax/libs/jqueryui/%version%/jquery-ui.min.js' |
Definition at line 48 of file jqueryui.cls.php.
const JQueryUI::CDN_MS = 'https://ajax.aspnetcdn.com/ajax/jquery.ui/%version_min%/jquery-ui.min.js' |
Definition at line 49 of file jqueryui.cls.php.
const JQueryUI::CORE = 'ui.core' |
Definition at line 45 of file jqueryui.cls.php.
const JQueryUI::CORE_WIDGET = 'ui.widget' |
Definition at line 46 of file jqueryui.cls.php.
const JQueryUI::EFFECTS_BLIND = 'effects.blind' |
Definition at line 11 of file jqueryui.cls.php.
const JQueryUI::EFFECTS_BOUNCE = 'effects.bounce' |
Definition at line 12 of file jqueryui.cls.php.
const JQueryUI::EFFECTS_CLIP = 'effects.clip' |
Definition at line 13 of file jqueryui.cls.php.
const JQueryUI::EFFECTS_CORE = 'effects.core' |
Definition at line 10 of file jqueryui.cls.php.
const JQueryUI::EFFECTS_DROP = 'effects.drop' |
Definition at line 14 of file jqueryui.cls.php.
const JQueryUI::EFFECTS_EXPLODE = 'effects.explode' |
Definition at line 15 of file jqueryui.cls.php.
const JQueryUI::EFFECTS_FADE = 'effects.fade' |
Definition at line 16 of file jqueryui.cls.php.
const JQueryUI::EFFECTS_FOLD = 'effects.fold' |
Definition at line 17 of file jqueryui.cls.php.
const JQueryUI::EFFECTS_HIGHLIGHT = 'effects.highlight' |
Definition at line 18 of file jqueryui.cls.php.
const JQueryUI::EFFECTS_PULSATE = 'effects.pulsate' |
Definition at line 19 of file jqueryui.cls.php.
const JQueryUI::EFFECTS_SCALE = 'effects.scale' |
Definition at line 20 of file jqueryui.cls.php.
const JQueryUI::EFFECTS_SHAKE = 'effects.shake' |
Definition at line 21 of file jqueryui.cls.php.
const JQueryUI::EFFECTS_SLIDE = 'effects.slide' |
Definition at line 22 of file jqueryui.cls.php.
const JQueryUI::EFFECTS_TRANSFER = 'effects.transfer' |
Definition at line 23 of file jqueryui.cls.php.
const JQueryUI::FEATURE_DRAGGABLE = 'ui.draggable' |
Definition at line 36 of file jqueryui.cls.php.
const JQueryUI::FEATURE_DROPPABLE = 'ui.droppable' |
Definition at line 37 of file jqueryui.cls.php.
const JQueryUI::FEATURE_MOUSE = 'ui.mouse' |
Definition at line 42 of file jqueryui.cls.php.
const JQueryUI::FEATURE_POSITION = 'ui.position' |
Definition at line 43 of file jqueryui.cls.php.
const JQueryUI::FEATURE_RESIZABLE = 'ui.resizable' |
Definition at line 38 of file jqueryui.cls.php.
const JQueryUI::FEATURE_SELECTABLE = 'ui.selectable' |
Definition at line 39 of file jqueryui.cls.php.
const JQueryUI::FEATURE_SORTABLE = 'ui.sortable' |
Definition at line 40 of file jqueryui.cls.php.
const JQueryUI::WIDGET_ACCORDION = 'ui.accordion' |
Definition at line 26 of file jqueryui.cls.php.
const JQueryUI::WIDGET_AUTOCOMPLETE = 'ui.autocomplete' |
Definition at line 33 of file jqueryui.cls.php.
const JQueryUI::WIDGET_BUTTON = 'ui.button' |
Definition at line 27 of file jqueryui.cls.php.
const JQueryUI::WIDGET_DATEPICKER = 'ui.datepicker' |
Definition at line 28 of file jqueryui.cls.php.
const JQueryUI::WIDGET_DIALOG = 'ui.dialog' |
Definition at line 29 of file jqueryui.cls.php.
const JQueryUI::WIDGET_PROGRESSBAR = 'ui.progressbar' |
Definition at line 30 of file jqueryui.cls.php.
const JQueryUI::WIDGET_SLIDER = 'ui.slider' |
Definition at line 31 of file jqueryui.cls.php.
const JQueryUI::WIDGET_TABS = 'ui.tabs' |
Definition at line 32 of file jqueryui.cls.php.
The documentation for this class was generated from the following file:
- contributions/javascript.jqueryui/lib/helpers/jqueryui.cls.php