diff --git a/wbce/admin/admintools/index.php b/wbce/admin/admintools/index.php index 9f4d875c0..158edb25e 100644 --- a/wbce/admin/admintools/index.php +++ b/wbce/admin/admintools/index.php @@ -17,11 +17,10 @@ */ require('../../config.php'); -require_once(WB_PATH.'/framework/class.admin.php'); $admin = new admin('admintools', 'admintools'); // Include the WB functions file -require_once(WB_PATH.'/framework/functions.php'); + // Setup template object, parse vars to it, then parse it // Create new template object @@ -37,23 +36,29 @@ // Insert tools into tool list $template->set_block('main_block', 'tool_list_block', 'tool_list'); -$results = $database->query("SELECT * FROM {TP}addons WHERE type = 'module' AND function LIKE '%tool%' AND `function` NOT LIKE '%hidden%' ORDER BY name"); +$results = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND `function` LIKE '%tool%' AND `function` NOT LIKE '%hidden%' AND `directory` not in ('".(implode("','",$_SESSION['MODULE_PERMISSIONS']))."') order by name"); if($results->numRows() > 0) { - while($tool = $results->fetchRow()) { - $template->set_var('TOOL_NAME', $tool['name']); - $template->set_var('TOOL_DIR', $tool['directory']); - // check if a module description exists for the displayed backend language - $tool_description = false; - if(function_exists('file_get_contents') && file_exists(WB_PATH.'/modules/'.$tool['directory'].'/languages/'.LANGUAGE .'.php')) { - // read contents of the module language file into string - $data = @file_get_contents(WB_PATH .'/modules/' .$tool['directory'] .'/languages/' .LANGUAGE .'.php'); - $tool_description = get_variable_content('module_description', $data, true, false); - } - $template->set_var('TOOL_DESCRIPTION', ($tool_description === False)? $tool['description'] :$tool_description); - $template->parse('tool_list', 'tool_list_block', true); - } + while($tool = $results->fetchRow()) { + $template->set_var('TOOL_NAME', $tool['name']); + $template->set_var('TOOL_DIR', $tool['directory']); + // check if a module description exists for the displayed backend language + $tool_description = false; + if(function_exists('file_get_contents') && file_exists(WB_PATH.'/modules/'.$tool['directory'].'/languages/'.LANGUAGE .'.php')) { + // read contents of the module language file into string + $data = @file_get_contents(WB_PATH .'/modules/' .$tool['directory'] .'/languages/' .LANGUAGE .'.php'); + $tool_description = get_variable_content('module_description', $data, true, false); + } + $template->set_var('TOOL_DESCRIPTION', ($tool_description === False)? $tool['description'] :$tool_description); + $tool_default_icon= "fa fa-graduation-cap"; + $tool_icon =false; + $data = @file_get_contents(WB_PATH .'/modules/' .$tool['directory'] .'/info.php'); + $tool_icon = get_variable_content('module_icon', $data, true, false); + $template->set_var('TOOL_ICON', ($tool_icon === False)? $tool_default_icon :$tool_icon); + + $template->parse('tool_list', 'tool_list_block', true); + } } else { - $template->set_var('TOOL_LIST', $TEXT['NONE_FOUND']); + $template->set_var('TOOL_LIST', $TEXT['NONE_FOUND']); } // Parse template objects output diff --git a/wbce/modules/droplets/info.php b/wbce/modules/droplets/info.php index edb03da0a..5bb3565d1 100644 --- a/wbce/modules/droplets/info.php +++ b/wbce/modules/droplets/info.php @@ -19,6 +19,7 @@ $module_author = 'Ruud, pcwacht, WebBird, cwsoft, Norhei, Colinax'; $module_license = 'GNU General Public License'; $module_description = 'This tool allows you to manage your local Droplets.'; +$module_icon = 'fa fa-eyedropper'; $module_home = 'http://www.wbce.org'; $module_guid = '9F2AC2DF-C3E1-4E15-BA4C-2A86E37FE6E5';