From 34c13a8becdffba82bcdc3b07acf84b5ce760df8 Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Thu, 14 Dec 2017 14:51:59 -0800 Subject: [PATCH] Move git update feature to separate tab --- inc/functions.php | 4 ++++ inc/html.php | 16 ++-------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 3cf2366..403037f 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -561,3 +561,7 @@ function getEmbed($url) { return array('', array()); } + +function installedViaGit() { + return is_dir('.git'); +} diff --git a/inc/html.php b/inc/html.php index befa1db..25bd102 100644 --- a/inc/html.php +++ b/inc/html.php @@ -508,7 +508,8 @@ function adminBar() { if (!$loggedin) { return $return; } - return '[Status] [' . (($isadmin) ? 'Bans] [' : '') . 'Moderate Post] [Raw Post] [' . (($isadmin) ? 'Rebuild All] [' : '') . (($isadmin && TINYIB_DBMIGRATE) ? 'Migrate Database] [' : '') . 'Log Out] · ' . $return; + + return '[Status] [' . (($isadmin) ? 'Bans] [' : '') . 'Moderate Post] [Raw Post] [' . (($isadmin) ? 'Rebuild All] [' : '') . (($isadmin && installedViaGit()) ? 'Update] [' : '') . (($isadmin && TINYIB_DBMIGRATE) ? 'Migrate Database] [' : '') . 'Log Out] · ' . $return; } function managePage($text, $onload = '') { @@ -832,19 +833,6 @@ EOF; $info -EOF; - if ($isadmin) { - $output .= << -
- - - -
- -EOF; - } - $output .= <<