1<?php
2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
3//
4// All Rights Reserved. See copyright.txt for details and a complete list of authors.
5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
6// $Id$
7
8function prefs_jquery_list($partial = false)
9{
10
11	global $prefs;
12
13	$jquery_effect_options = [
14		''      => tra('Default'),
15		'none'  => tra('None'),
16		'slide' => tra('Slide'),
17		'fade'  => tra('Fade'),
18	];
19
20	if (! $partial && $prefs['feature_jquery_ui'] == 'y') {
21		$jquery_effect_options['blind_ui'] = tra('Blind (UI)');
22		$jquery_effect_options['clip_ui'] = tra('Clip (UI)');
23		$jquery_effect_options['drop_ui'] = tra('Drop (UI)');
24		$jquery_effect_options['explode_ui'] = tra('Explode (UI)');
25		$jquery_effect_options['fold_ui'] = tra('Fold (UI)');
26		$jquery_effect_options['puff_ui'] = tra('Puff (UI)');
27		$jquery_effect_options['slide_ui'] = tra('Slide (UI)');
28	}
29
30	return [
31		'jquery_effect' => [
32			'name' => tra('Effect for modules'),
33			'type' => 'list',
34			'options' => $jquery_effect_options,
35			'help' => 'JQuery#Effects',
36			'default' => '',				// Default effect for general show/hide: ['' | 'slide' | 'fade' | and
37											// see http://docs.jquery.com/UI/Effects: 'blind' | 'clip' | 'explode' etc]
38		],
39		'jquery_effect_tabs' => [
40			'name' => tra('Effect for tabs'),
41			'type' => 'list',
42			'options' => $jquery_effect_options,
43			'help' => 'JQuery#Effects',
44			'default' => 'slide',	// Different effect for tabs (['none' | 'normal' (for jq) | 'slide' etc]
45		],
46		'jquery_effect_speed' => [
47			'name' => tra('Speed'),
48			'type' => 'list',
49			'options' => [
50				'fast' => tra('Fast'),
51				'normal' => tra('Normal'),
52				'slow' => tra('Slow'),
53			],
54			'default' => 'normal', 	// ['slow' | 'normal' | 'fast' | milliseconds (int) ]
55		],
56		'jquery_effect_direction' => [
57			'name' => tra('Direction'),
58			'type' => 'list',
59			'options' => [
60				'vertical' => tra('Vertical'),
61				'horizontal' => tra('Horizontal'),
62				'left' => tra('Left'),
63				'right' => tra('Right'),
64				'up' => tra('Up'),
65				'down' => tra('Down'),
66			],
67			'default' => 'vertical', 	// ['horizontal' | 'vertical' | 'left' | 'right' | 'up' | 'down' ]
68		],
69		'jquery_effect_tabs_speed' => [
70			'name' => tra('Speed'),
71			'type' => 'list',
72			'options' => [
73				'fast' => tra('Fast'),
74				'normal' => tra('Normal'),
75				'slow' => tra('Slow'),
76			],
77			'default' => 'fast',
78		],
79		'jquery_effect_tabs_direction' => [
80			'name' => tra('Direction'),
81			'type' => 'list',
82			'options' => [
83				'vertical' => tra('Vertical'),
84				'horizontal' => tra('Horizontal'),
85				'left' => tra('Left'),
86				'right' => tra('Right'),
87				'up' => tra('Up'),
88				'down' => tra('Down'),
89			],
90			'default' => 'vertical',
91		],
92		'jquery_ui_chosen' => [
93			'name' => tra('jQuery-UI Chosen Select Boxes'),
94			'description' => tra('Styled replacement for dropdown select lists and multiple-select inputs.'),
95			'type' => 'flag',
96			'default' => 'n',
97			'dependencies' => [
98				'feature_jquery_ui',
99			],
100		],
101		'jquery_ui_chosen_sortable' => [
102			'name' => tra('Sortable Chosen Multi-selects'),
103			'description' => tra('Enable drag and drop re-ordering of Chosen multi-select options.'),
104			'type' => 'flag',
105			'default' => 'n',
106			'dependencies' => [
107				'jquery_ui_chosen',
108			],
109		],
110		'jquery_colorbox_theme' => [
111			'name' => tra('Visual style of Colorbox (a.k.a. "Shadowbox")'),
112			'type' => 'list',
113			'perspective' => false,
114			'options' => [
115				'example1' => tra('One'),
116				'example2' => tra('Two'),
117				'example3' => tra('Three'),
118				'example4' => tra('Four'),
119				'example5' => tra('Five'),
120			],
121			'default' => 'example1',
122			'dependencies' => [
123				'feature_shadowbox',
124			],
125		],
126		'jquery_fitvidjs' => [
127			'name' => tra('FitVids.js'),
128			'description' => tra('jQuery plugin for fluid-width (responsive) embedded videos.'),
129			'type' => 'flag',
130			'default' => 'n',
131		],
132		'jquery_timeago' => [
133			'name' => tra('jQuery Timeago'),
134			'description' => tra('jQuery plugin for fuzzy timestamps.'),
135			'type' => 'flag',
136			'default' => 'n',
137		],
138		'jquery_smartmenus_enable' => [
139			'name' => tra('SmartMenus'),
140			'description' => tra('Add "SmartMenus" to Bootstrap menus. See smartmenus.org for more.'),
141			'type' => 'flag',
142			'default' => 'n',
143			'tags' => ['advanced'],
144			'keywords' => 'smart menu',
145		],
146		'jquery_smartmenus_mode' => [
147			'name' => tra('SmartMenus Mode'),
148			'type' => 'list',
149			'options' => [
150				'' => tra('None'),
151				'blue' => tra('Blue'),
152				'clean' => tra('Clean'),
153				'mint' => tra('Mint'),
154				'simple' => tra('Simple'),
155			],
156			'default' => '',
157			'dependencies' => [
158				'jquery_smartmenus_enable',
159			],
160		],
161		'jquery_ui_modals_draggable' => [
162			'name' => tra('Draggable Modals'),
163			'description' => tra('Modal popups can be moved around.'),
164			'type' => 'flag',
165			'default' => 'n',
166			'dependencies' => [
167				'feature_jquery_ui',
168			],
169		],
170		'jquery_ui_modals_resizable' => [
171			'name' => tra('Resizable Modals'),
172			'description' => tra('Modal popups can be resized.'),
173			'type' => 'flag',
174			'default' => 'n',
175			'dependencies' => [
176				'feature_jquery_ui',
177			],
178		],
179		'jquery_jqdoublescroll' => [
180			'name' => tra('jQuery Double Scroll'),
181			'description' => tra('jQuery plugin which adds an extra horizontal scroll bar at the top.'),
182			'type' => 'flag',
183			'default' => 'n',
184		],
185	];
186}
187