From d09a5674e915e79762931a3465461327fb5737ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= <nicolas.loeuillet@gmail.com>
Date: Thu, 20 Feb 2014 08:58:59 +0100
Subject: [add] message in install screen to prevent user when wallabag is
 already installed

---
 install/index.php | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

(limited to 'install')

diff --git a/install/index.php b/install/index.php
index 4d7e8cd2..975b997f 100644
--- a/install/index.php
+++ b/install/index.php
@@ -172,7 +172,7 @@ else if ($_POST['install']) {
                 <li><a href="http://www.wallabag.org/">wallabag.org</a></li>
             </ul> 
             <?php if (!empty($errors)) : ?>
-                <div class='install messages error'>
+                <div class='messages error install'>
                     <p>Errors during installation:</p>
                     <p>
                         <ul>
@@ -185,7 +185,7 @@ else if ($_POST['install']) {
                 </div>
             <?php endif; ?>
             <?php if (!empty($successes)) : ?>
-                <div class='install messages success'>
+                <div class='messages success install'>
                     <p>
                         <ul>
                         <?php foreach($successes as $success) :?>
@@ -194,6 +194,14 @@ else if ($_POST['install']) {
                         </ul>
                     </p>
                 </div>
+            <?php else : ?>
+                <?php if (file_exists('inc/poche/config.inc.php') && is_dir('vendor')) : ?>
+                <div class='messages success install'>
+                    <p>
+                        wallabag seems already installed. If you want to update it, you only have to delete install folder.
+                    </p>
+                </div>
+                <?php endif; ?>    
             <?php endif; ?>
             <p>To install wallabag, you just have to fill the following fields. That's all.</p>
             <p>Don't forget to check your server compatibility <a href="wallabag_compatibility_test.php">here</a>.</p>
@@ -201,7 +209,7 @@ else if ($_POST['install']) {
                 <fieldset>
                     <legend><strong>Technical settings</strong></legend>
                     <?php if (!is_dir('vendor')) : ?>
-                        <div class='install messages notice'>wallabag needs twig, a template engine (<a href="http://twig.sensiolabs.org/">?</a>). Two ways to install it: 
+                        <div class='messages notice install'>wallabag needs twig, a template engine (<a href="http://twig.sensiolabs.org/">?</a>). Two ways to install it: 
                         <ul>
                             <li>automatically download and extract vendor.zip into your wallabag folder. 
                             <p><input type="submit" name="download" value="Download vendor.zip" /></p>
-- 
cgit v1.2.3