Beispiel #1
0
function event_category_list($evname)
{
    global $prefs;
    if ($evname == 'article') {
        $headspan = $prefs['show_article_category_count'] ? 3 : 2;
    }
    $o = hed(gTxt($evname . '_head') . popHelp($evname . '_category'), 3);
    $o .= form(fInput('text', 'name', '', 'edit', '', '', 10) . fInput('submit', '', gTxt('Create'), 'smallerbox') . eInput('category') . sInput($evname . '_create'));
    $rs = getTree('root', $evname);
    if ($rs) {
        foreach ($rs as $a) {
            extract($a);
            if ($name == 'root') {
                continue;
            }
            //Stuff for articles only
            if ($evname == 'article' && $prefs['show_article_category_count']) {
                $sname = doSlash($name);
                $count = sp . small(safe_count("textpattern", "((Category1='{$sname}') or (Category2='{$sname}'))"));
            } else {
                $count = '';
            }
            $cbox = checkbox('selected[]', $id, 0);
            $editlink = eLink('category', $evname . '_edit', 'id', $id, $title);
            $items[] = graf($cbox . sp . str_repeat(sp, max(0, $level - 1) * 2) . $editlink . $count);
        }
        if (!empty($items)) {
            $o .= article_multiedit_form($evname, $items);
        }
    }
    return $o;
}
Beispiel #2
0
function image_list()
{
    global $url_mode;
    $o = hed(gTxt('image_head') . popHelp('image_category'), 3);
    $o .= form(fInput('text', 'name', '', 'edit', '', '', 10) . fInput('submit', '', gTxt('Create'), 'smallerbox') . eInput('category') . sInput('image_create'));
    $rs = getTree('root', 'image');
    if ($rs) {
        foreach ($rs as $a) {
            extract($a);
            if ($name == 'root') {
                continue;
            }
            $cbox = checkbox('selected[]', $name, 0);
            $editimage = eLink('category', 'image_edit', 'name', $name, htmlspecialchars($name));
            $items[] = graf($cbox . sp . str_repeat(sp, $level - 1) . $editimage);
        }
        if (!empty($items)) {
            $o .= article_multiedit_form('image', $items);
        }
    }
    return $o;
}