本文整理汇总了PHP中Themes::filter_search方法的典型用法代码示例。如果您正苦于以下问题:PHP Themes::filter_search方法的具体用法?PHP Themes::filter_search怎么用?PHP Themes::filter_search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Themes
的用法示例。
在下文中一共展示了Themes::filter_search方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$this->template->header->this_page = 'home';
$this->template->content = new View('main/layout');
// JP: Allow the main body content to have access to the submit button so that the submit button can be used outside of the header in some themes.
$this->template->content->submit_btn = $this->template->header->submit_btn;
// JP: Add the filter search, if applicable.
$this->template->content->filter_search = $this->themes->filter_search();
// Cacheable Main Controller
$this->is_cachable = TRUE;
// Map Block
$div_map = new View('main/map');
// Filter::map_main - Modify Main Map Block
Event::run('ushahidi_filter.map_main', $div_map);
$this->template->content->div_map = $div_map;
// JP: Only add a timeline if the chronological filter is enabled.
if (Kohana::config('settings.enable_chronological_filter')) {
// Slider Block
$div_timeline = new View('main/timeline');
// Filter::map_timeline - Modify Main Map Block
Event::run('ushahidi_filter.map_timeline', $div_timeline);
$this->template->content->div_timeline = $div_timeline;
} else {
$this->template->content->div_timeline = '';
}
// Check if there is a site message
$this->template->content->site_message = '';
$site_message = trim(Kohana::config('settings.site_message'));
if ($site_message != '') {
// Send the site message to both the header and the main content body
// so a theme can utilize it in either spot.
$this->template->content->site_message = $site_message;
$this->template->header->site_message = $site_message;
}
// Get locale
$l = Kohana::config('locale.language.0');
// Get all active top level categories
$parent_categories = array();
$all_parents = ORM::factory('category')->where('category_visible', '1')->where('parent_id', '0')->find_all();
foreach ($all_parents as $category) {
// Get The Children
$children = array();
foreach ($category->children as $child) {
$child_visible = $child->category_visible;
if ($child_visible) {
// Check for localization of child category
$display_title = Category_Lang_Model::category_title($child->id, $l);
$ca_img = $child->category_image != NULL ? url::convert_uploaded_to_abs($child->category_image) : NULL;
$children[$child->id] = array($display_title, $child->category_color, $ca_img);
}
}
// Check for localization of parent category
$display_title = Category_Lang_Model::category_title($category->id, $l);
// Put it all together
$ca_img = $category->category_image != NULL ? url::convert_uploaded_to_abs($category->category_image) : NULL;
$parent_categories[$category->id] = array($display_title, $category->category_color, $ca_img, $children);
}
$this->template->content->categories = $parent_categories;
// Get all active Layers (KMZ/KML)
$layers = array();
$config_layers = Kohana::config('map.layers');
// use config/map layers if set
if ($config_layers == $layers) {
foreach (ORM::factory('layer')->where('layer_visible', 1)->find_all() as $layer) {
$layers[$layer->id] = array($layer->layer_name, $layer->layer_color, $layer->layer_url, $layer->layer_file);
}
} else {
$layers = $config_layers;
}
$this->template->content->layers = $layers;
// Get Default Color
$this->template->content->default_map_all = Kohana::config('settings.default_map_all');
// Get default 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->template->content->default_map_all_icon = Kohana::config('upload.relative_directory') . "/" . $icon_object->media_medium;
}
// Get Twitter Hashtags
$this->template->content->twitter_hashtag_array = array_filter(array_map('trim', explode(',', Kohana::config('settings.twitter_hashtags'))));
// Get Report-To-Email
$this->template->content->report_email = Kohana::config('settings.site_email');
// Get SMS Numbers
$phone_array = array();
$sms_no1 = Kohana::config('settings.sms_no1');
$sms_no2 = Kohana::config('settings.sms_no2');
$sms_no3 = Kohana::config('settings.sms_no3');
if (!empty($sms_no1)) {
$phone_array[] = $sms_no1;
}
if (!empty($sms_no2)) {
$phone_array[] = $sms_no2;
}
if (!empty($sms_no3)) {
$phone_array[] = $sms_no3;
}
$this->template->content->phone_array = $phone_array;
// Get external apps
$external_apps = array();
// Catch errors, in case we have an old db
//.........这里部分代码省略.........