@@ -52,6 +52,13 @@ if ($object) {
52
52
53
53
$ this ->opengraph ->attach (new Pair ("url " , $ url ));
54
54
55
+ $ edit_url = Common::relativeUrlToAbsolute ("/packet/edit?id= " . urlencode ($ object_id ));
56
+ $ delete_url = Common::relativeUrlToAbsolute ("/packet/delete?id= " . urlencode ($ object_id ));
57
+ $ edit_visible = ($ logged_in && ($ logged_in ->getOptionsBitmask ()
58
+ & User::OPTION_ACL_PACKET_MODIFY ));
59
+ $ delete_visible = ($ logged_in && ($ logged_in ->getOptionsBitmask ()
60
+ & User::OPTION_ACL_PACKET_DELETE ));
61
+
55
62
$ this ->additional_css [] = "/a/packet.css " ;
56
63
$ this ->additional_css [] = "/a/comments.css " ;
57
64
if ($ logged_in ) $ this ->additional_css [] = "/a/forms.css " ;
@@ -62,6 +69,12 @@ require("./header.inc.phtml");
62
69
<a href="https://plus.google.com/share?url=<?php echo urlencode ($ url ); ?> " rel="external" data-popup="1"><img class="header-button float-right" src="<?php echo Common::relativeUrlToAbsolute ("/a/social-gplus-24px.png " ); ?> "/></a>
63
70
<a href="https://twitter.com/share?text=<?php echo urlencode ($ packet_id . " " . $ object ->getPacketName ()); ?> &url=<?php echo urlencode ($ url ); ?> " rel="external" data-popup="1"><img class="header-button float-right" src="<?php echo Common::relativeUrlToAbsolute ("/a/social-twitter-24px.png " ); ?> "/></a>
64
71
<a href="https://facebook.com/sharer/sharer.php?u=<?php echo urlencode ($ url ); ?> " rel="external" data-popup="1"><img class="header-button float-right" src="<?php echo Common::relativeUrlToAbsolute ("/a/social-facebook-24px.png " ); ?> "/></a>
72
+ <?php if ($ edit_visible ) { ?>
73
+ <a href="<?php echo $ edit_url ; ?> " class="header-button float-right">Edit</a>
74
+ <?php } ?>
75
+ <?php if ($ delete_visible ) { ?>
76
+ <a href="<?php echo $ delete_url ; ?> " class="header-button float-right">Delete</a>
77
+ <?php } ?>
65
78
<header><a href="<?php echo $ url ; ?> "><?php echo filter_var ($ title , FILTER_SANITIZE_STRING ); ?> </a></header>
66
79
<section>
67
80
<table class="info"><tbody>
0 commit comments