Example #1
0
 /**
  * Function: index
  *
  * Description: This controller calls the helper functions to create and assemble the various components
  * needed to make a working map
  *
  * Views: enhancedmap/print_mapview, enhancedmap/print_map_header
  *
  * Results: User gets a map that they can interact with
  */
 public function index()
 {
     ////////////////////////////////////////////////////////////////////////////////////////////////
     // custom JS that the print map needs
     plugin::add_javascript("enhancedmap/js/jquery.address-1.4.min.js");
     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // Setup the map
     enhancedmap_helper::setup_enhancedmap($this, "enhancedmap/print_mapview", "enhancedmap/css/print_enhancedmap");
     //ARE WE CLUSTERING?
     $clustering = cookie::get('clustering', Kohana::config('settings.allow_clustering'));
     /////////////////////////////////////////////////////////////////////////////////////////////////////////
     //get the CATEGORIES
     /////////////////////////////////////////////////////////////////////////////////////////////////////////
     if (isset($this->group_id) && $this->group_id) {
         $group_id = $this->group_id;
         $group = ORM::factory('simplegroups_groups', $this->group_id)->find($this->group_id);
         $this->template->content->div_categories_filter = enhancedmap_helper::set_categories(false, $group);
         $urlParams = array('sgid' => $group_id);
     } else {
         //get the categories
         $this->template->content->div_categories_filter = enhancedmap_helper::set_categories();
         $urlParams = array();
     }
     //status filter
     $this->template->content->div_status_filter = enhancedmap_helper::get_status_filter();
     //boolean filter
     $this->template->content->div_boolean_filter = enhancedmap_helper::get_boolean_filter();
     //dot size selector
     $this->template->content->div_dotsize_selector = enhancedmap_helper::get_dotsize_selector();
     //clustering selector
     $this->template->content->div_clustering_selector = enhancedmap_helper::get_clustering_selector();
     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //setup the map
     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $json_url = $clustering == 1 ? "bigmap_json/cluster" : "bigmap_json";
     $json_timeline_url = "bigmap_json/timeline/";
     enhancedmap_helper::set_map($this->template, $this->themes, $json_url, $json_timeline_url, 'enhancedmap/print_mapview_js', 'enhancedmap/big_main_map', 'enhancedmap/print_main_timeline', $urlParams);
     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //setup the overlays and shares
     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //layers
     $this->template->content->div_layers_filter = enhancedmap_helper::set_layers();
     //shares
     $this->template->content->div_shares_filter = enhancedmap_helper::set_shares(false, false);
     plugin::add_stylesheet("enhancedmap/css/jquery.hovertip-1.0");
     plugin::add_javascript("enhancedmap/js/jquery.hovertip-1.0");
     $this->template->header = new View('enhancedmap/print_map_header');
     $this->template->header->site_name = $this->site_name;
     $this->template->header->this_page = "printmap";
     // Rebuild Header Block
     $this->template->header->header_block = $this->themes->header_block();
 }
Example #2
0
 /**
  * Function: index
  *
  * Description: This controller calls the helper functions to create and assemble the various components
  * needed to make a working map
  *
  *	@param int $width - Width of the iframe
  *
  * Views: enhancedmap/iframe_mapview,
  *
  * Results: User gets a map that they can interact with
  */
 public function index($width = 400)
 {
     //set the title of the page
     $this->template->header->this_page = 'bigmap';
     //javascript for the big map special features
     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // Setup the map
     enhancedmap_helper::setup_enhancedmap($this, "enhancedmap/iframe_mapview", "enhancedmap/css/iframe_adminmap");
     //set the site name
     $this->template->content->site_name = $this->template->header->site_name;
     //set the width of the map
     $this->template->content->width = $width;
     //ARE WE CLUSTERING?
     $clustering = cookie::get('clustering', Kohana::config('settings.allow_clustering'));
     /////////////////////////////////////////////////////////////////////////////////////////////////////////
     //get the CATEGORIES
     /////////////////////////////////////////////////////////////////////////////////////////////////////////
     //get the categories
     enhancedmap_helper::set_categories($this, false);
     $json_url = $clustering == 1 ? "iframemap_json/cluster" : "iframemap_json";
     $json_timeline_url = "bigmap_json/timeline/";
     //boolean filter
     $this->template->content->div_boolean_filter = enhancedmap_helper::get_boolean_filter();
     //boolean filter
     $this->template->content->div_categories_filter = enhancedmap_helper::set_categories();
     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //setup the map
     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     enhancedmap_helper::set_map($this->template, $this->themes, $json_url, $json_timeline_url, 'enhancedmap/adminmap_js', 'enhancedmap/big_main_map', 'enhancedmap/iframe_main_timeline');
     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //setup the overlays and shares
     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //layers
     $this->template->content->div_layers_filter = enhancedmap_helper::set_layers();
     //shares
     $this->template->content->div_shares_filter = enhancedmap_helper::set_shares(false, false);
     plugin::add_stylesheet("enhancedmap/css/jquery.hovertip-1.0");
     plugin::add_javascript("enhancedmap/js/jquery.hovertip-1.0");
     // Rebuild Header Block
     $this->template->header->header_block = $this->themes->header_block();
 }
