Exemple #1
0
    $new_imageurl = $model->uploadClubImage($club['imageurl']);
    $new_club['imageurl'] = !empty($new_imageurl['filename']) ? $new_imageurl['filename'] : $club['imageurl'];

    $model->updateClub($item_id, $new_club);

    cmsCore::addSessionMessage($_LANG['CONFIG_SAVE_OK'], 'success');

    if (empty($_SESSION['editlist'])) {
        cmsCore::redirect('index.php?view=components&do=config&id='. $id .'&opt=list');
    } else {
        cmsCore::redirect('index.php?view=components&do=config&id='. $id .'&opt=edit');
    }
}

if ($opt == 'delete') {
    $model->deleteClub(cmsCore::request('item_id', 'int', 0));
    cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
    cmsCore::redirect('index.php?view=components&do=config&id='. $id .'&opt=list');
}

cpToolMenu($toolmenu);

if ($opt == 'list') {
    $fields = array(
        array( 'title' => 'id', 'field' => 'id', 'width' => '40'),
        array( 'title' => $_LANG['DATE'], 'field' => 'pubdate', 'width' => '100', 'filter' => '15', 'fdate' => '%d/%m/%Y'),
        array( 'title' => $_LANG['TITLE'], 'field' => 'title', 'width' => '', 'filter' => '15', 'link' => '?view=components&do=config&id='. $id .'&opt=edit&item_id=%id%'),
        array( 'title' => $_LANG['CLUB_TYPE'], 'field' => 'clubtype', 'width' => '100'),
        array( 'title' => $_LANG['MEMBERS'], 'field' => 'members_count', 'width' => '100'),
        array( 'title' => $_LANG['AD_IS_PUBLISHED'], 'field' => 'published', 'width' => '100', 'do' => 'opt', 'do_suffix' => '_club')
    );
Exemple #2
0
        if (array_search($admin_id, $members)) {
            unset($members[array_search($admin_id, $members)]);
        }
        clubSaveUsers($id, $moders, 'moderator', $clubtype);
        clubSaveUsers($id, $members, 'member', $clubtype);
    }
    if (!isset($_SESSION['editlist']) || @sizeof($_SESSION['editlist']) == 0) {
        $inCore->redirect('index.php?view=components&do=config&id=' . $_REQUEST['id'] . '&opt=list');
    } else {
        $inCore->redirect('index.php?view=components&do=config&id=' . $_REQUEST['id'] . '&opt=edit');
    }
}
if ($opt == 'delete') {
    if (isset($_REQUEST['item_id'])) {
        $id = (int) $_REQUEST['item_id'];
        $model->deleteClub($id);
    }
    $inCore->redirect('index.php?view=components&do=config&id=' . $_REQUEST['id'] . '&opt=list');
}
cpToolMenu($toolmenu);
if ($opt == 'list') {
    cpAddPathway('Клубы пользователей', '?view=components&do=config&id=' . $_REQUEST['id'] . '&opt=list');
    echo '<h3>Клубы пользователей</h3>';
    //TABLE COLUMNS
    $fields = array();
    $fields[0]['title'] = 'id';
    $fields[0]['field'] = 'id';
    $fields[0]['width'] = '30';
    $fields[1]['title'] = 'Дата';
    $fields[1]['field'] = 'pubdate';
    $fields[1]['width'] = '100';