From 475608057d2d1d0b0aabab6a5a4ce27bd4457665 Mon Sep 17 00:00:00 2001 From: Eric Rasmussen <erasmussen2@unl.edu> Date: Fri, 30 Apr 2010 22:24:41 +0000 Subject: [PATCH] work on new globe plugin --- plugins/putyourselfonthemap/index.php | 18 +++--- plugins/putyourselfonthemap/start.php | 55 +++++-------------- .../canvas/layouts/putyourselfonthemap.php | 20 +++++++ 3 files changed, 41 insertions(+), 52 deletions(-) create mode 100644 plugins/putyourselfonthemap/views/default/canvas/layouts/putyourselfonthemap.php diff --git a/plugins/putyourselfonthemap/index.php b/plugins/putyourselfonthemap/index.php index c30aac91..ad2e5d3c 100644 --- a/plugins/putyourselfonthemap/index.php +++ b/plugins/putyourselfonthemap/index.php @@ -1,27 +1,25 @@ <?php /** - * Elgg globe plugin + * Elgg Put Yourself On The Map Plugin * * @package ElggGlobe * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Eric Rasmussen - * @copyright UNL 2009 + * @author University of Nebraska/Eric Rasmussen + * @copyright University of Nebraska Board of Regents 2010 * @link http://planetred.unl.edu/ */ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); - - gatekeeper(); - - // Get view - $area1 = elgg_view('globe/content', array()); + + $newest_members = elgg_get_entities_from_metadata(array('metadata_names' => 'icontime', 'types' => 'user', 'limit' => 10)); + // Format - $body = elgg_view_layout('one_column', $area1); + $body = elgg_view_layout('putyourselfonthemap', $newest_members); // Draw page - echo page_draw(elgg_echo(' Put Yourself On The Map'), $body); + echo page_draw(elgg_echo('Put Yourself On The Map'), $body); ?> \ No newline at end of file diff --git a/plugins/putyourselfonthemap/start.php b/plugins/putyourselfonthemap/start.php index a5eed512..6b2a94ad 100644 --- a/plugins/putyourselfonthemap/start.php +++ b/plugins/putyourselfonthemap/start.php @@ -7,54 +7,25 @@ * @author Eric Rasmussen * @copyright UNL 2009 * @link http://planetred.unl.edu/ - */ - - /** - * Initialise the groups plugin. - * Register actions, set up menus - */ - function globe_init() - { - - global $CONFIG; - - - if (isloggedin()) - { - add_menu(elgg_echo('Around the World'), $CONFIG->wwwroot . "pg/globe/"); - //add_menu(elgg_echo('groups:alldiscussion'),$CONFIG->wwwroot."mod/groups/discussions.php"); - } - else - { - add_menu(elgg_echo('Around the World'), $CONFIG->wwwroot . "pg/globe/"); - } - + */ + function putyourselfonthemap_init() + { + add_menu(elgg_echo('Around the World'), $vars['url'].'pg/putyourselfonthemap/'); // Extend system CSS with our own styles, which are defined in the globe/css view - extend_view('css','globe/css'); + extend_view('css','putyourselfonthemap/css'); - - register_page_handler('globe', 'globe_page_handler'); - + // Allows us to use /pg/putyourselfonthemap + register_page_handler('putyourselfonthemap', 'putyourselfonthemap_page_handler'); } - function globe_page_handler($page) { - switch ($page[0]) - { - case 'friends': - include("globe.php"); - break; - default: - include("index.php"); - break; - } + function putyourselfonthemap_page_handler($page) { + // Sets a filter, like /pg/putyourselfonthemap/friends will show only your friends + if (isset($page[0])) { + set_input('pyotm_filter',$page[0]); + } } - - - - register_elgg_event_handler('init','system','globe_init'); - - + register_elgg_event_handler('init','system','putyourselfonthemap_init'); ?> diff --git a/plugins/putyourselfonthemap/views/default/canvas/layouts/putyourselfonthemap.php b/plugins/putyourselfonthemap/views/default/canvas/layouts/putyourselfonthemap.php new file mode 100644 index 00000000..4e2db780 --- /dev/null +++ b/plugins/putyourselfonthemap/views/default/canvas/layouts/putyourselfonthemap.php @@ -0,0 +1,20 @@ +<?php + + + + + +?> + + +<div class="col left"><div class="contentWrapper"> + <?php + if(isset($vars['area1'])) { + //display member avatars + foreach($vars['area1'] as $members){ + echo "<div class=\"index_members\">"; + echo elgg_view("profile/icon",array('entity' => $members, 'size' => 'small')); + echo "</div>"; + } + }?></div> +</div> \ No newline at end of file -- GitLab