1: <?php
2:
3: /**
4: * This file contains the upgrade job 14.
5: *
6: * @package Setup
7: * @subpackage UpgradeJob
8: * @version SVN Revision $Rev:$
9: *
10: * @author frederic.schneider
11: * @copyright four for business AG <www.4fb.de>
12: * @license http://www.contenido.org/license/LIZENZ.txt
13: * @link http://www.4fb.de
14: * @link http://www.contenido.org
15: */
16:
17: // assert CONTENIDO framework
18: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
19:
20: /**
21: * Upgrade job 14
22: *
23: * Switched AMR and url_shortener plugins from "Content" navigation to "Extras" navigation
24: *
25: * @package Setup
26: * @subpackage UpgradeJob
27: */
28: class cUpgradeJob_0014 extends cUpgradeJobAbstract {
29:
30: public $maxVersion = "4.9.4";
31:
32: public function _execute() {
33: global $cfg;
34:
35: if ($_SESSION['setuptype'] == 'upgrade') {
36:
37: // Initializing cApiNavSub
38: $navsub = new cApiNavSub();
39:
40: // mod_rewrite/main
41: // Get informations for mod_rewrite/xml/;navigation/content/mod_rewrite/main
42: $navsub->loadBy('location', 'mod_rewrite/xml/;navigation/content/mod_rewrite/main');
43:
44: // If entry exist, change location to mod_rewrite/xml/;navigation/extra/mod_rewrite/main
45: if ($navsub !== null) {
46: $navsub->set('location', 'mod_rewrite/xml/;navigation/extra/mod_rewrite/main');
47: $navsub->store();
48: }
49:
50: // mod_rewrite/settings
51: // Get informations for mod_rewrite/xml/;navigation/content/mod_rewrite/settings
52: $navsub->loadBy('location', 'mod_rewrite/xml/;navigation/content/mod_rewrite/settings');
53:
54: // If entry exist, change location to mod_rewrite/xml/;navigation/extra/mod_rewrite/settings
55: if ($navsub !== null) {
56: $navsub->set('location', 'mod_rewrite/xml/;navigation/extra/mod_rewrite/settings');
57: $navsub->store();
58: }
59:
60: // mod_rewrite/expert
61: // Get informations for mod_rewrite/xml/;navigation/content/mod_rewrite/expert
62: $navsub->loadBy('location', 'mod_rewrite/xml/;navigation/content/mod_rewrite/expert');
63:
64: // If entry exist, change location to mod_rewrite/xml/;navigation/extra/mod_rewrite/expert
65: if ($navsub !== null) {
66: $navsub->set('location', 'mod_rewrite/xml/;navigation/extra/mod_rewrite/expert');
67: $navsub->store();
68: }
69:
70: // mod_rewrite/test
71: // Get informations for mod_rewrite/xml/;navigation/content/mod_rewrite/test
72: $navsub->loadBy('location', 'mod_rewrite/xml/;navigation/content/mod_rewrite/test');
73:
74: // If entry exist, change location to mod_rewrite/xml/;navigation/extra/mod_rewrite/test
75: if ($navsub !== null) {
76: $navsub->set('location', 'mod_rewrite/xml/;navigation/extra/mod_rewrite/test');
77: $navsub->store();
78: }
79:
80: // url_shortener/main
81: // Get informations for url_shortener/xml/;navigation/content/url_shortener/main
82: $navsub->loadBy('location', 'url_shortener/xml/;navigation/content/url_shortener/main');
83:
84: // If entry exist, change location to url_shortener/xml/;navigation/extra/url_shortener/main
85: if ($navsub !== null) {
86: $navsub->set('location', 'url_shortener/xml/;navigation/extra/url_shortener/main');
87: $navsub->store();
88: }
89:
90: }
91: }
92:
93: }
94:
95: