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>"; ) . '>' . $matches[2] . "</$tag>";
}, $str); }, $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 ^^^^^^^^^^^^^^^^^^ // ^^^^^^^^^^^^^^^^ 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 // 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.label = "";
this.extra_link_target = "_self"; this.extra_link_target = "_self";
this.extra_link_popup = ""; this.extra_link_popup = "";
this.expose_view = false;
this._handleClick = this._handleClick.bind(this); this._handleClick = this._handleClick.bind(this);
} }

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE overlay PUBLIC "-//EGroupware GmbH//eTemplate 2//EN" "http://www.egroupware.org/etemplate2.dtd"> <!DOCTYPE overlay PUBLIC "-//EGroupware GmbH//eTemplate 2//EN" "http://www.egroupware.org/etemplate2.dtd">
<!-- $Id$ -->
<overlay> <overlay>
<template id="resources.show.rows" template="" lang="" group="0" version="1.9.003"> <template id="resources.show.rows" template="" lang="" group="0" version="1.9.003">
<grid width="100%"> <grid width="100%">
@ -39,9 +38,7 @@
<nextmatch-customfields id="customfields"/> <nextmatch-customfields id="customfields"/>
</row> </row>
<row class="$row_cont[class]"> <row class="$row_cont[class]">
<et2-image-expose id="${row}[picture_thumb]" label="$row_cont[name]" <image id="${row}[picture_thumb]" expose_view="true" href="$row_cont[picture_original]" src="$row_cont[picture_thumb]" class="thumbnailImage"/>
href="$row_cont[picture_original]"
src="$row_cont[picture_thumb]"/>
<vbox> <vbox>
<description id="${row}[name]" no_lang="1"/> <description id="${row}[name]" no_lang="1"/>
<description id="${row}[short_description]" no_lang="1"/> <description id="${row}[short_description]" no_lang="1"/>
@ -110,9 +107,11 @@
</vbox> </vbox>
</box> </box>
<styles> <styles>
.image16 img { .thumbnailImage img {
max-width: 16px; width: 100%;
max-height: 16px; max-width: 65px;
height: auto !important;
max-height: 50px;
} }
.action_popup[id] { .action_popup[id] {
position: fixed; position: fixed;