egroupware/api/src/Etemplate/WidgetBrowser.php

59 lines
1.5 KiB
PHP
Raw Normal View History

2013-02-11 09:10:25 +01:00
<?php
/**
* EGroupware eTemplate2 widget browser
*
* @link http://www.egroupware.org
* @author Nathan Gray
* @copyright 2013 Nathan Gray
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
* @subpackage tools
* @version $Id$
*/
namespace EGroupware\Api\Etemplate;
use EGroupware\Api;
2013-02-11 09:10:25 +01:00
/**
* eTemplate2 widget browser
*
2013-02-11 09:10:25 +01:00
* View & play with et2 widgets. Most of the good stuff happens
* on the client side via js, this is the server side.
*/
class WidgetBrowser
2013-02-11 09:10:25 +01:00
{
public $public_functions = array(
'index' => true
);
public static function index()
2013-02-11 09:10:25 +01:00
{
$GLOBALS['egw_info']['flags']['currentapp'] = 'etemplate';
$GLOBALS['egw_info']['flags']['app_header'] = 'et2 Widgets';
//'js_link_registry' => True,
// Widget browser code
Api\Framework::includeJS('/api/js/etemplate/widget_browser.js');
2013-02-11 09:10:25 +01:00
// Include the etemplate2 javascript code
Api\Framework::includeJS('.', 'etemplate2', 'etemplate');
2013-02-11 09:10:25 +01:00
// Include the jQuery-UI CSS - many more complex widgets use it
$theme = 'redmond';
2016-06-06 17:38:20 +02:00
Api\Framework::includeCSS("/vendor/bower-asset/jquery-ui/themes/$theme/jquery-ui-1.10.3.custom.css");
Api\Framework::includeCSS('/api/templates/default/etemplate2.css');
2013-02-11 09:10:25 +01:00
Api\Framework::includeCSS('api','widget_browser',false);
2013-02-11 09:10:25 +01:00
// load translations
Api\Translation::add_app('etemplate');
2013-02-11 09:10:25 +01:00
$GLOBALS['egw']->framework->render('
2013-02-11 09:10:25 +01:00
<div id="widget_list"></div>
<div id="widget_container"></div>');
2013-02-11 09:10:25 +01:00
}
}