Beispiel #1
0
}
////////////////////////////////////////////////////////////////////////////////
// Interface generation                                                       //
////////////////////////////////////////////////////////////////////////////////
if (!empty($_POST['new'])) {
    $frm = new InputForm('', 'post', __('Submit'));
    $frm->addmessage('<a href="">&lt;&lt;&lt; ' . __('Back') . '</a>');
    $frm->addbreak(__('Create menu'));
    $frm->hidden('newsave', '1');
    $frm->addrow('<abbr title="' . __('Use only small Latin letters and digits') . '">' . __('MenuID') . '</abbr>', $frm->text_box('id', ''));
    $frm->addrow(__('Title'), $frm->text_box('title', ''));
    $frm->addrow(__('Alignment'), $frm->select_tag('align', array('center' => __('Center'), 'left' => __('Left'), 'right' => __('Right'), 'justify' => __('Justify'))));
    $frm->addrow(__('Text') . tinymce_selector('text') . '<br/>' . __('All HTML is allowed in this field and line breaks will not be transformed to &lt;br&gt; tags!'), $frm->textarea('text', '', 70, 25), 'top');
    $frm->show();
} elseif (!empty($_REQUEST['edit'])) {
    if ($menu = ucm_get($_REQUEST['edit'])) {
        $frm = new InputForm("", "post", __('Submit'));
        if (!empty($_GET['edit'])) {
            $frm->addmessage('&lt;&lt;&lt; <a href="' . RCMS_ROOT_PATH . '">' . __('Return to') . ' ' . __('site index') . '</a>');
        } else {
            $frm->addmessage('<a href="">&lt;&lt;&lt; ' . __('Back') . '</a>');
        }
        $frm->addbreak(__('Menu editing'));
        $frm->hidden('edit', $_REQUEST['edit']);
        $frm->hidden('save', '1');
        if (empty($_GET['edit'])) {
            $frm->addrow('<abbr title="' . __('Use only small Latin letters and digits') . '">' . __('MenuID') . '</abbr>', $frm->text_box('id', $_REQUEST['edit']));
        } else {
            $frm->addrow('<abbr title="' . __('Use only small Latin letters and digits') . '">' . __('MenuID') . '</abbr>', $_REQUEST['edit'] . $frm->hidden('id', $_REQUEST['edit']));
        }
        $frm->addrow(__('Title'), $frm->text_box('title', $menu[0]));
}
////////////////////////////////////////////////////////////////////////////////
// Interface generation                                                       //
////////////////////////////////////////////////////////////////////////////////
if (!empty($_POST['new'])) {
    $frm = new InputForm("", "post", $lang['general']['submit']);
    $frm->addmessage('<a href="">&lt;&lt;&lt; ' . $lang['general']['back'] . '</a>');
    $frm->addbreak($lang['admincp']['general']['ucm']['create']);
    $frm->hidden('newsave', '1');
    $frm->addrow('<abbr title="' . $lang['general']['ucm']['id_h'] . '">' . $lang['general']['ucm']['id'] . '</abbr>', $frm->text_box('id', ''));
    $frm->addrow('<abbr title="' . $lang['general']['ucm']['title_h'] . '">' . $lang['general']['ucm']['title'] . '</abbr>', $frm->text_box('title', ''));
    $frm->addrow($lang['general']['alignment'], $frm->select_tag('align', $lang['general']['align']));
    $frm->addrow($lang['general']['ucm']['text'] . '<br>' . $lang['general']['ucm']['text_h'], $frm->textarea('text', '', 70, 25), 'top');
    $frm->show();
} elseif (!empty($_POST['edit'])) {
    if ($menu = ucm_get($_POST['edit'])) {
        $frm = new InputForm("", "post", $lang['general']['submit']);
        $frm->addmessage('<a href="">&lt;&lt;&lt; ' . $lang['general']['back'] . '</a>');
        $frm->addbreak($lang['admincp']['general']['ucm']['edit']);
        $frm->hidden('edit', $_POST['edit']);
        $frm->hidden('save', '1');
        $frm->addrow('<abbr title="' . $lang['general']['ucm']['id_h'] . '">' . $lang['general']['ucm']['id'] . '</abbr>', $frm->text_box('id', $_POST['edit']));
        $frm->addrow('<abbr title="' . $lang['general']['ucm']['title_h'] . '">' . $lang['general']['ucm']['title'] . '</abbr>', $frm->text_box('title', $menu[0]));
        $frm->addrow($lang['general']['alignment'], $frm->select_tag('align', $lang['general']['align'], $menu[2]));
        $frm->addrow($lang['general']['ucm']['text'] . '<br>' . $lang['general']['ucm']['text_h'], $frm->textarea('text', $menu[1], 70, 25), 'top');
        $frm->show();
    } else {
        rcms_showAdminMessage($lang['results']['general'][8]);
    }
} else {
    $frm = new InputForm('', 'post', $lang['general']['createucm']);