1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* EGroupware eTemplate2 widget browser |
4
|
|
|
* |
5
|
|
|
* @link http://www.egroupware.org |
6
|
|
|
* @author Nathan Gray |
7
|
|
|
* @copyright 2013 Nathan Gray |
8
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License |
9
|
|
|
* @package etemplate |
10
|
|
|
* @subpackage tools |
11
|
|
|
* @version $Id$ |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace EGroupware\Api\Etemplate; |
15
|
|
|
|
16
|
|
|
use EGroupware\Api; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* eTemplate2 widget browser |
20
|
|
|
* |
21
|
|
|
* View & play with et2 widgets. Most of the good stuff happens |
22
|
|
|
* on the client side via js, this is the server side. |
23
|
|
|
*/ |
24
|
|
|
class WidgetBrowser |
25
|
|
|
{ |
26
|
|
|
|
27
|
|
|
public $public_functions = array( |
28
|
|
|
'index' => true |
29
|
|
|
); |
30
|
|
|
|
31
|
|
|
public static function index() |
32
|
|
|
{ |
33
|
|
|
$GLOBALS['egw_info']['flags']['currentapp'] = 'etemplate'; |
34
|
|
|
$GLOBALS['egw_info']['flags']['app_header'] = 'et2 Widgets'; |
35
|
|
|
//'js_link_registry' => True, |
36
|
|
|
|
37
|
|
|
// Widget browser code |
38
|
|
|
Api\Framework::includeJS('/api/js/etemplate/widget_browser.js'); |
39
|
|
|
|
40
|
|
|
// Include the etemplate2 javascript code |
41
|
|
|
Api\Framework::includeJS('.', 'etemplate2', 'etemplate'); |
42
|
|
|
|
43
|
|
|
// Include the jQuery-UI CSS - many more complex widgets use it |
44
|
|
|
$theme = 'redmond'; |
45
|
|
|
Api\Framework::includeCSS("/vendor/bower-asset/jquery-ui/themes/$theme/jquery-ui-1.10.3.custom.css"); |
46
|
|
|
|
47
|
|
|
Api\Framework::includeCSS('/api/templates/default/etemplate2.css'); |
48
|
|
|
|
49
|
|
|
Api\Framework::includeCSS('api','widget_browser',false); |
50
|
|
|
|
51
|
|
|
// load translations |
52
|
|
|
Api\Translation::add_app('etemplate'); |
53
|
|
|
|
54
|
|
|
$GLOBALS['egw']->framework->render(' |
55
|
|
|
<div id="widget_list"></div> |
56
|
|
|
<div id="widget_container"></div>'); |
57
|
|
|
} |
58
|
|
|
} |
59
|
|
|
|