From 84b44fabfdbbdc2ce93fbcc5d41d77184763228a Mon Sep 17 00:00:00 2001 From: Matt Beckett Date: Sat, 19 May 2012 00:52:07 -0700 Subject: Initial commit --- README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000000000..7e20e27bd --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +River-Privacy-1.8.x +=================== + +Makes non-object oriented river items private - eg. friendship creation \ No newline at end of file -- cgit v1.2.3 From 4caa18176ab7b25896596276ee5a3d724a5915fd Mon Sep 17 00:00:00 2001 From: Matt Beckett Date: Sat, 19 May 2012 01:54:51 -0600 Subject: Initial Commit --- river_privacy/CHANGES.txt | 7 ++ river_privacy/languages/en.php | 13 ++++ river_privacy/manifest.xml | 18 +++++ river_privacy/start.php | 30 ++++++++ .../default/plugins/river_privacy/settings.php | 17 +++++ .../default/page/components/list.php | 86 ++++++++++++++++++++++ 6 files changed, 171 insertions(+) create mode 100644 river_privacy/CHANGES.txt create mode 100644 river_privacy/languages/en.php create mode 100644 river_privacy/manifest.xml create mode 100644 river_privacy/start.php create mode 100644 river_privacy/views/default/plugins/river_privacy/settings.php create mode 100644 river_privacy/views_override/default/page/components/list.php diff --git a/river_privacy/CHANGES.txt b/river_privacy/CHANGES.txt new file mode 100644 index 000000000..df26e881d --- /dev/null +++ b/river_privacy/CHANGES.txt @@ -0,0 +1,7 @@ +== Version History == + +x.x: + +1.0 (05/19/2012): + +- Initial Release \ No newline at end of file diff --git a/river_privacy/languages/en.php b/river_privacy/languages/en.php new file mode 100644 index 000000000..f0cfde2a1 --- /dev/null +++ b/river_privacy/languages/en.php @@ -0,0 +1,13 @@ + "River Privacy", + 'river_privacy:hide_old:description' => "Only items that are created after this plugin is enabled + will be set to private. This setting can allow old items to be hidden - this is done at + display time, so it may affect layout (eg. 20 items are expected to be shown, but only 15 are + visible because 5 of them are filtered out by this plugin). + Note that new items created will be private regardless of this setting, this setting is only for old items.", + 'river_privacy:hide_old:label' => "Hide old river entries?", +); + +add_translation("en",$english); diff --git a/river_privacy/manifest.xml b/river_privacy/manifest.xml new file mode 100644 index 000000000..36ed40f92 --- /dev/null +++ b/river_privacy/manifest.xml @@ -0,0 +1,18 @@ + + + River Privacy + Matt Beckett (matt@clever-name.com) + 1.0 + Sets non-object oriented river items to private access (eg. friend relationships) + http://landing.athabascau.ca + (C) Matt Beckett, 2012 + GNU Public License version 2 + + + + elgg_release + 1.8 + + + Miscellaneous + diff --git a/river_privacy/start.php b/river_privacy/start.php new file mode 100644 index 000000000..b836ded52 --- /dev/null +++ b/river_privacy/start.php @@ -0,0 +1,30 @@ + 'params[hide_old_items]', + 'value' => $vars['entity']->hide_old_items ? $vars['entity']->hide_old_items : 'yes', + 'options_values' => array( + 'yes' => elgg_echo('option:yes'), + 'no' => elgg_echo('option:no'), + ), +); + +echo elgg_echo('river_privacy:hide_old:label') . "
"; +echo elgg_view('input/dropdown', $options); + +echo "

" . elgg_echo('river_privacy:hide_old:description'); + +echo "

