diff options
| author | lsces <lester@lsces.co.uk> | 2026-03-27 16:09:48 +0000 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2026-03-27 16:09:48 +0000 |
| commit | a5c67ff464e5401629baa497692595a8d901c812 (patch) | |
| tree | 98df885b6349b700bf98dd63c495bc7814a600ca /templates | |
| parent | 3e0a5c736f12533bac64d2d40ceacd132987ff48 (diff) | |
| download | kernel-a5c67ff464e5401629baa497692595a8d901c812.tar.gz kernel-a5c67ff464e5401629baa497692595a8d901c812.tar.bz2 kernel-a5c67ff464e5401629baa497692595a8d901c812.zip | |
Figured what has been causing a problem with using && and || in smarty templates and related to mistake in processing {2} elements that should use curly brackets and not revert to square ones. (Some of these base templates have had the and-or mod for a long time, but reverting to correct format.
Diffstat (limited to 'templates')
| -rwxr-xr-x | templates/admin.tpl | 6 | ||||
| -rwxr-xr-x | templates/admin_features.tpl | 2 | ||||
| -rwxr-xr-x | templates/admin_packages.tpl | 20 | ||||
| -rwxr-xr-x | templates/bit_left.tpl | 2 | ||||
| -rwxr-xr-x | templates/bit_right.tpl | 2 | ||||
| -rw-r--r-- | templates/bot_bar.tpl | 6 | ||||
| -rwxr-xr-x | templates/bot_stats_bar.tpl | 6 | ||||
| -rw-r--r-- | templates/box.tpl | 2 | ||||
| -rwxr-xr-x | templates/error.tpl | 2 | ||||
| -rwxr-xr-x | templates/error_ticket.tpl | 4 | ||||
| -rwxr-xr-x | templates/html.tpl | 8 | ||||
| -rwxr-xr-x | templates/html_head_inc.tpl | 6 | ||||
| -rw-r--r-- | templates/menu_side_admin_inc.tpl | 4 | ||||
| -rwxr-xr-x | templates/menu_top_admin_inc.tpl | 4 | ||||
| -rwxr-xr-x | templates/pagination.tpl | 6 | ||||
| -rwxr-xr-x | templates/server_stats_inc.tpl | 2 | ||||
| -rwxr-xr-x | templates/top_bar.tpl | 6 |
17 files changed, 44 insertions, 44 deletions
diff --git a/templates/admin.tpl b/templates/admin.tpl index 5a896a5..31952b9 100755 --- a/templates/admin.tpl +++ b/templates/admin.tpl @@ -28,11 +28,11 @@ {formfeedback error=$version_info.error.string} {elseif $version_info} {legend legend="Version Check"} - {if $version_info.compare eq 0 and !$version_info.release} + {if $version_info.compare eq 0 && !$version_info.release} {formfeedback success="{tr}Your version is up to date.{/tr}"} - {elseif $version_info.compare lt 0 or $version_info.release} + {elseif $version_info.compare lt 0 || $version_info.release} {formfeedback warning="{tr}Your version is not up to date.{/tr}"} - {elseif $version_info.compare gt 0 or $version_info.release} + {elseif $version_info.compare gt 0 || $version_info.release} {formfeedback warning="{tr}Seems you are using a test version.{/tr}"} {/if} diff --git a/templates/admin_features.tpl b/templates/admin_features.tpl index 9a788b9..bf175f9 100755 --- a/templates/admin_features.tpl +++ b/templates/admin_features.tpl @@ -45,7 +45,7 @@ {/if} <option value="users_custom_home"{if $gBitSystem->getConfig('bit_index') eq $gBitSystem->getConfig('site_url_index')} selected="selected"{/if}>{tr}Custom home{/tr}</option> {foreach key=name item=package from=$gBitSystem->mPackages} - {if $package.homeable and $package.installed} + {if $package.homeable && $package.installed} <option {if $gBitSystem->getConfig('bit_index') eq $package.dir}selected="selected"{/if} value="{$package.dir}">{$package.dir|capitalize}</option> {/if} {/foreach} diff --git a/templates/admin_packages.tpl b/templates/admin_packages.tpl index 1f0b4a8..66afec5 100755 --- a/templates/admin_packages.tpl +++ b/templates/admin_packages.tpl @@ -2,7 +2,7 @@ {* checks if installer path is available *} {assign var=installfile value="`$smarty.const.INSTALL_PKG_PATH`install.php"|is_file} {assign var=installread value="`$smarty.const.INSTALL_PKG_PATH`install.php"|is_readable} -{if $installfile neq 1 and $installread neq 1} +{if $installfile neq 1 && $installread neq 1} {capture assign=install_unavailable} <p>{tr}You might have to rename your <strong>install/install.done</strong> file back to <strong>install/install.php</strong>.{/tr}</p> {/capture} @@ -47,7 +47,7 @@ <div class="bit-columns"> {foreach key=name item=package from=$gBitSystem->mPackages} - {if $package.installed|default:false and !$package.service|default:false and !$package.required|default:true } + {if $package.installed|default:false && !$package.service|default:false && !$package.required|default:true } <div class="bit-column-cell"> <div class="well"> <div class="form-group clear"> @@ -58,7 +58,7 @@ <label> {assign var=is_requirement value=''} {foreach from=$gBitSystem->mRequirements key=req item=reqs} - {if !empty($reqs.$name) and $gBitSystem->isPackageActive($req) and $package.active_switch eq 'y'} + {if !empty($reqs.$name) && $gBitSystem->isPackageActive($req) && $package.active_switch eq 'y'} {assign var=is_requirement value='true'} {/if} {/foreach} @@ -95,7 +95,7 @@ </p> <div class="bit-columns"> {foreach key=name item=package from=$gBitSystem->mPackages} - {if $package.installed and !empty($package.service) and !$package.required|default:false} + {if $package.installed && !empty($package.service) && !$package.required|default:false} <div class="bit-column-cell"> <div class="well"> <div class="form-group"> @@ -106,7 +106,7 @@ <label> {assign var=is_requirement value=''} {foreach from=$gBitSystem->mRequirements key=req item=reqs} - {if !empty($reqs.$name) and $gBitSystem->isPackageActive($req) and $package.active_switch eq 'y'} + {if !empty($reqs.$name) && $gBitSystem->isPackageActive($req) && $package.active_switch eq 'y'} {assign var=is_requirement value='true'} {/if} {/foreach} @@ -147,7 +147,7 @@ {legend legend="Required packages installed on your system"} <div class="bit-columns"> {foreach key=name item=package from=$gBitSystem->mPackages} - {if $package.installed and !$package.service and $package.required|default:false } + {if $package.installed && !$package.service && $package.required|default:false } <div class="bit-column-cell"> <div class="well"> <div class="form-group"> @@ -168,7 +168,7 @@ {legend legend="Required services installed on your system"} <div class="bit-columns"> {foreach key=name item=package from=$gBitSystem->mPackages} - {if $package.installed and !empty($package.service) and $package.required|default:false} + {if $package.installed && !empty($package.service) && $package.required|default:false} <div class="bit-column-cell"> <div class="well"> <div class="form-group"> @@ -191,7 +191,7 @@ {/jstab} - {if !empty($requirementsMap) or !empty($requirements)} + {if !empty($requirementsMap) || !empty($requirements)} {jstab title="Dependencies"} {legend legend="Requirements"} {if !empty($requirementsMap)} @@ -264,7 +264,7 @@ {formfeedback warning="At least one package recommend a version lower to the one you have installed. This might cause problems."} {/if} - {if !$min_dep and !$max_dep and !$missing} + {if !$min_dep && !$max_dep && !$missing} {formfeedback success="All package requirements have been met."} {/if} {/if} @@ -289,7 +289,7 @@ <div class="bit-columns"> {foreach key=name item=package from=$gBitSystem->mPackages} - {if ((1 or $package.tables) and !$package.required|default:false and !$package.installed|default:false) } + {if ((1 || $package.tables) && !$package.required|default:false && !$package.installed|default:false) } <div class="bit-column-cell"> <div class="well"> <div class="form-group clear"> diff --git a/templates/bit_left.tpl b/templates/bit_left.tpl index eff37d4..5e085e9 100755 --- a/templates/bit_left.tpl +++ b/templates/bit_left.tpl @@ -1,4 +1,4 @@ -{if $gBitSystem->isFeatureActive( 'site_left_column' ) and $l_modules and !$gHideModules} +{if $gBitSystem->isFeatureActive( 'site_left_column' ) && $l_modules && !$gHideModules} {section name=homeix loop=$l_modules} {$l_modules[homeix].data} {/section} diff --git a/templates/bit_right.tpl b/templates/bit_right.tpl index 55b4f06..455ecdc 100755 --- a/templates/bit_right.tpl +++ b/templates/bit_right.tpl @@ -1,4 +1,4 @@ -{if $gBitSystem->isFeatureActive( 'site_right_column' ) and $r_modules and !$gHideModules} +{if $gBitSystem->isFeatureActive( 'site_right_column' ) && $r_modules && !$gHideModules} {section name=homeix loop=$r_modules} {$r_modules[homeix].data} {/section} diff --git a/templates/bot_bar.tpl b/templates/bot_bar.tpl index 8459772..4866736 100644 --- a/templates/bot_bar.tpl +++ b/templates/bot_bar.tpl @@ -17,11 +17,11 @@ {if $version_info.error.number ne 0} {$version_info.error.string} - {elseif $version_info.compare eq 0 and !$version_info.release} + {elseif $version_info.compare eq 0 && !$version_info.release} {tr}Your version is up to date.{/tr} - {elseif $version_info.compare lt 0 or $version_info.release} + {elseif $version_info.compare lt 0 || $version_info.release} {tr}Your version is not up to date.{/tr} - {elseif $version_info.compare gt 0 or $version_info.release} + {elseif $version_info.compare gt 0 || $version_info.release} {tr}Seems you are using a test version.{/tr} {/if} </div> diff --git a/templates/bot_stats_bar.tpl b/templates/bot_stats_bar.tpl index d55e2aa..d48fa26 100755 --- a/templates/bot_stats_bar.tpl +++ b/templates/bot_stats_bar.tpl @@ -17,11 +17,11 @@ {if $version_info.error.number ne 0} {$version_info.error.string} - {elseif $version_info.compare eq 0 and !$version_info.release} + {elseif $version_info.compare eq 0 && !$version_info.release} {tr}Your version is up to date.{/tr} - {elseif $version_info.compare lt 0 or $version_info.release} + {elseif $version_info.compare lt 0 || $version_info.release} {tr}Your version is not up to date.{/tr} - {elseif $version_info.compare gt 0 or $version_info.release} + {elseif $version_info.compare gt 0 || $version_info.release} {tr}Seems you are using a test version.{/tr} {/if} </div> diff --git a/templates/box.tpl b/templates/box.tpl index edb34da..1016bf2 100644 --- a/templates/box.tpl +++ b/templates/box.tpl @@ -1,6 +1,6 @@ {strip} <div class="{$class|default:"box"}" {$atts}> - {if $ipackage and $iname} + {if $ipackage && $iname} {biticon ipackage=$ipackage iname=$iname iexplain=$iexplain iclass=$iclass iforce=icon} {/if} diff --git a/templates/error.tpl b/templates/error.tpl index a80181b..12995a6 100755 --- a/templates/error.tpl +++ b/templates/error.tpl @@ -22,7 +22,7 @@ </div> {/if} - {if !empty($page) and ( $gBitUser->isAdmin() or $gBitUser->hasPermission( 'p_wiki_admin' ) )} + {if !empty($page) && ( $gBitUser->isAdmin() || $gBitUser->hasPermission( 'p_wiki_admin' ) )} <p>{tr}Create the page{/tr}: <a href="{$smarty.const.WIKI_PKG_URL}edit.php?page={$page}">{$page}</a></p> {/if} diff --git a/templates/error_ticket.tpl b/templates/error_ticket.tpl index 59d6153..1637a80 100755 --- a/templates/error_ticket.tpl +++ b/templates/error_ticket.tpl @@ -10,7 +10,7 @@ <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> -{if $gBitSystem->isFeatureActive( 'site_left_column' ) and $l_modules} +{if $gBitSystem->isFeatureActive( 'site_left_column' ) && $l_modules} <td id="bitleft"> {section name=homeix loop=$l_modules} {$l_modules[homeix].data} @@ -37,7 +37,7 @@ </div> </div> </td> -{if $gBitSystem->isFeatureActive( 'site_right_column' ) and $r_modules} +{if $gBitSystem->isFeatureActive( 'site_right_column' ) && $r_modules} <td id="bitright"> {section name=homeix loop=$r_modules} {$r_modules[homeix].data} diff --git a/templates/html.tpl b/templates/html.tpl index 3483f1d..70d962f 100755 --- a/templates/html.tpl +++ b/templates/html.tpl @@ -43,11 +43,11 @@ {if $gBitSystem->isFeatureActive( 'bidirectional_text' )}<div dir="rtl">{/if} {if $gBitThemes->mDisplayMode != 'edit'} - {if $gBitSystem->isFeatureActive( 'site_left_column' ) and !$gHideModules and $gBitThemes->hasColumnModules('l')} + {if $gBitSystem->isFeatureActive( 'site_left_column' ) && !$gHideModules && $gBitThemes->hasColumnModules('l')} {assign var=leftCol value=$gBitThemes->fetchLayoutColumn('l')} {/if} - {if $gBitSystem->isFeatureActive( 'site_right_column' ) and !$gHideModules and $gBitThemes->hasColumnModules('r')} + {if $gBitSystem->isFeatureActive( 'site_right_column' ) && !$gHideModules && $gBitThemes->hasColumnModules('r')} {assign var=rightCol value=$gBitThemes->fetchLayoutColumn('r')} {/if} {/if} @@ -64,7 +64,7 @@ {assign var=extraColumns value=0} {/if} - {if $gBitSystem->isFeatureActive( 'site_top_column' ) and !$gHideModules} + {if $gBitSystem->isFeatureActive( 'site_top_column' ) && !$gHideModules} <header itemscope itemtype="http://schema.org/WPHeader" role="banner" class="container{$gBitSystem->getConfig('layout-header')}" id="bw-main-header"> {$gBitThemes->displayLayoutColumn('t')} {if $gBitSystem->getConfig('site_notice')} @@ -117,7 +117,7 @@ <footer id="bw-main-footer" class="container{$gBitSystem->getConfig('layout-footer')}"> {**** Theme Layout Modules : BOTTOM ****} - {if $gBitSystem->isFeatureActive( 'site_bottom_column' ) and !$gHideModules} + {if $gBitSystem->isFeatureActive( 'site_bottom_column' ) && !$gHideModules} {$gBitThemes->displayLayoutColumn('b')} {/if} {* get custom footer files from individual packages *} diff --git a/templates/html_head_inc.tpl b/templates/html_head_inc.tpl index 1ded775..a23c364 100755 --- a/templates/html_head_inc.tpl +++ b/templates/html_head_inc.tpl @@ -7,7 +7,7 @@ <meta name="description" content="{$metaDescription|escape}" /> {elseif $smarty.server.REQUEST_URI==$smarty.const.BIT_ROOT_URL} <meta name="description" content="{$gBitSystem->getConfig('site_description')|escape}"/> -{elseif !empty($gContent) and $gContent->isValid()} +{elseif !empty($gContent) && $gContent->isValid()} <meta name="description" content="{$gContent->generateDescription()|strip_tags|escape}"/> {/if} @@ -15,7 +15,7 @@ <meta name="keywords" content="{$metaKeywords|escape}" /> {elseif $smarty.server.REQUEST_URI==BIT_ROOT_URI} <meta name="keywords" content="{$metaKeywords|default:$gBitSystem->getConfig('site_keywords')}" /> -{elseif !empty($gContent) and $gContent->isValid()} +{elseif !empty($gContent) && $gContent->isValid()} <meta name="keywords" content="{','|implode:$gContent->generateKeywords()|strip_tags|escape}"/> {/if} @@ -74,7 +74,7 @@ var bitTk = "{$gBitUser->mTicket}"; /* ]]> */</script> -{if $gBitSystem->isPackageActive('jscalendar') and $gBitSystem->isFeatureActive( 'site_use_jscalendar' )} +{if $gBitSystem->isPackageActive('jscalendar') && $gBitSystem->isFeatureActive( 'site_use_jscalendar' )} <link rel="stylesheet" title="{$style}" type="text/css" href="{$smarty.const.UTIL_PKG_URL}javascript/dynarch/jscalendar/calendar-system.css" media="all" nonce="{$cspNonce} /> <script nonce="{$cspNonce}" async src="{$smarty.const.UTIL_PKG_URL}javascript/dynarch/jscalendar/calendar.js"></script> <script nonce="{$cspNonce}" async src="{$smarty.const.UTIL_PKG_URL}javascript/dynarch/jscalendar/lang/calendar-en.js"></script> diff --git a/templates/menu_side_admin_inc.tpl b/templates/menu_side_admin_inc.tpl index 4b5aad0..5205d64 100644 --- a/templates/menu_side_admin_inc.tpl +++ b/templates/menu_side_admin_inc.tpl @@ -4,14 +4,14 @@ </a> <ul class="dropdown-menu sub-menu pull-right"> {foreach key=key item=menu from=$adminMenu} - {if $key eq 'kernel' or $key eq 'liberty' or $key eq 'users' or $key eq 'themes'} + {if $key eq 'kernel' || $key eq 'liberty' || $key eq 'users' || $key eq 'themes'} <li class="dropdown-submenu"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><strong>{$key|capitalize}</strong></a> {include file=$menu.tpl packageMenuClass="dropdown-menu"} </li> {/if} {/foreach} {foreach key=key item=menu from=$adminMenu} - {if $key neq 'kernel' and $key neq 'liberty' and $key neq 'users' and $key neq 'themes'} + {if $key neq 'kernel' && $key neq 'liberty' && $key neq 'users' && $key neq 'themes'} <li class="dropdown-submenu"><a href="#" class="dropdown-toggle" data-toggle="dropdown">{$key|capitalize}</a> {include file=$menu.tpl packageMenuClass="dropdown-menu"} </li> diff --git a/templates/menu_top_admin_inc.tpl b/templates/menu_top_admin_inc.tpl index 4858f10..8e53573 100755 --- a/templates/menu_top_admin_inc.tpl +++ b/templates/menu_top_admin_inc.tpl @@ -3,12 +3,12 @@ </a> <ul class="dropdown-menu sub-menu pull-right"> {foreach key=key item=menu from=$adminMenu} - {if $key=='kernel' or $key=='liberty' or $key=='users' or $key=='themes'} + {if $key=='kernel' || $key=='liberty' || $key=='users' || $key=='themes'} <li class="dropdown-submenu favorite">{include file=$menu.tpl packageMenuTitle=$key packageMenuClass="dropdown-menu sub-menu"}</li> {/if} {/foreach} {foreach key=key item=menu from=$adminMenu} - {if $key!=='kernel' and $key!=='liberty' and $key!=='users' and $key!=='themes'} + {if $key!=='kernel' && $key!=='liberty' && $key!=='users' && $key!=='themes'} <li class="dropdown-submenu">{include file=$menu.tpl packageMenuTitle=$key packageMenuClass="dropdown-menu sub-menu"}</li> {/if} {/foreach} diff --git a/templates/pagination.tpl b/templates/pagination.tpl index 05624b0..5afec7d 100755 --- a/templates/pagination.tpl +++ b/templates/pagination.tpl @@ -28,7 +28,7 @@ {if $value ne ''}{$param}={$value}&{/if} {/if} {/foreach} - {if isset($listInfo.sort_mode) and $listInfo.sort_mode ne ''} + {if isset($listInfo.sort_mode) && $listInfo.sort_mode ne ''} {if is_array($listInfo.sort_mode)} {foreach from=$listInfo.sort_mode item=sort} sort_mode[]={$sort}& @@ -37,14 +37,14 @@ sort_mode={$listInfo.sort_mode}& {/if} {/if} - {if isset($listInfo.find) and $listInfo.find ne ''} + {if isset($listInfo.find) && $listInfo.find ne ''} find={$listInfo.find}& {/if} {/capture} {assign var=pageUrlVar value=$smarty.capture.string|regex_replace:'/"/':'%22'} {assign var=pageUrl value="`$pgnUrl`?`$pageUrlVar`"} {/if} -{if !empty($listInfo) and $listInfo.total_pages > 1 and $listInfo.page_records} +{if !empty($listInfo) && $listInfo.total_pages > 1 && $listInfo.page_records} <div class="paginator overflow-hidden clear"> <ul class="pagination pull-left"> {if $listInfo.current_page > 1} diff --git a/templates/server_stats_inc.tpl b/templates/server_stats_inc.tpl index 6b8bac2..a05211a 100755 --- a/templates/server_stats_inc.tpl +++ b/templates/server_stats_inc.tpl @@ -1,4 +1,4 @@ -{strip}{if !$gBitSystem->isLive() or $gBitUser->hasPermission('p_stats_view')} +{strip}{if !$gBitSystem->isLive() || $gBitUser->hasPermission('p_stats_view')} <div class="server-stats"> {if !$gBitSystem->isLive()}<span class="alert alert-warning">{tr}Site is not live. Search engines will not index this site.{/tr}</span>{/if} {tr}Execution:{/tr} {elapsed}s, {memusage}, {$gBitSystem->mDb->mNumQueries} Queries ( {$gBitSystem->mDb->mQueryTime|string_format:"%.3f"}s / {($gBitSystem->mDb->mQueryTime/$gBitSystem->mTimer->elapsed()*100)|round}% ) diff --git a/templates/top_bar.tpl b/templates/top_bar.tpl index c84c73e..ea6e63c 100755 --- a/templates/top_bar.tpl +++ b/templates/top_bar.tpl @@ -9,7 +9,7 @@ {if $gBitSystem->mAppMenu.bar} <ul class="nav navbar-nav"> {foreach key=key item=menu from=$gBitSystem->mAppMenu.bar} - {if $menu.menu_title and $menu.index_url and $menu.menu_template and !$menu.is_disabled} + {if $menu.menu_title && $menu.index_url && $menu.menu_template && !$menu.is_disabled} {if $gBitSystem->isFeatureActive( 'site_top_bar_dropdown' )} <li class="dropdown m-{$key}{if $gBitSystem->getActivePackage() eq $menu.package_name} active{/if}"> {include file="`$menu.menu_template`" packageMenuClass="dropdown-menu" packageMenuTitle=$menu.menu_title} @@ -25,7 +25,7 @@ {/if} {if !empty($gBitSystem->mAppMenu.form)} {foreach key=key item=menu from=$gBitSystem->mAppMenu.form} - {if $menu.menu_title and $menu.index_url and $menu.menu_template and !$menu.is_disabled} + {if $menu.menu_title && $menu.index_url && $menu.menu_template && !$menu.is_disabled} {include file="`$menu.menu_template`" packageMenuClass="dropdown-menu" packageMenuTitle=$menu.menu_title} {/if} {/foreach} @@ -55,7 +55,7 @@ {/if} </nav> -{if $gBitSystem->isFeatureActive('site_top_bar_js') and $gBitSystem->isFeatureActive('site_top_bar_dropdown')} +{if $gBitSystem->isFeatureActive('site_top_bar_js') && $gBitSystem->isFeatureActive('site_top_bar_dropdown')} <script> /*<