Fixed Statics and Widgets tpls (PHP 8.0)

This commit is contained in:
franciscoarocas 2021-02-11 00:04:04 +01:00
parent 2eb21a98c8
commit e3c41566e3
10 changed files with 43 additions and 40 deletions

View File

@ -1,6 +1,6 @@
{include file='shared:admin_errorlist.tpl'}
{static_block}
{if $preview}
{if isset($preview)}
<div class="row">
<div class="col-xl-12 col-lg-12">
<div class="card shadow mb-4">
@ -21,15 +21,18 @@
<h6 class="m-0 font-weight-bold text-primary">{$panelstrings.head}</h6>
</div>
<div class="card-body">
{html_form}
{html_form}
{if !isset($post)}
{assign var="post" value=""}
{/if}
{static content=$post alwaysshow=true}
<input type="text" name="subject" id="subject" class="form-control input_gray input-max-width" placeholder="{$panelstrings.subject}" {$error.subject|notempty:'class="field-error"'}
<input type="text" name="subject" id="subject" class="form-control input_gray input-max-width" placeholder="{$panelstrings.subject}" {if isset($error)}{$error.subject|notempty:'class="field-error"'}{/if}
value="{$subject|default:$smarty.request.subject|default:$smarty.request.page|wp_specialchars:1}" />
<input type="hidden" name="timestamp" value="{$date}" />
<p>
<label for="content"></label>
<textarea name="content" {$error.content|notempty:'class="field-error"'} id="content_textarea" placeholder="{$panelstrings.content}" class="form-control">{$content|default:$smarty.request.content|htmlspecialchars}</textarea><br />
{if $sceditor_display!='disable'}
<textarea name="content" {if isset($error)}{$error.content|notempty:'class="field-error"'}{/if} id="content_textarea" placeholder="{$panelstrings.content}" class="form-control">{$content|default:$smarty.request.content|htmlspecialchars}</textarea><br />
{if $sceditor_display != 'disable'}
<script src="{$smarty.const.BLOG_BASEURL}/fp-includes/bootstrap/js/bootstrap.min.js"></script>
<!-- Here is the SCEditor -->
<script src="{$smarty.const.BLOG_BASEURL}/admin/res/sceditor/sceditor.min.js"></script>
@ -75,7 +78,7 @@
</div>
<div class="card-body">
<input type="hidden" name="oldid" id="oldid" class="form-control input_gray" value="{$id|default:$smarty.request.oldid}" />
<input type="text" name="id" id="id" class="maxsize{$error.id|notempty:' field-error'} form-control input_gray "
<input type="text" name="id" id="id" class="maxsize{if isset($error)}{$error.id|notempty:' field-error'}{/if} form-control input_gray "
value="{$smarty.request.id|default:$smarty.request.page|default:$static_id}" /></p>
{html_submit name="save" id="save" class="btn btn-primary" value=$panelstrings.submit accesskey=s}
{html_submit name="preview" id="preview" class="btn btn-primary" value=$panelstrings.preview accesskey=p}

View File

@ -75,10 +75,10 @@
<ul id="widgetsetid-{$widgetset}">
{foreach from=$widgetarr item=widget}
<li class="widget-instance widget-id-{$widget.id} {$widget.class}">
<li class="widget-instance widget-id-{$widget.id} {if isset($widget.class)}{$widget.class}{/if}">
<input class="widget-id" type="hidden" name="widgets[{$widgetset}][]"
value="{$widget.id}{if $widget.params}:{$widget.params}{/if}" />
{if $widget.params}
value="{$widget.id}{if isset($widget.params)}:{$widget.params}{/if}" />
{if isset($widget.params)}
{* this will be hooked from javascript *}
<input class="textinput" style="float:right"
type="text" value="{$widget.params}"/>
@ -116,8 +116,8 @@
{foreach from=$widgetarr item=widget}
<li class="widget-instance widget-id-{$widget.id}">
<input class="widget-id" type="hidden" name="widgets[{$widgetset}][]"
value="{$widget.id}{if $widget.params}:{$widget.params}{/if}" />
{if $widget.params}
value="{$widget.id}{if isset($widget.params)}:{$widget.params}{/if}" />
{if isset($widget.params)}
{* this will be hooked from javascript *}
<input class="textinput" style="float:right"
type="text" value="{$widget.params}"/>

