allow to load widget specific edit-template from the app the widget belongs too, eg. infolog-value --> infolog.widget.infolog-value

This commit is contained in:
Ralf Becker 2009-05-17 11:41:58 +00:00
parent e8354276e1
commit 220492880d
5 changed files with 76 additions and 21 deletions

View File

@ -1341,7 +1341,9 @@ class editor
$type_tmpl =& new etemplate;
list($ext_type) = explode('-',$widget['type']);
if ($type_tmpl->read('etemplate.editor.widget.'.$widget['type']) ||
// allow to read template of app-specific widgets from their app: eg. "infolog-value" --> "infolog.widget.infolog-value"
if (isset($GLOBALS['egw_info']['apps'][$ext_type]) && $type_tmpl->read($ext_type.'.widget.'.$widget['type']) ||
$type_tmpl->read('etemplate.editor.widget.'.$widget['type']) ||
$type_tmpl->read('etemplate.editor.widget.'.$ext_type))
{
$editor->set_cell_attribute('etemplate.editor.widget.generic','obj',$type_tmpl);

File diff suppressed because one or more lines are too long

View File

@ -21,6 +21,9 @@
.leftPad5 {
padding-left: 5px;
}
.inputFullWidth input {
width: 100%;
}
/*
* mark input as required

View File

@ -0,0 +1,48 @@
<?xml version="1.0"?>
<!-- $Id$ -->
<overlay>
<template id="etemplate.editor.widget.contact" template="" lang="" group="0" version="1.7.001">
<grid>
<columns>
<column/>
<column/>
<column/>
<column/>
<column/>
<column/>
</columns>
<rows>
<row class="row">
<description options=",,,type" value="Type"/>
<menulist>
<menupopup id="type" onchange="1" statustext="type of the field (select Label if field should be empty)"/>
</menulist>
<contact-fields id="size" statustext="Contact field to show" span="all" label="Field"/>
</row>
<row class="row">
<description options=",,,label" value="Label"/>
<textbox id="label" statustext="displayed in front of input or input is inserted for a '%s' in the label (label of the Submitbutton or Image-filename)"/>
<textbox size="10" id="span" statustext="number of colums the field/cell should span or 'all' for the remaining columns, CSS-class name (for the TD tag)" label="Span, Class" span="2"/>
<description value="Align" align="center"/>
<menulist>
<menupopup id="align" statustext="alignment of label and input-field in table-cell"/>
</menulist>
</row>
<row class="row">
<description options=",,,name" value="Name"/>
<textbox id="name" statustext="index/name of returned content (name of the Template, Link / Method for Image)"/>
<checkbox label="%s disabled" id="disabled" statustext="if field is disabled an empty table-cell is displayed, for (temporal) removement of a field/cell" span="all"/>
</row>
<row class="row" disabled="!@type=button">
<description options="onclick" value="onClick"/>
<hbox options="0,0" span="all">
<menulist>
<menupopup id="onclick_type" statustext="confirmation necesary or custom java-script"/>
</menulist>
<textbox span="all" class="leftPad5 inputFullWidth" id="onclick" statustext="confirmation message or custom javascript (returning true or false)" align="right"/>
</hbox>
</row>
</rows>
</grid>
</template>
</overlay>

View File

@ -1,10 +1,10 @@
<?xml version="1.0"?>
<!-- $Id$ -->
<overlay>
<template id="etemplate.editor.widget.generic" template="" lang="" group="0" version="1.3.001">
<grid>
<template id="etemplate.editor.widget.generic" template="" lang="" group="0" version="1.7.001">
<grid width="100%">
<columns>
<column/>
<column width="70"/>
<column/>
<column/>
<column/>
@ -50,31 +50,35 @@
</row>
<row class="row">
<description options=",,,help" value="Help"/>
<textbox size="71" span="all" id="help" statustext="displayed in statusline of browser if input-field gets focus"/>
<textbox size="71" span="all" class="inputFullWidth" id="help" statustext="displayed in statusline of browser if input-field gets focus"/>
<description/>
<description/>
<description/>
<description/>
</row>
<row class="row" disabled="@type=label">
<description value="onChange"/>
<hbox span="all">
<hbox options="0,0" span="all">
<menulist>
<menupopup id="onchange_type" statustext="Should the form be submitted or any custom javascript be executed"/>
</menulist>
<textbox size="50" span="all" id="onchange" statustext="custom javascript for onChange"/>
<textbox size="50" span="all" class="leftPad5 inputFullWidth" id="onchange" statustext="custom javascript for onChange" align="right"/>
</hbox>
</row>
<row class="row">
<description options="onclick" value="onClick"/>
<hbox span="all">
<hbox options="0,0" span="all">
<menulist>
<menupopup id="onclick_type" statustext="confirmation necesary or custom java-script"/>
</menulist>
<textbox size="53" span="all" id="onclick" statustext="confirmation message or custom javascript (returning true or false)"/>
<textbox size="53" span="all" class="leftPad5 inputFullWidth" id="onclick" statustext="confirmation message or custom javascript (returning true or false)" align="right"/>
</hbox>
</row>
</rows>
</grid>
</template>
<template id="etemplate.editor.widget" template="" lang="" group="0" version="1.7.001">
<grid>
<grid width="100%">
<columns>
<column/>
<column/>
@ -89,10 +93,10 @@
<menupopup options="Box..." id="box_menu" onchange="1" statustext="all operations save the template!"/>
</menulist>
<menulist>
<menupopup options="Row..." id="row_menu" onchange="1" statustext="all operations save the template!"/>
<menupopup options="Row..." id="row_menu" onchange="1" statustext="all operations save the template!" disabled="true"/>
</menulist>
<menulist>
<menupopup options="Column..." id="column_menu" onchange="1" statustext="all operations save the template!"/>
<menupopup options="Column..." id="column_menu" onchange="1" statustext="all operations save the template!" disabled="true"/>
</menulist>
</hbox>
</row>