当前位置: 首页>>代码示例>>PHP>>正文


PHP category::get_category_tree_view方法代码示例

本文整理汇总了PHP中category::get_category_tree_view方法的典型用法代码示例。如果您正苦于以下问题:PHP category::get_category_tree_view方法的具体用法?PHP category::get_category_tree_view怎么用?PHP category::get_category_tree_view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在category的用法示例。


在下文中一共展示了category::get_category_tree_view方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Displays all reports.
  */
 public function index()
 {
     // Cacheable Controller
     $this->is_cachable = TRUE;
     $this->template->header->this_page = 'reports';
     $this->template->content = new View('reports');
     $this->themes->js = new View('reports_js');
     // Store any exisitng URL parameters
     $this->themes->js->url_params = json_encode($_GET);
     // Enable the map
     $this->themes->map_enabled = TRUE;
     // Set the latitude and longitude
     $this->themes->js->latitude = Kohana::config('settings.default_lat');
     $this->themes->js->longitude = Kohana::config('settings.default_lon');
     $this->themes->js->default_map = Kohana::config('settings.default_map');
     $this->themes->js->default_zoom = Kohana::config('settings.default_zoom');
     // Load the alert radius view
     $alert_radius_view = new View('alert_radius_view');
     $alert_radius_view->show_usage_info = FALSE;
     $alert_radius_view->enable_find_location = FALSE;
     $alert_radius_view->css_class = "rb_location-radius";
     $this->template->content->alert_radius_view = $alert_radius_view;
     // Get locale
     $l = Kohana::config('locale.language.0');
     // Get the report listing view
     $report_listing_view = $this->_get_report_listing_view($l);
     // Set the view
     $this->template->content->report_listing_view = $report_listing_view;
     // Load the category
     $category_id = (isset($_GET['c']) and intval($_GET['c']) > 0) ? intval($_GET['c']) : 0;
     $category = ORM::factory('category', $category_id);
     if ($category->loaded) {
         $translated_title = Category_Lang_Model::category_title($category_id, $l);
         // Set the category title
         $this->template->content->category_title = $translated_title ? $translated_title : $category->category_title;
     } else {
         $this->template->content->category_title = "";
     }
     // Collect report stats
     $this->template->content->report_stats = new View('reports_stats');
     // Total Reports
     $total_reports = Incident_Model::get_total_reports(TRUE);
     // Get the date of the oldest report
     $oldest_timestamp = Incident_Model::get_oldest_report_timestamp();
     // Get the date of the latest report
     $latest_timestamp = Incident_Model::get_latest_report_timestamp();
     // Round the number of days up to the nearest full day
     $days_since = ceil((time() - $oldest_timestamp) / 86400);
     $avg_reports_per_day = $days_since < 1 ? $total_reports : round($total_reports / $days_since, 2);
     // Percent Verified
     $total_verified = Incident_Model::get_total_reports_by_verified(TRUE);
     $percent_verified = $total_reports == 0 ? '-' : round($total_verified / $total_reports * 100, 2) . '%';
     // Category tree view
     $this->template->content->category_tree_view = category::get_category_tree_view();
     // Additional view content
     $this->template->content->oldest_timestamp = $oldest_timestamp;
     $this->template->content->latest_timestamp = $latest_timestamp;
     $this->template->content->report_stats->total_reports = $total_reports;
     $this->template->content->report_stats->avg_reports_per_day = $avg_reports_per_day;
     $this->template->content->report_stats->percent_verified = $percent_verified;
     $this->template->content->services = Service_Model::get_array();
     $this->template->header->header_block = $this->themes->header_block();
 }
开发者ID:huslage,项目名称:Ushahidi_Web,代码行数:66,代码来源:reports.php

