From 338c61838f8c977940f0cbda12c59bb061a87833 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 4 May 2020 11:53:12 +0200 Subject: [PATCH] Fix templates PHP warning --- public_html/templates/default/LSdefault.tpl | 6 +-- public_html/templates/default/LSform.tpl | 38 +++++++++---------- .../default/LSformElement_uri_field.tpl | 2 +- public_html/templates/default/LSform_view.tpl | 18 ++++----- public_html/templates/default/LSrelations.tpl | 8 ++-- public_html/templates/default/top.tpl | 2 +- public_html/templates/default/view.tpl | 8 ++-- 7 files changed, 42 insertions(+), 40 deletions(-) diff --git a/public_html/templates/default/LSdefault.tpl b/public_html/templates/default/LSdefault.tpl index ff0d40ed..42466c32 100644 --- a/public_html/templates/default/LSdefault.tpl +++ b/public_html/templates/default/LSdefault.tpl @@ -1,6 +1,6 @@
{$LSjsConfig}
-
{if is_array($LSinfos) && !empty($LSinfos)} +
{if isset($LSinfos) && is_array($LSinfos) && !empty($LSinfos)}
    {foreach $LSinfos as $info}
  • {$info|escape:"htmlall"}
  • @@ -8,9 +8,9 @@
{/if}
-
{$LSerrors}
+
{if isset($LSerrors) && $LSerrors}{$LSerrors}{/if}
-
{if $LSdebug != ''}{$LSdebug}{/if}
+
{if isset($LSdebug) && $LSdebug}{$LSdebug}{/if}
diff --git a/public_html/templates/default/LSform.tpl b/public_html/templates/default/LSform.tpl index 1bb3d835..ba47e860 100644 --- a/public_html/templates/default/LSform.tpl +++ b/public_html/templates/default/LSform.tpl @@ -1,6 +1,6 @@
{$LSform_header} -{if $LSform_layout} +{if isset($LSform_layout) && $LSform_layout}
    {foreach from=$LSform_layout item=tab key=tab_key} @@ -14,9 +14,9 @@

    {tr msg=$tab.label}

    - {if $LSformElement_image!='' && $tab.img==1} -
    - {if $LSformElement_image_actions!='' && !$LSformElement_image_errors} + {if isset($LSformElement_image) && $LSformElement_image!='' && isset($tab['img']) && $tab.img==1} +
    + {if isset($LSformElement_image_actions) && $LSformElement_image_actions!='' && !(isset($LSformElement_image_errors) && $LSformElement_image_errors)}
    • {foreach from=$LSformElement_image_actions item=item} @@ -27,13 +27,13 @@
    {/if} - +
    {foreach from=$tab.args item=arg} - {if $LSform_fields[$arg]} -
    {$LSform_fields[$arg].label}{if $LSform_fields[$arg].required} *{/if}{if $LSform_fields[$arg].help_info!=""} ?{/if}
    -
    {$LSform_fields[$arg].html}{if $LSform_fields[$arg].add != ''} + Ajouter un champ{/if}
    - {if $LSform_fields[$arg].errors != ''} + {if isset($LSform_fields[$arg])} +
    {$LSform_fields[$arg].label}{if isset($LSform_fields[$arg]['required']) && $LSform_fields[$arg]['required']} *{/if}{if isset($LSform_fields[$arg]['help_info']) && $LSform_fields[$arg]['help_info']} ?{/if}
    +
    {$LSform_fields[$arg].html}{if isset($LSform_fields[$arg]['add']) && $LSform_fields[$arg]['add']} + Ajouter un champ{/if}
    + {if isset($LSform_fields[$arg]['errors']) && $LSform_fields[$arg]['errors']} {foreach from=$LSform_fields[$arg].errors item=error}
    {$error|escape:'htmlall'}
    {/foreach} @@ -42,14 +42,14 @@ {/foreach}
    - +
    - {/foreach} + {/foreach} {else} - {if $LSformElement_image!=''} -
    - {if $LSformElement_image_actions!='' && !$LSformElement_image_errors} + {if isset($LSformElement_image) && $LSformElement_image!=''} +
    + {if isset($LSformElement_image_actions) && $LSformElement_image_actions!='' && !(isset($LSformElement_image_errors) && $LSformElement_image_errors)}
    • {foreach from=$LSformElement_image_actions item=item} @@ -60,13 +60,13 @@
    {/if} - +
    {foreach from=$LSform_fields item=field} -
    {$field.label}{if $field.required} *{/if}{if $field.help_info!=""} ?{/if}
    -
    {$field.html}{if $field.add != ''} + Ajouter un champ{/if}
    - {if $field.errors != ''} +
    {$field.label}{if isset($field['required']) && $field['required']} *{/if}{if isset($field['help_info']) && $field['help_info']} ?{/if}
    +
    {$field.html}{if isset($field['add']) && $field['add']} + Ajouter un champ{/if}
    + {if isset($field['errors']) && $field['errors']} {foreach from=$field.errors item=error}
    {$error|escape:'htmlall'}
    {/foreach} @@ -75,6 +75,6 @@
    - + {/if} diff --git a/public_html/templates/default/LSformElement_uri_field.tpl b/public_html/templates/default/LSformElement_uri_field.tpl index 17262653..a3328570 100644 --- a/public_html/templates/default/LSformElement_uri_field.tpl +++ b/public_html/templates/default/LSformElement_uri_field.tpl @@ -1,7 +1,7 @@ {if $freeze} {if $value} - {$value|escape:"htmlall"} + {$value|escape:"htmlall"} {else} {$noValueTxt|escape:"htmlall"} {/if} diff --git a/public_html/templates/default/LSform_view.tpl b/public_html/templates/default/LSform_view.tpl index 75f339ff..ac470c43 100644 --- a/public_html/templates/default/LSform_view.tpl +++ b/public_html/templates/default/LSform_view.tpl @@ -1,6 +1,6 @@ -{if $LSform_layout} +{if isset($LSform_layout) && $LSform_layout}
      {foreach from=$LSform_layout item=tab key=tab_key} @@ -14,17 +14,17 @@

      {$tab.label|escape:"htmlall"}

      - - {if $LSformElement_image!='' && $tab.img==1} + + {if isset($LSformElement_image) && $LSformElement_image!='' && isset($tab['img']) && $tab.img==1}
      {/if} - +
      {assign var='field' value='non'} {foreach from=$tab.args item=arg} - {if $LSform_fields[$arg]} + {if isset($LSform_fields[$arg])} {assign var='field' value='oui'}
      {$LSform_fields[$arg].label|escape:"htmlall"}{if $LSform_fields[$arg].help_info_in_view && $LSform_fields[$arg].help_info!=""} ?{/if}
      {$LSform_fields[$arg].html}
      @@ -34,13 +34,13 @@
      {$LSform_layout_nofield_label|escape:"htmlall"}
      {/if}
      - +
      - {/foreach} + {/foreach} {else} - {if $LSformElement_image!=''} + {if isset($LSformElement_image) && $LSformElement_image!=''}
      @@ -54,5 +54,5 @@ {/foreach}
    - + {/if} diff --git a/public_html/templates/default/LSrelations.tpl b/public_html/templates/default/LSrelations.tpl index 88d7ae6d..9e4c0605 100644 --- a/public_html/templates/default/LSrelations.tpl +++ b/public_html/templates/default/LSrelations.tpl @@ -7,9 +7,11 @@
{/if} diff --git a/public_html/templates/default/top.tpl b/public_html/templates/default/top.tpl index 109c6ae8..ffd779e2 100644 --- a/public_html/templates/default/top.tpl +++ b/public_html/templates/default/top.tpl @@ -19,7 +19,7 @@ - {if $LSsession_subDn!=""} + {if isset($LSsession_subDn) && $LSsession_subDn!=""}