tiki-wizard_admin.php 8.07 KB
Newer Older
1 2 3 4
<?php
/**
 * @package tikiwiki
 */
5
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
6 7 8 9 10
// 
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

11 12 13 14 15 16 17 18 19 20 21 22 23
$inputConfiguration =	[[
	'staticKeyFilters'	=> [
		'use-default-prefs'	=> 'alnum', 		// request
		'use-upgrade-wizard'=> 'alnum', 		// request
		'url'				=> 'relativeurl',	// request
		'close'				=> 'alnum',			// post
		'showOnLogin'		=> 'alnum',			// post
		'wizard_step'		=> 'int',			// post
		'stepNr'			=> 'int',			// get
		'back'				=> 'alnum',			// post
	],
]];

24 25
require 'tiki-setup.php';

26
$headerlib = TikiLib::lib('header');
27
$headerlib->add_cssfile('themes/base_files/feature_css/admin.css');
28
$headerlib->add_cssfile('themes/base_files/feature_css/wizards.css');
29

30 31 32
// Hide the display of the preference dependencies in the wizard
$headerlib->add_css('.pref_dependency{display:none !important;}');

33 34 35
$accesslib = TikiLib::lib('access');
$accesslib->check_permission('tiki_p_admin');

36 37 38 39 40 41 42
// Create the template instances
$pages = array();

/////////////////////////////////////
// BEGIN Wizard page section
/////////////////////////////////////

43
// Always show the first page
44
require_once('lib/wizard/pages/admin_wizard.php'); 
45
$pages[] = new AdminWizard();
46