"; \ No newline at end of file diff --git a/river_privacy/views_override/default/page/components/list.php b/river_privacy/views_override/default/page/components/list.php new file mode 100644 index 000000000..b34c454a6 --- /dev/null +++ b/river_privacy/views_override/default/page/components/list.php @@ -0,0 +1,86 @@ + element + * @uses $vars['item_class'] Additional CSS class for the
  • elements + */ + +$items = $vars['items']; +$offset = elgg_extract('offset', $vars); +$limit = elgg_extract('limit', $vars); +$count = elgg_extract('count', $vars); +$base_url = elgg_extract('base_url', $vars, ''); +$pagination = elgg_extract('pagination', $vars, true); +$offset_key = elgg_extract('offset_key', $vars, 'offset'); +$position = elgg_extract('position', $vars, 'after'); + +// remove non-object items for anyone who's not the subject +if(is_array($items) && ($items[0] instanceof ElggRiverItem)){ + foreach($items as $key => $item){ + if($item->type != 'object' && $item->subject_guid != elgg_get_logged_in_user_guid()){ + unset($items[$key]); + } + } +} + +// reset key values +$items = array_merge(array(), $items); + +$list_class = 'elgg-list'; +if (isset($vars['list_class'])) { + $list_class = "$list_class {$vars['list_class']}"; +} + +$item_class = 'elgg-item'; +if (isset($vars['item_class'])) { + $item_class = "$item_class {$vars['item_class']}"; +} + +$html = ""; +$nav = ""; + +if ($pagination && $count) { + $nav .= elgg_view('navigation/pagination', array( + 'base_url' => $base_url, + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + 'offset_key' => $offset_key, + )); +} + +if (is_array($items) && count($items) > 0) { + $html .= "
      "; + foreach ($items as $item) { + if (elgg_instanceof($item)) { + $id = "elgg-{$item->getType()}-{$item->getGUID()}"; + } else { + $id = "item-{$item->getType()}-{$item->id}"; + } + $html .= "
    • "; + $html .= elgg_view_list_item($item, $vars); + $html .= '
    • '; + } + $html .= '
    '; +} + +if ($position == 'before' || $position == 'both') { + $html = $nav . $html; +} + +if ($position == 'after' || $position == 'both') { + $html .= $nav; +} + +echo $html; -- cgit v1.2.3 From 0ef4f3dd1637687d3ece88e2a6208d5e17a96ce1 Mon Sep 17 00:00:00 2001 From: Sem Date: Fri, 20 Jul 2012 06:38:08 +0200 Subject: Moved plugin to root folder. --- CHANGES.txt | 7 ++ languages/en.php | 13 ++++ manifest.xml | 19 +++++ river_privacy/CHANGES.txt | 7 -- river_privacy/languages/en.php | 13 ---- river_privacy/manifest.xml | 18 ----- river_privacy/start.php | 30 -------- .../default/plugins/river_privacy/settings.php | 17 ----- .../default/page/components/list.php | 86 ---------------------- start.php | 30 ++++++++ views/default/plugins/river_privacy/settings.php | 17 +++++ views_override/default/page/components/list.php | 86 ++++++++++++++++++++++ 12 files changed, 172 insertions(+), 171 deletions(-) create mode 100644 CHANGES.txt create mode 100644 languages/en.php create mode 100644 manifest.xml delete mode 100644 river_privacy/CHANGES.txt delete mode 100644 river_privacy/languages/en.php delete mode 100644 river_privacy/manifest.xml delete mode 100644 river_privacy/start.php delete mode 100644 river_privacy/views/default/plugins/river_privacy/settings.php delete mode 100644 river_privacy/views_override/default/page/components/list.php create mode 100644 start.php create mode 100644 views/default/plugins/river_privacy/settings.php create mode 100644 views_override/default/page/components/list.php diff --git a/CHANGES.txt b/CHANGES.txt new file mode 100644 index 000000000..df26e881d --- /dev/null +++ b/CHANGES.txt @@ -0,0 +1,7 @@ +== Version History == + +x.x: + +1.0 (05/19/2012): + +- Initial Release \ No newline at end of file diff --git a/languages/en.php b/languages/en.php new file mode 100644 index 000000000..f0cfde2a1 --- /dev/null +++ b/languages/en.php @@ -0,0 +1,13 @@ + "River Privacy", + 'river_privacy:hide_old:description' => "Only items that are created after this plugin is enabled + will be set to private. This setting can allow old items to be hidden - this is done at + display time, so it may affect layout (eg. 20 items are expected to be shown, but only 15 are + visible because 5 of them are filtered out by this plugin). + Note that new items created will be private regardless of this setting, this setting is only for old items.", + 'river_privacy:hide_old:label' => "Hide old river entries?", +); + +add_translation("en",$english); diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 000000000..42f2da5ff --- /dev/null +++ b/manifest.xml @@ -0,0 +1,19 @@ + + + River Privacy + Matt Beckett (matt@clever-name.com) + 1.0 + Sets non-object oriented river items to private access (eg. friend relationships) + http://landing.athabascau.ca + (C) Matt Beckett, 2012 + GNU Public License version 2 + + + + elgg_release + 1.8 + + + privacy + true + diff --git a/river_privacy/CHANGES.txt b/river_privacy/CHANGES.txt deleted file mode 100644 index df26e881d..000000000 --- a/river_privacy/CHANGES.txt +++ /dev/null @@ -1,7 +0,0 @@ -== Version History == - -x.x: - -1.0 (05/19/2012): - -- Initial Release \ No newline at end of file diff --git a/river_privacy/languages/en.php b/river_privacy/languages/en.php deleted file mode 100644 index f0cfde2a1..000000000 --- a/river_privacy/languages/en.php +++ /dev/null @@ -1,13 +0,0 @@ - "River Privacy", - 'river_privacy:hide_old:description' => "Only items that are created after this plugin is enabled - will be set to private. This setting can allow old items to be hidden - this is done at - display time, so it may affect layout (eg. 20 items are expected to be shown, but only 15 are - visible because 5 of them are filtered out by this plugin). - Note that new items created will be private regardless of this setting, this setting is only for old items.", - 'river_privacy:hide_old:label' => "Hide old river entries?", -); - -add_translation("en",$english); diff --git a/river_privacy/manifest.xml b/river_privacy/manifest.xml deleted file mode 100644 index 36ed40f92..000000000 --- a/river_privacy/manifest.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - River Privacy - Matt Beckett (matt@clever-name.com) - 1.0 - Sets non-object oriented river items to private access (eg. friend relationships) - http://landing.athabascau.ca - (C) Matt Beckett, 2012 - GNU Public License version 2 - - - - elgg_release - 1.8 - - - Miscellaneous - diff --git a/river_privacy/start.php b/river_privacy/start.php deleted file mode 100644 index b836ded52..000000000 --- a/river_privacy/start.php +++ /dev/null @@ -1,30 +0,0 @@ - 'params[hide_old_items]', - 'value' => $vars['entity']->hide_old_items ? $vars['entity']->hide_old_items : 'yes', - 'options_values' => array( - 'yes' => elgg_echo('option:yes'), - 'no' => elgg_echo('option:no'), - ), -); - -echo elgg_echo('river_privacy:hide_old:label') . "
    "; -echo elgg_view('input/dropdown', $options); - -echo "

    " . elgg_echo('river_privacy:hide_old:description'); - -echo "

    "; \ No newline at end of file diff --git a/river_privacy/views_override/default/page/components/list.php b/river_privacy/views_override/default/page/components/list.php deleted file mode 100644 index b34c454a6..000000000 --- a/river_privacy/views_override/default/page/components/list.php +++ /dev/null @@ -1,86 +0,0 @@ - element - * @uses $vars['item_class'] Additional CSS class for the
  • elements - */ - -$items = $vars['items']; -$offset = elgg_extract('offset', $vars); -$limit = elgg_extract('limit', $vars); -$count = elgg_extract('count', $vars); -$base_url = elgg_extract('base_url', $vars, ''); -$pagination = elgg_extract('pagination', $vars, true); -$offset_key = elgg_extract('offset_key', $vars, 'offset'); -$position = elgg_extract('position', $vars, 'after'); - -// remove non-object items for anyone who's not the subject -if(is_array($items) && ($items[0] instanceof ElggRiverItem)){ - foreach($items as $key => $item){ - if($item->type != 'object' && $item->subject_guid != elgg_get_logged_in_user_guid()){ - unset($items[$key]); - } - } -} - -// reset key values -$items = array_merge(array(), $items); - -$list_class = 'elgg-list'; -if (isset($vars['list_class'])) { - $list_class = "$list_class {$vars['list_class']}"; -} - -$item_class = 'elgg-item'; -if (isset($vars['item_class'])) { - $item_class = "$item_class {$vars['item_class']}"; -} - -$html = ""; -$nav = ""; - -if ($pagination && $count) { - $nav .= elgg_view('navigation/pagination', array( - 'base_url' => $base_url, - 'offset' => $offset, - 'count' => $count, - 'limit' => $limit, - 'offset_key' => $offset_key, - )); -} - -if (is_array($items) && count($items) > 0) { - $html .= "
      "; - foreach ($items as $item) { - if (elgg_instanceof($item)) { - $id = "elgg-{$item->getType()}-{$item->getGUID()}"; - } else { - $id = "item-{$item->getType()}-{$item->id}"; - } - $html .= "
    • "; - $html .= elgg_view_list_item($item, $vars); - $html .= '
    • '; - } - $html .= '
    '; -} - -if ($position == 'before' || $position == 'both') { - $html = $nav . $html; -} - -if ($position == 'after' || $position == 'both') { - $html .= $nav; -} - -echo $html; diff --git a/start.php b/start.php new file mode 100644 index 000000000..b836ded52 --- /dev/null +++ b/start.php @@ -0,0 +1,30 @@ + 'params[hide_old_items]', + 'value' => $vars['entity']->hide_old_items ? $vars['entity']->hide_old_items : 'yes', + 'options_values' => array( + 'yes' => elgg_echo('option:yes'), + 'no' => elgg_echo('option:no'), + ), +); + +echo elgg_echo('river_privacy:hide_old:label') . "
    "; +echo elgg_view('input/dropdown', $options); + +echo "

    " . elgg_echo('river_privacy:hide_old:description'); + +echo "

    "; \ No newline at end of file diff --git a/views_override/default/page/components/list.php b/views_override/default/page/components/list.php new file mode 100644 index 000000000..b34c454a6 --- /dev/null +++ b/views_override/default/page/components/list.php @@ -0,0 +1,86 @@ + element + * @uses $vars['item_class'] Additional CSS class for the
  • elements + */ + +$items = $vars['items']; +$offset = elgg_extract('offset', $vars); +$limit = elgg_extract('limit', $vars); +$count = elgg_extract('count', $vars); +$base_url = elgg_extract('base_url', $vars, ''); +$pagination = elgg_extract('pagination', $vars, true); +$offset_key = elgg_extract('offset_key', $vars, 'offset'); +$position = elgg_extract('position', $vars, 'after'); + +// remove non-object items for anyone who's not the subject +if(is_array($items) && ($items[0] instanceof ElggRiverItem)){ + foreach($items as $key => $item){ + if($item->type != 'object' && $item->subject_guid != elgg_get_logged_in_user_guid()){ + unset($items[$key]); + } + } +} + +// reset key values +$items = array_merge(array(), $items); + +$list_class = 'elgg-list'; +if (isset($vars['list_class'])) { + $list_class = "$list_class {$vars['list_class']}"; +} + +$item_class = 'elgg-item'; +if (isset($vars['item_class'])) { + $item_class = "$item_class {$vars['item_class']}"; +} + +$html = ""; +$nav = ""; + +if ($pagination && $count) { + $nav .= elgg_view('navigation/pagination', array( + 'base_url' => $base_url, + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + 'offset_key' => $offset_key, + )); +} + +if (is_array($items) && count($items) > 0) { + $html .= "
      "; + foreach ($items as $item) { + if (elgg_instanceof($item)) { + $id = "elgg-{$item->getType()}-{$item->getGUID()}"; + } else { + $id = "item-{$item->getType()}-{$item->id}"; + } + $html .= "
    • "; + $html .= elgg_view_list_item($item, $vars); + $html .= '
    • '; + } + $html .= '
    '; +} + +if ($position == 'before' || $position == 'both') { + $html = $nav . $html; +} + +if ($position == 'after' || $position == 'both') { + $html .= $nav; +} + +echo $html; -- cgit v1.2.3 From 9c543bc93cf31e7368a5be1c6b53b7099b28191d Mon Sep 17 00:00:00 2001 From: Sem Date: Fri, 12 Oct 2012 18:07:38 +0200 Subject: Added catalan languages. --- languages/ca.php | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 languages/ca.php diff --git a/languages/ca.php b/languages/ca.php new file mode 100644 index 000000000..50f508e75 --- /dev/null +++ b/languages/ca.php @@ -0,0 +1,7 @@ + 'Privacitat de l\'activitat', + 'river_privacy:hide_old:description' => 'Només els objectes que es creen després de l\'activació d\'aquesta extensió seran privats. Aquesta opció pot permetre els antics objectes d\'ocultar-se - això funciona en el moment de mostrar-los, i pot afectar a la visualització (per exemple, s\'espera mostrar 20 elements, però només 15 són visibles perquè 5 d\'ells els filtra aquesta extensió)', + 'river_privacy:hide_old:label' => 'Ocultar activitat antiga?', +); +add_translation("ca", $language); \ No newline at end of file -- cgit v1.2.3 From 4a8f3623c5d15543cc08ab93a245d612fa09c3fe Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 23 Oct 2012 02:35:48 +0000 Subject: protect from empty items. --- views_override/default/page/components/list.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/views_override/default/page/components/list.php b/views_override/default/page/components/list.php index b34c454a6..b5a78406d 100644 --- a/views_override/default/page/components/list.php +++ b/views_override/default/page/components/list.php @@ -35,7 +35,10 @@ if(is_array($items) && ($items[0] instanceof ElggRiverItem)){ } // reset key values -$items = array_merge(array(), $items); +if ($items) + $items = array_merge(array(), $items); +else + $items = array(); $list_class = 'elgg-list'; if (isset($vars['list_class'])) { -- cgit v1.2.3 From 5417f6228a66dcc7a26b96abbd5ce7fa159991b4 Mon Sep 17 00:00:00 2001 From: Sem Date: Fri, 8 Nov 2013 06:24:30 +0100 Subject: Bumped version 1.8.0 --- manifest.xml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/manifest.xml b/manifest.xml index 42f2da5ff..dbd08da35 100644 --- a/manifest.xml +++ b/manifest.xml @@ -2,14 +2,12 @@ River Privacy Matt Beckett (matt@clever-name.com) - 1.0 + 1.8.0 Sets non-object oriented river items to private access (eg. friend relationships) http://landing.athabascau.ca (C) Matt Beckett, 2012 GNU Public License version 2 - - - + elgg_release 1.8 -- cgit v1.2.3