function module_table() { $this->installed = $this->connection->db_assoc("SELECT * FROM `RheinaufCMS>Module` WHERE `SYSTEM` = 0 ORDER BY `id` ASC"); $this->available_modules = RheinaufFile::dir_array(INSTALL_PATH . '/Module', false, 'php'); foreach ($this->available_modules as $module) { $class_name = preg_replace('/\\.php/', '', $module); if ($module != 'Navi.php') { if (RheinaufFile::is_file(INSTALL_PATH . '/Module/' . $class_name . '/Install.php')) { include_once INSTALL_PATH . '/Module/' . $class_name . '/Install.php'; $class_name .= 'Install'; } else { include_once $module; } } if (is_callable(array($class_name, 'about'))) { eval('$module_about = ' . $class_name . '::about();'); switch ($module_about['type']) { case 'inPage': $this->inPageModules[] = $module_about; break; case 'installable': $this->installableModules[] = $module_about; break; } } } $return_string = ''; $this->return .= Html::h(3, 'Installierbare Module'); $table = new Table(2); $table->add_th(array('Installierbare Module', 'Installierte Module')); $form = new Form(); $form->form_tag(SELF_URL); $installed_modules = array(); foreach ($this->installed as $installed) { $installed_modules[] = $installed['Name']; } $installables_select = new Select('installable', array('size' => '10', 'style' => 'width:150px')); foreach ($this->installableModules as $modul) { if (!in_array($modul['Name'], $installed_modules)) { $installables_select->add_option(rawurlencode($modul['Name']), $modul['Name']); } } $installed_select = new Select('installed', array('size' => '10', 'style' => 'width:150px')); foreach ($installed_modules as $modul) { $installed_select->add_option(rawurlencode($modul), $modul); } $table->add_td(array($installables_select->flush_select(), $installed_select->flush_select())); $install_submit = Form::add_input('submit', 'install', 'Installieren'); $uninstall_submit = Form::add_input('submit', 'uninstall', 'Deinstallieren'); $table->add_td(array($install_submit, $uninstall_submit), array('style' => 'text-align:center')); $form->add_custom($table->flush_table()); $this->return .= $form->flush_form(); $this->return .= Html::h(3, 'Aufruf über Template'); $table = new Table(2, array('style' => 'width:500px')); $table->add_th(array('Modul', 'Einbindung')); foreach ($this->inPageModules as $module) { $table->add_td(array(Html::bold($module['Name']), $module['Usage'])); } $this->return .= $table->flush_table(); }