[eGroupWare-svn] r55790 - in /trunk: admin/inc/ admin/templates/default/ admin/templates/pixelegg/ egroupware/api/js/etemplate/ egroupware/doc/

[email protected]
Newsgroups gmane.comp.web.egroupware.cvs
Message-ID <[email protected]>
Author: ralfbecker
Date: Wed Apr 20 20:52:55 2016
New Revision: 55790

URL: http://svn.stylite.de/viewvc/egroupware?rev=55790&view=rev
Log:
WIP et2 based site configuration

Added:
    trunk/admin/inc/class.admin_config.inc.php
      - copied, changed from r55778, trunk/admin/inc/class.uiconfig.inc.php
    trunk/admin/templates/default/config.xet   (with props)
    trunk/egroupware/doc/config2xet.php   (with props)
Modified:
    trunk/admin/templates/default/app.css
    trunk/admin/templates/default/config.tpl
    trunk/admin/templates/pixelegg/app.css
    trunk/egroupware/api/js/etemplate/et2_widget_selectbox.js

Copied: trunk/admin/inc/class.admin_config.inc.php (from r55778, trunk/admin/inc/class.uiconfig.inc.php)
URL: http://svn.stylite.de/viewvc/egroupware/trunk/admin/inc/class.admin_config.inc.php?p2=trunk/admin/inc/class.admin_config.inc.php&p1=trunk/admin/inc/class.uiconfig.inc.php&r1=55778&r2=55790&rev=55790&view=diff
==============================================================================
--- trunk/admin/inc/class.uiconfig.inc.php (original)
+++ trunk/admin/inc/class.admin_config.inc.php Wed Apr 20 20:52:55 2016
@@ -1,10 +1,11 @@
 <?php
 /**
- * EGgroupware admin - site configuration
+ * EGgroupware admin - New et2 site configuration
  *
  * @link http://www.egroupware.org
- * @author Miles Lott <[email protected]>
+ * @author Ralf Becker <[email protected]>
  * @package admin
+ * @copyright (c) 2016 by Ralf Becker <[email protected]>
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @version $Id$
  */
@@ -12,31 +13,25 @@
 use EGroupware\Api;
 
 /**
- * Site configuration for all apps using an $app/templates/default/config.tpl
+ * New site configuration for all apps using eTemplate2 $app/templates/default/config.xet
  */
