mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 00:13:35 +01:00
- implemented limited support for sidebox options in preferences
- opening import/export dialogs as popups, as they use egw window.close()
This commit is contained in:
parent
284f226d6d
commit
b92a2ed5b6
@ -24,16 +24,18 @@ class importexport_admin_prefs_sidebox_hooks
|
||||
if ($GLOBALS['egw_info']['user']['apps']['preferences'] && $location != 'admin')
|
||||
{
|
||||
$file = array(
|
||||
'Import'=> array(
|
||||
array(
|
||||
'text' => 'Import',
|
||||
'link' => $GLOBALS['egw']->link('/index.php','menuaction=importexport.importexport_import_ui.import_dialog'),
|
||||
'target' => 'new',
|
||||
'link' => "javascript:egw_openWindowCentered2('".
|
||||
egw::link('/index.php','menuaction=importexport.importexport_import_ui.import_dialog',false).
|
||||
"','_blank',850,440,'yes')",
|
||||
'icon' => 'import'
|
||||
),
|
||||
'Export'=> array(
|
||||
array(
|
||||
'text' => 'Export',
|
||||
'link' => $GLOBALS['egw']->link('/index.php','menuaction=importexport.importexport_export_ui.export_dialog'),
|
||||
'target' => 'new',
|
||||
'link' => "javascript:egw_openWindowCentered2('".
|
||||
egw::link('/index.php','menuaction=importexport.importexport_export_ui.export_dialog',false).
|
||||
"','_blank',850,440,'yes')",
|
||||
'icon' => 'export'
|
||||
),
|
||||
);
|
||||
@ -50,11 +52,11 @@ class importexport_admin_prefs_sidebox_hooks
|
||||
if ($GLOBALS['egw_info']['user']['apps']['admin'] && $location != 'preferences')
|
||||
{
|
||||
$file = Array(
|
||||
'Import definitions' => $GLOBALS['egw']->link('/index.php','menuaction=importexport.importexport_definitions_ui.import_definition'),
|
||||
'Define imports|exports' => $GLOBALS['egw']->link('/index.php',array(
|
||||
'Import definitions' => egw::link('/index.php','menuaction=importexport.importexport_definitions_ui.import_definition'),
|
||||
'Define imports|exports' => egw::link('/index.php',array(
|
||||
'menuaction' => 'importexport.importexport_definitions_ui.index',
|
||||
)),
|
||||
'Schedule' => $GLOBALS['egw']->link('/index.php', array(
|
||||
'Schedule' => egw::link('/index.php', array(
|
||||
'menuaction' => 'importexport.importexport_schedule_ui.index'
|
||||
)),
|
||||
);
|
||||
|
@ -1,40 +1,37 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - preferences *
|
||||
* http://www.egroupware.org *
|
||||
* Written by Joseph Engo <jengo@phpgroupware.org> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
/**
|
||||
* EGroupware preferences
|
||||
*
|
||||
* @package preferences
|
||||
* @link http://www.egroupware.org
|
||||
* @author Joseph Engo <jengo@phpgroupware.org>
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$GLOBALS['egw_info'] = array(
|
||||
$GLOBALS['egw_info'] = array(
|
||||
'flags' => array(
|
||||
'currentapp' => 'preferences',
|
||||
'disable_Template_class' => True,
|
||||
),
|
||||
);
|
||||
include('../header.inc.php');
|
||||
);
|
||||
include('../header.inc.php');
|
||||
|
||||
$pref_tpl =& CreateObject('phpgwapi.Template',EGW_APP_TPL);
|
||||
$templates = Array(
|
||||
$pref_tpl =& CreateObject('phpgwapi.Template',EGW_APP_TPL);
|
||||
$templates = Array(
|
||||
'pref' => 'index.tpl'
|
||||
);
|
||||
);
|
||||
|
||||
$pref_tpl->set_file($templates);
|
||||
$pref_tpl->set_file($templates);
|
||||
|
||||
$pref_tpl->set_block('pref','list');
|
||||
$pref_tpl->set_block('pref','app_row');
|
||||
$pref_tpl->set_block('pref','app_row_noicon');
|
||||
$pref_tpl->set_block('pref','link_row');
|
||||
$pref_tpl->set_block('pref','spacer_row');
|
||||
$pref_tpl->set_block('pref','list');
|
||||
$pref_tpl->set_block('pref','app_row');
|
||||
$pref_tpl->set_block('pref','app_row_noicon');
|
||||
$pref_tpl->set_block('pref','link_row');
|
||||
$pref_tpl->set_block('pref','spacer_row');
|
||||
|
||||
if ($GLOBALS['egw']->acl->check('run',1,'admin'))
|
||||
{
|
||||
if ($GLOBALS['egw']->acl->check('run',1,'admin'))
|
||||
{
|
||||
// This is where we will keep track of our position.
|
||||
// Developers won't have to pass around a variable then
|
||||
$session_data = $GLOBALS['egw']->session->appsession('session_data','preferences');
|
||||
@ -58,15 +55,15 @@
|
||||
|
||||
$tabs[] = array(
|
||||
'label' => lang('Your preferences'),
|
||||
'link' => $GLOBALS['egw']->link('/preferences/index.php','type=user')
|
||||
'link' => egw::link('/preferences/index.php','type=user')
|
||||
);
|
||||
$tabs[] = array(
|
||||
'label' => lang('Default preferences'),
|
||||
'link' => $GLOBALS['egw']->link('/preferences/index.php','type=default')
|
||||
'link' => egw::link('/preferences/index.php','type=default')
|
||||
);
|
||||
$tabs[] = array(
|
||||
'label' => lang('Forced preferences'),
|
||||
'link' => $GLOBALS['egw']->link('/preferences/index.php','type=forced')
|
||||
'link' => egw::link('/preferences/index.php','type=forced')
|
||||
);
|
||||
|
||||
switch($type)
|
||||
@ -76,11 +73,11 @@
|
||||
case 'forced': $selected = 2; break;
|
||||
}
|
||||
$pref_tpl->set_var('tabs',$GLOBALS['egw']->common->create_tabs($tabs,$selected));
|
||||
}
|
||||
}
|
||||
|
||||
// This func called by the includes to dump a row header
|
||||
function section_start($appname='',$icon='')
|
||||
{
|
||||
// This func called by the includes to dump a row header
|
||||
function section_start($appname='',$icon='')
|
||||
{
|
||||
global $pref_tpl;
|
||||
|
||||
$pref_tpl->set_var('a_name',$appname);
|
||||
@ -94,10 +91,10 @@
|
||||
{
|
||||
$pref_tpl->parse('rows','app_row_noicon',True);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function section_item($pref_link='',$pref_text='')
|
||||
{
|
||||
function section_item($pref_link='',$pref_text='')
|
||||
{
|
||||
global $pref_tpl;
|
||||
|
||||
$pref_tpl->set_var('pref_link',$pref_link);
|
||||
@ -112,31 +109,35 @@
|
||||
}
|
||||
|
||||
$pref_tpl->parse('rows','link_row',True);
|
||||
}
|
||||
}
|
||||
|
||||
function section_end()
|
||||
{
|
||||
function section_end()
|
||||
{
|
||||
global $pref_tpl;
|
||||
|
||||
$pref_tpl->parse('rows','spacer_row',True);
|
||||
}
|
||||
}
|
||||
|
||||
function display_section($appname,$file,$file2=False)
|
||||
{
|
||||
function display_section($appname,$file,$file2=False)
|
||||
{
|
||||
if ($file2)
|
||||
{
|
||||
$file = $file2;
|
||||
}
|
||||
section_start($appname,$GLOBALS['egw']->common->image($appname,Array('navbar',$appname)));
|
||||
|
||||
while(list($text,$url) = each($file))
|
||||
foreach($file as $text => $url)
|
||||
{
|
||||
if (is_array($url))
|
||||
{
|
||||
$text = $url['text'];
|
||||
$url = $url['link'];
|
||||
}
|
||||
section_item($url,lang($text));
|
||||
}
|
||||
section_end();
|
||||
}
|
||||
}
|
||||
|
||||
$GLOBALS['egw']->hooks->process('preferences',array('preferences'));
|
||||
$pref_tpl->pfp('out','list');
|
||||
$GLOBALS['egw']->common->egw_footer();
|
||||
?>
|
||||
$GLOBALS['egw']->hooks->process('preferences',array('preferences'));
|
||||
$pref_tpl->pfp('out','list');
|
||||
common::egw_footer();
|
||||
|
Loading…
Reference in New Issue
Block a user