public static function plugins_list($only_installed = false) { $plugins = array(); if ($only_installed == true) { $plugins = explode(",", OPTIONS::website('installed_plugins')); if (count($plugins) == 1 && $plugins[0] == '') { $plugins = array(); } } else { foreach (scandir(FOLDER_PLUGINS) as $f) { $temp_p = FOLDER_PLUGINS . $f; if ($f != '.' && $f != '..' && is_dir($temp_p)) { // check for elementary file if (!file_exists($temp_p . DS . "index.php")) { continue; } // include infos $p_info = drawline_getFileDoc($temp_p . DS . "index.php"); $p_info['folder'] = $f; $p_info['path'] = $temp_p . DS; $p_info['url'] = str_replace(array(FOLDER_BASE, DS), array(BASE_URL, "/"), $p_info['path']); // check if current $p_info['installed'] = DRAWLINE::plugin_installed($f); // add to list $plugins[] = $p_info; } } } // return plugins list return $plugins; }
TPL::message("We encounted some errors during the installition of " . $package . ". Please try again!"); } } } TPL::assign("plugins", DRAWLINE::plugins_list()); TPL::render('v_extender/extender_plugins'); break; /* * uninstall plugins */ /* * uninstall plugins */ case "plugin_uninstall": $package = $_GET['package']; if (DRAWLINE::plugin_installed($package)) { if (DRAWLINE::uninstall_plugin($package)) { TPL::message("The plugin " . $package . " was succesfully uninstalled!", "success"); } else { if (empty(TPL::get_messages('error'))) { TPL::message("We encounted some errors during the uninstallition of " . $package . ". Please try again!"); } } } else { TPL::message("This plugin is not installed. You can't uninstall an uninstalled plugin :)"); } TPL::assign("plugins", DRAWLINE::plugins_list()); TPL::render('v_extender/extender_plugins'); break; /* * drawline marketplace