-class uiconfig
+class admin_config
 {
 	var $public_functions = array('index' => True);
 
-	function index($params=null)
+	function index($_content=null)
 	{
-		// allowing inline js
-		egw_framework::csp_script_src_attrs('unsafe-inline');
-
-		// for POST requests validate CSRF token (or terminate request)
-		if ($_SERVER['REQUEST_METHOD'] == 'POST')
+		if (is_array($_content))
 		{
-			Api\Csrf::validate($_POST['csrf_token'], __CLASS__);
+			$_appname = $_content['appname'];
 		}
-
-		if (empty($_GET['appname']) && isset($params['appname']))
+		elseif (!empty($_GET['appname']) && isset($GLOBALS['egw_info']['apps'][$_GET['appname']]))
 		{
-			$_appname = $params['appname'];
+			$_appname = $_GET['appname'];
 		}
 		else
 		{
-			//_debug_array($params);
-			$_appname = $_GET['appname'];
+			throw new Api\Exception\WrongParameter("Wrong or missing appname parameter!");
 		}
 		if ($GLOBALS['egw']->acl->check('site_config_acce',1,'admin'))
 		{
@@ -49,21 +44,12 @@
 			Api\Translation::add_app($_appname);
 		}
 
-		if(get_magic_quotes_gpc() && is_array($_POST['newsettings']))
-		{
-			$_POST['newsettings'] = array_stripslashes($_POST['newsettings']);
-		}
-
 		switch($_appname)
 		{
 			case 'admin':
 			case 'addressbook':
 			case 'calendar':
 			case 'preferences':
-				/*
-				Other special apps can go here for now, e.g.:
-				case 'bogusappname':
-				*/
 				$appname = $_appname;
 				$config_appname = 'phpgwapi';
 				break;
@@ -77,47 +63,25 @@
 				$config_appname = $appname;
 				break;
 		}
-		if (ob_get_contents()) ob_end_flush(); // if there is output in buffer, flush it now.
-		$t = new Template(common::get_tpl_dir($appname));
-		$t->set_unknowns('keep');
-		$t->set_file(array('config' => 'config.tpl'));
-		$t->set_block('config','header','header');
-
-		// fix header templates missing essential parts like display of validation errors
-		$header = $t->get_var('header');
-		if (strpos($header, '{hidden_vars}') === false)
-		{
-			if (strpos($header, '<table'))
-			{
-				list($header, $table) = explode('<table', $header);
-				$header .= "{hidden_vars}\n<table".$table;
-			}
-			else
-			{
-				$header .= "{hidden_vars}\n";
-			}
-		}
-		$t->set_var('header', $header);
-
-		$t->set_block('config','body','body');
-		$t->set_block('config','footer','footer');
-
-		// fix footer submit buttons to just {submit} {cancel}
-		$t->set_var('footer', preg_replace('/<input[^>]+value="{lang_(submit|cancel)}"[^>]*>/', '{$1}', $t->get_var('footer')));
 
 		$c = new Api\Config($config_appname);
 		$c->read_repository();
-		if ($_POST['cancel'] || ($_POST['submit'] || $_POST['save'] || $_POST['apply']) && $GLOBALS['egw']->acl->check('site_config_acce',2,'admin'))
+		if ($_content['cancel'] || ($_content['save'] || $_content['apply']) && $GLOBALS['egw']->acl->check('site_config_acce',2,'admin'))
 		{
 			egw::redirect_link('/admin/index.php?ajax=true');
 		}
 
-		if ($_POST['submit'] || $_POST['save'] || $_POST['apply'])
+		if ($_content['save'] || $_content['apply'])
 		{
+			// support old validation hooks
+			$_POST = array('newsettings' => &$_content['newsettings']);
+
 			/* Load hook file with functions to validate each config (one/none/all) */
-			$GLOBALS['egw']->hooks->single('config_validate',$appname);
+			Api\Hooks::single(array(
+				'location' => 'config_validate',
+			)+$_content['newsettings'], $appname);
 
-			foreach($_POST['newsettings'] as $key => $config)
+			foreach($_content['newsettings'] as $key => $config)
 			{
 				if ($config)
 				{
@@ -132,7 +96,7 @@
 						}
 					}
 				}
-				/* don't erase passwords, since we also don't print them */
+				// don't erase passwords, since we also don't print them
 				elseif(strpos($key,'passwd') === false && strpos($key,'password') === false && strpos($key,'root_pw') === false)
 				{
 					unset($c->config_data[$key]);
@@ -141,7 +105,7 @@
 			if(in_array('final_validation', (array)$GLOBALS['egw_info']['server']['found_validation_hook']) &&
 				function_exists('final_validation'))
 			{
-				final_validation($_POST['newsettings']);
+				final_validation($_content['newsettings']);
 				if($GLOBALS['config_error'])
 				{
 					$errors .= lang($GLOBALS['config_error']) . "\n";
@@ -152,7 +116,7 @@
 
 			$c->save_repository();
 
-			if(!$errors && !$_POST['apply'])
+			if(!$errors && !$_content['apply'])
 			{
 				egw_framework::message(lang('Configuration saved.'), 'success');
 				egw::redirect_link('/index.php', array(
@@ -162,122 +126,32 @@
 			}
 		}
 
-		$t->set_var('error','');
 		if($errors)
 		{
 			egw_framework::message(lang('Error') . ': ' . $errors, 'error');
 			unset($errors);
 			unset($GLOBALS['config_error']);
 		}
-		elseif ($_POST['apply'])
+		elseif ($_content['apply'])
 		{
 			egw_framework::message(lang('Configuration saved.'), 'success');
 		}
-		$t->set_var('title',lang('Site Configuration'));
-		$t->set_var('action_url',$GLOBALS['egw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname));
-		$t->set_var('th_bg',     $GLOBALS['egw_info']['theme']['th_bg']);
-		$t->set_var('th_text',   $GLOBALS['egw_info']['theme']['th_text']);
-		$t->set_var('row_on',    $GLOBALS['egw_info']['theme']['row_on']);
-		$t->set_var('row_off',   $GLOBALS['egw_info']['theme']['row_off']);
-		$t->set_var('hidden_vars', html::input_hidden('csrf_token', Api\Csrf::token(__CLASS__)));
 
-		$vars = $t->get_undefined('body');
+		Api\Hooks::single('config', $appname);
 
-		if ($GLOBALS['egw']->hooks->single('config',$appname))	// reload the config-values, they might have changed
+		$tmpl = new Api\Etemplate($appname.'.config');
+		$path = (parse_url($tmpl->rel_path, PHP_URL_SCHEME) !== 'vfs' ? EGW_SERVER_ROOT : '').$tmpl->rel_path;
+		$content = array('newsettings' => array());
+		$config = $c->read_repository();
+
+		// for security reasons we do not send all config to client-side, but only ones mentioned in templates
+		$matches = null;
+		preg_match_all('/id="newsettings\[([^]]+)\]"/', file_get_contents($path), $matches, PREG_PATTERN_ORDER);
+		foreach($matches[1] as $name)
 		{
-			$c->read_repository();
+			$content['newsettings'][$name] = $config[$name];
 		}
-		foreach($vars as $value)
-		{
-			$valarray = explode('_',$value);
-			$type = array_shift($valarray);
-			$newval = implode(' ',$valarray);
 
-			switch ($type)
-			{
-				case 'lang':
-					$t->set_var($value,lang($newval));
-					break;
-				case 'value':
-					$newval = str_replace(' ','_',$newval);
-					/* Don't show passwords in the form */
-					if(strpos($value,'passwd') !== false || strpos($value,'password') !== false || strpos($value,'root_pw') !== false)
-					{
-						$t->set_var($value,'');
-					}
-					else
-					{
-						$t->set_var($value,$c->config_data[$newval]);
-					}
-					break;
-				/*
-				case 'checked':
-					$newval = str_replace(' ','_',$newval);
-					if ($c->config_data[$newval])
-					{
-						$t->set_var($value,' checked');
-					}
-					else
-					{
-						$t->set_var($value,'');
-					}
-					break;
-				*/
-				case 'selected':
-					$configs = array();
-					$newvals = explode(' ',$newval);
-					$setting = end($newvals);
-					for ($i=0;$i<(count($newvals) - 1); $i++)
-					{
-						$configs[] = $newvals[$i];
-					}
-					$config = implode('_',$configs);
-					/* echo $config . '=' . $c->config_data[$config]; */
-					if ($c->config_data[$config] == $setting)
-					{
-						$t->set_var($value,' selected');
-					}
-					else
-					{
-						$t->set_var($value,'');
-					}
-					break;
-				case 'hook':
-					$newval = str_replace(' ','_',$newval);
-					if(function_exists($newval))
-					{
-						$t->set_var($value,$newval($c->config_data));
-					}
-					else
-					{
-						$t->set_var($value,'');
-					}
-					break;
-				case 'call':	// eg. call_class::method or call_app.class.method
-					$newval = str_replace(' ','_',$newval);
-					$t->set_var($value,ExecMethod($newval,$c->config_data));
-					break;
-				default:
-					$t->set_var($value,'');
-					break;
-			}
-		}
-		$t->set_var('submit', '<div class="dialogFooterToolbar" style="text-align: left">'.
-			($GLOBALS['egw']->acl->check('site_config_acce',2,'admin') ? '' :
-				html::submit_button('save', 'Save')."\n".
-				html::submit_button('apply', 'Apply')));
-		$t->set_var('cancel', html::submit_button('cancel', 'Cancel').'</div>');
-
-		$GLOBALS['egw_info']['flags']['app_header'] = lang('Site configuration').
-			($appname != 'admin' ? ': '.lang($appname) : '');
-
-		// render the page
-		$GLOBALS['egw']->framework->render(
-			'<div id="admin-config-'.$appname.'" class="admin-config">'.
-			$t->parse('out','header').
-			$t->fp('out','body').
-			$t->fp('out','footer').'</div>',
-			null,true
-		);
+		$tmpl->exec('admin.admin_config.index', $content, array(), array(), array('appname' => $appname));
 	}
 }

Modified: trunk/admin/templates/default/app.css
URL: http://svn.stylite.de/viewvc/egroupware/trunk/admin/templates/default/app.css?rev=55790&r1=55789&r2=55790&view=diff
==============================================================================
--- trunk/admin/templates/default/app.css (original)
+++ trunk/admin/templates/default/app.css Wed Apr 20 20:52:55 2016
@@ -153,3 +153,11 @@
 select#admin-mailaccount_ident_id {
   width: 95%;
 }
+
+/**
+ * new et2 site configuration
+ */
+table.admin-config td.subHeader span {
+	font-weight: bold;
+	font-size: 110%;
+}

Modified: trunk/admin/templates/default/config.tpl
URL: http://svn.stylite.de/viewvc/egroupware/trunk/admin/templates/default/config.tpl?rev=55790&r1=55789&r2=55790&view=diff
==============================================================================
--- trunk/admin/templates/default/config.tpl (original)
+++ trunk/admin/templates/default/config.tpl Wed Apr 20 20:52:55 2016
@@ -233,7 +233,7 @@
     <td>{lang_Passwords_require_a_minimum_number_of_characters}:</td>
     <td>
      <select name="newsettings[force_pwd_length]">
-     	<option value="">{lang_None}</options>
+     	<option value="">{lang_None}</option>
      	<option value="6"{selected_force_pwd_length_6}>6</option>
      	<option value="7"{selected_force_pwd_length_7}>7</option>
      	<option value="8"{selected_force_pwd_length_8}>8</option>

Added: trunk/admin/templates/default/config.xet
URL: http://svn.stylite.de/viewvc/egroupware/trunk/admin/templates/default/config.xet?rev=55790&view=auto
==============================================================================
--- trunk/admin/templates/default/config.xet (added)
+++ trunk/admin/templates/default/config.xet Wed Apr 20 20:52:55 2016
@@ -1,0 +1,263 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE overlay PUBLIC "-//Stylite AG//eTemplate 2//EN" "http://www.egroupware.org/etemplate2.dtd">
+<!-- $Id$ -->
+<overlay>
+	<template id="admin.config" template="" lang="" group="0" version="16.1">
+		<grid width="100%" class="admin-config egwGridView_grid">
+			<columns>
+				<column width="70%"/>
+				<column/>
+			</columns>
+			<rows>
+				<row>
+					<description value="Site configuration" span="all" class="subHeader"/>
+				</row>
+				<row>
+					<description value="Should the login page include a language selectbox (useful for demo-sites) ?" label="%s:"/>
+					<select id="newsettings[login_show_language_selection]">
+						<option value="">No</option>
+						<option value="True">Yes</option>
+					</select>
+				</row>
+				<row>
+					<description value="How should EMail addresses for new users be constructed?" label="%s:"/>
+					<select id="newsettings[email_address_format]">
+						<option value="first-dot-last">{Firstname}.{Lastname}@domain.com</option>
+						<option value="first-last">{Firstname}{Lastname}@domain.com</option>
+						<option value="first-underscore-last">{Firstname}_{Lastname}@domain.com</option>
+						<option value="initial-last">{Initial}{Lastname}@domain.com</option>
+						<option value="initial-dot-last">{Initial}.{Lastname}@domain.com</option>
+						<option value="last-dot-first">{Lastname}.{Firstname}@domain.com</option>
+						<option value="last-first">{Lastname}{Firstname}@domain.com</option>
+						<option value="last-underscore-first">{Lastname}_{Firstname}@domain.com</option>
+						<option value="last">{Lastname}@domain.com</option>
+						<option value="first">{Firstname}@domain.com</option>
+						<option value="account">{Username}@domain.com</option>
+					</select>
+				</row>
+				<row>
+					<description value="Enter the VFS-Path where additional images, icons or logos can be placed (and found by EGroupwares applications). The path MUST start with /,and be readable by all users" label="%s:"/>
+					<textbox id="newsettings[vfs_image_dir]" size="40"/>
+				</row>
+				<row>
+					<description value="Log user-agent and action of changes in history-log of entries" label="%s:"/>
+					<select id="newsettings[log_user_agent_action]">
+						<option value="">No</option>
+						<option value="True">Yes</option>
+					</select>
+				</row>
+				<row>
+					<description value="appearance" span="all" class="subHeader"/>
+				</row>
+				<row>
+					<description value="Enter the title for your site" label="%s:"/>
+					<textbox id="newsettings[site_title]"/>
+				</row>
+				<row>
+					<description value="Enter the URL or filename (in phpgwapi/templates/default/images) of your logo" label="%s:"/>
+					<textbox id="newsettings[login_logo_file]"/>
+				</row>
+				<row>
+					<description value="Enter the url where your logo should link to" label="%s:"/>
+					<textbox id="newsettings[login_logo_url]"/>
+				</row>
+				<row>
+					<description value="Enter the title of your logo" label="%s:"/>
+					<textbox id="newsettings[login_logo_title]"/>
+				</row>
+				<row>
+					<description value="Enter the URL or filename (in your templates image directory) of your favicon (the little icon that appears in the browsers tabs)" label="%s:"/>
+					<textbox id="newsettings[favicon_file]"/>
+				</row>
+				<row>
+					<description value="How big should thumbnails for linked images be (maximum in pixels) ?" label="%s:"/>
+					<textbox id="newsettings[link_list_thumbnail]" size="5"/>
+				</row>
+				<row>
+					<description value="Enable spellcheck in rich text editor" label="%s:"/>
+					<select id="newsettings[enabled_spellcheck]">
+						<option value="">{No} - {more secure}</option>
+						<option value="True">Yes</option>
+						<option value="YesNoSCAYT">Yes, but no SCAYT</option>
+						<option value="YesBrowserBased">{Yes, use browser based spell checking engine} - {more secure}</option>
+						<option value="YesUseWebSpellCheck">Yes, use WebSpellChecker</option>
+					</select>
+				</row>
+				<row>
+					<description value="EGroupware Tutorial" label="%s:"/>
+					<select id="newsettings[egw_tutorial_disable]">
+						<option value="">Enable</option>
+						<option value="sidebox">Hide sidebox video tutorials</option>
+						<option value="intro">Do not offer introduction video</option>
+						<option value="all">Disable all</option>
+					</select>
+				</row>
+				<row>
+					<description value="Applications available on mobile devices" label="%s:"/>
+					<select-app id="newsettings[fw_mobile_app_list]" multiple="true" tags="true"/>
+				</row>
+				<row>
+					<description value="security" span="all" class="subHeader"/>
+				</row>
+				<row>
+					<description value="Cookie path (allows multiple eGW sessions with different directories, has problemes with SiteMgr!)" label="%s:"/>
+					<select id="newsettings[cookiepath]">
+						<option value="">Document root (default)</option>
+						<option value="egroupware">eGroupWare directory</option>
+					</select>
+				</row>
+				<row>
+					<description value="Cookie domain (default empty means use full domain name, for SiteMgr eg. &quot;.domain.com&quot; allows to use the same cookie for egw.domain.com and www.domain.com)" label="%s:"/>
+					<textbox id="newsettings[cookiedomain]"/>
+				</row>
+				<row>
+					<vbox>
+						<description value="check ip address of all sessions"/>
+						<description value="switch it off, if users are randomly thrown out" label="%s:"/>
+						<description value="Your session could not be verified."/>
+					</vbox>
+					<select id="newsettings[sessions_checkip]">
+						<option value="True">{Yes} - {more secure}</option>
+						<option value="">No</option>
+					</select>
+				</row>
+				<row>
+					<description value="Use secure cookies (transmitted only via https)"/>
+					<select id="newsettings[insecure_cookies]">
+						<option value="">{Yes} - {more secure}</option>
+						<option value="insecure">No</option>
+					</select>
+				</row>
+				<row>
+					<description value="Deny all users access to grant other users access to their entries ?" label="%s:"/>
+					<select id="newsettings[deny_user_grants_access]">
+						<option value="">No</option>
+						<option value="True">Yes</option>
+					</select>
+				</row>
+				<!--
+				<row>
+					<description value="Default file system space per user"/>
+					<textbox id="newsettings[vfs_default_account_size_number]" type="text" size="7"/>
+
+     <td>{Default_file_system_space_per_user}/{group_?}:</td>
+     <td>
+      <input type="text" name="newsettings[vfs_default_account_size_number]" size="7" value="{value_vfs_default_account_size_number}">&nbsp;&nbsp;
+      <select name="newsettings[vfs_default_account_size_type]">
+       <option value="gb"{selected_vfs_default_account_size_type_gb}>GB</option>
+       <option value="mb"{selected_vfs_default_account_size_type_mb}>MB</option>
+       <option value="kb"{selected_vfs_default_account_size_type_kb}>KB</option>
+       <option value="b"{selected_vfs_default_account_size_type_b}>B</option>
+      </select>
+     </td>
+    				</row> -->
+				<row>
+					<description value="How many days should entries stay in the access log, before they get deleted (default 90) ?" label="%s:"/>
+					<textbox id="newsettings[max_access_log_age]" size="5"/>
+				</row>
+				<row>
+					<description value="After how many unsuccessful attempts to login, an account should be blocked (default 3) ?" label="%s:"/>
+					<textbox id="newsettings[num_unsuccessful_id]" size="5"/>
+				</row>
+				<row>
+					<description value="After how many unsuccessful attempts to login, an IP should be blocked (default 3) ?" label="%s:"/>
+					<textbox id="newsettings[num_unsuccessful_ip]" size="5"/>
+				</row>
+				<row>
+					<description value="How many minutes should an account or IP be blocked (default 30) ?" label="%s:"/>
+					<textbox id="newsettings[block_time]" size="5"/>
+				</row>
+				<row>
+					<description value="Force users to change their password regularily?(empty for no,number for after that number of days" label="%s:"/>
+					<textbox id="newsettings[change_pwd_every_x_days]" size="5"/>
+				</row>
+				<row>
+					<description value="Warn users about the need to change their password? The number set here should be lower than the value used to enforce the change of passwords every X days. Only effective when enforcing of password change is enabled. (empty for no,number for number of days before they must change)" label="%s:"/>
+					<textbox id="newsettings[warn_about_upcoming_pwd_change]" size="5"/>
+				</row>
+				<row>
+					<description value="Passwords require a minimum number of characters" label="%s:"/>
+					<select id="newsettings[force_pwd_length]">
+						<option value="">None</option>
+						<option value="6">6</option>
+						<option value="7">7</option>
+						<option value="8">8</option>
+						<option value="10">10</option>
+						<option value="12">12</option>
+						<option value="14">14</option>
+						<option value="16">16</option>
+					</select>
+				</row>
+				<row>
+					<vbox>
+						<description value="Passwords requires this number of different character classes"/>
+						<description value="Uppercase, lowercase, number, special char" label="(%s)"/>
+					</vbox>
+					<select id="newsettings[force_pwd_strength]">
+						<option value="">None</option>
+						<option value="2">2</option>
+						<option value="3">3</option>
+						<option value="4">4</option>
+					</select>
+				</row>
+				<row>
+					<description value="Reject passwords containing part of username or full name (3 or more characters long)" label="%s:"/>
+					<select id="newsettings[passwd_forbid_name]">
+						<option value="no">No</option>
+						<option value="yes">Yes</option>
+					</select>
+				</row>
+				<row>
+					<description value="Admin email addresses (comma-separated) to be notified about the blocking (empty for no notify)" label="%s:"/>
+					<textbox id="newsettings[admin_mails]" size="40"/>
+				</row>
+				<!-- not used at the moment RalfBecker 2007/05/17
+				<row>
+					<description value="Disable &quot;auto completion&quot; of the login form " label="%s:"/>
+					<select id="newsettings[autocomplete_login]">
+						<option value="">No</option>
+						<option value="True">Yes</option>
+					</select>
+				</row> -->
+				<row>
+					<vbox>
+						<description value="How many entries should non-admins be able to export (empty = no limit, no = no export)"/>
+						<description value="This controls exports and merging."/>
+					</vbox>
+					<textbox id="newsettings[export_limit]" size="5"/>
+				</row>
+				<row>
+					<description value="Group excepted from above export limit (admins are always excepted)" label="%s:"/>
+					<select-account id="newsettings[export_limit_excepted]" account_type="groups" multiple="true" tags="true"/>
+				</row>
+				<row>
+					<vbox>
+						<description value="Allow remote administration from following install ID's (comma separated)"/>
+						<description id="newsettings[install_id]" label="Own install ID:"/>
+					</vbox>
+					<textbox id="newsettings[allow_remote_admin]" size="40"/>
+				</row>
+				<row>
+					<description value="Should exceptions contain a trace (including function arguments)" label="%s:"/>
+					<select id="newsettings[exception_show_trace]">
+						<option value="">{No} - {more secure}</option>
+						<option value="True">Yes</option>
+					</select>
+				</row>
+				<row>
+					<description value="Disable minifying of javascript and CSS files" label="%s:"/>
+					<select id="newsettings[debug_minify]">
+						<option value="">{No} - {Default}</option>
+						<option value="True">Yes</option>
+						<option value="debug">Debug</option>
+					</select>
+				</row>
+			</rows>
+		</grid>
+		<hbox class="dialogFooterToolbar">
+			<button id="save" label="Save"/>
+			<button id="apply" label="Apply"/>
+			<button id="cancel" label="Cancel"/>
+		</hbox>
+	</template>
+</overlay>

Propchange: trunk/admin/templates/default/config.xet
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/admin/templates/default/config.xet
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Propchange: trunk/admin/templates/default/config.xet
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: trunk/admin/templates/pixelegg/app.css
URL: http://svn.stylite.de/viewvc/egroupware/trunk/admin/templates/pixelegg/app.css?rev=55790&r1=55789&r2=55790&view=diff
==============================================================================
--- trunk/admin/templates/pixelegg/app.css (original)
+++ trunk/admin/templates/pixelegg/app.css Wed Apr 20 20:52:55 2016
@@ -160,6 +160,13 @@
 select#admin-mailaccount_ident_id {
   width: 95%;
 }
+/**
+ * new et2 site configuration
+ */
+table.admin-config td.subHeader span {
+  font-weight: bold;
+  font-size: 110%;
+}
 @media all {
   div.dhtmlxTree td.standartTreeRow span.selectedTreeRow {
     background-color: #ffdd73;

Modified: trunk/egroupware/api/js/etemplate/et2_widget_selectbox.js
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/js/etemplate/et2_widget_selectbox.js?rev=55790&r1=55789&r2=55790&view=diff
==============================================================================
--- trunk/egroupware/api/js/etemplate/et2_widget_selectbox.js (original)
+++ trunk/egroupware/api/js/etemplate/et2_widget_selectbox.js Wed Apr 20 20:52:55 2016
@@ -424,11 +424,16 @@
 		}
 
 		// Read the option-tags
-		var options = et2_directChildrenByTagName(_node, "options");
+		var options = et2_directChildrenByTagName(_node, "option");
+		var egw = this.egw();
 		for (var i = 0; i < options.length; i++)
 		{
 			this.options.select_options[et2_readAttrWithDefault(options[i], "value", options[i].textContent)] = {
-				"label": options[i].textContent,
+				// allow options to contain multiple translated sub-strings eg: {Firstname}.{Lastname}
+				"label": options[i].textContent.replace(/{([^}]+)}/g, function(str,p1)
+				{
+					return egw.lang(p1);
+				}),
 				"title": et2_readAttrWithDefault(options[i], "title", "")
 			};
 		}

Added: trunk/egroupware/doc/config2xet.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/doc/config2xet.php?rev=55790&view=auto
==============================================================================
--- trunk/egroupware/doc/config2xet.php (added)
+++ trunk/egroupware/doc/config2xet.php Wed Apr 20 20:52:55 2016
@@ -1,0 +1,174 @@
+<?php
+/**
+ * EGroupware - convert old config.tpl to et2 config.xet
+ *
+ * @link http://www.egroupware.org
+ * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
+ * @author Ralf Becker <[email protected]>
+ * @copyright 2016 by Ralf Becker <[email protected]>
+ * @version $Id$
+ */
+
+if (php_sapi_name() !== 'cli' && !empty($_GET['app']) && preg_match('/^[a-z0-9_-]+$/i', $_GET['app']))
+{
+	$app = $_GET['app'];
+}
+elseif ($_SERVER['argc'] > 1)
+{
+	$app = $_SERVER['argv'][1];
+}
+else
+{
+	$app = 'admin';
+}
+
+include __DIR__.'/../phpgwapi/inc/common_functions.inc.php';
+
+$path = EGW_SERVER_ROOT.'/'.$app.'/templates/default/config.tpl';
+if (!file_exists($path) || !($content = file_get_contents($path)))
+{
+	die("File not found: $path");
+}
+if (!preg_match('|<!-- BEGIN body -->(.*)<!-- END body -->|sui', $content, $table) &&
+	!preg_match('|\<table[^>]*\>(.*)</table\>|sui', $content, $table))
+{
+	die('No BEGIN/END body or table tag found!');
+}
+$table[1] = preg_replace('/^<!-- (BEGIN|END)\s*[^ -]+-->/U', '', $table[1]);
+
+if (!preg_match_all('|(<!--[^<-]*)?\s*<tr[^>]*>(.*)</tr>|Usui', $table[1], $trs, PREG_PATTERN_ORDER))
+{
+	die('No tr tags found!');
+}
+if (php_sapi_name() !== 'cli')
+{
+	EGroupware\Api\Header\Content::type('config.xet', 'text/plain', 0, true, false);
+}
+echo '<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE overlay PUBLIC "-//Stylite AG//eTemplate 2//EN" "http://www.egroupware.org/etemplate2.dtd">
+<!-- $Id$ -->
+<overlay>
+	<template id="'.$app.'.config" template="" lang="" group="0" version="16.1">
+		<grid width="100%" class="admin-config egwGridView_grid">
+			<columns>
+				<column width="60%"/>
+				<column/>
+			</columns>
+			<rows>
+				<row>
+					<description value="Site configuration" span="all" class="subHeader"/>
+				</row>
+';
+foreach($trs[2] as $n => $tr)
+{
+	if (strpos($tr, '{title}') || strpos($tr, '<input type="submit"')) continue;
+
+	if (!preg_match_all('|<td\s*([^>]*)>(.*)</td>|Usui', $tr, $tds, PREG_PATTERN_ORDER))
+	{
+		die("No td tags found in $n. tr: $tr");
+	}
+	if (($commented = !empty($trs[1][$n])? $trs[1][$n] : ''))
+	{
+		echo "\t\t\t\t$commented\n";
+	}
+	echo "\t\t\t\t<row>\n";
+	foreach($tds[2] as $t => $td)
+	{
+		if (preg_match('|^\s*<([^ >]+)\s*([^/>]+)/?>(.*)\s*$|sui', $td, $matches))
+		{
+			$attrs = preg_match_all('|\s*([^=]+)="([^"]+)"|', $matches[2], $attrs) ?
+				array_combine($attrs[1], $attrs[2]) : array();
+
+			switch($matches[1])
+			{
+				case 'input':
+					echo "\t\t\t\t\t<textbox id=\"".$attrs['name'].'"';
+					unset($attrs['value'], $attrs['name']);
+					foreach($attrs as $name => $value)
+					{
+						echo " $name=\"$value\"";
+					}
+					echo "/>\n";
+					if (trim($matches[3]))
+					{
+						if ($commented)
+						{
+							echo $tr;
+							continue;
+						}
+						echo "\t\t\t\t\t<!-- ".trim($matches[3])." -->\n";
+					}
+
+					break;
+
+				case 'select':
+					echo "\t\t\t\t\t<select id=\"".$attrs['name'].'"';
+					unset($attrs['name']);
+					foreach($attrs as $name => $value)
+					{
+						echo " $name=\"$value\"";
+					}
+					echo ">\n";
+					if (preg_match_all('|<option\s+value="([^"]*)"\s*({selected_[^}]+})?>(.*)</option>|Usui', $matches[3], $options))
+					{
+						foreach($options[3] as $i => $label)
+						{
+							$label = preg_replace_callback('/{lang_([^}]+)}/', function($matches)
+							{
+								return '{'.str_replace('_', ' ', $matches[1]).'}';
+							}, $label);
+							// no need for spezial sub-string translation syntax
+							if ($label[0] == '{' && strpos($label, '{', 1) === false && substr($label, -1) == '}')
+							{
+								$label = substr($label, 1, -1);
+							}
+							echo "\t\t\t\t\t\t<option value=\"".$options[1][$i].'">'.$label."</option>\n";
+						}
+					}
+					else
+					{
+						echo "\t\t\t\t\t<!-- ".trim($matches[3])." -->\n";
+					}
+					echo "\t\t\t\t\t</select>\n";
+					break;
+
+				default:
+					echo "\t\t\t\t\t<!-- $tr -->\n";
+					break;
+			}
+		}
+		elseif (preg_match('/^\s*([^{]*){lang_([^}]+)}\s*(.*)$/sui',
+			str_replace(array('&nbsp;', '<b>', '</b>'), '', $td), $matches))
+		{
+			if (!$commented && trim($matches[1])) echo "\t\t\t\t\t<!-- $matches[1] -->\n";
+			echo "\t\t\t\t\t<description value=\"".htmlspecialchars(str_replace('_', ' ', $matches[2])).'"';
+			if (trim($matches[3]) == ':')
+			{
+				echo ' label="%s:"';
+				unset($matches[3]);
+			}
+			if (strpos($tds[1][$t], 'colspan='))
+			{
+				echo ' span="all" class="subHeader"';
+			}
+			echo "/>\n";
+			if (!$commented && !empty($matches[3]) && trim($matches[3])) echo "\t\t\t\t\t<!-- ".trim($matches[3])." -->\n";
+		}
+		elseif(!$commented)
+		{
+			echo "\t\t\t\t\t<!-- ".trim($td)." -->\n";
+		}
+	}
+	echo "\t\t\t\t</row>".($commented ? ' -->' : '')."\n";
+}
+echo
+'			</rows>
+		</grid>
+		<hbox class="dialogFooterToolbar">
+			<button id="save" label="Save"/>
+			<button id="apply" label="Apply"/>
+			<button id="cancel" label="Cancel"/>
+		</hbox>
+	</template>
+</overlay>
+';

Propchange: trunk/egroupware/doc/config2xet.php
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/egroupware/doc/config2xet.php
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.