Exemplo n.º 1
0
* Interface                                                                   *
******************************************************************************/
// Show container selector
$frm = new InputForm('', 'post', __('Submit'));
$frm->addrow(__('Select section'), $frm->select_tag('c', $articles->getContainers(2), $c), 'top');
// Show category selector
if (!empty($c) && $c != '#hidden' && $c != '#root') {
    if ($articles->setWorkContainer($c)) {
        $frm->addrow(__('Select category'), $frm->select_tag('b', $articles->getCategories(true, false), $b), 'top');
    } else {
        rcms_showAdminMessage($articles->last_error);
    }
}
$frm->show();
if (!empty($_POST['tc']) && !empty($_POST['tb']) && !empty($_POST['ms']) && $_POST['ms'] == '2') {
    if (!$articles->moveArticleToContainer($_POST['mc'], $_POST['mb'], $_POST['ma'], $_POST['tc'], $_POST['tb'])) {
        rcms_showAdminMessage($articles->last_error);
    } else {
        rcms_showAdminMessage(__('Article moved'));
    }
} elseif (!empty($_POST['tc']) && !empty($_POST['ms']) && $_POST['ms'] == '1') {
    if ($_POST['mc'] == $_POST['tc']) {
        rcms_showAdminMessage(__('Cannot move article to source section'));
    } elseif (!$articles->setWorkContainer($_POST['tc'])) {
        rcms_showAdminMessage($articles->last_error);
    } elseif ($_POST['tc'] == '#hidden' || $_POST['tc'] == '#root') {
        if (!$articles->moveArticleToContainer($_POST['mc'], $_POST['mb'], $_POST['ma'], $_POST['tc'])) {
            rcms_showAdminMessage($articles->last_error);
        } else {
            rcms_showAdminMessage(__('Article moved'));
        }