aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcapo <capo@riseup.net>2014-01-12 23:07:20 +0100
committercapo <capo@riseup.net>2014-01-12 23:07:20 +0100
commite30ab4e309edcad41c2fef9147db1b1325497984 (patch)
treeae9ef78ce72cc624164a1f852d42fd5daf7301b5
parente79633358a5165bb68f6d0e1b8fe855d84cea8cc (diff)
downloadelgg-e30ab4e309edcad41c2fef9147db1b1325497984.tar.gz
elgg-e30ab4e309edcad41c2fef9147db1b1325497984.tar.bz2
edit link only show when you can edit
-rw-r--r--views/default/simplepie/group_module.php24
-rw-r--r--views/default/simplepie/group_module.php~39
2 files changed, 32 insertions, 31 deletions
diff --git a/views/default/simplepie/group_module.php b/views/default/simplepie/group_module.php
index d9860d65f..90c017a86 100644
--- a/views/default/simplepie/group_module.php
+++ b/views/default/simplepie/group_module.php
@@ -90,18 +90,20 @@ HTML;
elgg_pop_context();
if (!$content) {
- $content = '<p>' . elgg_echo('simplepie:none') . '</p>';
+ $content = '<p>' . elgg_echo('simplepie:none') . '</p>';
+}
+if ($group->canEdit()) {
+ $edit = elgg_view('output/url', array(
+ 'href' => '#simplepie-form',
+ 'text' => elgg_echo('edit'),
+ 'rel' => 'toggle'
+ ));
+} else {
+ $edit = false;
}
-
-$edit = elgg_view('output/url', array(
- 'href' => '#simplepie-form',
- 'text' => elgg_echo('edit'),
- 'rel' => 'toggle'
-));
echo elgg_view('groups/profile/module', array(
- 'title' => elgg_echo('RSS Group'),
- 'content' => $content,
- 'all_link' => $edit,
+ 'title' => elgg_echo('RSS Group'),
+ 'content' => $content,
+ 'all_link' => $edit,
));
-
diff --git a/views/default/simplepie/group_module.php~ b/views/default/simplepie/group_module.php~
index bfba96f06..d9860d65f 100644
--- a/views/default/simplepie/group_module.php~
+++ b/views/default/simplepie/group_module.php~
@@ -52,32 +52,31 @@ if ($feed_url) {
}
$feed_link = elgg_view('output/url', array(
- 'href' => $feed->get_permalink(),
- 'text' => $feed->get_title(),
-));
+ 'href' => $feed->get_permalink(),
+ 'text' => $feed->get_title(),
+ ));
-// need to center
+ // need to center
$content .= "<h2 class=\"simplepie-heading\">$feed_link</h2>";
$content .= '<ul class="simplepie-list">';
foreach ($feed->get_items(0, $num_items) as $item) {
- $item_link = elgg_view('output/url', array(
- 'href' => $item->get_permalink(),
- 'text' => $item->get_title(),
-));
-
-if ($excerpt) {
- $text = strip_tags($item->get_description(true), $allowed_tags);
- $excerpt = elgg_get_excerpt($text);
-}
-
-if ($post_date) {
- $item_date_label = elgg_echo('simplepie:postedon');
- $item_date = $item->get_date('j F Y | g:i a');
- $post_date = "$item_date_label $item_date";
-}
+ $item_link = elgg_view('output/url', array(
+ 'href' => $item->get_permalink(),
+ 'text' => $item->get_title(),
+ ));
+
+ if ($excerpt) {
+ $text = strip_tags($item->get_description(true), $allowed_tags);
+ $excerpt = elgg_get_excerpt($text);
+ }
- $content .= <<<HTML
+ if ($post_date) {
+ $item_date_label = elgg_echo('simplepie:postedon');
+ $item_date = $item->get_date('j F Y | g:i a');
+ $post_date = "$item_date_label $item_date";
+ }
+ $content .= <<<HTML
<li class="mbm elgg-item">
<h4 class="mbs">$item_link</h4>
<p class="elgg-subtext">$post_date</p>