move et2 widget browser to api, thought link to it is currently only in old eTemplate sidebox menu

This commit is contained in:
Ralf Becker 2016-03-19 15:25:32 +00:00
parent 3453021a6d
commit 6af1e23b66
4 changed files with 81 additions and 77 deletions

View File

@ -12,6 +12,9 @@
* @version $Id$
*/
/*egw:uses
etemplate2;
*/
/**
* widget_browser shows a list of widgets, and allows you to view them one at a time.

View File

@ -1,7 +1,6 @@
<?php
/**
* EGroupware eTemplate2 widget browser
* View & play with et2 widgets - PHP
*
* @link http://www.egroupware.org
* @author Nathan Gray
@ -12,27 +11,34 @@
* @version $Id$
*/
namespace EGroupware\Api\Etemplate;
use EGroupware\Api;
// explicitly list not yet ported api classes
use egw_framework;
/**
* eTemplate2 widget browser
*
* View & play with et2 widgets. Most of the good stuff happens
* on the client side via js, this is the server side.
*/
class etemplate_et2_widgets
class WidgetBrowser
{
public $public_functions = array(
'index' => true
);
public static function index($content = array())
public static function index()
{
$GLOBALS['egw_info']['flags']['currentapp'] = 'etemplate';
$GLOBALS['egw_info']['flags']['app_header'] = 'et2 Widgets';
//'js_link_registry' => True,
// Widget browser code
egw_framework::validate_file('/etemplate/js/widget_browser.js');
egw_framework::validate_file('/api/js/etemplate/widget_browser.js');
// Include the etemplate2 javascript code
egw_framework::validate_file('.', 'etemplate2', 'etemplate');
@ -41,19 +47,15 @@ class etemplate_et2_widgets
$theme = 'redmond';
egw_framework::includeCSS("/phpgwapi/js/jquery/jquery-ui/$theme/jquery-ui-1.10.3.custom.css");
egw_framework::includeCSS('/etemplate/templates/default/etemplate2.css');
egw_framework::includeCSS('/api/templates/default/etemplate2.css');
egw_framework::includeCSS('etemplate','widget_browser',false);
egw_framework::includeCSS('api','widget_browser',false);
// load translations
translation::add_app('etemplate');
Api\Translation::add_app('etemplate');
common::egw_header();
parse_navbar();
echo '
$GLOBALS['egw']->framework->render('
<div id="widget_list"></div>
<div id="widget_container"></div>';
common::egw_footer();
<div id="widget_container"></div>');
}
}

View File

@ -1,6 +1,6 @@
/**
* CSS for the widget browser
* etemplate.etemplate_et2_widgets.index
* Api\Etemplate\WidgetBrowser.php
*/
/* Basic layout */

View File

@ -1,7 +1,6 @@
<?php
/**
* eGroupWare - Setup
* Originaly from the phpGW XSLT API
/**
* EGroupware - eTemplate sidebox
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -10,13 +9,13 @@
* @version $Id$
*/
$menu_title = $GLOBALS['egw_info']['apps'][$appname]['title'] . ' '. lang('Menu');
$file = Array(
$menu_title = $GLOBALS['egw_info']['apps'][$appname]['title'] . ' '. lang('Menu');
$file = Array(
'eTemplate Editor' => $GLOBALS['egw']->link('/index.php','menuaction=etemplate.editor.edit'),
'DB-Tools' => $GLOBALS['egw']->link('/index.php','menuaction=etemplate.db_tools.edit'),
);
if (@$GLOBALS['egw_info']['user']['apps']['developer_tools'])
{
);
if (@$GLOBALS['egw_info']['user']['apps']['developer_tools'])
{
$file += array(
'_NewLine_', // give a newline
'developer_tools' => $GLOBALS['egw']->link('/index.php','menuaction=developer_tools.uilangfile.index'),
@ -26,12 +25,12 @@
{
display_sidebox($appname,$menu_title,$file);
}
$menu_title = lang('Documentation');
$docs = $GLOBALS['egw_info']['server']['webserver_url'].'/etemplate/doc/';
$file = Array(
$menu_title = lang('Documentation');
$docs = $GLOBALS['egw_info']['server']['webserver_url'].'/etemplate/doc/';
$doc_file = Array(
array(
'text' => 'eTemplate2 Reference',
'link' => egw::link('/index.php','menuaction=etemplate.etemplate_et2_widgets.index', 'etemplate'),
'link' => egw::link('/index.php','menuaction=api.EGroupware\\Api\\Etemplate\\WidgetBrowser.index', 'etemplate'),
),
array(
'text' => 'eTemplate Tutorial',
@ -55,9 +54,9 @@
'target' => 'docs'
),
);
);
if($GLOBALS['egw_info']['flags']['currentapp'] == 'etemplate')
{
display_sidebox($appname,$menu_title,$file);
}
if($GLOBALS['egw_info']['flags']['currentapp'] == 'etemplate')
{
display_sidebox($appname, $menu_title, $doc_file);
}