aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-02-25 22:50:16 +0100
committerMario Vavti <mario@mariovavti.com>2016-02-25 22:50:16 +0100
commitb2474334a7b7f009442883a08d544280231b29fc (patch)
tree55da2a355de6d22b263a7716514cf1299885d56a
parent2a0d4a2011e8f3161a815d7d5144fcf3d86c2465 (diff)
downloadvolse-hubzilla-b2474334a7b7f009442883a08d544280231b29fc.tar.gz
volse-hubzilla-b2474334a7b7f009442883a08d544280231b29fc.tar.bz2
volse-hubzilla-b2474334a7b7f009442883a08d544280231b29fc.zip
provide an edit button for the profile page
-rw-r--r--include/identity.php9
-rwxr-xr-xview/tpl/profile_advanced.tpl3
2 files changed, 8 insertions, 4 deletions
diff --git a/include/identity.php b/include/identity.php
index a389a613e..0a88ed208 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -1237,10 +1237,6 @@ function advanced_profile(&$a) {
if(! perm_is_allowed($a->profile['profile_uid'],get_observer_hash(),'view_profile'))
return '';
- $o = '';
-
- $o .= '<h2>' . t('Profile') . '</h2>';
-
if($a->profile['name']) {
$tpl = get_markup_template('profile_advanced.tpl');
@@ -1351,6 +1347,10 @@ function advanced_profile(&$a) {
$profile['extra_fields'] = $a->profile['extra_fields'];
}
+
+ $is_owner = (($a->profile['profile_uid'] == local_channel()) ? true : false);
+ $edit = (($is_owner) ? array('link' => $a->get_baseurl() . '/profiles/' . $a->profile['profile_uid'], 'label' => t('Edit')) : '');
+
$things = get_things($a->profile['profile_guid'],$a->profile['profile_uid']);
// logger('mod_profile: things: ' . print_r($things,true), LOGGER_DATA);
@@ -1360,6 +1360,7 @@ function advanced_profile(&$a) {
'$canlike' => (($profile['canlike'])? true : false),
'$likethis' => t('Like this thing'),
'$profile' => $profile,
+ '$edit' => $edit,
'$things' => $things
));
}
diff --git a/view/tpl/profile_advanced.tpl b/view/tpl/profile_advanced.tpl
index a027a7c2e..780626cf9 100755
--- a/view/tpl/profile_advanced.tpl
+++ b/view/tpl/profile_advanced.tpl
@@ -12,6 +12,9 @@
<i class="icon-thumbs-up-alt" title="{{$profile.likethis}}"></i>
</button>
{{/if}}
+ {{if $edit}}
+ <a href="{{$edit.link}}" class="btn btn-primary btn-xs"><i class="icon-pencil"></i>&nbsp;{{$edit.label}}</a>
+ {{/if}}
</div>
<h2>{{$title}}</h2>
<div class="clear"></div>