function edit() { $GLOBALS['scripts'] .= Html::script('', array('src' => '/' . INSTALL_PATH . '/Libraries/ContextMenu/ContextMenu.js')); $GLOBALS['scripts'] .= Html::script(' var head = document.getElementsByTagName("head")[0]; var style = document.createElement("link"); style.rel = "stylesheet"; style.type="text/css"; style.href = "/' . INSTALL_PATH . '/Libraries/ContextMenu/ContextMenu.css"; head.appendChild(style); function ctx_new_entry (date) { window.location.href="' . SELF . '?new="+date; } function ctx_edit(id) { window.location.href="' . SELF . '?edit="+id; } '); //$GLOBALS['other_css'] .= Html::stylesheet('/'.INSTALL_PATH.'/Libraries/ContextMenu/ContextMenu.css'); $this->scaff->edit_enabled = true; $this->scaff->order_dir = 'DESC'; if ($_POST['edit_id']) { $this->scaff->db_insert(); } if ($_GET['edit']) { $this->return .= Html::div($this->scaff->make_form($_GET['edit']), array('style' => 'margin-top:10px')); } else { /* $this->scaff->results_per_page = 30; $results_table = $this->scaff->make_table('',INSTALL_PATH.'/Classes/Admin/Templates/TermineListe.template.html'); $nav = $this->scaff->list_navigation(); $this->return .= Html::div( $results_table.$nav,array('style'=>'margin-top:10px'));*/ if (!class_exists('Kalender')) { include_once 'Kalender.php'; } $kalender = new Kalender(); $kalender->class_init($this->system); $kalender->scaff->edit_enabled = true; $kalender->template = INSTALL_PATH . '/Module/Kalender/Templates/KalenderAdminListe.template.html'; $this->return .= $kalender->show(); $context_menu = "var ctx_menu = {}\n"; foreach ($kalender->cal->cal_ids as $cal_id) { $new_entry_ctx = '["Neuer Eintrag",function () {ctx_new_entry("' . $cal_id . '")},null,"' . '/' . INSTALL_PATH . '/Libraries/Icons/16x16/appointment.png' . '"]'; $context_menu .= "ctx_menu['{$cal_id}'] = [{$new_entry_ctx}];\n"; } foreach ($kalender->cal->cal_links as $key => $link) { $context_menu .= "ctx_menu['{$key}'] = [['Neuer Eintrag',function () {ctx_new_entry(\"" . $link[0][2] . "\")},null,'" . '/' . INSTALL_PATH . '/Libraries/Icons/16x16/appointment.png' . "']];\n"; foreach ($link as $entry) { $context_menu .= 'ctx_menu["' . $key . '"].push(["Bearbeiten ' . $entry[1] . '",function(){ctx_edit(' . $entry[0] . ')},null,"' . '/' . INSTALL_PATH . '/Libraries/Icons/16x16/today.png' . '"]);' . "\n"; } } $this->return .= Html::script($context_menu); } }