-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathdefault.php
More file actions
38 lines (31 loc) · 1.06 KB
/
default.php
File metadata and controls
38 lines (31 loc) · 1.06 KB
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
<?php
/**
*
* @author Matthew McNaney <mcnaney at gmail dot com>
* @package Global
* @license http://opensource.org/licenses/lgpl-3.0.html
*/
javascript('jquery');
$wrap_header = $wrap_body = true;
$style = '<link rel="stylesheet" type="text/css" href="' . PHPWS_SOURCE_HTTP . 'javascript/datetimepicker/jquery.datetimepicker.css" / >';
\Layout::addJSHeader($style);
\Layout::addJSHeader('<script src="' . PHPWS_SOURCE_HTTP . 'javascript/datetimepicker/jquery.datetimepicker.js"></script>');
$default['format'] = null;
$options = array();
if (!empty($data['format'])) {
$format = $data['format'];
$options[] = "format:'$format'";
}
if (isset($data['timepicker'])) {
$options[] = 'timepicker: ' . ($data['timepicker'] ? 'true' : 'false');
}
if (isset($data['datepicker'])) {
$options[] = 'datepicker: ' . ($data['datepicker'] ? 'true' : 'false');
}
if (isset($data['format'])) {
$options[] = "format: '" . $data['format'] . "'";
}
if (!isset($data['selector'])) {
$data['selector'] = '.datetimepicker';
}
$data['options'] = implode(',', $options);