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();
 }
 function search_form($legend = 'Filter')
 {
     $inputs = '';
     foreach ($this->enable_search_for as $search_field) {
         $name = $this->cols_array[$search_field]['name'];
         $id = Html::html_legal_id($search_field);
         $input_name = rawurlencode($search_field);
         if ($this->cols_array[$search_field]['options']) {
             $options = $this->get_options($search_field, true);
             $select = new Select($encoded_name);
             $select->add_option('', $this->cols_array[$search_field]['name']);
             $attr_array = array();
             if (is_array($options)) {
                 foreach ($options as $option => $name) {
                     if (isset($_GET['option'])) {
                         $attr_array['selected'] = 'selected';
                     } else {
                         unset($attr_array['selected']);
                     }
                     $select->add_option($option, $name, $attr_array);
                 }
             }
             $inputs .= $select->flush_select();
         } else {
             $input = Form::add_input('text', $input_name, "{If:" . $search_field . "_search_value}", array('id' => $id, 'onkeyup' => 'getSuggestions(event,this)'));
             $inputs .= Form::add_label($id, $name . ' ' . $input, array('class' => 'nowrap'));
         }
     }
     $inputs .= "{If:filter_get_vars}\n";
     $inputs .= Form::add_input('submit', 'Filter');
     $inputs .= Form::add_input('submit', '', 'Zurücksetzen', array('onclick' => "resetFilter(this);return false;"));
     $form = new Form();
     $form->form_tag('{SELF_URL}', 'get', '', array('onsubmit' => 'httpRequestSubmit(this);return false;', 'autocomplete' => 'off'));
     $form->fieldset($inputs, $legend);
     return $form->flush_form();
 }
    function editor()
    {
        $rubrik = $this->I18n_get_real($this->navi[$_GET['edit']]['Rubrik']);
        $rubrik = $this->path_encode($rubrik);
        $seite = $this->I18n_get_real($this->navi[$_GET['edit']]['Subnavi'][$_GET['edit_page']]['Seite']);
        $seite = $this->path_encode($seite);
        $folder = INSTALL_PATH . "/Content/{$rubrik}/{$seite}";
        $wokingversion = isset($_GET['workingversion']) ? true : false;
        if ($wokingversion && RheinaufFile::is_file($folder . "/Arbeitsversion/content.html")) {
            $contents = RheinaufFile::get_file($folder . "/Arbeitsversion/content.html");
        } else {
            $contents = RheinaufFile::get_file($folder . "/content.html");
        }
        $_SESSION['rubrik'] = $this->path_encode($rubrik);
        $_SESSION['seite'] = $this->path_encode($seite);
        $_SESSION['docroot'] = DOCUMENT_ROOT;
        $editor_page = new Html();
        //$editor_page->body_attributes=array('onunload'=>'catchClose(xinha_editors.editor)');
        $title = 'Editor für ' . PROJECT_NAME . ' -> ' . $rubrik . ' -> ' . $seite;
        $title .= $wokingversion ? ' (Arbeitsversion)' : ' (Liveversion)';
        $editor_page->title = $title;
        $editor_page->script(' _editor_url  = "/' . INSTALL_PATH . '/Libraries/Xinha/";_editor_lang = "de";_document_root = "' . DOCUMENT_ROOT . '"');
        $editor_page->script('', array('src' => '/' . INSTALL_PATH . '/Libraries/Xinha/XinhaLoader.js'));
        $editor_page->script('', array('src' => '/' . INSTALL_PATH . '/Libraries/XinhaConfig/editor.php'));
        $editor_page->script("var project_name = '" . addslashes(PROJECT_NAME) . "';");
        $styles = 'BODY 	{
						margin: 0;
						background-color:Menu;
						font-size:12px;
						padding:0;
						font-family: sans-serif;
					}

					#editor {
						width:100%;
						height:500px;
					}

					/*---DropDowns*/

					ul { /* all lists */
						padding: 0;
						margin: 0;
						list-style: none;
						position:absolute;
						top:2px;
						left:0px;
						z-index:999;
						cursor:default;


					}
					ul a {
						cursor:default;
						color:black;
						text-decoration:none;
						display:block;
					}

					li { /* all list items */
						float: left;
						position: relative;
						width: 10em;
						border:1px solid;
						border-color:Menu;
						padding-left:2px;
					}

					li:hover,li.over {
						border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
					}
					li ul { /* second-level lists */
						display: none;
						position: absolute;
						top: 15px;
						left: 0;
						-moz-opacity:1;
						filter:alpha(opacity = 100);
						padding-bottom:5px;
					}

					li>ul { /* to override top and left in browsers other than IE, which will position to the top right of the containing li, rather than bottom left */
						top: auto;
						left: auto;
					}

					li:hover ul, li.over ul { /* lists nested under hovered list items */
						display: block;
						background-color: Menu;
						border:1px solid;
						border-color:Menu ButtonShadow ButtonShadow ButtonHighlight;
					}
					li:hover ul a:hover, li.over ul a:hover {
						color:white;
						background-color:darkblue;

					}

					#content {
						clear: left;
						padding:20px 0 0 0 ;
					}

					';
        $editor_page->style($styles);
        $editor_page->div($this->menu());
        $form = new Form();
        if ($wokingversion) {
            $get_working_version = 'workingversion&';
        } else {
            $get_working_version = '';
        }
        $form->form_tag(SELF_URL . '?' . $get_working_version . 'edit=' . $_GET['edit'] . '&edit_page=' . $_GET['edit_page'], 'post', 'application/x-www-urlencoded', array('id' => 'editor_form'));
        $form->add_input('hidden', 'rubrik', $rubrik);
        $form->add_input('hidden', 'seite', $seite);
        $form->add_input('hidden', 'tmp_file', RheinaufFile::is_file($this->work_folder() . 'tmp.html') ? 'true' : 'false', array('id' => 'tmp_file'));
        $form->add_textarea('editor_text', $contents, array('id' => 'editor'));
        $form->close_form();
        $editor_page->div($form->flush_form(), array('id' => 'content'));
        return $editor_page->flush_page();
    }
 function search_form($legend = 'Filter')
 {
     $inputs = '';
     foreach ($this->enable_search_for as $search_field) {
         $name = $this->cols_array[$search_field]['name'];
         $id = Html::html_legal_id($search_field);
         $input_name = rawurlencode($search_field);
         $input = Form::add_input('text', $input_name, "{If:" . $search_field . "_search_value}", array('id' => $id, 'onkeyup' => 'getSuggestions(event,this)'));
         $inputs .= Form::add_label($id, $name . ' ' . $input, array('class' => 'nowrap'));
     }
     $inputs .= "{If:filter_get_vars}\n";
     $inputs .= Form::add_input('submit', 'Filter');
     $inputs .= Form::add_input('submit', '', 'Zurücksetzen', array('onclick' => "resetFilter(this);return false;"));
     $form = new Form();
     $form->form_tag('{SELF_URL}', 'get', '', array('onsubmit' => 'httpRequestSubmit(this);return false;', 'autocomplete' => 'off'));
     $form->fieldset($inputs, $legend);
     return $form->flush_form();
 }