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 .= "'; -} - -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 .= "'; +} + +if ($position == 'before' || $position == 'both') { + $html = $nav . $html; +} + +if ($position == 'after' || $position == 'both') { + $html .= $nav; +} + +echo $html; -- cgit v1.2.3