PHP8 compat fixes for themes menu
This commit is contained in:
		| @@ -264,6 +264,8 @@ function serendipity_fetchTemplateInfo($theme, $abspath = null) { | |||||||
|     if (@is_file($serendipity['templatePath'] . $theme . '/config.inc.php')) { |     if (@is_file($serendipity['templatePath'] . $theme . '/config.inc.php')) { | ||||||
|         $data['custom_config'] = YES; |         $data['custom_config'] = YES; | ||||||
|         $data['custom_config_engine'] = $theme; |         $data['custom_config_engine'] = $theme; | ||||||
|  |     } else { | ||||||
|  |         $data['custom_config'] = NO; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     // Templates can depend on a possible "Engine" (i.e. "Engine: 2k11"). |     // Templates can depend on a possible "Engine" (i.e. "Engine: 2k11"). | ||||||
| @@ -277,19 +279,25 @@ function serendipity_fetchTemplateInfo($theme, $abspath = null) { | |||||||
|             if (@is_file($serendipity['templatePath'] . $engine . '/config.inc.php')) { |             if (@is_file($serendipity['templatePath'] . $engine . '/config.inc.php')) { | ||||||
|                 $data['custom_config'] = YES; |                 $data['custom_config'] = YES; | ||||||
|                 $data['custom_config_engine'] = $engine; |                 $data['custom_config_engine'] = $engine; | ||||||
|  |             } else { | ||||||
|  |                 $data['custom_config'] = NO; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     if ( $theme != 'default' && $theme != 'default-rtl' |     if ( $theme != 'default' && $theme != 'default-rtl' | ||||||
|       && @is_dir($serendipity['templatePath'] . $theme . '/admin') |       && @is_dir($serendipity['templatePath'] . $theme . '/admin') | ||||||
|       && strtolower($data['backend']) == 'yes' ) { |       && strtolower($data['backend'] ?? '') == 'yes' ) { | ||||||
|  |  | ||||||
|         $data['custom_admin_interface'] = YES; |         $data['custom_admin_interface'] = YES; | ||||||
|     } else { |     } else { | ||||||
|         $data['custom_admin_interface'] = NO; |         $data['custom_admin_interface'] = NO; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     # php 8 compat section | ||||||
|  |     if (! isset($data['customURI'])) { $data['customURI'] = null; } | ||||||
|  |     if (! isset($data['author'])) { $data['author'] = null; } | ||||||
|  |  | ||||||
|     return $data; |     return $data; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -113,9 +113,17 @@ | |||||||
|                                     <dt class="template_date">{$CONST.LAST_UPDATED}:</dt> |                                     <dt class="template_date">{$CONST.LAST_UPDATED}:</dt> | ||||||
|                                     <dd>{$info.info.date}</dd> |                                     <dd>{$info.info.date}</dd> | ||||||
|                                     <dt class="template_config">{$CONST.CUSTOM_CONFIG}:</dt> |                                     <dt class="template_config">{$CONST.CUSTOM_CONFIG}:</dt> | ||||||
|                                     <dd>{$info.info.custom_config|default:$CONST.NO}</dd> |                                     {if isset($info.info.custom_config) } | ||||||
|  |                                     <dd>{$info.info.custom_config}</dd> | ||||||
|  |                                     {else} | ||||||
|  |                                     <dd>{$CONST.NO}</dd> | ||||||
|  |                                     {/if} | ||||||
|                                     <dt class="template_admin">{$CONST.CUSTOM_ADMIN_INTERFACE}:</dt> |                                     <dt class="template_admin">{$CONST.CUSTOM_ADMIN_INTERFACE}:</dt> | ||||||
|                                     <dd>{if $info.info.custom_admin_interface} {$info.info.custom_admin_interface} {else} {$CONST.NO} {/if}</dd> |                                     {if isset($info.info.custom_admin_interface) } | ||||||
|  |                                     <dd>{$info.info.custom_admin_interface}</dd> | ||||||
|  |                                     {else} | ||||||
|  |                                     <dd>{$CONST.NO}</dd> | ||||||
|  |                                     {/if} | ||||||
|                                 </dl> |                                 </dl> | ||||||
|                             </footer> |                             </footer> | ||||||
|                         </div> |                         </div> | ||||||
| @@ -125,8 +133,8 @@ | |||||||
|                 {if $info.demoURL} |                 {if $info.demoURL} | ||||||
|                     <a class="demo_link button_link" href="{$info.demoURL}" title="{$CONST.THEMES_PREVIEW_BLOG}" target="_blank"><span class="icon-search" aria-hidden="true"></span><span class="visuallyhidden"> {$CONST.THEMES_PREVIEW_BLOG}</span></a> |                     <a class="demo_link button_link" href="{$info.demoURL}" title="{$CONST.THEMES_PREVIEW_BLOG}" target="_blank"><span class="icon-search" aria-hidden="true"></span><span class="visuallyhidden"> {$CONST.THEMES_PREVIEW_BLOG}</span></a> | ||||||
|                 {/if} |                 {/if} | ||||||
|                 {if !$info.unmetRequirements} |                 {if !isset($info.unmetRequirements) || !$info.unmetRequirements} | ||||||
|                     {if $info.info.custom_admin_interface == $CONST.YES && $cur_tpl_backend.info.name != $info.info.name} |                     {if isset($info.info.custom_admin_interface) and $info.info.custom_admin_interface == $CONST.YES && $cur_tpl_backend.info.name != $info.info.name} | ||||||
|                     <a class="button_link" href="?serendipity[adminModule]=templates&serendipity[adminAction]=install-frontend&serendipity[theme]={$template}{$info.info.customURI}&{$urltoken}" title="{$CONST.SET_AS_TEMPLATE}">{$CONST.INSTALL}: {$CONST.FRONTEND}</a> |                     <a class="button_link" href="?serendipity[adminModule]=templates&serendipity[adminAction]=install-frontend&serendipity[theme]={$template}{$info.info.customURI}&{$urltoken}" title="{$CONST.SET_AS_TEMPLATE}">{$CONST.INSTALL}: {$CONST.FRONTEND}</a> | ||||||
|                     <a class="button_link" href="?serendipity[adminModule]=templates&serendipity[adminAction]=install-backend&serendipity[theme]={$template}{$info.info.customURI}&{$urltoken}" title="{$CONST.SET_AS_TEMPLATE}">{$CONST.INSTALL}: {$CONST.BACKEND}</a> |                     <a class="button_link" href="?serendipity[adminModule]=templates&serendipity[adminAction]=install-backend&serendipity[theme]={$template}{$info.info.customURI}&{$urltoken}" title="{$CONST.SET_AS_TEMPLATE}">{$CONST.INSTALL}: {$CONST.BACKEND}</a> | ||||||
|                     {else} |                     {else} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user