示例2: index

 /**
  * Displays all reports.
  */
 public function index()
 {
     // Cacheable Controller
     $this->is_cachable = TRUE;
     $this->template->header->this_page = 'reports';
     $this->template->content = new View('reports/main');
     $this->themes->js = new View('reports/reports_js');
     $this->template->header->page_title .= Kohana::lang('ui_main.reports') . Kohana::config('settings.title_delimiter');
     // Store any exisitng URL parameters
     $this->themes->js->url_params = json_encode($_GET);
     // Enable the map
     $this->themes->map_enabled = TRUE;
     // Set the latitude and longitude
     $this->themes->js->latitude = Kohana::config('settings.default_lat');
     $this->themes->js->longitude = Kohana::config('settings.default_lon');
     $this->themes->js->default_map = Kohana::config('settings.default_map');
     $this->themes->js->default_zoom = Kohana::config('settings.default_zoom');
     // Get Default Color
     $this->themes->js->default_map_all = $this->template->content->default_map_all = Kohana::config('settings.default_map_all');
     // Get default icon
     $this->themes->js->default_map_all_icon = $this->template->content->default_map_all_icon = '';
     if (Kohana::config('settings.default_map_all_icon_id')) {
         $icon_object = ORM::factory('media')->find(Kohana::config('settings.default_map_all_icon_id'));
         $this->themes->js->default_map_all_icon = $this->template->content->default_map_all_icon = Kohana::config('upload.relative_directory') . "/" . $icon_object->media_thumb;
     }
     // Load the alert radius view
     $alert_radius_view = new View('alerts/radius');
     $alert_radius_view->show_usage_info = FALSE;
     $alert_radius_view->enable_find_location = TRUE;
     $alert_radius_view->css_class = "rb_location-radius";
     $this->template->content->alert_radius_view = $alert_radius_view;
     // Get locale
     $l = Kohana::config('locale.language.0');
     // Get the report listing view
     $report_listing_view = $this->_get_report_listing_view($l);
     // Set the view
     $this->template->content->report_listing_view = $report_listing_view;
     // Load the category
     $category_id = (isset($_GET['c']) and intval($_GET['c']) > 0) ? intval($_GET['c']) : 0;
     $category = ORM::factory('category', $category_id);
     if ($category->loaded) {
         // Set the category title
         $this->template->content->category_title = Category_Lang_Model::category_title($category_id, $l);
     } else {
         $this->template->content->category_title = "";
     }
     // Collect report stats
     $this->template->content->report_stats = new View('reports/stats');
     // Total Reports
     $total_reports = Incident_Model::get_total_reports(TRUE);
     // Get the date of the oldest report
     if (isset($_GET['s']) and !empty($_GET['s']) and intval($_GET['s']) > 0) {
         $oldest_timestamp = intval($_GET['s']);
     } else {
         $oldest_timestamp = Incident_Model::get_oldest_report_timestamp();
     }
     // Get the date of the latest report
     if (isset($_GET['e']) and !empty($_GET['e']) and intval($_GET['e']) > 0) {
         $latest_timestamp = intval($_GET['e']);
     } else {
         $latest_timestamp = Incident_Model::get_latest_report_timestamp();
     }
     // Round the number of days up to the nearest full day
     $days_since = ceil((time() - $oldest_timestamp) / 86400);
     $avg_reports_per_day = $days_since < 1 ? $total_reports : round($total_reports / $days_since, 2);
     // Percent Verified
     $total_verified = Incident_Model::get_total_reports_by_verified(TRUE);
     $percent_verified = $total_reports == 0 ? '-' : round($total_verified / $total_reports * 100, 2) . '%';
     // Category tree view
     $this->template->content->category_tree_view = category::get_category_tree_view();
     // Additional view content
     $this->template->content->custom_forms_filter = new View('reports/submit_custom_forms');
     $this->template->content->custom_forms_filter->disp_custom_fields = customforms::get_custom_form_fields();
     $this->template->content->custom_forms_filter->search_form = TRUE;
     $this->template->content->oldest_timestamp = $oldest_timestamp;
     $this->template->content->latest_timestamp = $latest_timestamp;
     $this->template->content->report_stats->total_reports = $total_reports;
     $this->template->content->report_stats->avg_reports_per_day = $avg_reports_per_day;
     $this->template->content->report_stats->percent_verified = $percent_verified;
     $this->template->content->services = Service_Model::get_array();
 }
开发者ID:niiyatii,项目名称:crowdmap,代码行数:84,代码来源:reports.php


注:本文中的category::get_category_tree_view方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。