Skip to content

Commit 1300d17

Browse files
committed
Next pass at bootstrap conversion
1 parent 75a3822 commit 1300d17

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

src/templates/News/View.phtml

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ require('./header.inc.phtml'); ?>
6969
<section class="red"><p><strong>Warning:</strong> This news post is not yet published. You can view this because you are allowed to create, modify, or delete news posts.</p></section>
7070
<? } ?>
7171
<section class="news"><img class="category" alt="<? echo $object->getCategory()->getLabel(); ?>" title="<? echo $object->getCategory()->getLabel(); ?>" src="<? echo Common::relativeUrlToAbsolute("/a/news_categories/" . $object->getCategory()->getFilename()); ?>"/><? echo $object->getContent(true); ?></section>
72-
<footer>
72+
<div class="card"><div class="card-body">
7373
<? if ($object->getEditedDateTime() !== null) { ?>
7474
<span class="float-right"><time datetime="<? echo $object->getCreatedDateTime()->format('c'); ?>"><? echo $object->getCreatedDateTime()->format("l, F j, Y"); ?></time> | Edited: <time datetime="<? echo $object->getEditedDateTime()->format('c'); ?>"><? echo $object->getEditedDateTime()->format("l, F j, Y"); ?></time></span>
7575
<? } else { ?>
7676
<span class="float-right"><time datetime="<? echo $object->getCreatedDateTime()->format('c'); ?>"><? echo $object->getCreatedDateTime()->format("l, F j, Y"); ?></time></span>
7777
<? } ?>
7878
<span><a href="<? echo $user_url; ?>"><img class="avatar" src="<? echo $user_avatar; ?>"/>&nbsp;<? echo filter_var($user_name, FILTER_SANITIZE_STRING); ?></a></span>
79-
</footer>
79+
</div></div>
8080
</div>
8181
<div class="container mb-3">
8282
<?

src/templates/header.inc.phtml

+5-11
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@ if (!isset($title_suffix)) /* this should be allowed to be empty, however */
1818
{
1919
$title_suffix = ' &ndash; BNETDocs';
2020
}
21-
function _header_active($url, $sr)
21+
function _header_active(string $url, bool $sr)
2222
{
2323
$current_url = parse_url(getenv('REQUEST_URI'), PHP_URL_PATH);
2424
$match = (substr($current_url, 0, strlen($url)) == $url);
2525
if (!$match) return '';
26-
if ($sr)
27-
return ' <span class="sr-only">(current)</span>';
28-
else
29-
return ' active';
26+
if ($sr) return ' <span class="sr-only">(current)</span>'; else return ' active';
3027
}
3128
$_header_user = Authentication::$user;
3229
$_unique_asset = (
@@ -79,12 +76,9 @@ $_header_nav = [
7976
['label' => 'Event Logs', 'url' => '/eventlog/index', 'acl' => User::OPTION_ACL_EVENT_LOG_VIEW],
8077
]],
8178
];
82-
/* <a>Account</a>
83-
<a href="<?=Common::relativeUrlToAbsolute('/user/changepassword')?>">Change Password</a>
84-
<a href="<?=Common::relativeUrlToAbsolute('/user/update')?>">Update Profile</a>*/
8579
function _header_nav_html($nav)
8680
{
87-
function _line(string $format) { call_user_func_array('printf', func_get_args()) . PHP_EOL; }
81+
function _line(string $format) { call_user_func_array('printf', func_get_args()); echo PHP_EOL; }
8882

8983
ob_start();
9084
_line('<nav class="navbar navbar-expand-lg navbar-dark bg-primary mb-3">');
@@ -157,11 +151,11 @@ function _header_nav_html($nav)
157151
}
158152
else if (!$dropdown)
159153
{
160-
if (isset($item['url'])) printf('<li class="nav-item"><a class="nav-link%s" href="%s">%s</a></li>' . PHP_EOL, $class, $item['url'], filter_var($item['label'], FILTER_SANITIZE_FULL_SPECIAL_CHARS));
154+
if (isset($item['url'])) printf('<li class="nav-item"><a class="nav-link%s" href="%s">%s</a></li>' . PHP_EOL, $class, Common::relativeUrlToAbsolute($item['url']), filter_var($item['label'], FILTER_SANITIZE_FULL_SPECIAL_CHARS));
161155
}
162156
else if ($dropdown)
163157
{
164-
if (isset($item['url'])) printf('<a class="dropdown-item%s" href="%s">%s</a>' . PHP_EOL, $class, $item['url'], filter_var($item['label'], FILTER_SANITIZE_FULL_SPECIAL_CHARS));
158+
if (isset($item['url'])) printf('<a class="dropdown-item%s" href="%s">%s</a>' . PHP_EOL, $class, Common::relativeUrlToAbsolute($item['url']), filter_var($item['label'], FILTER_SANITIZE_FULL_SPECIAL_CHARS));
165159
}
166160

167161
if (isset($item['dropdown']))

0 commit comments

Comments
 (0)