issue #1309 compatibility PHP 8

This commit is contained in:
plegall
2021-08-06 15:46:04 +02:00
parent e537eac9dd
commit a0be45af34
8 changed files with 33 additions and 12 deletions

View File

@@ -63,10 +63,14 @@ $(document).ready(() => {
cont.find(".icon-folder-open, .icon-sitemap").addClass(colors[colorId]);
}
var url_split = window.location.href.split("&");
var url_split = window.location.href.split("#");
var catToOpen = url_split[url_split.length-1].split("-")[1];
if(catToOpen) {
function isNumeric(num){
return !isNaN(num)
}
if(catToOpen && isNumeric(catToOpen)) {
goToNode($('.tree').tree('getNodeById', catToOpen), $('.tree').tree('getNodeById', catToOpen));
}

View File

@@ -43,7 +43,8 @@ jQuery(document).ready(function(){
});
{/literal}{/footer_script}
<h2>{'User comments'|@translate} {$TABSHEET_TITLE}</h2>
<h2>{'User comments'|@translate}{if isset($TABSHEET_TITLE)} {$TABSHEET_TITLE}{/if}
</h2>
<div class="commentFilter">
<a href="{$F_ACTION}&amp;filter=all" class="{if $filter == 'all'}commentFilterSelected{/if}">{'All'|@translate}</a> ({$nb_total})

View File

@@ -71,7 +71,11 @@ usersCache.selectize(jQuery('select.UserSearch'));
</div>
<div class="groupHeader">
<div class="groupIcon">
<div class="icon-users-1 {$grp_color}"></div>
<div class="icon-users-1
{if isset($grp_color)}
{$grp_color}
{/if}">
</div>
<div class="groupMessage icon-ok"></div>
<div class="groupError icon-cancel"></div>
</div>

View File

@@ -102,10 +102,10 @@ $(window).bind("load", function() {
{assign var='version' value=$theme.VERSION}
{/if}
<div class="themeBox{if $theme.IS_DEFAULT} themeDefault{/if}">
<div class="themeBox{if isset($theme.IS_DEFAULT) and $theme.IS_DEFAULT} themeDefault{/if}">
<div class="themeShot"><a href="{$theme.SCREENSHOT}" class="preview-box" title="{$theme.NAME}"><img src="{$theme.SCREENSHOT}" alt=""></a></div>
<div class="themeName" title="{$theme.NAME}">
{$theme.NAME} {if $theme.IS_DEFAULT}<i class="icon-star" title="{'default'|@translate}"></i>{/if} {if $theme.IS_MOBILE}<i class="icon-mobile" title="{'Mobile'|translate}"></i>{/if}
{$theme.NAME} {if isset($theme.IS_DEFAULT) and $theme.IS_DEFAULT}<i class="icon-star" title="{'default'|@translate}"></i>{/if} {if $theme.IS_MOBILE}<i class="icon-mobile" title="{'Mobile'|translate}"></i>{/if}
<a class="icon-ellipsis-v showInfo"></a>
</div>
<div class="showInfo-dropdown dropdown">
@@ -125,7 +125,7 @@ $(window).bind("load", function() {
<span class="dropdown-option icon-trash delete-plugin-button"title="{$theme.DELETE_TOOLTIP}">{'Delete'|@translate}</span>
{/if}
{/if}
{if $theme.DEACTIVABLE}
{if isset($theme.DEACTIVABLE) and $theme.DEACTIVABLE}
<a href="{$deactivate_baseurl}{$theme.ID}" class="showInfo-dropdown-action tiptip icon-cancel-circled" title="{'Forbid this theme to users'|@translate}">{'Deactivate'|@translate}</a>
{/if}
</div>
@@ -136,7 +136,7 @@ $(window).bind("load", function() {
{else}
<div class="pluginUnavailableAction icon-cog tiptip" title="{'N/A'|translate}">{'Configuration'|@translate}</div>
{/if}
{if not $theme.IS_DEFAULT}
{if isset($theme.IS_DEFAULT) and not $theme.IS_DEFAULT}
<a href="{$set_default_baseurl}{$theme.ID}" class="tiptip icon-star" title="{'Set as default theme for unregistered and new users'|@translate}">{'Set as default'|@translate}</a>
{else}
<span class="tiptip icon-star" title="{'This is already the default theme'|@translate}">{'Set as default'|@translate}</span>

View File

@@ -146,7 +146,7 @@ function cmp($a, $b)
if($a['STATE'] == $b['STATE'])
return strcasecmp($a['NAME'], $b['NAME']);
else
return $s[$a['STATE']] >= $s[$b['STATE']];
return $s[$a['STATE']] <=> $s[$b['STATE']];
}
usort($tpl_themes, 'cmp');

View File

@@ -34,6 +34,12 @@ $template->assign('ADMIN_PAGE_TITLE', l10n('User Activity logs'));
// +-----------------------------------------------------------------------+
// | sending html code |
// +-----------------------------------------------------------------------+
$template->assign(array(
'PWG_TOKEN' => get_pwg_token(),
'INHERIT' => $conf['inheritance_by_default'],
'CACHE_KEYS' => get_admin_client_cache_keys(array('users')),
));
$template->assign_var_from_handle('ADMIN_CONTENT', 'user_activity');
?>

View File

@@ -584,7 +584,14 @@ Request format: ".@$this->_requestFormat." Response format: ".@$this->_responseF
}
$result = trigger_change('ws_invoke_allowed', true, $methodName, $params);
if ( strtolower( @get_class($result) )!='pwgerror')
$is_error = false;
if (is_object($result) and strtolower( get_class($result) ) == 'pwgerror')
{
$is_error = true;
}
if (!$is_error)
{
if ( !empty($method['include']) )
{

View File

@@ -10,8 +10,7 @@ class PwgJsonEncoder extends PwgResponseEncoder
{
function encodeResponse($response)
{
$respClass = strtolower( @get_class($response) );
if ($respClass=='pwgerror')
if (is_object($response) and strtolower(get_class($response)) == 'pwgerror')
{
return json_encode(
array(