本文整理汇总了PHP中Themes::header_block方法的典型用法代码示例。如果您正苦于以下问题:PHP Themes::header_block方法的具体用法?PHP Themes::header_block怎么用?PHP Themes::header_block使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Themes
的用法示例。
在下文中一共展示了Themes::header_block方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _pre_render
/**
* Trigger themes->requirements() at the last minute
*
* This is in case features are enabled/disabled
*/
public function _pre_render()
{
$this->themes->requirements();
$this->themes->plugin_requirements();
$this->template->header->header_block = $this->themes->header_block();
$this->template->footer->footer_block = $this->themes->footer_block();
}
示例2: index
//.........这里部分代码省略.........
$last_month = $month;
$i++;
}
$show_year = $first_year;
$selected_start_flag = TRUE;
while ($show_year <= $last_year) {
$startDate .= "<optgroup label=\"" . $show_year . "\">";
$s_m = 1;
if ($show_year == $first_year) {
// If we are showing the first year, the starting month may not be January
$s_m = $first_month;
}
$l_m = 12;
if ($show_year == $last_year) {
// If we are showing the last year, the ending month may not be December
$l_m = $last_month;
}
for ($i = $s_m; $i <= $l_m; $i++) {
if ($i < 10) {
// All months need to be two digits
$i = "0" . $i;
}
$startDate .= "<option value=\"" . strtotime($show_year . "-" . $i . "-01") . "\"";
if ($selected_start_flag == TRUE) {
$display_startDate = strtotime($show_year . "-" . $i . "-01");
$startDate .= " selected=\"selected\" ";
$selected_start_flag = FALSE;
}
$startDate .= ">" . date('M', mktime(0, 0, 0, $i, 1)) . " " . $show_year . "</option>";
}
$startDate .= "</optgroup>";
$endDate .= "<optgroup label=\"" . $show_year . "\">";
for ($i = $s_m; $i <= $l_m; $i++) {
if ($i < 10) {
// All months need to be two digits
$i = "0" . $i;
}
$endDate .= "<option value=\"" . strtotime($show_year . "-" . $i . "-" . date('t', mktime(0, 0, 0, $i, 1)) . " 23:59:59") . "\"";
if ($i == $l_m and $show_year == $last_year) {
$display_endDate = strtotime($show_year . "-" . $i . "-" . date('t', mktime(0, 0, 0, $i, 1)) . " 23:59:59");
$endDate .= " selected=\"selected\" ";
}
$endDate .= ">" . date('M', mktime(0, 0, 0, $i, 1)) . " " . $show_year . "</option>";
}
$endDate .= "</optgroup>";
// Show next year
$show_year++;
}
Event::run('ushahidi_filter.active_startDate', $display_startDate);
Event::run('ushahidi_filter.active_endDate', $display_endDate);
Event::run('ushahidi_filter.startDate', $startDate);
Event::run('ushahidi_filter.endDate', $endDate);
$this->template->content->div_timeline->startDate = $startDate;
$this->template->content->div_timeline->endDate = $endDate;
// Javascript Header
$this->themes->map_enabled = TRUE;
$this->themes->main_page = TRUE;
// Map Settings
$clustering = Kohana::config('settings.allow_clustering');
$marker_radius = Kohana::config('map.marker_radius');
$marker_opacity = Kohana::config('map.marker_opacity');
$marker_stroke_width = Kohana::config('map.marker_stroke_width');
$marker_stroke_opacity = Kohana::config('map.marker_stroke_opacity');
// pdestefanis - allows to restrict the number of zoomlevels available
$numZoomLevels = Kohana::config('map.numZoomLevels');
$minZoomLevel = Kohana::config('map.minZoomLevel');
$maxZoomLevel = Kohana::config('map.maxZoomLevel');
// pdestefanis - allows to limit the extents of the map
$lonFrom = Kohana::config('map.lonFrom');
$latFrom = Kohana::config('map.latFrom');
$lonTo = Kohana::config('map.lonTo');
$latTo = Kohana::config('map.latTo');
$this->themes->js = new View('main_js');
$this->themes->js->json_url = $clustering == 1 ? "json/cluster" : "json";
$this->themes->js->marker_radius = $marker_radius >= 1 && $marker_radius <= 10 ? $marker_radius : 5;
$this->themes->js->marker_opacity = $marker_opacity >= 1 && $marker_opacity <= 10 ? $marker_opacity * 0.1 : 0.9;
$this->themes->js->marker_stroke_width = $marker_stroke_width >= 1 && $marker_stroke_width <= 5 ? $marker_stroke_width : 2;
$this->themes->js->marker_stroke_opacity = $marker_stroke_opacity >= 1 && $marker_stroke_opacity <= 10 ? $marker_stroke_opacity * 0.1 : 0.9;
// pdestefanis - allows to restrict the number of zoomlevels available
$this->themes->js->numZoomLevels = $numZoomLevels;
$this->themes->js->minZoomLevel = $minZoomLevel;
$this->themes->js->maxZoomLevel = $maxZoomLevel;
// pdestefanis - allows to limit the extents of the map
$this->themes->js->lonFrom = $lonFrom;
$this->themes->js->latFrom = $latFrom;
$this->themes->js->lonTo = $lonTo;
$this->themes->js->latTo = $latTo;
$this->themes->js->default_map = Kohana::config('settings.default_map');
$this->themes->js->default_zoom = Kohana::config('settings.default_zoom');
$this->themes->js->latitude = Kohana::config('settings.default_lat');
$this->themes->js->longitude = Kohana::config('settings.default_lon');
$this->themes->js->default_map_all = Kohana::config('settings.default_map_all');
$this->themes->js->active_startDate = $display_startDate;
$this->themes->js->active_endDate = $display_endDate;
$this->themes->js->blocks_per_row = Kohana::config('settings.blocks_per_row');
//$myPacker = new javascriptpacker($js , 'Normal', false, false);
//$js = $myPacker->pack();
// Rebuild Header Block
$this->template->header->header_block = $this->themes->header_block();
}
示例3: index
//.........这里部分代码省略.........
$external_apps = ORM::factory('externalapp')->find_all();
$this->template->content->external_apps = $external_apps;
// Get The START, END and Incident Dates
$startDate = "";
$endDate = "";
$display_startDate = 0;
$display_endDate = 0;
$db = new Database();
// Next, Get the Range of Years
$query = $db->query('SELECT DATE_FORMAT(incident_date, \'%Y-%c\') AS dates ' . 'FROM ' . $this->table_prefix . 'incident ' . 'WHERE incident_active = 1 ' . 'GROUP BY DATE_FORMAT(incident_date, \'%Y-%c\') ' . 'ORDER BY incident_date');
$first_year = date('Y');
$last_year = date('Y');
$first_month = 1;
$last_month = 12;
$i = 0;
foreach ($query as $data) {
$date = explode('-', $data->dates);
$year = $date[0];
$month = $date[1];
// Set first year
if ($i == 0) {
$first_year = $year;
$first_month = $month;
}
// Set last dates
$last_year = $year;
$last_month = $month;
$i++;
}
$show_year = $first_year;
$selected_start_flag = TRUE;
while ($show_year <= $last_year) {
$startDate .= "<optgroup label=\"" . $show_year . "\">";
$s_m = 1;
if ($show_year == $first_year) {
// If we are showing the first year, the starting month may not be January
$s_m = $first_month;
}
$l_m = 12;
if ($show_year == $last_year) {
// If we are showing the last year, the ending month may not be December
$l_m = $last_month;
}
for ($i = $s_m; $i <= $l_m; $i++) {
if ($i < 10) {
// All months need to be two digits
$i = "0" . $i;
}
$startDate .= "<option value=\"" . strtotime($show_year . "-" . $i . "-01") . "\"";
if ($selected_start_flag == TRUE) {
$display_startDate = strtotime($show_year . "-" . $i . "-01");
$startDate .= " selected=\"selected\" ";
$selected_start_flag = FALSE;
}
$startDate .= ">" . date('M', mktime(0, 0, 0, $i, 1)) . " " . $show_year . "</option>";
}
$startDate .= "</optgroup>";
$endDate .= "<optgroup label=\"" . $show_year . "\">";
for ($i = $s_m; $i <= $l_m; $i++) {
if ($i < 10) {
// All months need to be two digits
$i = "0" . $i;
}
$endDate .= "<option value=\"" . strtotime($show_year . "-" . $i . "-" . date('t', mktime(0, 0, 0, $i, 1)) . " 23:59:59") . "\"";
if ($i == $l_m and $show_year == $last_year) {
$display_endDate = strtotime($show_year . "-" . $i . "-" . date('t', mktime(0, 0, 0, $i, 1)) . " 23:59:59");
$endDate .= " selected=\"selected\" ";
}
$endDate .= ">" . date('M', mktime(0, 0, 0, $i, 1)) . " " . $show_year . "</option>";
}
$endDate .= "</optgroup>";
// Show next year
$show_year++;
}
Event::run('ushahidi_filter.active_startDate', $display_startDate);
Event::run('ushahidi_filter.active_endDate', $display_endDate);
Event::run('ushahidi_filter.startDate', $startDate);
Event::run('ushahidi_filter.endDate', $endDate);
$this->template->content->div_timeline->startDate = $startDate;
$this->template->content->div_timeline->endDate = $endDate;
// Javascript Header
$this->themes->map_enabled = TRUE;
$this->themes->main_page = TRUE;
// Map Settings
$marker_radius = Kohana::config('map.marker_radius');
$marker_opacity = Kohana::config('map.marker_opacity');
$marker_stroke_width = Kohana::config('map.marker_stroke_width');
$marker_stroke_opacity = Kohana::config('map.marker_stroke_opacity');
$this->themes->js = new View('main/main_js');
$this->themes->js->marker_radius = ($marker_radius >= 1 and $marker_radius <= 10) ? $marker_radius : 5;
$this->themes->js->marker_opacity = ($marker_opacity >= 1 and $marker_opacity <= 10) ? $marker_opacity * 0.1 : 0.9;
$this->themes->js->marker_stroke_width = ($marker_stroke_width >= 1 and $marker_stroke_width <= 5) ? $marker_stroke_width : 2;
$this->themes->js->marker_stroke_opacity = ($marker_stroke_opacity >= 1 and $marker_stroke_opacity <= 10) ? $marker_stroke_opacity * 0.1 : 0.9;
$this->themes->js->active_startDate = $display_startDate;
$this->themes->js->active_endDate = $display_endDate;
$this->themes->js->blocks_per_row = Kohana::config('settings.blocks_per_row');
// Build Header and Footer Blocks
$this->template->header->header_block = $this->themes->header_block();
$this->template->footer->footer_block = $this->themes->footer_block();
}