move html from bookmarks module to its tpl

This commit is contained in:
SK
2026-01-15 02:15:26 +05:30
parent deaab14c5f
commit ea07bd1693
2 changed files with 30 additions and 25 deletions

View File

@@ -83,37 +83,31 @@ class Bookmarks extends \Zotlabs\Web\Controller {
$channel = \App::get_channel();
$o = '';
$o .= '<div class="generic-content-wrapper-styled">';
$o .= '<h3>' . t('Bookmarks') . '</h3>';
$x = menu_list(local_channel(),'',MENU_BOOKMARK);
if($x) {
foreach($x as $xx) {
$y = menu_fetch($xx['menu_name'],local_channel(),get_observer_hash());
$o .= menu_render($y,'',true);
$bookmarks = [];
$x = menu_list(local_channel(), '', MENU_BOOKMARK);
if ($x) {
foreach ($x as $xx) {
$y = menu_fetch($xx['menu_name'], local_channel(), get_observer_hash());
$bookmarks[] = menu_render($y, '', true);
}
}
$o .= '<h3>' . t('My Connections Bookmarks') . '</h3>';
$x = menu_list(local_channel(),'',MENU_SYSTEM|MENU_BOOKMARK);
if($x) {
foreach($x as $xx) {
$y = menu_fetch($xx['menu_name'],local_channel(),get_observer_hash());
$o .= menu_render($y,'',true);
$conn_bookmarks = [];
$x = menu_list(local_channel(), '', MENU_SYSTEM | MENU_BOOKMARK);
if ($x) {
foreach ($x as $xx) {
$y = menu_fetch($xx['menu_name'], local_channel(), get_observer_hash());
$conn_bookmarks[] = menu_render($y, '', true);
}
}
$o .= '</div>';
return $o;
return replace_macros(get_markup_template('bookmarks.tpl'), [
'$title1' => t('Bookmarks'),
'$title2' => t('My Connections Bookmarks'),
'$bookmarks' => $bookmarks,
'$conn_bookmarks' => $conn_bookmarks,
]);
}

11
view/tpl/bookmarks.tpl Normal file
View File

@@ -0,0 +1,11 @@
<div class="generic-content-wrapper-styled">
<h3>{{$title1}}</h3>
{{foreach $bookmarks as $bm}}
{{$bm}}
{{/foreach}}
<h3>{{$title2}}</h3>
{{foreach $conn_bookmarks as $bm}}
{{$bm}}
{{/foreach}}
</div>