-
Notifications
You must be signed in to change notification settings - Fork 162
/
Copy pathinterface.php
379 lines (335 loc) · 13.2 KB
/
interface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
<?php
/**
* Copyright (c) UNA, Inc - https://una.io
* MIT License - https://opensource.org/licenses/MIT
*
* @defgroup UnaCoreSamples Samples
* @{
*/
/**
* @page samples
* @section interface Interface
*/
/**
* Interface elements
*/
$aPathInfo = pathinfo(__FILE__);
require_once ($aPathInfo['dirname'] . '/../inc/header.inc.php');
require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
$GLOBALS['SAMPLE_TEXT'] = 'Lorem ipsum dolor sit amet, <b>vitae tractatos philosophia ius ei</b>, per id causae integre voluptatibus. An iusto <a href="javascript:void(0);">rationibus concludaturque vix</a>, ei dicat admodum minimum vix. Vim ne eruditi scripserit. Nonumy dolorem ex eum, <i>te quo aliquid mnesarchum</i>, ea mel dico populo. Accumsan platonem salutandi te mei, nostro epicurei per ea. Sed ut nonumy sapientem, <u>stet postea periculis eu nec</u>, et purto erat facilisis sed.
';
$GLOBALS['SAMPLE_TITLE'] = 'Lorem ipsum dolor sit amet';
$GLOBALS['SAMPLE_THUMB'] = 'modules/boonex/persons/template/images/no-picture-preview.png';
$oTemplate = BxDolTemplate::getInstance();
$oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
$oTemplate->setPageHeader ("Interface elements");
$oTemplate->setPageContent ('page_main_code', PageCompMainCode());
$oTemplate->addCss(BX_DOL_URL_PLUGINS_PUBLIC . 'jush/jush.css');
$oTemplate->addJs(BX_DOL_URL_PLUGINS_PUBLIC . 'jush/jush.js');
$oTemplate->getPageCode();
/**
* page code function
*/
function PageCompMainCode()
{
ob_start();
?>
<script>
function samples_interface_toggle_code(e)
{
var ePre = $(e).parent().find('pre');
if (!ePre.hasClass('syntax-highlighed')) {
var s = ePre.html().replace(/\s+$/gm, '');
ePre.html(jush.highlight('htm', s).replace(/\t/g, ' ').replace(/(^|\n| ) /g, '$1 '));
ePre.addClass('syntax-highlighed');
}
ePre.toggle();
}
</script>
<style>
pre {
display:none;
border:1px solid #060;
padding:5px;
font-size:14px;
max-height:200px;
overflow:auto;
}
section hr:first-child {
display:none;
}
section > div {
box-sizing:border-box;
-moz-box-sizing:border-box; /* Firefox */
display:inline-block;
width:50%;
vertical-align:top;
}
section > div > h3 {
margin:0;
}
.sample-box {
float:left;;
width:64px;
height:64px;
border:1px solid #966;
background-color:#c99
}
.sample-box-empty {
height:64px;
}
</style>
<?php
$s = ob_get_clean();
$sMenu = '<ul class="samples-interface-menu">';
$aSections = array (
'Buttons' => array ('title' => 'Buttons', 'desc' => '
Using buttons with images is strictly discouraged - use font icons istead.'
),
'PaddingsMargins' => array ('title' => 'Paddings & margins', 'desc' => '
3 sizes are available: default, -sec, -thd. <br />
Possible combination: -left, -right, -top, -bottom, -leftright, -rightbottomleft, -topbottom. <br />
-auto is special suffix to be added for -left and -top margin combinations, if it is first then margin is 0. <br />
-thd is special size to be used as padding and margin together to get proper spacing from borders and between items when several tiles are displayed.'
),
'BordersCornersShadow' => array ('title' => 'Borders, corners and shadow', 'desc' => '
Possible combination of borders only: -left, -right, -top, -bottom, -rightbottomleft. <br />
-auto is special suffix to be added for -top border, if element is first then there is no border.'
),
'ThumbsIconsUnits' => array ('title' => 'Thumbs, icons & units', 'desc' => '
Additianl classes are available: bx-def-thumb-size-max-height, bx-def-thumb-size-min-height, bx-def-icon-size-max-height, bx-def-icon-size-min-height'
),
'Colors' => array ('title' => 'Colors', 'desc' => '
<a href="samples/palette.php">Additional pallette</a> is also available.'
),
'Fonts' => array ('title' => 'Fonts', 'desc' => ''
),
'Form' => array ('title' => 'Form', 'desc' => '
<a href="samples/forms.php">Form sample is here</a>'
),
'Grid' => array ('title' => 'Grid', 'desc' => '
<a href="samples/grid.php">Grid sample is here</a>'
),
'DesignBoxes' => array ('title' => 'Design Boxes', 'desc' => '
<a href="samples/designbox.php">Design boxes samples are here</a>'
),
);
foreach ($aSections as $sName => $a) {
$sMenu .= '<li><a href="samples/interface.php#' . $sName . '">' . $a['title'] . '</a></li>';
$s .= '<div id="' . $sName. '" class="bx-anchor bx-def-margin-top-auto">';
$s .= '<hr class="bx-def-hr" />';
$s .= '<hr class="bx-def-hr" />';
$s .= '<h1 class="bx-def-margin-sec-topbottom bx-def-padding-sec-topbottom">' . $a['title'] . '</h1>';
if ($a['desc'])
$s .= '<p>' . $a['desc'] . '</p>';
$sFunc = 'Samples_' . $sName;
if (function_exists($sFunc))
$s .= $sFunc();
$s .= '</div>';
}
$sMenu .= '</ul>';
return DesignBoxContent("Interface elements", $sMenu . $s, BX_DB_PADDING_NO_CAPTION);
}
function Samples_Buttons()
{
$aBlocks = array ();
ob_start();
?>
<button class="bx-btn bx-def-margin-right">Button</button>
<button class="bx-btn bx-btn-primary bx-def-margin-right">Primary button</button>
<button class="bx-btn bx-btn-disabled bx-def-margin-right">Disabled button</button>
<?php
$aBlocks['.bx-btn'] = ob_get_clean();
ob_start();
?>
<button class="bx-btn bx-btn-small bx-def-margin-right">Button</button>
<button class="bx-btn bx-btn-small bx-btn-primary bx-def-margin-right">Primary button</button>
<button class="bx-btn bx-btn-small bx-btn-disabled bx-def-margin-right">Disabled button</button>
<?php
$aBlocks['.bx-btn .bx-btn-small'] = ob_get_clean();
ob_start();
?>
<button class="bx-btn bx-def-margin-right"><i class="sys-icon fire-extinguisher"></i></button>
<button class="bx-btn bx-def-margin-right"><i class="sys-icon fire-extinguisher sys-icon-bigger"></i></button>
<button class="bx-btn bx-def-margin-right"><i class="sys-icon fire-extinguisher sys-icon-bigger col-red2"></i></button>
<button class="bx-btn bx-def-margin-right"><i class="sys-icon fire-extinguisher"></i><u>Button</u></button>
<?php
$aBlocks['.bx-btn with icon'] = ob_get_clean();
ob_start();
?>
<button class="bx-btn bx-btn-small bx-def-margin-right"><i class="sys-icon fire-extinguisher"></i></button>
<button class="bx-btn bx-btn-small bx-def-margin-right"><i class="sys-icon fire-extinguisher"></i><u>Button</u></button>
<?php
$aBlocks['.bx-btn .bx-btn-small with icon'] = ob_get_clean();
ob_start();
?>
<button class="bx-btn bx-btn-img bx-def-margin-right"><img src="template/images/icons/clock.png" /></button>
<button class="bx-btn bx-btn-img bx-def-margin-right"><img src="template/images/icons/clock.png"><u>Button</u></button>
<?php
$aBlocks['.bx-btn with image'] = ob_get_clean();
ob_start();
?>
<button class="bx-btn bx-btn-small bx-btn-img bx-def-margin-right"><img src="template/images/icons/clock.png" /></button>
<button class="bx-btn bx-btn-small bx-btn-img bx-def-margin-right"><img src="template/images/icons/clock.png" /><u>Button</u></button>
<?php
$aBlocks['.bx-btn .bx-btn-small with image'] = ob_get_clean();
ob_start();
?>
<div class="bx-btn-group">
<button class="bx-btn bx-def-margin-right">Button</button>
<button class="bx-btn bx-def-margin-right">Shmatton</button>
<button class="bx-btn bx-def-margin-right">Tratton</button>
</div>
<?php
$aBlocks['.bx-btn-group'] = ob_get_clean();
return FormatBlocks($aBlocks);
}
function Samples_PaddingsMargins()
{
$aBlocks = array ();
ob_start();
?>
<div class="bx-def-border bx-def-padding">
<?php echo $GLOBALS['SAMPLE_TEXT']; ?>
</div>
<?php
$aBlocks['.bx-def-padding'] = ob_get_clean();
ob_start();
?>
<div class="bx-def-border bx-def-padding-left bx-def-padding-right">
<?php echo $GLOBALS['SAMPLE_TEXT']; ?>
</div>
<?php
$aBlocks['.bx-def-padding-left .bx-def-padding-right'] = ob_get_clean();
ob_start();
?>
<div class="bx-def-border bx-def-padding-sec">
<?php echo $GLOBALS['SAMPLE_TEXT']; ?>
</div>
<?php
$aBlocks['.bx-def-padding-sec'] = ob_get_clean();
ob_start();
?>
<div class="bx-clearfix">
<div class="sample-box bx-def-margin-left"></div>
<div class="sample-box bx-def-margin-left"></div>
</div>
<?php
$aBlocks['.bx-def-margin-left'] = ob_get_clean();
ob_start();
?>
<div class="bx-clearfix">
<div class="sample-box bx-def-margin-left-auto"></div>
<div class="sample-box bx-def-margin-left-auto"></div>
</div>
<?php
$aBlocks['.bx-def-margin-left-auto'] = ob_get_clean();
ob_start();
?>
<div class="bx-def-border bx-clearfix">
<div class="sample-box bx-def-margin-sec"></div>
<div class="sample-box bx-def-margin-sec"></div>
<div class="sample-box bx-def-margin-sec"></div>
</div>
<?php
$aBlocks['.bx-def-margin-sec'] = ob_get_clean();
ob_start();
?>
<div class="bx-def-border bx-clearfix bx-def-padding-thd">
<div class="sample-box bx-def-margin-thd"></div>
<div class="sample-box bx-def-margin-thd"></div>
<div class="sample-box bx-def-margin-thd"></div>
</div>
<?php
$aBlocks['.bx-def-padding-thd and .bx-def-margin-thd'] = ob_get_clean();
return FormatBlocks($aBlocks);
}
function Samples_Colors()
{
$aBlocks = array ();
$aClasses = array ('bx-def-color-bg-page', 'bx-def-color-bg-block', 'bx-def-color-bg-box', 'bx-def-color-bg-sec', 'bx-def-color-bg-active', 'bx-def-color-bg-hl', 'bx-def-color-bg-hl-hover');
foreach ($aClasses as $sClass) {
ob_start();
?>
<div class="bx-def-border sample-box-empty <?php echo $sClass; ?>">
</div>
<?php
$aBlocks['.' . implode(" .", explode(' ', $sClass))] = ob_get_clean();
}
return FormatBlocks($aBlocks);
}
function Samples_BordersCornersShadow()
{
$aBlocks = array ();
$aClasses = array ('bx-def-border', 'bx-def-border-left bx-def-border-bottom', 'bx-def-border bx-def-round-corners', 'bx-def-shadow');
foreach ($aClasses as $sClass) {
ob_start();
?>
<div class="sample-box-empty <?php echo $sClass; ?>">
</div>
<?php
$aBlocks['.' . implode(" .", explode(' ', $sClass))] = ob_get_clean();
}
return FormatBlocks($aBlocks);
}
function Samples_ThumbsIconsUnits()
{
$aBlocks = array ();
$aClasses = array ('bx-def-thumb bx-def-thumb-size', 'bx-def-icon bx-def-icon-size');
foreach ($aClasses as $sClass) {
ob_start();
?>
<img class="<?php echo $sClass; ?>" src="<?php echo $GLOBALS['SAMPLE_THUMB']; ?>" />
<?php
$aBlocks['.' . implode(" .", explode(' ', $sClass))] = ob_get_clean();
}
ob_start();
?>
<div class="bx-def-unit">
<a href="javascript:void(0);"><img class="bx-def-thumb bx-def-thumb-size" src="<?php echo $GLOBALS['SAMPLE_THUMB']; ?>" /></a>
<div class="bx-def-unit-info bx-def-thumb-size-max-height bx-def-padding-left">
<span class="bx-def-font-large">Some info here</span><br />
<span class="bx-def-font-grayed">additional info</span>
</div>
</div>
<?php
$aBlocks['.bx-def-unit .bx-def-thumb'] = ob_get_clean();
ob_start();
?>
<div class="bx-def-unit">
<a href="javascript:void(0);"><img class="bx-def-icon bx-def-icon-size" src="<?php echo $GLOBALS['SAMPLE_THUMB']; ?>" /></a>
<div class="bx-def-unit-info bx-def-icon-size-max-height bx-def-padding-sec-left">
Some info here
</div>
</div>
<?php
$aBlocks['.bx-def-unit .bx-def-icon'] = ob_get_clean();
return FormatBlocks($aBlocks);
}
function Samples_Fonts()
{
$aBlocks = array ();
$aClasses = array ('' => 'SAMPLE_TEXT', 'bx-def-font-grayed' => 'SAMPLE_TEXT', 'bx-def-font-small' => 'SAMPLE_TEXT', 'bx-def-font-middle' => 'SAMPLE_TEXT', 'bx-def-font-large' => 'SAMPLE_TEXT', 'bx-def-font-h1' => 'SAMPLE_TITLE', 'bx-def-font-h2' => 'SAMPLE_TITLE', 'bx-def-font-h3' => 'SAMPLE_TITLE', 'bx-def-font-contrasted bx-def-font-h2 bg-col-green3' => 'SAMPLE_TITLE');
foreach ($aClasses as $sClass => $sSampleText) {
ob_start();
?>
<div class="<?php echo $sClass; ?>">
<?php echo $GLOBALS[$sSampleText]; ?>
</div>
<?php
$aBlocks['.' . implode(" .", explode(' ', $sClass))] = ob_get_clean();
}
return FormatBlocks($aBlocks);
}
function FormatBlocks ($aBlocks)
{
$s = '<section class="bx-def-padding-top">';
foreach ($aBlocks as $sCaption => $sBlock) {
$s .= '<hr class="bx-def-hr bx-def-margin-topbottom" />';
$s .= '<div>' . $sBlock . '</div>';
$s .= '<div class="bx-def-padding-left"><h3>' . $sCaption . '</h3><a href="javascript:void(0);" onclick="samples_interface_toggle_code(this)">Toggle code</a><br /><pre>' . $sBlock . '</pre></div>';
}
$s .= '</section>';
return $s;
}
/** @} */