47
// If $useDefaultPrefs is set, the "profiles wizard" should be run. Otherwise the "admin wizard". 
48
$useDefaultPrefs = isset($_REQUEST['use-default-prefs']) ? true : false;
49 50
// If $useUpgradeWizard is set, the "upgrade wizard" should be run. Otherwise the "admin wizard". 
$useUpgradeWizard = isset($_REQUEST['use-upgrade-wizard']) ? true : false;
51 52 53 54
if ($useDefaultPrefs) {
	
	// Store the default prefs selection in the wizard bar
	$smarty->assign('useDefaultPrefs', $useDefaultPrefs);
55

56 57
	require_once('lib/wizard/pages/profiles_featured_site_confs.php');
	$pages[] = new ProfilesWizardFeaturedSiteConfs();
58

59 60
    require_once('lib/wizard/pages/profiles_useful_micro_confs.php');
    $pages[] = new ProfilesWizardUsefulMicroConfs();
61

62 63
	require_once('lib/wizard/pages/profiles_useful_changes_in_display.php');
	$pages[] = new ProfilesWizardUsefulChangesInDisplay();
64

65 66
    require_once('lib/wizard/pages/profiles_useful_new_tech_confs.php');
    $pages[] = new ProfilesWizardUsefulNewTechConfs();
67

68 69
    require_once('lib/wizard/pages/profiles_useful_admin_confs.php');
    $pages[] = new ProfilesWizardUsefulAdminConfs();
70

71 72
    require_once('lib/wizard/pages/profiles_demo_common_confs.php');
    $pages[] = new ProfilesWizardDemoCommonConfs();
73

74 75
	require_once('lib/wizard/pages/profiles_demo_interesting_use_cases.php');
	$pages[] = new ProfilesWizardDemoInterestingUseCases();
76

77 78 79
    require_once('lib/wizard/pages/profiles_demo_other_interesting_use_cases.php');
    $pages[] = new ProfilesWizardDemoOtherInterestingUseCases();

80 81
	require_once('lib/wizard/pages/profiles_demo_more_advanced_confs.php');
	$pages[] = new ProfilesWizardDemoMoreAdvancedConfs();
82

83 84 85 86
	require_once('lib/wizard/pages/profiles_demo_highly_specialized_confs.php');
	$pages[] = new ProfilesWizardHighlySpecializedConfs();

	require_once('lib/wizard/pages/profiles_completed.php');
87 88
	$pages[] = new AdminWizardProfilesCompleted();

89 90 91 92 93 94 95 96
} elseif ($useUpgradeWizard) {

	// Store the use Upgrade Wizard selection in the wizard bar
	$smarty->assign('useUpgradeWizard', $useUpgradeWizard);
	
	require_once('lib/wizard/pages/upgrade_ui.php');
	$pages[] = new UpgradeWizardUI();

97 98
	require_once('lib/wizard/pages/upgrade_novice_admin_assistance.php');
	$pages[] = new UpgradeWizardNoviceAdminAssistance();
99 100 101 102 103 104 105 106 107 108

	require_once('lib/wizard/pages/upgrade_trackers.php');
	$pages[] = new UpgradeWizardTrackers();

    require_once('lib/wizard/pages/upgrade_permissions_and_logs.php');
    $pages[] = new UpgradeWizardPermissionsAndLogs();

    require_once('lib/wizard/pages/upgrade_others.php');
    $pages[] = new UpgradeWizardOthers();

109 110 111
    require_once('lib/wizard/pages/upgrade_new_in_13.php');
    $pages[] = new UpgradeWizardNewIn13();

112 113 114
    require_once('lib/wizard/pages/upgrade_new_in_14.php');
    $pages[] = new UpgradeWizardNewIn14();

115 116 117
    require_once('lib/wizard/pages/upgrade_new_in_15.php');
    $pages[] = new UpgradeWizardNewIn15();

118 119 120
    require_once('lib/wizard/pages/upgrade_doc_page_iframe.php');
    $pages[] = new UpgradeWizardDocPageIframe();

121 122 123
    require_once('lib/wizard/pages/upgrade_send_feedback.php');
    $pages[] = new UpgradeWizardSendFeedback();

124 125 126
	require_once('lib/wizard/pages/upgrade_wizard_completed.php');
	$pages[] = new UpgradeWizardCompleted();

127
} else {
128
	
129
	require_once('lib/wizard/pages/admin_language.php');
130 131
	$pages[] = new AdminWizardLanguage();

132 133 134
    require_once('lib/wizard/pages/admin_date_time.php');
    $pages[] = new AdminWizardDateTime();

135 136 137
    require_once('lib/wizard/pages/admin_login.php');
	$pages[] = new AdminWizardLogin();

138
    require_once('lib/wizard/pages/admin_look_and_feel.php');
139
    $pages[] = new AdminWizardLookAndFeel();
140

141
    require_once('lib/wizard/pages/admin_editor_type.php');
142
	$pages[] = new AdminWizardEditorType();
143

144 145
	require_once('lib/wizard/pages/admin_wysiwyg.php'); 
	$pages[] = new AdminWizardWysiwyg();
146

147 148
	require_once('lib/wizard/pages/admin_text_area.php'); 
	$pages[] = new AdminWizardTextArea();
149

150 151
	require_once('lib/wizard/pages/admin_wiki.php'); 
	$pages[] = new AdminWizardWiki();
152

153 154
	require_once('lib/wizard/pages/admin_auto_toc.php'); 
	$pages[] = new AdminWizardAutoTOC();
155

156 157
	require_once('lib/wizard/pages/admin_category.php'); 
	$pages[] = new AdminWizardCategory();
158

159 160
	require_once('lib/wizard/pages/admin_structures.php'); 
	$pages[] = new AdminWizardStructures();
161

162 163
	require_once('lib/wizard/pages/admin_jcapture.php'); 
	$pages[] = new AdminWizardJCapture();
164

165 166
	require_once('lib/wizard/pages/admin_files.php'); 
	$pages[] = new AdminWizardFiles();
arildb's avatar
arildb committed
167

168 169
	require_once('lib/wizard/pages/admin_files_storage.php'); 
	$pages[] = new AdminWizardFileStorage();
170

171 172
	require_once('lib/wizard/pages/admin_features.php'); 
	$pages[] = new AdminWizardFeatures();
173

174 175 176 177
	require_once('lib/wizard/pages/admin_search.php');
	$pages[] = new AdminWizardSearch();

	require_once('lib/wizard/pages/admin_community.php');
178
	$pages[] = new AdminWizardCommunity();
179

180
	require_once('lib/wizard/pages/admin_advanced.php');
181
	$pages[] = new AdminWizardAdvanced();
182

183 184
	require_once('lib/wizard/pages/admin_namespace.php'); 
	$pages[] = new AdminWizardNamespace();
185 186 187 188

	require_once('lib/wizard/pages/admin_wizard_completed.php'); 
	$pages[] = new AdminWizardCompleted();
	
189 190
}