View File

@ -4,7 +4,7 @@
<p>{$plang.app_desc}</p>
{assign var="fetch" value="confirm"}
{include file=plugin:commentcenter/listcomments}
{if $use_akismet}
{if isset($use_akismet)}
<h3>{$plang.app_akismet}</h3>
<p>{$plang.app_spamdesc}</p>
{assign var="fetch" value="akismet"}
@ -12,7 +12,7 @@
<p><input type="checkbox" class="form-check-input" name="submitham" id="submitham" checked="checked" />
<label for="submitham">{$plang.app_hamsubmit}</label></p>
{/if}
{if $other}
{if isset($other)}
<h3>{$plang.app_other}</h3>
{assign var="fetch" value="denided"}
{include file=plugin:commentcenter/listcomments}

View File

@ -10,7 +10,7 @@
<dt><label for="log_all">{$plang.log_all}</label></dt>
<dd>
<div class="form-check">
<input class="form-check-input" type="checkbox" name="log_all" id="log_all"{if $pl_conf.log_all} checked="checked"{/if}>
<input class="form-check-input" type="checkbox" name="log_all" id="log_all"{if isset($pl_conf.log_all)} checked="checked"{/if}>
<label class="form-check-label" for="log_all">
{$plang.log_all_long}
</label>
@ -20,7 +20,7 @@
<dt><label for="email_alert">{$plang.email_alert}</label></dt>
<dd>
<div class="form-check">
<input type="checkbox" class="form-check-input" name="email_alert" id="log_all"{if $pl_conf.email_alert} checked="checked"{/if} >
<input type="checkbox" class="form-check-input" name="email_alert" id="log_all"{if isset($pl_conf.email_alert)} checked="checked"{/if} >
<label class="form-check-label" for="log_all">
{$plang.email_alert_long}
</label>
@ -31,19 +31,19 @@
<h2>{$plang.akismet}</h2>
<dl class="option-set">
<div class="form-check">
<input type="checkbox" class="form-check-input" name="akismet_check" id="akismet_check"{if $pl_conf.akismet_check} checked="checked"{/if} >
<input type="checkbox" class="form-check-input" name="akismet_check" id="akismet_check"{if isset($pl_conf.akismet_check)} checked="checked"{/if} >
<label class="form-check-label" for="log_all">
{$plang.akismet_use}
</label>
</div>
<dt class="akismet_opts"><label for="akismet_key">{$plang.akismet_key}</label></dt>
<dd class="akismet_opts">
<input type="text" class="form-control" name="akismet_key" id="akismet_key" value="{$pl_conf.akismet_key}" /><br />
<input type="text" class="form-control" name="akismet_key" id="akismet_key" value="{if isset($pl_conf.akismet_key)}{$pl_conf.akismet_key}{/if}" /><br />
{$plang.akismet_key_long}
</dd>
<dt class="akismet_opts"><label for="akismet_url">{$plang.akismet_url}</label></dt>
<dd class="akismet_opts">
<input type="text" class="form-control" name="akismet_url" id="akismet_url" value="{$pl_conf.akismet_url}" /><br />
<input type="text" class="form-control" name="akismet_url" id="akismet_url" value="{if isset($pl_conf.akismet_url)}{$pl_conf.akismet_url}{/if}" /><br />
{$plang.akismet_url_long|sprintf:$smarty.const.BLOG_BASEURL}
</dd>
</dl>

View File

@ -1,19 +1,19 @@
{include file=plugin:commentcenter/header}
<h2>{$plang.delc_title}</h2>
<p>{if $single}{$plang.delc_descs}{else}{$plang.delc_descm}{/if}</p>
<p>{if isset($single)}{$plang.delc_descs}{else}{$plang.delc_descm}{/if}</p>
{html_form}
{assign var="delete" value=true}
{assign var="fetch" value="del"}
{include file=plugin:commentcenter/listcomments}
<p>{$plang.sure}</p>
<div class="buttonbar">
{if $is_managing}
{if isset($is_managing)}
<input type="hidden" name="entry" value="{$entry}" />
{assign var="button_suff" value="_2"}
{else}
{assign var="button_suff" value=""}
{/if}
{if $single}
{if isset($single)}
{html_submit name="commdelok$button_suff" class="btn btn-primary" id="commdelok$button_suff" value=$plang.del_subs}
{else}
{html_submit name="commdelok$button_suff" class="btn btn-primary" id="commdelok$button_suff" value=$plang.del_subm}

