aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-04-01 12:42:28 +0200
committerMario <mario@mariovavti.com>2019-04-01 12:42:28 +0200
commitf61b898633721484119d1a0aaff2b6c53d556b44 (patch)
tree0059662d88cf275ebe021c97d0f16690e8dd0fa3
parent2bdcd436bb3b8ed3090a500550bf93d30d15aa7f (diff)
parent595429fdde770644ae1d7d265de308818e2d29ef (diff)
downloadvolse-hubzilla-f61b898633721484119d1a0aaff2b6c53d556b44.tar.gz
volse-hubzilla-f61b898633721484119d1a0aaff2b6c53d556b44.tar.bz2
volse-hubzilla-f61b898633721484119d1a0aaff2b6c53d556b44.zip
Merge branch 'dev' into 'dev'
Add remove cover photo function See merge request hubzilla/core!1577
-rw-r--r--Zotlabs/Module/Cover_photo.php10
-rwxr-xr-xview/tpl/cover_photo.tpl3
-rwxr-xr-xview/tpl/profile_photo.tpl2
3 files changed, 13 insertions, 2 deletions
diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php
index b911ac991..822cc8ef6 100644
--- a/Zotlabs/Module/Cover_photo.php
+++ b/Zotlabs/Module/Cover_photo.php
@@ -48,6 +48,16 @@ class Cover_photo extends \Zotlabs\Web\Controller {
$channel = \App::get_channel();
check_form_security_token_redirectOnErr('/cover_photo', 'cover_photo');
+
+ // Remove cover photo
+ if(isset($_POST['remove'])) {
+ q("update photo set photo_usage = %d where photo_usage = %d and uid = %d",
+ intval(PHOTO_NORMAL),
+ intval(PHOTO_COVER),
+ intval(local_channel())
+ );
+ goaway(z_root() . '/cover_photo');
+ }
if((array_key_exists('cropfinal',$_POST)) && ($_POST['cropfinal'] == 1)) {
diff --git a/view/tpl/cover_photo.tpl b/view/tpl/cover_photo.tpl
index 5a5bf2286..a1c4a922d 100755
--- a/view/tpl/cover_photo.tpl
+++ b/view/tpl/cover_photo.tpl
@@ -102,7 +102,8 @@
<br />
<br />
<div id="profile-photo-submit-wrapper">
- <input type="submit" name="submit" id="profile-photo-submit" value="{{$submit}}">
+ <button type="submit" class="btn btn-outline-primary" name="submit" id="profile-photo-submit">{{$submit}}</button>
+ <button type="submit" class="btn btn-outline-danger" name="remove" id="profile-photo-remove">{{$remove}}</button>
</div>
</div>
diff --git a/view/tpl/profile_photo.tpl b/view/tpl/profile_photo.tpl
index 819502df5..b2190dda3 100755
--- a/view/tpl/profile_photo.tpl
+++ b/view/tpl/profile_photo.tpl
@@ -124,7 +124,7 @@
{{/if}}
<div id="profile-photo-submit-wrapper">
- <input type="submit" name="submit" id="profile-photo-submit" value="{{$submit}}">
+ <button type="submit" class="btn btn-outline-primary" name="submit" id="profile-photo-submit">{{$submit}}</button>
</div>
</div>