Browse Source

Remove unused function

jmontoyaa 8 years ago
parent
commit
123d3dc396
3 changed files with 1 additions and 24 deletions
  1. 0 15
      main/inc/lib/api.lib.php
  2. 1 2
      main/inc/lib/plugin.lib.php
  3. 0 7
      tests/main/inc/lib/main_api.lib.test.php

+ 0 - 15
main/inc/lib/api.lib.php

@@ -4535,21 +4535,6 @@ function api_number_of_plugins($location) {
     return isset($_plugins[$location]) && is_array($_plugins[$location]) ? count($_plugins[$location]) : 0;
 }
 
-/**
- * Checks to see wether a certain plugin is installed.
- * @return boolean true if the plugin is installed, false otherwise.
- */
-function api_is_plugin_installed($plugin_list, $plugin_name) {
-    if (is_array($plugin_list)) {
-        foreach ($plugin_list as $plugin_location) {
-            if (array_search($plugin_name, $plugin_location) !== false) {
-                return true;
-            }
-        }
-    }
-    return false;
-}
-
 /**
  * Transforms a number of seconds in hh:mm:ss format
  * @author Julian Prud'homme

+ 1 - 2
main/inc/lib/plugin.lib.php

@@ -372,8 +372,7 @@ class AppPlugin
                         $_template['plugin_info'] = $plugin_info;
                     }
 
-                    // Setting the plugin info available in the template if exists
-
+                    // Setting the plugin info available in the template if exists.
                     $template->assign($plugin_name, $_template);
 
                     // Loading the Twig template plugin files if exists

+ 0 - 7
tests/main/inc/lib/main_api.lib.test.php

@@ -491,13 +491,6 @@ class TestMainApi extends UnitTestCase {
 		$this->assertTrue($_plugins[$location]);
 	}
 
-	function testApiIsPluginInstalled(){
-		$plugin_name = false;
-		$plugin_list = true;
-		$res = api_is_plugin_installed($plugin_list, $plugin_name);
-		$this->assertTrue(is_bool($res));
-	}
-
 	function testApiTimeToHms(){
 		$seconds = -1;
 		ob_start();