View File

@ -1,12 +1,12 @@
{include file=plugin:commentcenter/header}
<h2>{$plang.del_policies}</h2>
<p>{if $single}{$plang.del_descs}{else}{$plang.del_descm}{/if}</p>
<p>{if isset($single)}{$plang.del_descs}{else}{$plang.del_descm}{/if}</p>
{html_form}
{assign var="delete" value=true}
{include file=plugin:commentcenter/listpolicies}
<p>{$plang.sure}</p>
<div class="buttonbar">
{if $single}
{if isset($single)}
{html_submit class="btn btn-primary" name="delok" id="delok" value=$plang.del_subs}
{else}
{html_submit class="btn btn-primary" name="delok" id="delok" value=$plang.del_subm}

View File

@ -1,22 +1,22 @@
{include file=plugin:commentcenter/header}
{html_form}
<h2>{if $polnew}{$plang.newpol}{else}{$plang.editpol}{/if}</h2>
<h2>{if isset($polnew)}{$plang.newpol}{else}{$plang.editpol}{/if}</h2>
<dl class="option-set">
<dt>{$plang.apply_to}</dt>
<dd>
<input type="radio" class="form-check-input" name="apply_to" id="all_entries" value="all_entries"{if $policy.is_all} checked="checked"{/if} />
<input type="radio" class="form-check-input" name="apply_to" id="all_entries" value="all_entries"{if isset($policy.is_all)} checked="checked"{/if} />
<label for="all_entries">{$plang.all_entries}</label><br />
<input type="radio" class="form-check-input" name="apply_to" id="some_entries" value="some_entries"{if !empty($policy.entry)} checked="checked"{/if} />
<input type="radio" class="form-check-input" name="apply_to" id="some_entries" value="some_entries"{if isset($policy.entry) && !empty($policy.entry)} checked="checked"{/if} />
<label for="some_entries">{$plang.some_entries}</label><br />
<input type="radio" class="form-check-input" name="apply_to" id="properties" value="properties"{if !$polnew && !$policy.is_all & empty($policy.entry)} checked="checked"{/if} />
<input type="radio" class="form-check-input" name="apply_to" id="properties" value="properties"{if isset($polnew) && !$polnew && isset($policy.is_all) && !$policy.is_all && isset($policy.entry) && empty($policy.entry)} checked="checked"{/if} />
<label for="properties">{$plang.properties}</label><br />
</dd>
<dt><label for="behavoir">{$plang.behavoir}</label></dt>
<dd>
<select name="behavoir" class="form-select" id="behavoir">
<option value="1"{if $policy.do==1} selected="selected"{/if}>{$plang.allow}</option>
<option value="0"{if $policy.do==0 && !$polnew} selected="selected"{/if}>{$plang.approvation}</option>
<option value="-1"{if $policy.do==-1} selected="selected"{/if}>{$plang.block}</option>
<option value="1"{if isset($policy.do) && $policy.do==1} selected="selected"{/if}>{$plang.allow}</option>
<option value="0"{if isset($policy.do) && $policy.do==0 && isset($polnew) && !$polnew} selected="selected"{/if}>{$plang.approvation}</option>
<option value="-1"{if isset($policy.do) && $policy.do==-1} selected="selected"{/if}>{$plang.block}</option>
</select>
</dd>
</dl>
@ -27,16 +27,16 @@
<p>{$plang.se_desc|sprintf:"<i>`$plang.some_entries`</i>"}</p>
<p>{$plang.se_fill}</p>
{if !empty($policy.entry) && !is_array($policy.entry)}
{if isset($policy.entry) && !empty($policy.entry) && !is_array($policy.entry)}
{assign var="parity" value=1}
<input type="text" class="form-control" name="entries[]" value="{$policy.entry|wp_specialchars}" />
{elseif !empty($policy.entry)}
{elseif isset($policy.entry) && !empty($policy.entry)}
{foreach name=entries_foreach from=$policy.entry item=entry}
<input type="text" class="form-control" name="entries[]" value="{$entry|wp_specialchars}" /> {if ($smarty.foreach.entries_foreach.iteration % 2)==0}<br />{/if}
{if ($smarty.foreach.entries_foreach.iteration % 2)==1 && $smarty.foreach.entries_foreach.last}{assign var="parity" value=1}{/if}
{/foreach}
{/if}
{if $parity==1} <input type="text" name="entries[]" value="" /><br />{/if}
{if isset($parity) && $parity==1} <input type="text" name="entries[]" value="" /><br />{/if}
<input type="text" class="form-control" name="entries[]" value="" />
<input type="text" class="form-control" name="entries[]" value="" /><br />
@ -58,7 +58,7 @@
<fieldset>
<legend>{$plang.po_time}</legend>
<p><label for="older">{$plang.po_older}</label>
<input type="text" class="form-control" name="older" id="older" value="{if !empty($policy.older)}{$policy.older/86400}{/if}" class="smalltextinput" style="display: inline-block;"/>
<input type="text" class="form-control" name="older" id="older" value="{if isset($policy.older) && !empty($policy.older)}{$policy.older/86400}{/if}" class="smalltextinput" style="display: inline-block;"/>
{$plang.days}</p>
<!-- TODO: add the option for timestamp -->
</fiedlset>

