From: nicolasconnault Date: Thu, 24 Jan 2008 08:40:36 +0000 (+0000) Subject: MDL-13101 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=51b57ef6a8abbfd24011bd4f82596226b274e465;p=moodle.git MDL-13101 1. Showing full path 2. Showing plugins to be installed 3. Lang strings properly used 4. Table headers --- diff --git a/lang/en_utf8/moodle.php b/lang/en_utf8/moodle.php index 8a20d7d169..57057d8b12 100644 --- a/lang/en_utf8/moodle.php +++ b/lang/en_utf8/moodle.php @@ -2,6 +2,7 @@ // moodle.php - created with Moodle 1.7 beta + (2006101003) +$string['abouttobeinstalled'] = 'about to be installed'; $string['action'] = 'Action'; $string['actions'] = 'Actions'; $string['active'] = 'Active'; @@ -385,6 +386,7 @@ $string['description'] = 'Description'; $string['deselectall'] = 'Deselect all'; $string['detailedless'] = 'Less detailed'; $string['detailedmore'] = 'More detailed'; +$string['directory'] = 'Directory'; $string['directorypaths'] = 'Directory Paths'; $string['disable'] = 'Disable'; $string['displayingfirst'] = 'Only the first $a->count $a->things are displayed'; diff --git a/lib/adminlib.php b/lib/adminlib.php index a88641aff4..d696bc153d 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -4558,7 +4558,7 @@ function db_replace($search, $replace) { */ function print_plugin_tables() { $compatlist = array(); - $compatlist['mods'] = array('assignment', + $compatlist['mod'] = array('assignment', 'chat', 'choice', 'data', @@ -4587,7 +4587,6 @@ function print_plugin_tables() { 'calendar_upcoming', 'course_list', 'course_summary', - 'db', 'glossary_random', 'html', 'loancalc', @@ -4610,7 +4609,7 @@ function print_plugin_tables() { 'tag_youtube', 'tags'); - $compatlist['filters'] = array('activitynames', + $compatlist['filter'] = array('activitynames', 'algebra', 'censor', 'emailprotect', @@ -4620,11 +4619,22 @@ function print_plugin_tables() { 'tex', 'tidy'); + $installed_list = array(); + $installed_mods = get_records_list('modules', '', '', '', 'name'); + $installed_blocks = get_records_list('block', '', '', '', 'name'); + + foreach($installed_mods as $mod) { + $installed_list['mod'][] = $mod->name; + } + + foreach($installed_blocks as $block) { + $installed_list['blocks'][] = $block->name; + } $plugins = array(); - $plugins['mods'] = get_list_of_plugins(); - $plugins['blocks'] = get_list_of_plugins('blocks'); - $plugins['filters'] = get_list_of_plugins('filter'); + $plugins['mod'] = get_list_of_plugins('mod', 'db'); + $plugins['blocks'] = get_list_of_plugins('blocks', 'db'); + $plugins['filter'] = get_list_of_plugins('filter', 'db'); $strstandard = get_string('standard'); $strnonstandard = get_string('nonstandard'); @@ -4632,9 +4642,21 @@ function print_plugin_tables() { $html = ''; foreach ($plugins as $cat => $list) { + $strcaption = get_string($cat); + if ($cat == 'mod') { + $strcaption = get_string('activitymodule'); + } elseif ($cat == 'filter') { + $strcaption = get_string('managefilters'); + } + $html .= '' . "\n"; - $row = 0; + . 'id="' . $cat . 'compattable" summary="compatibility table">' . "\n"; + $html .= '\n" + . '\n" + . '\n"; + + $row = 1; + foreach ($list as $k => $plugin) { $standard = 'standard'; @@ -4642,7 +4664,41 @@ function print_plugin_tables() { $standard = 'nonstandard'; } - $html .= "\n"; + // Get real name and full path of plugin + $plugin_name = "[[$plugin]]"; + + global $CFG; + $plugin_path = $CFG->dirroot . "/$cat/$plugin"; + + if ($cat == 'mod') { + $plugin_name = get_string('modulename', $plugin); + } elseif ($cat == 'blocks') { + $plugin_name = get_string('blockname', "block_$plugin"); + if (empty($plugin_name) || $plugin_name == '[[blockname]]') { + if (($block = block_instance($plugin)) !== false) { + $plugin_name = $block->get_title(); + } else { + $plugin_name = "[[$plugin]]"; + } + } + } elseif ($cat == 'filter') { + $plugin_name = trim(get_string('filtername', $plugin)); + if (empty($plugin_name) or ($plugin_name == '[[filtername]]')) { + $textlib = textlib_get_instance(); + $plugin_name = $textlib->strtotitle($plugin); + } + } + + // Determine if the plugin is about to be installed + $strabouttobeinstalled = ''; + if ($cat != 'filter' && !in_array($plugin, $installed_list[$cat])) { + $strabouttobeinstalled = ' (' . get_string('abouttobeinstalled') . ')'; + } + + $html .= "\n" + . "\n" + . "\n" + . "\n\n"; $row++; } $html .= '
' . ucfirst($cat) . '' . $strcaption . '
' . get_string('directory') . "' . get_string('name') . "' . get_string('status') . "
" . ucfirst($plugin) . "" . ${'str' . $standard} . "
$plugin_path$plugin_name" . ${'str' . $standard} . $strabouttobeinstalled . "

';