Example #3
0
 /**
  * Function: fitler_cats
  *
  * Description: Used to set how the category list will be displayed, alphabetized or not
  *
  * Views: enhancedmap/categories_filter
  *
  * Results: renders the cateogry filter as indicated by the settings
  */
 public function fitler_cats()
 {
     $alphabetize = isset($_GET['alphabetize']);
     $fitler = enhancedmap_helper::set_categories(false, false, "enhancedmap/categories_filter", "category_switch", $alphabetize);
     $filter->render(true);
 }
Example #4
0
 /**
  * Function: timeline
  *
  * Description: This controller generates the timeline json of reports in the Ushahidi system.
  * This controller uses the helper class to do all the work.
  *
  * Views:
  *
  * Results: json is sent to the requesting client
  */
 public function timeline()
 {
     enhancedmap_helper::json_timeline($this);
 }
Example #5
0
 /**
  * Function: index
  *
  * Description: This controller calls the helper functions to create and assemble the various components
  * needed to make a working map
  *
  * Views: enhancedmap/status_filter, enhancedmap/boolean_filter
  *
  * Results: User gets a map that they can interact with
  */
 public function index()
 {
     enhancedmap_helper::setup_enhancedmap($this);
     //get the categories
     $this->template->content->div_categories_filter = enhancedmap_helper::set_categories($on_backend = true);
     //set the status filter
     $this->template->content->div_status_filter = enhancedmap_helper::get_status_filter($on_backend = true, $status_filter_view = 'enhancedmap/status_filter', $status_filter_id = "status_filter", $show_unapproved = true);
     //set the boolean filter
     $this->template->content->div_boolean_filter = enhancedmap_helper::get_boolean_filter($on_backend = true, $boolean_filter_view = 'enhancedmap/boolean_filter', $status_filter_id = "boolean_filter", $show_help = false);
     //dot size selector
     $this->template->content->div_dotsize_selector = enhancedmap_helper::get_dotsize_selector();
     //clustering selector
     $this->template->content->div_clustering_selector = enhancedmap_helper::get_clustering_selector();
     //setup the map
     $clustering = cookie::get('clustering', Kohana::config('settings.allow_clustering'));
     $json_url = $clustering == 1 ? "admin/adminmap_json/cluster" : "admin/adminmap_json";
     $json_timeline_url = "admin/adminmap_json/timeline/";
     enhancedmap_helper::set_map($this->template, $this->themes, $json_url, $json_timeline_url);
     //layers
     $this->template->content->div_layers_filter = enhancedmap_helper::set_layers(true);
     //shares
     $this->template->content->div_shares_filter = enhancedmap_helper::set_shares(true, false);
 }
Example #6
0
 /**
  * Function: timeline
  *
  * Description: This controller generates the timeline json of reports in the Ushahidi system.
  * This controller uses the helper class to do all the work.
  *
  * Views:
  *
  * Results: json is sent to the requesting client
  */
 public function timeline($category_ids = "0,")
 {
     enhancedmap_helper::json_timeline($this, $category_ids, false);
 }