View File

@ -16,7 +16,7 @@
{foreach from=$entry.$fetch item=comm key=comm_id}
{assign var="i" value=$i+1}
<tr>
{if !$delete}<td class="td_select_{$fetch}"><input type="checkbox" class="form-check-input" name="select[e{$entryid}_c{$comm_id}]" /></td>{/if}
{if isset($delete) && !$delete}<td class="td_select_{$fetch}"><input type="checkbox" class="form-check-input" name="select[e{$entryid}_c{$comm_id}]" /></td>{/if}
<td>{$comm.date|date_format:"%D, %T"}</td>
<td class="main_cell">
{$comm.content|strip_tags}
@ -38,7 +38,7 @@
<a href="{$action_url|cmd_link:pubnoham:"e`$entryid`_c`$comm.id`"}" title="{$plang.app_pubnotham}"><img src="{$plugin_url}imgs/publish.png" alt="{$plang.app_pubnotham}" /></a>
{/if}
{/if}
{if $is_managing}
{if isset($is_managing)}
{assign var="rm_url" value=$action_url|cmd_link:deletecomm2:"e`$entryid`_c`$comm_id`"}
{else}
{assign var="rm_url" value=$action_url|cmd_link:deletecomm:"e`$entryid`_c`$comm_id`"}

View File

@ -10,13 +10,13 @@
<tbody id="commencenter-table-body">
{foreach name=policies from=$policies key=id item=policy}
<tr class="tr_policy{$id}">
{if !$delete} <td class="td_select"><input type="checkbox" class="form-check-input" name="select[{$id}]" /></td>{/if}
{if isset($delete) && !$delete} <td class="td_select"><input type="checkbox" class="form-check-input" name="select[{$id}]" /></td>{/if}
<td class="main-cell">
{if isset($delete)}<input type="hidden" name="del_policy[]" value="{$id}" />
{/if}
{if $policy.is_all}
{if isset($policy.is_all) && $policy.is_all}
{$plang.all_entries}
{elseif is_array($policy.entry) && count($policy.entry)>0}
{elseif isset($policy.entry) && is_array($policy.entry) && count($policy.entry)>0}
{$plang.fol_entries}
<ul>
{foreach from=$policy.entry item=entry}

View File

@ -4,7 +4,7 @@
<p>{$plang.man_searchd}</p>
<div class="form-row">
<input type="text" class="form-control" name="entry" value="{$entry_id}" style="display: inline-block;"/>
<input type="text" class="form-control" name="entry" value="{if isset($entry_id)}{$entry_id}{/if}" style="display: inline-block;"/>
{html_submit name="entry_search" class="btn btn-primary mt-1" id="entry_search" value=$plang.man_search}
</div>