diff options
author | Simon Rettberg | 2015-09-28 16:08:37 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-09-28 16:08:37 +0200 |
commit | 8fc0fb48b4b1c7faa1728c59fcde269d9ab744f6 (patch) | |
tree | 3ea1985c7ca4484a36c0bdc452f2eec7706440e1 /modules/sysconfig/addconfig.inc.php | |
parent | Use systemctl to start/stop services (diff) | |
download | slx-admin-8fc0fb48b4b1c7faa1728c59fcde269d9ab744f6.tar.gz slx-admin-8fc0fb48b4b1c7faa1728c59fcde269d9ab744f6.tar.xz slx-admin-8fc0fb48b4b1c7faa1728c59fcde269d9ab744f6.zip |
Improved several translations, added help texts, fixed module grouping, layout
Diffstat (limited to 'modules/sysconfig/addconfig.inc.php')
-rw-r--r-- | modules/sysconfig/addconfig.inc.php | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/modules/sysconfig/addconfig.inc.php b/modules/sysconfig/addconfig.inc.php index 023ec000..e51a7f64 100644 --- a/modules/sysconfig/addconfig.inc.php +++ b/modules/sysconfig/addconfig.inc.php @@ -124,34 +124,55 @@ class AddConfig_Start extends AddConfig_Base $mods = ConfigModule::getList(); $res = Database::simpleQuery("SELECT moduleid, title, moduletype, filepath FROM configtgz_module" . " ORDER BY title ASC"); // Move to ConfigModule - if ($this->edit === false) + if ($this->edit === false) { $active = array(); - else + } else { $active = $this->edit->getModuleIds(); + } + $id = 0; + $modGroups = array(); + foreach ($mods as &$mod) { + $mod['groupid'] = 'g' . ++$id; + $modGroups[$mod['group']] =& $mod; + } + unset($mod); while ($row = $res->fetch(PDO::FETCH_ASSOC)) { if (!isset($mods[$row['moduletype']])) { $mods[$row['moduletype']] = array( 'unique' => false, - 'group' => 'Undefined moduletype in addconfig.inc.php' + 'group' => 'Undefined moduletype in addconfig.inc.php', + 'groupid' => 'g' . ++$id, ); + $modGroups[$mods[$row['moduletype']]['group']] =& $mods[$row['moduletype']]; } - if (!isset($mods[$row['moduletype']]['modules'])) { - $mods[$row['moduletype']]['modules'] = array(); - $mods[$row['moduletype']]['groupid'] = $row['moduletype']; + unset($group); + $group =& $modGroups[$mods[$row['moduletype']]['group']]; + if (!isset($group['modules'])) { + $group['modules'] = array(); } if (empty($row['filepath']) || !file_exists($row['filepath'])) $row['missing'] = true; $row['active'] = in_array($row['moduleid'], $active); - $mods[$row['moduletype']]['modules'][] = $row; + $group['modules'][] = $row; } - if ($this->edit !== false) + if ($this->edit !== false) { $title = $this->edit->title(); - elseif (Request::any('title')) + } elseif (Request::any('title')) { $title = Request::any('title'); - else + } else { $title = ''; + } + foreach ($modGroups as &$mod) { + if (!empty($mod['modules']) && $mod['unique']) { + array_unshift($mod['modules'], array( + 'moduleid' => 0, + 'title' => Dictionary::translate('lang_noModuleFromThisGroup'), + )); + } + } + unset($mod); Render::addDialog(Dictionary::translate("lang_configurationCompilation"), false, 'sysconfig/cfg-start', array( 'step' => 'AddConfig_Finish', - 'groups' => array_values($mods), + 'groups' => array_values($modGroups), 'title' => $title, 'edit' => ($this->edit !== false ? $this->edit->id() : false) )); |