fixed a few errors in the etemplate editor

This commit is contained in:
Ralf Becker 2008-03-20 18:43:11 +00:00
parent 186d0ad967
commit add5646e48
5 changed files with 2406 additions and 2408 deletions

View File

@ -1,15 +1,15 @@
<?php <?php
/** /**
* eGroupWare EditableTemplates - Business Objects * eGroupWare EditableTemplates - Business Objects
* *
* @link http://www.egroupware.org * @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker@outdoor-training.de> * @author Ralf Becker <RalfBecker@outdoor-training.de>
* @copyright 2002-8 by RalfBecker@outdoor-training.de * @copyright 2002-8 by RalfBecker@outdoor-training.de
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate * @package etemplate
* @subpackage api * @subpackage api
* @version $Id$ * @version $Id$
*/ */
/** /**
* Business Object for eTemplates, extending the Storage Object * Business Object for eTemplates, extending the Storage Object

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,36 +1,33 @@
<?php <?php
/** /**
* eGroupWare EditableTemplates - Storage Objects * eGroupWare EditableTemplates - Storage Objects
* *
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @link http://www.egroupware.org
* @package etemplate * @author Ralf Becker <RalfBecker@outdoor-training.de>
* @link http://www.egroupware.org * @copyright 2002-8 by RalfBecker@outdoor-training.de
* @author Ralf Becker <RalfBecker@outdoor-training.de> * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$ * @package etemplate
*/ * @subpackage api
* @version $Id$
*/
/** /**
* Storage Objects: Everything to store and retrive and eTemplate. * Storage Objects: Everything to store and retrive and eTemplate.
* *
* eTemplates are stored in the db in table 'phpgw_etemplate' and gets distributed * eTemplates are stored in the db in table 'phpgw_etemplate' and gets distributed
* through the file 'etemplates.inc.php' in the setup dir of each app. That file gets * through the file 'etemplates.inc.php' in the setup dir of each app. That file gets
* automatically imported in the db, whenever you show a eTemplate of the app. For * automatically imported in the db, whenever you show a eTemplate of the app. For
* performace reasons the timestamp of the file is stored in the db, so 'new' * performace reasons the timestamp of the file is stored in the db, so 'new'
* eTemplates need to have a newer file. The distribution-file is generated with the * eTemplates need to have a newer file. The distribution-file is generated with the
* function dump, usually by pressing a button in the editor. * function dump, usually by pressing a button in the editor.
* writeLangFile writes an lang-file with all Labels, incorporating an existing one. * writeLangFile writes an lang-file with all Labels, incorporating an existing one.
* Beside a name eTemplates use the following keys to find the most suitable template * Beside a name eTemplates use the following keys to find the most suitable template
* for an user (in order of precedence): * for an user (in order of precedence):
* 1) User-/Group-Id (not yet implemented) * 1) User-/Group-Id (not yet implemented)
* 2) preferd languages of the user (templates for all langs have $lang='') * 2) preferd languages of the user (templates for all langs have $lang='')
* 3) selected template: verdilak, ... (the default is called '' in the db, not default) * 3) selected template: verdilak, ... (the default is called '' in the db, not default)
* 4) a version-number of the form, eg: '0.9.13.001' (filled up with 0 same size) * 4) a version-number of the form, eg: '0.9.13.001' (filled up with 0 same size)
* */
* @package etemplate
* @subpackage api
* @author RalfBecker-AT-outdoor-training.de
* @license GPL
*/
class soetemplate class soetemplate
{ {
var $debug; // =1 show some debug-messages, = 'app.name' show messages only for eTemplate 'app.name' var $debug; // =1 show some debug-messages, = 'app.name' show messages only for eTemplate 'app.name'

View File

@ -81,6 +81,13 @@ class etemplate extends boetemplate
* @var boolean * @var boolean
*/ */
var $sitemgr=false; var $sitemgr=false;
/**
* Javascript to be called, when a widget get's double-clicked (used only by the editor)
* A '%p' gets replace with the colon ':' separated template-name, -version and path of the clicked widget.
*
* @var string
*/
var $onclick_handler;
/** /**
* constructor of etemplate class, reads an eTemplate if $name is given * constructor of etemplate class, reads an eTemplate if $name is given
@ -955,7 +962,7 @@ class etemplate extends boetemplate
{ {
if ($this->debug && (is_int($this->debug) && $this->debug >= 3 || $this->debug == $cell['type'])) if ($this->debug && (is_int($this->debug) && $this->debug >= 3 || $this->debug == $cell['type']))
{ {
echo "<p>etemplate.show_cell($this->name,name='${cell['name']}',type='${cell['type']}',cname='$cname')</p>\n"; echo "<p>etemplate.show_cell($this->name,name='${cell['name']}',type='${cell['type']}',cname='$cname',...,'$path')</p>\n";
} }
list($span) = explode(',',$cell['span']); // evtl. overriten later for type template list($span) = explode(',',$cell['span']); // evtl. overriten later for type template
@ -1742,7 +1749,7 @@ class etemplate extends boetemplate
} }
// generate an extra div, if we have an onclick handler and NO children or it's an extension // generate an extra div, if we have an onclick handler and NO children or it's an extension
//echo "<p>$this->name($this->onclick_handler:$this->no_onclick:$this->onclick_proxy): $cell[type]/$cell[name]</p>\n"; //echo "<p>$this->name($this->onclick_handler:$this->no_onclick:$this->onclick_proxy): $cell[type]/$cell[name]</p>\n";
if ($this->onclick_handler && !isset($this->widgets_with_children[$cell['type']])) if ($this->onclick_handler && !isset(self::$widgets_with_children[$cell['type']]))
{ {
$handler = str_replace('%p',$this->no_onclick ? $this->onclick_proxy : $this->name.':'.$this->version.':'.$path, $handler = str_replace('%p',$this->no_onclick ? $this->onclick_proxy : $this->name.':'.$this->version.':'.$path,
$this->onclick_handler); $this->onclick_handler);