template rework: rearrange sidebar widgets for contact related pages

This commit is contained in:
rabuzarus 2015-10-23 00:12:00 +02:00
parent 2aad62190f
commit 0c3979720f
6 changed files with 16 additions and 14 deletions

View file

@ -27,6 +27,9 @@ function contacts_init(&$a) {
require_once('include/group.php'); require_once('include/group.php');
require_once('include/contact_widgets.php'); require_once('include/contact_widgets.php');
if ($_GET['nets'] == "all")
$_GET['nets'] = "";
if(! x($a->page,'aside')) if(! x($a->page,'aside'))
$a->page['aside'] = ''; $a->page['aside'] = '';
@ -35,29 +38,28 @@ function contacts_init(&$a) {
$vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"),array( $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"),array(
'$name' => htmlentities($a->data['contact']['name']), '$name' => htmlentities($a->data['contact']['name']),
'$photo' => $a->data['contact']['photo'], '$photo' => $a->data['contact']['photo'],
'$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? $a->get_baseurl()."/redir/".$a->data['contact']['id'] : $a->data['contact']['url'] '$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? $a->get_baseurl()."/redir/".$a->data['contact']['id'] : $a->data['contact']['url']
)); ));
$follow_widget = ''; $follow_widget = '';
$networks_widget = '';
} }
else { else {
$vcard_widget = ''; $vcard_widget = '';
$networks_widget .= networks_widget('contacts',$_GET['nets']);
if (isset($_GET['add'])) if (isset($_GET['add']))
$follow_widget = follow_widget($_GET['add']); $follow_widget = follow_widget($_GET['add']);
else else
$follow_widget = follow_widget(); $follow_widget = follow_widget();
} }
if ($_GET['nets'] == "all")
$_GET['nets'] = "";
$groups_widget .= group_side('contacts','group',false,0,$contact_id);
$findpeople_widget .= findpeople_widget(); $findpeople_widget .= findpeople_widget();
$networks_widget .= networks_widget('contacts',$_GET['nets']); $groups_widget .= group_side('contacts','group',false,0,$contact_id);
$a->page['aside'] .= replace_macros(get_markup_template("contacts-widget-sidebar.tpl"),array( $a->page['aside'] .= replace_macros(get_markup_template("contacts-widget-sidebar.tpl"),array(
'$vcard_widget' => $vcard_widget, '$vcard_widget' => $vcard_widget,
'$findpeople_widget' => $findpeople_widget,
'$follow_widget' => $follow_widget, '$follow_widget' => $follow_widget,
'$groups_widget' => $groups_widget, '$groups_widget' => $groups_widget,
'$findpeople_widget' => $findpeople_widget,
'$networks_widget' => $networks_widget '$networks_widget' => $networks_widget
)); ));

View file

@ -6,10 +6,10 @@ function directory_init(&$a) {
if(local_user()) { if(local_user()) {
require_once('include/contact_widgets.php'); require_once('include/contact_widgets.php');
$a->page['aside'] .= follow_widget();
$a->page['aside'] .= findpeople_widget(); $a->page['aside'] .= findpeople_widget();
$a->page['aside'] .= follow_widget();
} }
else { else {
unset($_SESSION['theme']); unset($_SESSION['theme']);

View file

@ -13,9 +13,9 @@ function dirfind_init(&$a) {
if(! x($a->page,'aside')) if(! x($a->page,'aside'))
$a->page['aside'] = ''; $a->page['aside'] = '';
$a->page['aside'] .= follow_widget();
$a->page['aside'] .= findpeople_widget(); $a->page['aside'] .= findpeople_widget();
$a->page['aside'] .= follow_widget();
} }

View file

@ -19,8 +19,8 @@ function match_content(&$a) {
if(! local_user()) if(! local_user())
return; return;
$a->page['aside'] .= follow_widget();
$a->page['aside'] .= findpeople_widget(); $a->page['aside'] .= findpeople_widget();
$a->page['aside'] .= follow_widget();
$_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd; $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;

View file

@ -61,8 +61,8 @@ function suggest_content(&$a) {
$_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd; $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
$a->page['aside'] .= follow_widget();
$a->page['aside'] .= findpeople_widget(); $a->page['aside'] .= findpeople_widget();
$a->page['aside'] .= follow_widget();
$r = suggestion_query(local_user()); $r = suggestion_query(local_user());

View file

@ -1,7 +1,7 @@
{{$vcard_widget}} {{$vcard_widget}}
{{$findpeople_widget}}
{{$follow_widget}} {{$follow_widget}}
{{$groups_widget}} {{$groups_widget}}
{{$findpeople_widget}}
{{$networks_widget}} {{$networks_widget}}