Пример #1
0
function link_edit($message = "")
{
    global $vars, $step;
    extract(gpsa($vars));
    pagetop(gTxt('edit_links', $message));
    $id = gps('id');
    if ($id && $step == 'link_edit') {
        extract(safe_row("*", "txp_link", "id = {$id}"));
    }
    if ($step == 'link_save' or $step == 'link_post') {
        foreach ($vars as $var) {
            ${$var} = '';
        }
    }
    $textarea = '<textarea name="description" cols="40" rows="7" tabindex="4">' . $description . '</textarea>';
    $selects = linkcategory_popup($category);
    $editlink = ' [' . eLink('category', 'list', '', '', gTxt('edit')) . ']';
    $out = startTable('edit') . tr(fLabelCell('title') . fInputCell('linkname', $linkname, 1, 30)) . tr(fLabelCell('sort_value') . fInputCell('linksort', $linksort, 2, 15)) . tr(fLabelCell('url', 'link_url') . fInputCell('url', $url, 3, 30)) . tr(fLabelCell('link_category', 'link_category') . td($selects . $editlink)) . tr(fLabelCell('description', 'link_description') . tda($textarea, ' valign="top"')) . tr(td() . td(fInput("submit", '', gTxt('save'), "publish"))) . endTable() . eInput('link') . sInput($step == 'link_edit' ? 'link_save' : 'link_post') . hInput('id', $id);
    echo form($out);
    echo link_list();
}
Пример #2
0
function link_edit($message = '')
{
    global $vars, $step;
    pagetop(gTxt('edit_links'), $message);
    extract(gpsa($vars));
    $rs = array();
    if ($id && $step == 'link_edit') {
        $id = assert_int($id);
        $rs = safe_row('*', 'txp_link', "id = {$id}");
        extract($rs);
    }
    if ($step == 'link_save' or $step == 'link_post') {
        foreach ($vars as $var) {
            ${$var} = '';
        }
    }
    echo form(startTable('edit') . tr(fLabelCell('title', '', 'link-title') . fInputCell('linkname', $linkname, 1, 30, '', 'link-title')) . tr(fLabelCell('sort_value', '', 'link-sort') . fInputCell('linksort', $linksort, 2, 15, '', 'link-sort')) . tr(fLabelCell('url', 'link_url', 'link-url') . fInputCell('url', $url, 3, 30, '', 'link-url')) . tr(fLabelCell('link_category', 'link_category', 'link-category') . td(linkcategory_popup($category) . ' [' . eLink('category', 'list', '', '', gTxt('edit')) . ']')) . tr(tda('<label for="link-description">' . gTxt('description') . '</label>' . sp . popHelp('link_description'), ' style="text-align: right; vertical-align: top;"') . td('<textarea id="link-description" name="description" cols="40" rows="7" tabindex="4">' . htmlspecialchars($description) . '</textarea>')) . pluggable_ui('link_ui', 'extend_detail_form', '', $rs) . tr(td() . td(fInput('submit', '', gTxt('save'), 'publish'))) . endTable() . eInput('link') . ($id ? sInput('link_save') . hInput('id', $id) : sInput('link_post')) . hInput('search_method', gps('search_method')) . hInput('crit', gps('crit')), 'margin-bottom: 25px;');
    echo link_list();
}
Пример #3
0
function link_edit($message = '')
{
    global $vars, $event, $step, $txp_user;
    pagetop(gTxt('tab_link'), $message);
    echo '<div id="' . $event . '_container" class="txp-container">';
    extract(array_map('assert_string', gpsa($vars)));
    $is_edit = $id && $step == 'link_edit';
    $rs = array();
    if ($is_edit) {
        $id = assert_int($id);
        $rs = safe_row('*', 'txp_link', "id = {$id}");
        if ($rs) {
            extract($rs);
            if (!has_privs('link.edit') && !($author == $txp_user && has_privs('link.edit.own'))) {
                link_list(gTxt('restricted_area'));
                return;
            }
        }
    }
    if (has_privs('link.edit') || has_privs('link.edit.own')) {
        $caption = gTxt($is_edit ? 'edit_link' : 'add_new_link');
        echo form('<div class="txp-edit">' . n . hed($caption, 2) . n . inputLabel('linkname', fInput('text', 'linkname', $linkname, '', '', '', INPUT_REGULAR, '', 'linkname'), 'title') . n . inputLabel('linksort', fInput('text', 'linksort', $linksort, '', '', '', INPUT_REGULAR, '', 'linksort'), 'sort_value', 'link_sort') . n . inputLabel('url', fInput('text', 'url', $url, '', '', '', INPUT_REGULAR, '', 'url'), 'url', 'link_url', 'edit-link-url') . n . inputLabel('link_category', linkcategory_popup($category) . ' [' . eLink('category', 'list', '', '', gTxt('edit')) . ']', 'link_category', 'link_category') . n . inputLabel('link_description', '<textarea id="link_description" name="description" cols="' . INPUT_LARGE . '" rows="' . INPUT_SMALL . '">' . txpspecialchars($description) . '</textarea>', 'description', 'link_description', '', '') . n . pluggable_ui('link_ui', 'extend_detail_form', '', $rs) . n . graf(fInput('submit', '', gTxt('save'), 'publish')) . eInput('link') . sInput('link_save') . hInput('id', $id) . hInput('search_method', gps('search_method')) . hInput('crit', gps('crit')) . '</div>', '', '', 'post', 'edit-form', '', 'link_details');
    }
    echo '</div>';
}
Пример #4
0
function link_edit($message = '')
{
    global $vars, $event, $step, $txp_user;
    pagetop(gTxt('edit_links'), $message);
    echo '<div id="' . $event . '_container" class="txp-container">';
    extract(gpsa($vars));
    $rs = array();
    if ($id && $step == 'link_edit') {
        $id = assert_int($id);
        $rs = safe_row('*', 'txp_link', "id = {$id}");
        if ($rs) {
            extract($rs);
            if (!has_privs('link.edit') && !($author == $txp_user && has_privs('link.edit.own'))) {
                link_list(gTxt('restricted_area'));
                return;
            }
        }
    }
    if ($step == 'link_save' or $step == 'link_post') {
        foreach ($vars as $var) {
            ${$var} = '';
        }
    }
    if (has_privs('link.edit') || has_privs('link.edit.own')) {
        echo '<div class="txp-edit">' . form(startTable('edit', '', 'edit-pane') . tr(fLabelCell('title', '', 'link-title') . fInputCell('linkname', $linkname, 1, 30, '', 'link-title'), ' class="name"') . tr(fLabelCell('sort_value', '', 'link-sort') . fInputCell('linksort', $linksort, 2, 15, '', 'link-sort'), ' class="sort"') . tr(fLabelCell('url', 'link_url', 'link-url') . fInputCell('url', $url, 3, 30, '', 'link-url'), ' class="url"') . tr(fLabelCell('link_category', 'link_category', 'link-category') . td(linkcategory_popup($category) . ' [' . eLink('category', 'list', '', '', gTxt('edit')) . ']'), ' class="category"') . tr(tda('<label for="link-description">' . gTxt('description') . '</label>' . sp . popHelp('link_description'), ' style="text-align: right; vertical-align: top;"') . td('<textarea id="link-description" name="description" cols="40" rows="7" tabindex="4">' . htmlspecialchars($description) . '</textarea>'), ' class="description text"') . pluggable_ui('link_ui', 'extend_detail_form', '', $rs) . tr(td() . td(fInput('submit', '', gTxt('save'), 'publish'))) . endTable() . eInput('link') . ($id ? sInput('link_save') . hInput('id', $id) : sInput('link_post')) . hInput('search_method', gps('search_method')) . hInput('crit', gps('crit')), 'margin-bottom: 25px;', '', 'post', 'edit-form', '', 'link_details') . '</div>';
    }
    link_list();
    echo '</div>';
}