NewHome/func/_bar.php

22 lines
842 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* func/_bar.php —— 功能区子页公共头部条(需先引入 includes/layout.php
* 仅包含函数,不直接输出。
*/
function func_bar(string $title): void
{
// 从库首页“内部功能区”卡片进入时(?from=nav返回按钮改为“返回上一页”
$fromNav = (($_GET['from'] ?? '') === 'nav');
echo '<div class="func-bar">';
echo '<div class="wrap func-bar-inner">';
if ($fromNav) {
echo '<a class="btn btn-sm" href="javascript:history.back()" title="返回来源页面">← 返回上一页</a>';
} else {
echo '<a class="btn btn-sm" href="index.php">← 返回功能区首页</a>';
}
echo '<span class="func-bar-title">' . he($title) . '</span>';
echo '<a class="btn btn-sm" href="../index.php">首页</a>';
echo '</div></div>' . "\n";
}