Replace deprecated defaults() calls with ?? and ?: in include/ and view/
This commit is contained in:
parent
c0b78a9720
commit
8b836189d4
11 changed files with 30 additions and 30 deletions
|
@ -10,7 +10,7 @@ if (file_exists("$THEMEPATH/style.css")) {
|
|||
echo file_get_contents("$THEMEPATH/style.css");
|
||||
}
|
||||
|
||||
$uid = defaults($_REQUEST, 'puid', 0);
|
||||
$uid = $_REQUEST['puid'] ?? 0;
|
||||
|
||||
$s_colorset = Config::get('duepuntozero', 'colorset');
|
||||
$colorset = PConfig::get($uid, 'duepuntozero', 'colorset');
|
||||
|
|
|
@ -132,7 +132,7 @@ function frio_form($arr)
|
|||
'$nav_icon_color' => array_key_exists('nav_icon_color', $disable) ? '' : ['frio_nav_icon_color', L10n::t('Navigation bar icon color '), $arr['nav_icon_color'], '', false],
|
||||
'$link_color' => array_key_exists('link_color', $disable) ? '' : ['frio_link_color', L10n::t('Link color'), $arr['link_color'], '', false],
|
||||
'$background_color' => array_key_exists('background_color', $disable) ? '' : ['frio_background_color', L10n::t('Set the background color'), $arr['background_color'], '', false],
|
||||
'$contentbg_transp' => array_key_exists('contentbg_transp', $disable) ? '' : ['frio_contentbg_transp', L10n::t('Content background opacity'), defaults($arr, 'contentbg_transp', 100), ''],
|
||||
'$contentbg_transp' => array_key_exists('contentbg_transp', $disable) ? '' : ['frio_contentbg_transp', L10n::t('Content background opacity'), ($arr['contentbg_transp'] ?? 0) ?: 100, ''],
|
||||
'$background_image' => array_key_exists('background_image', $disable) ? '' : ['frio_background_image', L10n::t('Set the background image'), $arr['background_image'], $background_image_help, false],
|
||||
'$bg_image_options_title' => L10n::t('Background image style'),
|
||||
'$bg_image_options' => Image::get_options($arr),
|
||||
|
|
|
@ -28,7 +28,7 @@ $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser";
|
|||
<html>
|
||||
<head>
|
||||
<title><?php if (!empty($page['title'])) echo $page['title'] ?></title>
|
||||
<meta request="<?php echo htmlspecialchars(defaults($_REQUEST, 'pagename', '')) ?>">
|
||||
<meta request="<?php echo htmlspecialchars($_REQUEST['pagename'] ?? '') ?>">
|
||||
<script type="text/javascript">var baseurl = "<?php echo System::baseUrl(); ?>";</script>
|
||||
<script type="text/javascript">var frio = "<?php echo 'view/theme/frio'; ?>";</script>
|
||||
<?php
|
||||
|
@ -141,7 +141,7 @@ $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser";
|
|||
</main>
|
||||
|
||||
<footer>
|
||||
<?php echo defaults($page, 'footer', ''); ?>
|
||||
<?php echo $page['footer'] ?? ''; ?>
|
||||
</footer>
|
||||
<?php } ?> <!-- End of condition if $minimal else the rest -->
|
||||
</body>
|
||||
|
|
|
@ -22,7 +22,7 @@ function load_page(App $a)
|
|||
require 'view/theme/frio/none.php';
|
||||
} else {
|
||||
$template = 'view/theme/' . $a->getCurrentTheme() . '/'
|
||||
. defaults($a->page, 'template', 'default' ) . '.php';
|
||||
. (($a->page['template'] ?? '') ?: 'default' ) . '.php';
|
||||
if (file_exists($template)) {
|
||||
require_once $template;
|
||||
} else {
|
||||
|
|
|
@ -6,7 +6,7 @@ use Friendica\Core\Config;
|
|||
use Friendica\Core\PConfig;
|
||||
use Friendica\Model\Profile;
|
||||
|
||||
$uid = defaults($_REQUEST, 'puid', 0);
|
||||
$uid = $_REQUEST['puid'] ?? 0;
|
||||
|
||||
$color = false;
|
||||
$quattro_align = false;
|
||||
|
|
|
@ -7,7 +7,7 @@ use Friendica\Core\Config;
|
|||
use Friendica\Core\PConfig;
|
||||
use Friendica\Model\Profile;
|
||||
|
||||
$uid = defaults($_REQUEST, 'puid', 0);
|
||||
$uid = $_REQUEST['puid'] ?? 0;
|
||||
|
||||
$style = PConfig::get($uid, 'vier', 'style');
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ function vier_init(App $a)
|
|||
|
||||
Renderer::setActiveTemplateEngine('smarty3');
|
||||
|
||||
if (!empty($a->argv[0]) && $a->argv[0] . defaults($a->argv, 1, '') === "profile".$a->user['nickname'] || $a->argv[0] === "network" && local_user()) {
|
||||
if (!empty($a->argv[0]) && ($a->argv[0] . ($a->argv[1] ?? '')) === ('profile' . $a->user['nickname']) || $a->argv[0] === 'network' && local_user()) {
|
||||
vier_community_info();
|
||||
|
||||
$a->page['htmlhead'] .= "<link rel='stylesheet' type='text/css' href='view/theme/vier/wide.css' media='screen and (min-width: 1300px)'/>\n";
|
||||
|
@ -191,7 +191,7 @@ function vier_community_info()
|
|||
|
||||
//Community_Pages at right_aside
|
||||
if ($show_pages && local_user()) {
|
||||
$cid = defaults($_GET, 'cid', null);
|
||||
$cid = $_GET['cid'] ?? null;
|
||||
|
||||
//sort by last updated item
|
||||
$lastitem = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue