]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - Classes/class-plugin-git.php
More towards notes (still not finished)
[irc/unrealircd/unrealircd-webpanel.git] / Classes / class-plugin-git.php
index 8b128be5fe0d585c5679791bbd79d931188ac5c6..9bc5a77c43964246f4d37fffa33fd449276f0ea5 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-       define('DEFAULT_PLUGINS_DIR', 'https://api.dalek.services/plugins.list');
+       define('DEFAULT_PLUGINS_DIR', 'https://api.valware.uk/plugins.list');
        
 class PluginRepo
 {
@@ -67,7 +67,7 @@ class PluginRepo
 <?php   }
         else
         {   ?>
-            <div style="margin-left:40px;" class="badge rounded-pill badge-danger">Inompatible</div>
+            <div style="margin-left:40px;" class="badge rounded-pill badge-danger">Incompatible</div>
 <?php   }
     }
 
@@ -79,15 +79,16 @@ class PluginRepo
         if ($this->err)
             die("Could not fetch list.\n");
 
-        global $config;
             ?>
                <div class="row">
-            <?php     
-        $counter = 0;
-
-
+            <?php
         foreach($this->data->list as $p)
         {
+            $tok = split(WEBPANEL_VERSION,"-");
+            $upgradeRequired = false;
+            $wpversion = $tok[0];
+            if ($p->minver > $wpversion)
+                $upgradeRequired = true;
             $installed = in_array($p->name, $config['plugins']) ? true : false;
             if (is_string($p))
                 continue;
@@ -121,23 +122,17 @@ class PluginRepo
                     <div id="justALonelyEmptyDivCryEmoji"></div>
                     <div>
                         <div id="<?php echo $p->name ?>" class="more-info btn btn-info">More Info</div>
-                        <div id="<?php echo $p->name ?>install" class="btn-install-plugin btn btn-primary">Install</div>
+                        <?php if ($upgradeRequired){
+                            ?>
+                                <div id="<?php echo $p->name ?>coming-soon" class="btn-coming-soon btn btn-dark disabled">Panel Upgrade Required</div>
+                            <?php
+                        }
+                        ?>
+                        <div id="<?php echo $p->name ?>install" <?php if ($upgradeRequired) echo 'style="display:none" '; ?> class="btn-install-plugin btn btn-primary">Install</div>
                     </div>
                 </div>
             </div>
             <?php
-                /** only do three per row.
-                 *  WARNING: untested due to not having more than 2 plugins atm...
-                */
-                if ($counter >= 3)
-                {
-                    ?><!-- New row please mr html -->
-                        </div>
-                        <div class="row"> 
-                    <?php
-                    $counter = 0;
-                }
-                $counter++;
 
 
             }