automatic convert <(image|description) expose_view="true" to <et2-*-expose

This commit is contained in:
ralf 2022-05-05 19:07:44 +02:00
parent 632c40fbb7
commit 7dc959c223
3 changed files with 33 additions and 31 deletions

View File

@ -87,6 +87,10 @@ function send_template()
) . '>' . $matches[2] . "</$tag>";
}, $str);
// modify <(image|description) expose_view="true" --> <et2-*-expose
$str = preg_replace('/<(image|description)\s([^><]*)expose_view="true"\s([^><]*)\\/>/',
'<et2-$1-expose $2 $3></et2-$1-expose>', $str);
// ^^^^^^^^^^^^^^^^ above widgets get transformed independent of legacy="true" set in overlay ^^^^^^^^^^^^^^^^^^
// eTemplate marked as legacy --> replace only some widgets (eg. requiring jQueryUI) with web-components

View File

@ -96,7 +96,6 @@ export class Et2Image extends Et2Widget(SlotMixin(LitElement)) implements et2_ID
this.label = "";
this.extra_link_target = "_self";
this.extra_link_popup = "";
this.expose_view = false;
this._handleClick = this._handleClick.bind(this);
}

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE overlay PUBLIC "-//EGroupware GmbH//eTemplate 2//EN" "http://www.egroupware.org/etemplate2.dtd">
<!-- $Id$ -->
<overlay>
<template id="resources.show.rows" template="" lang="" group="0" version="1.9.003">
<grid width="100%">
@ -39,19 +38,17 @@
<nextmatch-customfields id="customfields"/>
</row>
<row class="$row_cont[class]">
<et2-image-expose id="${row}[picture_thumb]" label="$row_cont[name]"
href="$row_cont[picture_original]"
src="$row_cont[picture_thumb]"/>
<vbox>
<description id="${row}[name]" no_lang="1"/>
<description id="${row}[short_description]" no_lang="1"/>
</vbox>
<vbox align="left">
<description align="left" id="${row}[useable]" no_lang="1"/>
<description align="left" id="${row}[quantity]" no_lang="1"/>
<description align="left" id="${row}[bookable]" no_lang="1"/>
</vbox>
<vbox>
<image id="${row}[picture_thumb]" expose_view="true" href="$row_cont[picture_original]" src="$row_cont[picture_thumb]" class="thumbnailImage"/>
<vbox>
<description id="${row}[name]" no_lang="1"/>
<description id="${row}[short_description]" no_lang="1"/>
</vbox>
<vbox align="left">
<description align="left" id="${row}[useable]" no_lang="1"/>
<description align="left" id="${row}[quantity]" no_lang="1"/>
<description align="left" id="${row}[bookable]" no_lang="1"/>
</vbox>
<vbox>
<menulist>
<menupopup type="select-cat" id="{$row}[cat_id]" no_lang="1" readonly="true"/>
</menulist>
@ -110,20 +107,22 @@
</vbox>
</box>
<styles>
.image16 img {
max-width: 16px;
max-height: 16px;
}
.action_popup[id] {
position: fixed;
top: 200px;
left: 450px;
width: 76ex;
z-index: 20000;
display: none;
border-collapse:collapse;
border-spacing:0px
}
</styles>
.thumbnailImage img {
width: 100%;
max-width: 65px;
height: auto !important;
max-height: 50px;
}
.action_popup[id] {
position: fixed;
top: 200px;
left: 450px;
width: 76ex;
z-index: 20000;
display: none;
border-collapse:collapse;
border-spacing:0px
}
</styles>
</template>
</overlay>