aboutsummaryrefslogtreecommitdiffstats
path: root/mod/siteinfo.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/siteinfo.php')
-rw-r--r--mod/siteinfo.php72
1 files changed, 45 insertions, 27 deletions
diff --git a/mod/siteinfo.php b/mod/siteinfo.php
index 0cd569d20..bdf9b1af6 100644
--- a/mod/siteinfo.php
+++ b/mod/siteinfo.php
@@ -27,14 +27,20 @@ function siteinfo_init(&$a) {
$visible_plugins[] = $rr['name'];
}
+ if(@is_dir('.git') && function_exists('shell_exec'))
+ $commit = @shell_exec('git log -1 --format="%h"');
+ if(! isset($commit) || strlen($commit) > 16)
+ $commit = '';
+
$data = Array(
- 'version' => FRIENDICA_VERSION,
+ 'version' => RED_VERSION,
+ 'commit' => $commit,
'url' => z_root(),
'plugins' => $visible_plugins,
'register_policy' => $register_policy[$a->config['system']['register_policy']],
'admin' => $admin,
'site_name' => $a->config['sitename'],
- 'platform' => FRIENDICA_PLATFORM,
+ 'platform' => RED_PLATFORM,
'info' => ((x($a->config,'info')) ? $a->config['info'] : '')
);
@@ -47,27 +53,16 @@ function siteinfo_init(&$a) {
function siteinfo_content(&$a) {
- // FIXME Gak - this needs to be a template.
-
- $o = '';
- $o .= '<h3>' . t('Red') . '</h3>';
-
-
- $o .= '<p></p><p>';
-
- $o .= t('This is Red - another decentralized, distributed communications project by the folks at Friendica.');
- if(! get_config('system','hidden_version_siteinfo'))
- $o .= '</p><p>' . sprintf( t('Version %s'), FRIENDICA_VERSION ) . '</p><p>';
- $o .= '</p><p>';
- $o .= t('Running at web location') . ' ' . z_root() . '</p><p>';
-
- $o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica and/or Red project.') . '</p><p>';
-
- $o .= t('Bug reports and issues: please visit') . ' ' . '<a href="http://bugs.friendica.com">Bugs.Friendica.com</a></p><p>';
- $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '</p>';
-
- $o .= '<p></p>';
-
+ if(! get_config('system','hidden_version_siteinfo')) {
+ $version = sprintf( t('Version %s'), RED_VERSION );
+ if(@is_dir('.git') && function_exists('shell_exec'))
+ $commit = @shell_exec('git log -1 --format="%h"');
+ if(! isset($commit) || strlen($commit) > 16)
+ $commit = '';
+ }
+ else {
+ $version = $commit = '';
+ }
$visible_plugins = array();
if(is_array($a->plugins) && count($a->plugins)) {
$r = q("select * from addon where hidden = 0");
@@ -76,9 +71,9 @@ function siteinfo_content(&$a) {
$visible_plugins[] = $rr['name'];
}
-
+ $plugins_list = '';
if(count($visible_plugins)) {
- $o .= '<p>' . t('Installed plugins/addons/apps:') . '</p>';
+ $plugins_text = t('Installed plugins/addons/apps:');
$sorted = $visible_plugins;
$s = '';
sort($sorted);
@@ -88,10 +83,33 @@ function siteinfo_content(&$a) {
$s .= $p;
}
}
- $o .= '<div style="margin-left: 25px; margin-right: 25px;">' . $s . '</div>';
+ $plugins_list .= $s;
}
else
- $o .= '<p>' . t('No installed plugins/addons/apps') . '</p>';
+ $plugins_text = t('No installed plugins/addons/apps');
+
+ $admininfo = bbcode(get_config('system','admininfo'));
+
+ if(file_exists('doc/site_donate.html'))
+ $donate .= file_get_contents('doc/site_donate.html');
+
+ $o = replace_macros(get_markup_template('siteinfo.tpl'), array(
+ '$title' => t('Red'),
+ '$description' => t('This is a hub of the Red Matrix - a global cooperative network of decentralised privacy enhanced websites.'),
+ '$version' => $version,
+ '$commit' => $commit,
+ '$web_location' => t('Running at web location') . ' ' . z_root(),
+ '$visit' => t('Please visit <a href="http://getzot.com">GetZot.com</a> to learn more about the Red Matrix.'),
+ '$bug_text' => t('Bug reports and issues: please visit'),
+ '$bug_link_url' => 'https://github.com/friendica/red/issues',
+ '$bug_link_text' => 'redmatrix issues',
+ '$contact' => t('Suggestions, praise, etc. - please email "redmatrix" at librelist - dot com'),
+ '$donate' => $donate,
+ '$adminlabel' => t('Site Administrators'),
+ '$admininfo' => $admininfo,
+ '$plugins_text' => $plugins_text,
+ '$plugins_list' => $plugins_list
+ ));
call_hooks('about_hook', $o);