File: prefs.php

package info (click to toggle)
turba2 2.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 7,332 kB
  • ctags: 2,927
  • sloc: php: 11,046; xml: 1,690; sql: 507; makefile: 62; perl: 17; sh: 1
file content (49 lines) | stat: -rw-r--r-- 1,391 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
 * $Horde: turba/lib/prefs.php,v 1.2.10.9 2008/04/10 13:37:07 jan Exp $
 *
 * Copyright 2001-2008 The Horde Project (http://www.horde.org/)
 *
 * See the enclosed file LICENSE for license information (ASL).  If you
 * did not receive this file, see http://www.horde.org/licenses/asl.php.
 */

function handle_columnselect($updated)
{
    $columns = Util::getFormData('columns');
    if (!empty($columns)) {
        $GLOBALS['prefs']->setValue('columns', $columns);
        return true;
    }

    return false;
}

function handle_addressbookselect($updated)
{
    $addressbooks = Util::getFormData('addressbooks');
    $GLOBALS['prefs']->setValue('addressbooks', $addressbooks);
    return true;
}

/* Assign variables for select lists. */
if (!$prefs->isLocked('default_dir')) {
    $default_dir_options = array();
    foreach ($cfgSources as $key => $info) {
        $default_dir_options[$key] = $info['title'];
    }
}

foreach (Turba::getAddressBooks() as $key => $curSource) {
    if (empty($curSource['map']['__uid'])) {
        continue;
    }
    if (!empty($curSource['browse'])) {
        $_prefs['sync_books']['enum'][$key] = $curSource['title'];
    }
    $sync_books = @unserialize($prefs->getValue('sync_books'));
    if (empty($sync_books)) {
        $prefs->setValue('sync_books',
                         serialize(array(Turba::getDefaultAddressbook())));
    }
}