sort attributes, to stop xet files from changing because of changed attribute order

This commit is contained in:
Ralf Becker 2011-05-05 06:51:40 +00:00
parent c0c2a0ed0e
commit beb6f20790
2 changed files with 17 additions and 14 deletions

View File

@ -1,10 +1,10 @@
<?php
/**
* eGroupWare EditableTemplates - Storage Objects
* EGroupware EditableTemplates - Storage Objects
*
* @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker@outdoor-training.de>
* @copyright 2002-10 by RalfBecker@outdoor-training.de
* @copyright 2002-11 by RalfBecker@outdoor-training.de
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
* @subpackage api
@ -890,14 +890,14 @@ class soetemplate
}
fwrite($f,'<?php
/**
* eGroupWare - eTemplates for Application '. $app. '
* EGroupware - eTemplates for Application '. $app. '
* http://www.egroupware.org
* generated by soetemplate::dump4setup() '.date('Y-m-d H:i'). '
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package '. $app. '
* @subpackage setup
* @version $Id$
* @version $Id'.'$
*/'."\n\n\$templ_version=1;\n\n");
$n = 0;

View File

@ -1,12 +1,12 @@
<?php
/**
* eGroupWare - eTemplates - XUL/XML Import & Export
* EGroupware - eTemplates - XUL/XML Import & Export
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
* @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker@outdoor-training.de>
* @copyright 2002-9 by RalfBecker@outdoor-training.de
* @copyright 2002-11 by RalfBecker@outdoor-training.de
* @version $Id$
*/
@ -154,12 +154,15 @@ class xul_io
*/
function &add_widget(&$parent,$cell,&$embeded_too)
{
// sort attributes, to stop xet files from changing because of changed attribute order
ksort($cell, SORT_STRING);
$type = $cell['type'];
if (is_array($type))
{
list(,$type) = each($type);
}
if (!$type) $cell['type'] = $type = 'hugo';
if (!$type) $cell['type'] = $type = 'unknown';
if (substr($type,0,6) == 'select')
{
$type = $cell['size'] > 1 ? 'select-multi' : 'select';