Skip to content
Snippets Groups Projects
Commit 47560805 authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

work on new globe plugin

parent 294f4845
No related branches found
No related tags found
No related merge requests found
<?php <?php
/** /**
* Elgg globe plugin * Elgg Put Yourself On The Map Plugin
* *
* @package ElggGlobe * @package ElggGlobe
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Eric Rasmussen * @author University of Nebraska/Eric Rasmussen
* @copyright UNL 2009 * @copyright University of Nebraska Board of Regents 2010
* @link http://planetred.unl.edu/ * @link http://planetred.unl.edu/
*/ */
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
gatekeeper(); $newest_members = elgg_get_entities_from_metadata(array('metadata_names' => 'icontime', 'types' => 'user', 'limit' => 10));
// Get view
$area1 = elgg_view('globe/content', array());
// Format // Format
$body = elgg_view_layout('one_column', $area1); $body = elgg_view_layout('putyourselfonthemap', $newest_members);
// Draw page // 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
...@@ -7,54 +7,25 @@ ...@@ -7,54 +7,25 @@
* @author Eric Rasmussen * @author Eric Rasmussen
* @copyright UNL 2009 * @copyright UNL 2009
* @link http://planetred.unl.edu/ * @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 system CSS with our own styles, which are defined in the globe/css view
extend_view('css','globe/css'); extend_view('css','putyourselfonthemap/css');
// Allows us to use /pg/putyourselfonthemap
register_page_handler('globe', 'globe_page_handler'); register_page_handler('putyourselfonthemap', 'putyourselfonthemap_page_handler');
} }
function globe_page_handler($page) { function putyourselfonthemap_page_handler($page) {
switch ($page[0]) // Sets a filter, like /pg/putyourselfonthemap/friends will show only your friends
{ if (isset($page[0])) {
case 'friends': set_input('pyotm_filter',$page[0]);
include("globe.php"); }
break;
default:
include("index.php");
break;
}
} }
register_elgg_event_handler('init','system','putyourselfonthemap_init');
register_elgg_event_handler('init','system','globe_init');
?> ?>
<?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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment