Overview

Packages

  • Horde
    • Data
  • None
  • Turba

Classes

  • Turba
  • Turba_Api
  • Turba_Driver
  • Turba_Driver_Facebook
  • Turba_Driver_Favourites
  • Turba_Driver_Group
  • Turba_Driver_Imsp
  • Turba_Driver_Kolab
  • Turba_Driver_Ldap
  • Turba_Driver_Prefs
  • Turba_Driver_Share
  • Turba_Driver_Sql
  • Turba_Driver_Vbook
  • Turba_Exception
  • Turba_Factory_Driver
  • Turba_Form_AddContact
  • Turba_Form_Contact
  • Turba_Form_ContactBase
  • Turba_Form_CreateAddressBook
  • Turba_Form_DeleteAddressBook
  • Turba_Form_EditAddressBook
  • Turba_Form_EditContact
  • Turba_Form_EditContactGroup
  • Turba_List
  • Turba_LoginTasks_SystemTask_Upgrade
  • Turba_Object
  • Turba_Object_Group
  • Turba_Test
  • Turba_View_Browse
  • Turba_View_Contact
  • Turba_View_DeleteContact
  • Turba_View_Duplicates
  • Turba_View_EditContact
  • Turba_View_List
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Login system task for automated upgrade tasks.
 4:  *
 5:  * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
 6:  *
 7:  * See the enclosed file LICENSE for license information (ASL).  If you
 8:  * did not receive this file, see http://www.horde.org/licenses/apache.
 9:  *
10:  * @author   Michael J. Rubinsky <mrubinsk@horde.org>
11:  * @author   Michael Slusarz <slusarz@horde.org>
12:  * @category Horde
13:  * @license  http://www.horde.org/licenses/apache ASL
14:  * @package  Turba
15:  */
16: class Turba_LoginTasks_SystemTask_Upgrade extends Horde_Core_LoginTasks_SystemTask_Upgrade
17: {
18:     /**
19:      */
20:     protected $_app = 'turba';
21: 
22:     /**
23:      */
24:     protected $_versions = array(
25:         '3.0'
26:     );
27: 
28:     /**
29:      */
30:     protected function _upgrade($version)
31:     {
32:         switch ($version) {
33:         case '3.0':
34:             $this->_upgradeAbookPrefs();
35:             break;
36:         }
37:     }
38: 
39:     /**
40:      * Upgrade to the new addressbook preferences.
41:      */
42:     protected function _upgradeAbookPrefs()
43:     {
44:         global $prefs;
45: 
46:         if (!$prefs->isDefault('addressbooks')) {
47:             $abooks = $prefs->getValue('addressbooks');
48:             if (!is_array(json_decode($abooks))) {
49:                 $abooks = @explode("\n", $abooks);
50:                 if (empty($abooks)) {
51:                     $abooks = array();
52:                 }
53: 
54:                 return $prefs->setValue('addressbooks', json_encode($abooks));
55:             }
56:         }
57:     }
58: 
59: }
60: 
API documentation generated by ApiGen