From 0a0cd85fef075f9dad5db14067d14b64b9728f74 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 8 Jun 2013 01:21:44 -0400 Subject: [PATCH] Convert the admin homepage to use hoplite templates. --- admin/home.php | 50 ++++++++------------------------- admin/templates/admin_index.tpl | 36 +++++++++++++++++++++++- 2 files changed, 46 insertions(+), 40 deletions(-) diff --git a/admin/home.php b/admin/home.php index a36898c..3c4f877 100644 --- a/admin/home.php +++ b/admin/home.php @@ -35,11 +35,22 @@ class HomeAction extends http\Action implements TemplatePreCaching public function Invoke(http\Request $request, http\Response $response) { + // TODO(port): Migrate. + global $funct; + $response->data['title'] = T('Home'); $response->data['new_version_number'] = $this->_DoVersionCheck(); $response->data['current_version'] = Bugdar::$options['trackerversion']; + $response->data['php_version'] = phpversion(); + $response->data['mysql_version'] = Bugdar::$db->Query("SELECT VERSION() AS version")->FetchObject()->version; + $response->data['web_server'] = $_SERVER['SERVER_SOFTWARE']; + + $response->data['mysql_max_packet'] = Bugdar::$db->Query("SHOW VARIABLES LIKE 'max_allowed_packet'")->FetchObject()->Value; + $response->data['max_upload_size'] = $funct->fetch_max_attachment_size(); + $response->data['mysql_ft_min_length'] = Bugdar::$db->Query("SHOW VARIABLES LIKE 'ft_min_word_len'")->FetchObject()->Value; + $response->context['template'] = 'admin_index'; } @@ -64,42 +75,3 @@ class HomeAction extends http\Action implements TemplatePreCaching } } } - -/* - -$admin->table_start(); -$admin->table_head(T('Welcome to the Bugdar Admin Panel')); - -// ------------------------------------------------------------------- -$admin->row_span(T('Version Information'), 'thead'); -$admin->row_text(T('Bugdar Version'), $bugsys->options['trackerversion']); -$admin->row_text(T('PHP Version'), phpversion()); - -$mysql = $db->query_first("SELECT VERSION() AS version"); -$admin->row_text(T('MySQL Version'), $mysql['version']); - -$admin->row_text(T('Web Server'), ($_SERVER['SERVER_SOFTWARE'] ? $_SERVER['SERVER_SOFTWARE'] : $SERVER['SERVER_SOFTWARE'])); - -// ------------------------------------------------------------------- -$admin->row_span(T('Server Options'), 'thead'); - -$mysql = $db->query_first("SHOW VARIABLES LIKE 'max_allowed_packet'"); -$admin->row_text(T('MySQL: Maximum Packet Size'), $mysql['Value']); - -$admin->row_text(T('MySQL: Maximum Upload Size'), $funct->fetch_max_attachment_size()); - -$mysql = $db->query_first("SHOW VARIABLES LIKE 'ft_min_word_len'"); -$admin->row_text(T('MySQL: Full-Text Search Minimum Word Length'), $mysql['Value']); - -$admin->row_text(T('PHP: Safe Mode'), ((ini_get('safe_mode') == 1 OR strtolower(ini_get('safe_mode')) == 'on') ? T('Yes') : T('No'))); -$admin->row_text(T('PHP: Register Globals'), ((ini_get('register_globals') == 1 OR strtolower(ini_get('register_globals')) == 'on') ? T('Yes') : T('No'))); -$admin->row_text(T('PHP: Magic Quotes GPC'), ((ini_get('magic_quotes_gpc') == 1 OR strtolower(ini_get('magic_quotes_gpc')) == 'on') ? T('Yes') : T('No'))); -$admin->row_text(T('PHP: Magic Quotes Sybase'), ((ini_get('magic_quotes_sybase') == 1 OR strtolower(ini_get('magic_quotes_sybase')) == 'on') ? T('Yes') : T('No'))); - -// ------------------------------------------------------------------- - -$admin->table_end(); - -$admin->page_end(); - -*/ \ No newline at end of file diff --git a/admin/templates/admin_index.tpl b/admin/templates/admin_index.tpl index 0df6200..061cfa2 100644 --- a/admin/templates/admin_index.tpl +++ b/admin/templates/admin_index.tpl @@ -1,6 +1,6 @@ {%#import 'admin_header'%} -Hello World via Templates +

{%=T('Welcome to the Bugdar Admin Panel')%}

{% if ($new_version_number): %}
@@ -14,4 +14,38 @@ Hello World via Templates
{% endif %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{%=T('Version Information')%}
{%=T('Bugdar Version')%}{%= $current_version %}
{%=T('PHP Version')%}{%= $php_version %}
{%=T('MySQL Version')%}{%= $mysql_version %}
{%=T('Web Server')%}{%= $web_server %}
{%=T('Server Options')%}
{%=T('MySQL: Maximum Packet Size')%}{%= $mysql_max_packet %}
{%=T('MySQL: Maximum Upload Size')%}{%= $max_upload_size %}
{%=T('MySQL: Full-Text Search Minimum Word Length')%}{%= $mysql_ft_min_length %}
+ {%#import 'admin_footer'%} \ No newline at end of file -- 2.43.5