Example #1
0
function page_edit_form($name)
{
    global $step;
    if ($step == 'div_edit') {
        list($html_array, $html, $start_pos, $stop_pos) = extract_div();
        $html_array = serialize($html_array);
        $outstep = 'div_save';
    } else {
        $html = safe_field('user_html', 'txp_page', "name='{$name}'");
        $outstep = 'page_save';
    }
    $out[] = textarea('500', '600', $html, 'html') . graf(fInput('submit', 'save', gTxt('save'), 'publish') . eInput('page') . sInput($outstep) . hInput('name', $name));
    if ($step == 'div_edit') {
        $out[] = hInput('html_array', $html_array) . hInput('start_pos', $start_pos) . hInput('stop_pos', $stop_pos) . hInput('name', $name);
    } else {
        $out[] = graf(gTxt('copy_page_as') . fInput('text', 'newname', '', 'edit') . fInput('submit', 'copy', gTxt('copy'), 'smallerbox'));
    }
    return form(join('', $out));
}
Example #2
0
function page_edit_form($name)
{
    global $step;
    if ($step == 'div_edit') {
        list($html_array, $html, $start_pos, $stop_pos) = extract_div();
        $html_array = serialize($html_array);
        $outstep = 'div_save';
    } else {
        $html = safe_field('user_html', 'txp_page', "name='" . doSlash($name) . "'");
        $outstep = 'page_save';
    }
    $divline = $step == 'div_edit' ? graf(gTxt('you_are_editing_div') . sp . strong($div)) : '';
    $out[] = '<p>' . gTxt('you_are_editing_page') . sp . strong($name) . $divline . br . '<textarea id="html" class="code" name="html" cols="84" rows="36">' . htmlspecialchars($html) . '</textarea>' . br . n . fInput('submit', 'save', gTxt('save'), 'publish') . n . eInput('page') . n . sInput($outstep) . n . hInput('name', $name);
    if ($step == 'div_edit') {
        $out[] = n . hInput('html_array', $html_array) . n . hInput('start_pos', $start_pos) . n . hInput('stop_pos', $stop_pos) . n . hInput('name', $name);
    } else {
        $out[] = n . '<label for="copy-page">' . gTxt('copy_page_as') . '</label>' . sp . n . fInput('text', 'newname', '', 'edit', '', '', '', '', 'copy-page') . n . fInput('submit', 'copy', gTxt('copy'), 'smallerbox') . '</p>';
    }
    return form(join('', $out));
}