<?php /** * Elgg ShareMaps plugin * @package sharemaps */ elgg_load_library('elgg:sharemaps'); elgg_push_breadcrumb(elgg_echo('sharemaps')); // register post buttons, depending on settings $sm_map_types = elgg_get_config('sm_map_types'); foreach ($sm_map_types as $name => $type_info) { if (sharemaps_is_type_active($name)) { elgg_register_title_button('sharemaps', $type_info['button']); } } $limit = get_input("limit", 10); $title = elgg_echo('sharemaps:all'); $content = elgg_list_entities(array('types' => 'object', 'subtypes' => array('sharemaps', 'drawmap'), 'limit' => $limit, 'full_view' => FALSE)); if (!$content) { $content = elgg_echo('sharemaps:none'); } $sidebar = elgg_view('sharemaps/sidebar'); $body = elgg_view_layout('content', array('filter_context' => 'all', 'content' => $content, 'title' => $title, 'sidebar' => $sidebar)); echo elgg_view_page($title, $body);
<?php /** * Elgg ShareMaps plugin * @package sharemaps */ elgg_load_library('elgg:sharemaps'); if (!sharemaps_is_type_active('map_creation')) { register_error(elgg_echo('sharemaps:add:noaccessforpost')); forward(REFERER); } $userid = elgg_get_logged_in_user_guid(); $owner = elgg_get_page_owner_entity(); gatekeeper(); group_gatekeeper(); $title = elgg_echo('sharemaps:drawmap'); // set up breadcrumbs elgg_push_breadcrumb(elgg_echo('sharemaps'), "sharemaps/all"); if (elgg_instanceof($owner, 'user')) { elgg_push_breadcrumb($owner->name, "sharemaps/owner/{$owner->username}"); } else { elgg_push_breadcrumb($owner->name, "sharemaps/group/{$owner->guid}/all"); } elgg_push_breadcrumb($title); // create form $form_vars = array('enctype' => 'multipart/form-data'); $body_vars = sharemaps_prepare_form_vars_drawmap(); $content = elgg_view_form('sharemaps/drawmap', $form_vars, $body_vars); $body = elgg_view_layout('content', array('content' => $content, 'title' => $title, 'filter' => '')); echo elgg_view_page($title, $body);
<?php /** * Elgg sharemaps upload new maps * * @package ElggShareMaps */ elgg_load_library('elgg:sharemaps'); if (!sharemaps_is_type_active('map_upload')) { register_error(elgg_echo('sharemaps:add:noaccessforpost')); forward(REFERER); } $owner = elgg_get_page_owner_entity(); gatekeeper(); group_gatekeeper(); $title = elgg_echo('sharemaps:add'); // set up breadcrumbs elgg_push_breadcrumb(elgg_echo('sharemaps'), "sharemaps/all"); if (elgg_instanceof($owner, 'user')) { elgg_push_breadcrumb($owner->name, "sharemaps/owner/{$owner->username}"); } else { elgg_push_breadcrumb($owner->name, "sharemaps/group/{$owner->guid}/all"); } elgg_push_breadcrumb($title); // create form $form_vars = array('enctype' => 'multipart/form-data'); $body_vars = sharemaps_prepare_form_vars(); $content = elgg_view_form('sharemaps/upload', $form_vars, $body_vars); $body = elgg_view_layout('content', array('content' => $content, 'title' => $title, 'filter' => '')); echo elgg_view_page($title, $body);
<?php /** * Elgg ShareMaps plugin * @package sharemaps */ elgg_load_library('elgg:sharemaps'); if (!sharemaps_is_type_active('gmaps_links')) { register_error(elgg_echo('sharemaps:add:noaccessforpost')); forward(REFERER); } $userid = elgg_get_logged_in_user_guid(); $owner = elgg_get_page_owner_entity(); gatekeeper(); group_gatekeeper(); $title = elgg_echo('sharemaps:embed'); // set up breadcrumbs elgg_push_breadcrumb(elgg_echo('sharemaps'), "sharemaps/all"); if (elgg_instanceof($owner, 'user')) { elgg_push_breadcrumb($owner->name, "sharemaps/owner/{$owner->username}"); } else { elgg_push_breadcrumb($owner->name, "sharemaps/group/{$owner->guid}/all"); } elgg_push_breadcrumb($title); // create form $form_vars = array('enctype' => 'multipart/form-data'); $body_vars = sharemaps_prepare_form_vars_gmaplink(); $content = elgg_view_form('sharemaps/embed', $form_vars, $body_vars); $body = elgg_view_layout('content', array('content' => $content, 'title' => $title, 'filter' => '')); echo elgg_view_page($title, $body);