tiki-wizard_user.php 3.66 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 11 12
// 
// 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$

require 'tiki-setup.php';

13 14 15 16 17 18 19 20
// User preferences screen
if ($prefs['feature_wizard_user'] != 'y') {
	$smarty->assign('msg', tra("This feature is disabled") . ": feature_wizard_user");
	$smarty->display("error.tpl");
	die;
}
$access->check_user($user);

21
$headerlib = TikiLib::lib('header');
chibaguy's avatar
chibaguy committed
22
$headerlib->add_cssfile('themes/base_files/feature_css/wizards.css');
23 24 25

// Hide the display of the preference dependencies in the wizard
$headerlib->add_css('.pref_dependency{display:none !important;}');
26 27
$headerlib->add_css('.pagetitle {display: none;}');
					
28 29 30 31 32 33
$accesslib = TikiLib::lib('access');
$accesslib->check_user($user);

// Create the template instances
$pages = array();

34
/// fetch the itemId for the user tracker ------------------------------------
35 36 37
global $user, $prefs;
$userlib = TikiLib::lib('user');
$tikilib = TikiLib::lib('tiki');
38 39 40 41 42 43 44 45 46 47 48 49 50
if ($prefs['userTracker'] === 'y') {
	
	$trklib = TikiLib::lib('trk');
	
	$utid = $userlib->get_tracker_usergroup($user);

			if (isset($utid['usersTrackerId'])) {
				$_REQUEST['trackerId'] = $utid['usersTrackerId'];
				$_REQUEST["itemId"] = $trklib->get_item_id($_REQUEST['trackerId'], $utid['usersFieldId'], $user);
			}
}
/// --------------------------------

51
/////////////////////////////////////
52
// BEGIN User Wizard page section
53 54
/////////////////////////////////////

55 56
require_once('lib/wizard/pages/user_wizard.php'); 
$pages[] = new UserWizard();
57

58 59
require_once('lib/wizard/pages/user_preferences_info.php'); 
$pages[] = new UserWizardPreferencesInfo();
60

61 62 63 64 65 66 67 68
require_once('lib/wizard/pages/user_preferences_params.php'); 
$pages[] = new UserWizardPreferencesParams();

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

require_once('lib/wizard/pages/user_preferences_notifications.php'); 
$pages[] = new UserWizardPreferencesNotifications();
69

70 71 72
require_once('lib/wizard/pages/user_tracker.php'); 
$pages[] = new UserWizardUserTracker();

73 74 75
require_once('lib/wizard/pages/user_wizard_completed.php'); 
$pages[] = new UserWizardCompleted();

76
/////////////////////////////////////
77
// END User Wizard page section
78 79 80 81 82
/////////////////////////////////////


// Step the wizard pages
$wizardlib = TikiLib::lib('wizard');
83 84 85
$wizardlib->showPages($pages, true);

// Build the TOC
arildb's avatar
arildb committed
86
$toc = '<ul class="wizard_toc">';
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
$stepNr = 0;
$reqStepNr = $wizardlib->wizard_stepNr;
$homepageUrl = $_REQUEST['url'];
foreach ($pages as $page) {
	global $base_url;
	$cssClasses = '';

	// Start the user wizard
	$url = $base_url.'tiki-wizard_user.php?&amp;stepNr=' . $stepNr . '&amp;url=' . rawurlencode($homepageUrl);

	$cnt = 	$stepNr+1;
	if ($cnt <= 9) {
		$cnt = '&nbsp;&nbsp;'.$cnt;
	}
	$toc .= '<li><a ';
	$cssClasses .= 'adminWizardTOCItem ';
	if ($stepNr == $reqStepNr) {
		$cssClasses .= 'highlight ';
	}
	if (!$page->isVisible()) {
		$cssClasses .= 'disabledTOCSelection ';
	}
	$css = '';
	if (strlen($cssClasses) > 0) {
		$css = 'class="'.$cssClasses.'" ';
	}
	$toc .= $css;
	$toc .= 'href="'.$url.'">'.$page->pageTitle().'</a></li>';
	$stepNr++;
}
arildb's avatar
arildb committed
117
$toc .= '</ul>';
118 119 120 121 122 123 124 125 126 127 128 129
	// Hide the left and right sidebars when the admin wizard is run
	$headerlib = TikiLib::lib('header');
	$headerlib->add_js(
<<<JS
	hideCol('col2','left', 'col1');
	hideCol('col3','right', 'col1');
JS
);

if ($reqStepNr > 0) {
	$smarty->assign('wizard_toc', $toc);
}
130 131 132 133

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

134
$smarty->display('tiki-wizard_user.tpl');