Exemple #1
0
function link_multiedit_form($page, $sort, $dir, $crit, $search_method)
{
    global $all_link_cats, $all_link_authors;
    $categories = $all_link_cats ? treeSelectInput('category', $all_link_cats, '') : '';
    $authors = $all_link_authors ? selectInput('author', $all_link_authors, '', true) : '';
    $methods = array('changecategory' => array('label' => gTxt('changecategory'), 'html' => $categories), 'changeauthor' => array('label' => gTxt('changeauthor'), 'html' => $authors), 'delete' => gTxt('delete'));
    if (!$categories) {
        unset($methods['changecategory']);
    }
    if (has_single_author('txp_link')) {
        unset($methods['changeauthor']);
    }
    if (!has_privs('link.delete.own') && !has_privs('link.delete')) {
        unset($methods['delete']);
    }
    return multi_edit($methods, 'link', 'link_multi_edit', $page, $sort, $dir, $crit, $search_method);
}
Exemple #2
0
function file_multiedit_form($page, $sort, $dir, $crit, $search_method)
{
    $methods = array('changecategory' => gTxt('changecategory'), 'changeauthor' => gTxt('changeauthor'), 'delete' => gTxt('delete'));
    if (has_single_author('txp_file')) {
        unset($methods['changeauthor']);
    }
    if (!has_privs('file.delete.own') && !has_privs('file.delete')) {
        unset($methods['delete']);
    }
    return event_multiedit_form('file', $methods, $page, $sort, $dir, $crit, $search_method);
}
Exemple #3
0
function file_multiedit_form($page, $sort, $dir, $crit, $search_method)
{
    global $file_statuses, $all_file_cats, $all_file_authors;
    $categories = $all_file_cats ? treeSelectInput('category', $all_file_cats, '') : '';
    $authors = $all_file_authors ? selectInput('author', $all_file_authors, '', true) : '';
    $status = selectInput('status', $file_statuses, '', true);
    $methods = array('changecategory' => array('label' => gTxt('changecategory'), 'html' => $categories), 'changeauthor' => array('label' => gTxt('changeauthor'), 'html' => $authors), 'changestatus' => array('label' => gTxt('changestatus'), 'html' => $status), 'changecount' => array('label' => gTxt('reset_download_count')), 'delete' => gTxt('delete'));
    if (!$categories) {
        unset($methods['changecategory']);
    }
    if (has_single_author('txp_file')) {
        unset($methods['changeauthor']);
    }
    if (!has_privs('file.delete.own') && !has_privs('file.delete')) {
        unset($methods['delete']);
    }
    return multi_edit($methods, 'file', 'file_multi_edit', $page, $sort, $dir, $crit, $search_method);
}
/**
 * Renders a multi-edit form widget for articles.
 *
 * @param  int    $page          The page number
 * @param  string $sort          The current sort value
 * @param  string $dir           The current sort direction
 * @param  string $crit          The current search criteria
 * @param  string $search_method The current search method
 * @return string HTML
 */
function list_multiedit_form($page, $sort, $dir, $crit, $search_method)
{
    global $statuses, $all_cats, $all_authors, $all_sections;
    if ($all_cats) {
        $category1 = treeSelectInput('Category1', $all_cats, '');
        $category2 = treeSelectInput('Category2', $all_cats, '');
    } else {
        $category1 = $category2 = '';
    }
    $sections = $all_sections ? selectInput('Section', $all_sections, '', true) : '';
    $comments = onoffRadio('Annotate', get_pref('comments_on_default'));
    $status = selectInput('Status', $statuses, '', true);
    $authors = $all_authors ? selectInput('AuthorID', $all_authors, '', true) : '';
    $methods = array('changesection' => array('label' => gTxt('changesection'), 'html' => $sections), 'changecategory1' => array('label' => gTxt('changecategory1'), 'html' => $category1), 'changecategory2' => array('label' => gTxt('changecategory2'), 'html' => $category2), 'changestatus' => array('label' => gTxt('changestatus'), 'html' => $status), 'changecomments' => array('label' => gTxt('changecomments'), 'html' => $comments), 'changeauthor' => array('label' => gTxt('changeauthor'), 'html' => $authors), 'duplicate' => gTxt('duplicate'), 'delete' => gTxt('delete'));
    if (!$all_cats) {
        unset($methods['changecategory1'], $methods['changecategory2']);
    }
    if (has_single_author('textpattern', 'AuthorID')) {
        unset($methods['changeauthor']);
    }
    if (!has_privs('article.delete.own') && !has_privs('article.delete')) {
        unset($methods['delete']);
    }
    return multi_edit($methods, 'list', 'list_multi_edit', $page, $sort, $dir, $crit, $search_method);
}
Exemple #5
0
function list_multiedit_form($page, $sort, $dir, $crit, $search_method)
{
    $methods = array('changesection' => gTxt('changesection'), 'changecategory1' => gTxt('changecategory1'), 'changecategory2' => gTxt('changecategory2'), 'changestatus' => gTxt('changestatus'), 'changecomments' => gTxt('changecomments'), 'changeauthor' => gTxt('changeauthor'), 'delete' => gTxt('delete'));
    if (has_single_author('textpattern', 'AuthorID')) {
        unset($methods['changeauthor']);
    }
    if (!has_privs('article.delete.own') && !has_privs('article.delete')) {
        unset($methods['delete']);
    }
    return event_multiedit_form('list', $methods, $page, $sort, $dir, $crit, $search_method);
}