From 6199e1d5b8779efdfc8aac8863e113784a32cdb7 Mon Sep 17 00:00:00 2001 From: Michael Johnston Date: Wed, 20 Feb 2013 21:56:59 -0500 Subject: add siteinfo.tpl --- doc/Home.md | 2 +- mod/siteinfo.php | 44 +++++++++++++++++++++---------------------- view/tpl/siteinfo.tpl | 14 ++++++++++++++ view/tpl/smarty3/siteinfo.tpl | 19 +++++++++++++++++++ 4 files changed, 55 insertions(+), 24 deletions(-) create mode 100644 view/tpl/siteinfo.tpl create mode 100644 view/tpl/smarty3/siteinfo.tpl diff --git a/doc/Home.md b/doc/Home.md index 30efc93f7..561362f1e 100644 --- a/doc/Home.md +++ b/doc/Home.md @@ -33,5 +33,5 @@ Friendica Documentation and Resources **About** -* [Site/Version Info](friendica) +* [Site/Version Info](siteinfo) diff --git a/mod/siteinfo.php b/mod/siteinfo.php index 0cd569d20..7ea81fec1 100644 --- a/mod/siteinfo.php +++ b/mod/siteinfo.php @@ -47,26 +47,10 @@ function siteinfo_init(&$a) { function siteinfo_content(&$a) { - // FIXME Gak - this needs to be a template. - - $o = ''; - $o .= '

' . t('Red') . '

'; - - - $o .= '

'; - - $o .= t('This is Red - another decentralized, distributed communications project by the folks at Friendica.'); if(! get_config('system','hidden_version_siteinfo')) - $o .= '

' . sprintf( t('Version %s'), FRIENDICA_VERSION ) . '

'; - $o .= '

'; - $o .= t('Running at web location') . ' ' . z_root() . '

'; - - $o .= t('Please visit Friendica.com to learn more about the Friendica and/or Red project.') . '

'; - - $o .= t('Bug reports and issues: please visit') . ' ' . 'Bugs.Friendica.com

'; - $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '

'; - - $o .= '

'; + $version = sprintf( t('Version %s'), FRIENDICA_VERSION ); + else + $version = ""; $visible_plugins = array(); if(is_array($a->plugins) && count($a->plugins)) { @@ -76,9 +60,9 @@ function siteinfo_content(&$a) { $visible_plugins[] = $rr['name']; } - + $plugins_list = ''; if(count($visible_plugins)) { - $o .= '

' . t('Installed plugins/addons/apps:') . '

'; + $plugins_text = t('Installed plugins/addons/apps:'); $sorted = $visible_plugins; $s = ''; sort($sorted); @@ -88,10 +72,24 @@ function siteinfo_content(&$a) { $s .= $p; } } - $o .= '
' . $s . '
'; + $plugins_list .= $s; } else - $o .= '

' . t('No installed plugins/addons/apps') . '

'; + $plugins_text = t('No installed plugins/addons/apps'); + + $o = replace_macros(get_markup_template('siteinfo.tpl'), array( + '$title' => t('Red'), + '$description' => t('This is Red - another decentralized, distributed communications project by the folks at Friendica.'), + '$version' => $version, + '$web_location' => t('Running at web location') . ' ' . z_root(), + '$visit' => t('Please visit Friendica.com to learn more about the Friendica and/or Red project.'), + '$bug_text' => t('Bug reports and issues: please visit'), + '$bug_link_url' => 'http://bugs.friendica.com', + '$bug_link_text' => 'Bugs.Friendica.com', + '$contact' => t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com'), + '$plugins_text' => $plugins_text, + '$plugins_list' => $plugins_list + )); call_hooks('about_hook', $o); diff --git a/view/tpl/siteinfo.tpl b/view/tpl/siteinfo.tpl new file mode 100644 index 000000000..4931cc3a7 --- /dev/null +++ b/view/tpl/siteinfo.tpl @@ -0,0 +1,14 @@ +

$title

+

+

$description

+{{ if $version }} +

$version

+{{ endif }} +

$web_location

+

$visit

+

$bug_text $bug_link_text

+

$contact

+

$plugins_text

+{{ if $plugins_list }} +
$plugins_list
+{{ endif }} diff --git a/view/tpl/smarty3/siteinfo.tpl b/view/tpl/smarty3/siteinfo.tpl new file mode 100644 index 000000000..3720c9629 --- /dev/null +++ b/view/tpl/smarty3/siteinfo.tpl @@ -0,0 +1,19 @@ +{{* + * AUTOMATICALLY GENERATED TEMPLATE + * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN + * + *}} +

{{$title}}

+

+

{{$description}}

+{{if $version}} +

{{$version}}

+{{/if}} +

{{$web_location}}

+

{{$visit}}

+

{{$bug_text}} {{$bug_link_text}}

+

{{$contact}}

+

{{$plugins_text}}

+{{if $plugins_list}} +
{{$plugins_list}}
+{{/if}} -- cgit v1.2.3