Exemple #1
0
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/blogs.php';
$header = '../header.php';
//$additional_header = "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"Блоги на Free-lance.ru (".$gr_name.")\" href=\"/rss/blogs.php?gr=".$gr."&amp;t=".$t."\" />";
$css_file = array('lenta.css', 'commune.css', '/css/nav.css');
$content = 'content.php';
$js_file = array('polls.js', 'commune.js');
$footer = '../footer.html';
$user_mod = commune::MOD_ADMIN * hasPermissions('communes');
$user_mod |= commune::MOD_PRO * (users::IsPro($uid, $e) ? 1 : 0);
$user_mod |= commune::MOD_EMPLOYER * (int) is_emp();
$user_mod |= commune::MOD_BANNED * is_banned($uid);
$page = __paramInit('int', 'page', 'page', 1);
$action = __paramInit('string', NULL, 'action');
switch ($action) {
    case 'Save':
        $has_lenta = __paramInit('bool', NULL, 'has_lenta', NULL);
        $my_team = __paramInit('bool', NULL, 'my_team');
        $all_profs = __paramInit('bool', NULL, 'all_profs');
        $communes = __paramInit('array', NULL, 'commune_id');
        $prof_groups = __paramInit('array', NULL, 'prof_group_id');
        if (!lenta::SaveUserSettings($has_lenta, $uid, $my_team, $all_profs, $communes, $prof_groups)) {
        }
        // ошибка.
        header('Location: /lenta/');
        exit;
        break;
    default:
        break;
}
include '../template2.php';
Exemple #2
0
function Lenta_Save($data)
{
    session_start();
    $objResponse = new xajaxResponse();
    $uid = get_uid(false);
    if ($data['commune_id']) {
        foreach ($data['commune_id'] as $k => $v) {
            if (is_array($v)) {
                unset($data['commune_id'][$k]);
            }
        }
    }
    if ($data['prof_group_id']) {
        foreach ($data['prof_group_id'] as $k => $v) {
            if (is_array($v)) {
                unset($data['prof_group_id'][$k]);
            }
        }
    }
    if ($data['blog_gr_id']) {
        foreach ($data['blog_gr_id'] as $k => $v) {
            if (is_array($v)) {
                unset($data['blog_gr_id'][$k]);
            }
        }
    }
    if ($uid = get_uid(false)) {
        $_POST = $data;
        $has_lenta = __paramInit('bool', NULL, 'has_lenta', NULL);
        $my_team = __paramInit('bool', NULL, 'my_team');
        $all_profs = __paramInit('bool', NULL, 'all_profs');
        $communes = __paramInit('array', NULL, 'commune_id');
        $prof_groups = __paramInit('array', NULL, 'prof_group_id');
        $blog_groups = __paramInit('array', NULL, 'blog_gr_id');
        lenta::SaveUserSettings($has_lenta, $uid, $my_team, $all_profs, $communes, $prof_groups, $blog_groups);
    }
    $objResponse->script('spiner.show(); xajax_Lenta_Show(1);');
    $objResponse->script('fix_banner();');
    return $objResponse;
}