1: <?php
2: /**
3: * This file contains the upgrade job 17.
4: *
5: * @package Setup
6: * @subpackage UpgradeJob
7: * @author Frederic Schneider
8: * @copyright four for business AG <www.4fb.de>
9: * @license http://www.contenido.org/license/LIZENZ.txt
10: * @link http://www.4fb.de
11: * @link http://www.contenido.org
12: */
13: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
14:
15: /**
16: * Upgrade job 17
17: * Fill new name column at nav_main table
18: *
19: * @package Setup
20: * @subpackage UpgradeJob
21: */
22: class cUpgradeJob_0017 extends cUpgradeJobAbstract {
23:
24: public $maxVersion = "4.9.8";
25:
26: public function _execute() {
27:
28: if ($_SESSION['setuptype'] == 'upgrade') {
29:
30: // Initializing cApiNavMain
31: $navm = new cApiNavMain();
32:
33: // navigation/content/main
34: $navm->loadBy('location', 'navigation/content/main');
35:
36: // If entry exist, set name to "content"
37: if ($navm !== null) {
38: $navm->set('name', 'content');
39: $navm->store();
40: }
41:
42: // navigation/style/main
43: $navm->loadBy('location', 'navigation/style/main');
44:
45: // If entry exist, set name to "style"
46: if ($navm !== null) {
47: $navm->set('name', 'style');
48: $navm->store();
49: }
50:
51: // navigation/statistic/main
52: $navm->loadBy('location', 'navigation/statistic/main');
53:
54: // If entry exist, set name to "statistic"
55: if ($navm !== null) {
56: $navm->set('name', 'statistic');
57: $navm->store();
58: }
59:
60: // navigation/administration/main
61: $navm->loadBy('location', 'navigation/administration/main');
62:
63: // If entry exist, set name to "administration"
64: if ($navm !== null) {
65: $navm->set('name', 'administration');
66: $navm->store();
67: }
68:
69: // navigation/extra/main
70: $navm->loadBy('location', 'navigation/extra/main');
71:
72: // If entry exist, set name to "extra"
73: if ($navm !== null) {
74: $navm->set('name', 'extra');
75: $navm->store();
76: }
77: }
78: }
79:
80: }
81: