WidgetBrowser   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 24 1
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