Exemplo n.º 1
0
        Redirect('list');
    } else {
        Info(s('Categories saved'), true);
    }
}
$req = Sql_Query(sprintf('select * from %s %s', $tables['list'], $subselect));
if (!Sql_Affected_Rows()) {
    Info(s('All lists have already been assigned a category') . '<br/>' . PageLinkButton('list', s('Back')), true);
}
print '<div class="fright">' . PageLinkButton('catlists&show=all', s('Re-edit all lists')) . '</div>';
print '<div class="fright">' . PageLinkButton('configure&id=list_categories&ret=catlists', $I18N->get('Configure Categories')) . '</div>';
$ls = new WebblerListing(s('Categorise lists'));
$aListCategories = listCategories();
if (count($aListCategories)) {
    while ($row = Sql_Fetch_Assoc($req)) {
        $ls->addELement($row['id']);
        $ls->addColumn($row['id'], $GLOBALS['I18N']->get('Name'), stripslashes($row['name']));
        $catselect = '<select name="category[' . $row['id'] . ']">';
        $catselect .= '<option value="">-- ' . s('choose category') . '</option>';
        $catselect .= '<option value="">-- ' . s('none') . '</option>';
        foreach ($aListCategories as $category) {
            $category = trim($category);
            $catselect .= sprintf('<option value="%s" %s>%s</option>', $category, $category == $row['category'] ? 'selected="selected"' : '', $category);
        }
        $catselect .= '</select>';
        $ls->addColumn($row['id'], s('Category'), $catselect);
    }
}
$ls->addButton(s('save'), 'javascript:document.categoryedit.submit();');
print $ls->display();
print '</form>';