diff options
| author | lsces <lester@lsces.co.uk> | 2025-08-27 15:36:27 +0100 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2025-08-27 15:36:27 +0100 |
| commit | c7151e5754fab3aa6ccd3f5f9ee15e29f0793c00 (patch) | |
| tree | 18283408c5ca3974b29b6395fd9353f6876a6025 | |
| parent | 715848db7c3b4f9a7e1f4861dd40907f57b340b8 (diff) | |
| download | themes-c7151e5754fab3aa6ccd3f5f9ee15e29f0793c00.tar.gz themes-c7151e5754fab3aa6ccd3f5f9ee15e29f0793c00.tar.bz2 themes-c7151e5754fab3aa6ccd3f5f9ee15e29f0793c00.zip | |
Templates updated to PHP8.4 and namespace
| -rw-r--r-- | templates/admin_layout.tpl | 22 | ||||
| -rw-r--r-- | templates/admin_layout_inc.tpl | 2 | ||||
| -rw-r--r-- | templates/admin_layout_overview.tpl | 2 | ||||
| -rw-r--r-- | templates/admin_themes.tpl | 2 | ||||
| -rw-r--r-- | templates/html_head_inc.tpl | 21 | ||||
| -rw-r--r-- | templates/module.tpl | 6 | ||||
| -rw-r--r-- | templates/module_config_inc.tpl | 8 | ||||
| -rw-r--r-- | templates/module_config_role_inc.tpl | 6 | ||||
| -rw-r--r-- | templates/popup_header_inc.tpl | 2 |
9 files changed, 37 insertions, 34 deletions
diff --git a/templates/admin_layout.tpl b/templates/admin_layout.tpl index 6d04d41..4eccf64 100644 --- a/templates/admin_layout.tpl +++ b/templates/admin_layout.tpl @@ -116,7 +116,7 @@ {foreach key=pkg item=modules from=$allModules} <optgroup label="{$pkg}"> {foreach key=value item=module from=$modules} - <option value="{$value}" {if $fAssign.name eq $value}selected="selected"{/if}>{$module.title}</option> + <option value="{$value}" {if $fAssign.name|default:'' eq $value}selected="selected"{/if}>{$module.title|default:''}</option> {/foreach} </optgroup> {/foreach} @@ -131,12 +131,12 @@ {forminput} <select name="fAssign[layout_area]" id="layout_area"> {if $gBitSystem->isFeatureActive('site_top_column')} - <option value="t" {if $fAssign.layout_area eq 't'}selected="selected"{/if}>{tr}Top{/tr}</option> + <option value="t" {if $fAssign.layout_area|default:'' eq 't'}selected="selected"{/if}>{tr}Top{/tr}</option> {/if} - <option value="l" {if $fAssign.layout_area eq 'l'}selected="selected"{/if}>{tr}Left column{/tr}</option> - <option value="r" {if $fAssign.layout_area eq 'r'}selected="selected"{/if}>{tr}Right column{/tr}</option> + <option value="l" {if $fAssign.layout_area|default:'' eq 'l'}selected="selected"{/if}>{tr}Left column{/tr}</option> + <option value="r" {if $fAssign.layout_area|default:'' eq 'r'}selected="selected"{/if}>{tr}Right column{/tr}</option> {if $gBitSystem->isFeatureActive('site_bottom_column')} - <option value="b" {if $fAssign.layout_area eq 'b'}selected="selected"{/if}>{tr}Bottom{/tr}</option> + <option value="b" {if $fAssign.layout_area|default:'' eq 'b'}selected="selected"{/if}>{tr}Bottom{/tr}</option> {/if} </select> {formhelp note="Select the column this module should be displayed in."} @@ -146,7 +146,7 @@ <div class="form-group"> {formlabel label="Title" for="title"} {forminput} - <input type="text" size="48" name="fAssign[title]" id="title" value="{$fAssign.title|escape}" /> + <input type="text" size="48" name="fAssign[title]" id="title" value="{$fAssign.title|default:''|escape}" /> {formhelp note="Here you can override the default title used by the module. This is global for layouts in all sections. If you want to add a title just for one section, enter a module parameter below such as: title=My Title"} {/forminput} </div> @@ -156,7 +156,7 @@ {forminput} <select name="fAssign[pos]" id="pos"> {section name=ix loop=$orders} - <option value="{$orders[ix]|escape}" {if $fAssign.pos eq $orders[ix]}selected="selected"{/if}>{$orders[ix]}</option> + <option value="{$orders[ix]|escape}" {if $fAssign.pos|default:0 eq $orders[ix]}selected="selected"{/if}>{$orders[ix]}</option> {/section} </select> {formhelp note="Select where within the column the module should be displayed."} @@ -166,7 +166,7 @@ <div class="form-group"> {formlabel label="Cache Time" for="cache_time"} {forminput} - <input type="text" size="5" name="fAssign[cache_time]" id="cache_time" value="{$fAssign.cache_time|escape}" /> seconds + <input type="text" size="5" name="fAssign[cache_time]" id="cache_time" value="{$fAssign.cache_time|default:''|escape}" /> seconds {formhelp note="This is the number of seconds the module is cached before the content is refreshed. The higher the value, the less load there is on the server. (optional)"} {/forminput} </div> @@ -174,7 +174,7 @@ <div class="form-group"> {formlabel label="Rows" for="module_rows"} {forminput} - <input type="text" size="5" name="fAssign[module_rows]" id="module_rows" value="{$fAssign.module_rows|escape}" /> + <input type="text" size="5" name="fAssign[module_rows]" id="module_rows" value="{$fAssign.module_rows|default:0|escape}" /> {formhelp note="Select what the maximum number of items are displayed. (optional - default is 10)"} {/forminput} </div> @@ -189,9 +189,9 @@ {if $module.params} <table id="themes_params_help_{$value}" class="themes_params_help" style="display:none"> <tr> - <th colspan=2 style="text-align:left">Options for {$module.title}</th> + <th colspan=2 style="text-align:left">Options for {$module.title|default:''}</th> </tr> - {foreach key=param item=data from=$module.params} + {foreach key=param item=data from=$module.params|default:[]} {if $data.help} <tr> <td style="font-weight:bold; padding-right:4px">{$param}</td> diff --git a/templates/admin_layout_inc.tpl b/templates/admin_layout_inc.tpl index abffe56..de2a41b 100644 --- a/templates/admin_layout_inc.tpl +++ b/templates/admin_layout_inc.tpl @@ -4,7 +4,7 @@ <div class="form-group"> {formlabel label="Adjust display" for=""} {forminput} - {if !$smarty.request.nocollapse} + {if !$smarty.request.nocollapse|default:false} <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page={$page}&nocollapse=1">{booticon iname="fa-circle-plus" iexplain="Expand all modules"}</a> {else} <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page={$page}">{booticon iname="fa-circle-minus" iexplain="Collapse all modules"}</a> diff --git a/templates/admin_layout_overview.tpl b/templates/admin_layout_overview.tpl index 65adaa3..88bc03b 100644 --- a/templates/admin_layout_overview.tpl +++ b/templates/admin_layout_overview.tpl @@ -5,7 +5,7 @@ {form} <input type="hidden" name="page" value="{$page}" /> - <input type="hidden" name="nocollapse" value="{$smarty.request.nocollapse}" /> + <input type="hidden" name="nocollapse" value="{$smarty.request.nocollapse|default:false}" /> {jstabs} {foreach name=PkgLayouts from=$layouts item=layout key=module_package} diff --git a/templates/admin_themes.tpl b/templates/admin_themes.tpl index e50f619..2fa83a9 100644 --- a/templates/admin_themes.tpl +++ b/templates/admin_themes.tpl @@ -39,7 +39,7 @@ {forminput label="checkbox"} {html_checkboxes name="$feature" values="y" checked=$gBitSystem->getConfig($feature) label=$output.label id=$feature} {$output.label} - {formhelp note=$output.note page=$output.page} + {formhelp note=$output.note page=$output.page|default:''} {/forminput} </div> {/foreach} diff --git a/templates/html_head_inc.tpl b/templates/html_head_inc.tpl index 0d5ce57..0c2c1cd 100644 --- a/templates/html_head_inc.tpl +++ b/templates/html_head_inc.tpl @@ -1,12 +1,15 @@ {strip} -{foreach from=$gBitThemes->mRawFiles.css item=cssFile} - <link rel="stylesheet" title="{$style}" type="text/css" href="{$cssFile}" media="all"> -{/foreach} - -{foreach from=$gBitThemes->mRawFiles.js item=jsFile} - <script src="{$jsFile}"></script> -{/foreach} -{if $gBitThemes->mStyles.joined_css} - <link rel="stylesheet" title="{$style}" type="text/css" href="{$gBitThemes->mStyles.joined_css}" media="all"> +{if !empty($gBitThemes->mRawFiles.css)} + {foreach from=$gBitThemes->mRawFiles.css item=cssFile} + <link rel="stylesheet" title="{$style|default:'css'}" nonce="{$cspNonce}" type="text/css" href="{$cssFile}" media="all" /> + {/foreach} +{/if} +{if !empty($gBitThemes->mRawFiles.js)} + {foreach from=$gBitThemes->mRawFiles.js item=jsFile} + <script nonce="{$cspNonce}" src="{$jsFile}"></script> + {/foreach} +{/if} +{if !empty($gBitThemes->mStyles.joined_css)} + <link rel="stylesheet" title="{$style|default:'css'}" type="text/css" href="{$gBitThemes->mStyles.joined_css}" media="all" nonce="{$cspNonce}" /> {/if} {/strip} diff --git a/templates/module.tpl b/templates/module.tpl index d478d66..8064a1c 100644 --- a/templates/module.tpl +++ b/templates/module.tpl @@ -15,7 +15,7 @@ {assign var=area value=$moduleArea} {/if} -<{$moduleTag} class="panel panel-default module{if !empty($modInfo.class)} {$modInfo.class}{/if} {$modInfo.name|replace:'_':'-'}" {if !empty($area)}id="{$area}{$moduleParams.pos}"{/if}> +<{$moduleTag} class="panel panel-default module{if !empty($modInfo.class)} {$modInfo.class}{/if} {if !empty($modInfo.class)} {$modInfo.name|replace:'_':'-'|default:''}{/if}" {if !empty($area)}id="{$area}{$moduleParams.pos}"{/if}> {if empty($modInfo.notitle)} <div class="panel-heading"> {if $gBitSystem->isFeatureActive( 'themes_module_controls' )} @@ -29,7 +29,7 @@ </div> {/if} {if $gBitSystem->isFeatureActive( 'themes_collapsible_modules' )}<a href="javascript:BitBase.toggle('module{$area}{$moduleParams.pos}','block',true);">{/if} - {if $modInfo.notra} + {if !empty($modInfo.notra)} {$modInfo.title|default:$moduleParams.title} {else} {tr}{$modInfo.title|default:$moduleParams.title}{/tr} @@ -38,7 +38,7 @@ </div> {/if} <div class="panel-body"{if $gBitSystem->isFeatureActive( 'themes_collapsible_modules' )} style="display:{$moduleParams.toggle_state|default:block};" id="module{$area}{$moduleParams.pos}"{/if}> - {$modInfo.data} + {$modInfo.data|default:null} </div> </{$moduleTag}> {/strip} diff --git a/templates/module_config_inc.tpl b/templates/module_config_inc.tpl index 53b48ea..20c67c8 100644 --- a/templates/module_config_inc.tpl +++ b/templates/module_config_inc.tpl @@ -17,17 +17,17 @@ {strip} <strong> - {if !$smarty.request.nocollapse && !$condensed && $gBitThemes->isJavascriptEnabled()}<a href="javascript:BitBase.flipWithSign('id-{$modInfo.module_id}');"><span id="flipperid-{$modInfo.module_id}" class="monospace">[+]</span> {/if} + {if !$smarty.request.nocollapse|default:false && !$condensed && $gBitThemes->isJavascriptEnabled()}<a href="javascript:BitBase.flipWithSign('id-{$modInfo.module_id}');"><span id="flipperid-{$modInfo.module_id}" class="monospace">[+]</span> {/if} {$modInfo.name} <input type="hidden" name="modules[{$modInfo.module_id}][layout_area]" value="{$area}" /> <input type="hidden" name="modules[{$modInfo.module_id}][layout]" value="{$module_package}" /> - {if !$smarty.request.nocollapse && !$condensed && $gBitThemes->isJavascriptEnabled()}</a>{/if} + {if !$smarty.request.nocollapse|default:false && !$condensed && $gBitThemes->isJavascriptEnabled()}</a>{/if} <br /> {$smarty.capture.shared} </strong> {if !$condensed} - {if !$smarty.request.nocollapse && $gBitThemes->isJavascriptEnabled()}<div id="id-{$modInfo.module_id}" style="display:none;">{/if} + {if !$smarty.request.nocollapse|default:false && $gBitThemes->isJavascriptEnabled()}<div id="id-{$modInfo.module_id}" style="display:none;">{/if} <table class="table data"> <tr> <td class="alignright">{tr}Position{/tr}</td> @@ -73,6 +73,6 @@ </td> </tr> </table> - {if !$smarty.request.nocollapse && $gBitThemes->isJavascriptEnabled()}</div>{/if} + {if !$smarty.request.nocollapse|default:false && $gBitThemes->isJavascriptEnabled()}</div>{/if} {/if} {/strip} diff --git a/templates/module_config_role_inc.tpl b/templates/module_config_role_inc.tpl index c310cda..0cd270c 100644 --- a/templates/module_config_role_inc.tpl +++ b/templates/module_config_role_inc.tpl @@ -19,17 +19,17 @@ {strip} <strong> - {if !$smarty.request.nocollapse && !$condensed && $gBitThemes->isJavascriptEnabled()}<a href="javascript:BitBase.flipWithSign('id-{$modInfo.module_id}');"><span id="flipperid-{$modInfo.module_id}" class="monospace">[+]</span> {/if} + {if !$smarty.request.nocollapse|default:false && !$condensed && $gBitThemes->isJavascriptEnabled()}<a href="javascript:BitBase.flipWithSign('id-{$modInfo.module_id}');"><span id="flipperid-{$modInfo.module_id}" class="monospace">[+]</span> {/if} {$modInfo.name} <input type="hidden" name="modules[{$modInfo.module_id}][layout_area]" value="{$area}" /> <input type="hidden" name="modules[{$modInfo.module_id}][layout]" value="{$module_package}" /> - {if !$smarty.request.nocollapse && !$condensed && $gBitThemes->isJavascriptEnabled()}</a>{/if} + {if !$smarty.request.nocollapse|default:false && !$condensed && $gBitThemes->isJavascriptEnabled()}</a>{/if} <br /> {$smarty.capture.shared} </strong> {if !$condensed} - {if !$smarty.request.nocollapse && $gBitThemes->isJavascriptEnabled()}<div id="id-{$modInfo.module_id}" style="display:none;">{/if} + {if !$smarty.request.nocollapse|default:false && $gBitThemes->isJavascriptEnabled()}<div id="id-{$modInfo.module_id}" style="display:none;">{/if} <table class="table data"> <tr> <td class="alignright">{tr}Position{/tr}</td> diff --git a/templates/popup_header_inc.tpl b/templates/popup_header_inc.tpl index 8c3f311..701a755 100644 --- a/templates/popup_header_inc.tpl +++ b/templates/popup_header_inc.tpl @@ -3,7 +3,7 @@ <head> <title>{$browserTitle} - {$gBitSystem->getConfig('site_title')}</title> - <link rel="stylesheet" title="{$style}" type="text/css" href="{$gBitThemes->getStyleCssFile($smarty.request.site_style,1)}" media="all"> + <link rel="stylesheet" title="{$style}" type="text/css" href="{$gBitThemes->getStyleCssFile($smarty.request.site_style,1)}" media="all" /> {include file="bitpackage:kernel/header_inc.tpl"} {include file="bitpackage:themes/header_inc.tpl"} </head> |