191 192 193 194 195
/////////////////////////////////////
// END Wizard page section
/////////////////////////////////////


196
// Step the wizard pages
197
$wizardlib = TikiLib::lib('wizard');
arildb's avatar
arildb committed
198 199

// Show pages
200 201
$wizardlib->showPages($pages, true);

arildb's avatar
arildb committed
202
// Set the display flag
arildb's avatar
arildb committed
203
$showOnLogin = $wizardlib->get_preference('wizard_admin_hide_on_login') !== 'y';
204
$smarty->assign('showOnLogin', $showOnLogin);
205

206

arildb's avatar
arildb committed
207
// Build the TOC
arildb's avatar
arildb committed
208
$toc = '<ul class="wizard_toc">';
arildb's avatar
arildb committed
209 210 211
$stepNr = 0;
$reqStepNr = $wizardlib->wizard_stepNr;
$homepageUrl = $_REQUEST['url'];
212 213 214 215 216
foreach ($pages as $page) {
	global $base_url;
	$cssClasses = '';

	// Start the admin wizard
arildb's avatar
arildb committed
217
	$url = $base_url.'tiki-wizard_admin.php?&amp;stepNr=' . $stepNr . '&amp;url=' . rawurlencode($homepageUrl);
218 219 220
	if ($useDefaultPrefs) {
		$url .= '&amp;use-default-prefs=1';
	}
221 222 223
	if ($useUpgradeWizard) {
		$url .= '&amp;use-upgrade-wizard=1';
	}
224
	$cnt = 	$stepNr+1;
225
	if ($stepNr == 1 && $useUpgradeWizard) {
226 227
		$toc .= '<ul><li>'. tra("New in Tiki 12 (LTS)") .'</li>';
	}
228 229 230
	if ($cnt <= 9) {
		$cnt = '&nbsp;&nbsp;'.$cnt;
	}
231 232 233 234 235
	if (preg_match('/ Tiki /',$page->pageTitle()) OR $stepNr == 0) {
		$toc .= '</ul><ul><li><a ';
	} else {
		$toc .= '<ul><li><a ';
	}
236
	$cssClasses .= 'adminWizardTOCItem ';
237 238 239 240 241 242 243 244 245 246 247
	if ($stepNr == $reqStepNr) {
		$cssClasses .= 'highlight ';
	}
	if (!$page->isVisible()) {
		$cssClasses .= 'disabledTOCSelection ';
	}
	$css = '';
	if (strlen($cssClasses) > 0) {
		$css = 'class="'.$cssClasses.'" ';
	}
	$toc .= $css;
248
	$toc .= 'href="'.$url.'">'.$page->pageTitle().'</a></li>';
249
	$toc .= '</ul>';
250
	$stepNr++;
arildb's avatar
arildb committed
251
}
arildb's avatar
arildb committed
252
$toc .= '</ul>';
253

254 255 256
if ($reqStepNr > 0) {
	$smarty->assign('wizard_toc', $toc);
}
arildb's avatar
arildb committed
257 258


259 260 261
// disallow robots to index page:
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');

262
$smarty->display('tiki-wizard_admin.tpl');