Fixup some more wrong static usages
[mediawiki.git] / includes / installer / WebInstaller.php
blobb18536c902dc097fe79c4e9a601745c9d0b1590c
1 <?php
3 /**
4 * Class for the core installer web interface.
5 *
6 * @since 1.17
7 */
8 class WebInstaller extends CoreInstaller {
10 /**
11 * @var WebInstallerOutput
13 public $output;
15 /**
16 * WebRequest object.
18 * @var WebRequest
20 public $request;
22 /**
23 * Cached session array.
25 * @var array
27 public $session;
29 /**
30 * Captured PHP error text. Temporary.
32 public $phpErrors;
34 /**
35 * The main sequence of page names. These will be displayed in turn.
36 * To add one:
37 * * Add it here
38 * * Add a config-page-<name> message
39 * * Add a WebInstaller_<name> class
41 public $pageSequence = array(
42 'Language',
43 'Welcome',
44 'DBConnect',
45 'Upgrade',
46 'DBSettings',
47 'Name',
48 'Options',
49 'Install',
50 'Complete',
53 /**
54 * Out of sequence pages, selectable by the user at any time.
56 public $otherPages = array(
57 'Restart',
58 'Readme',
59 'ReleaseNotes',
60 'Copying',
61 'UpgradeDoc', // Can't use Upgrade due to Upgrade step
64 /**
65 * Array of pages which have declared that they have been submitted, have validated
66 * their input, and need no further processing.
68 public $happyPages;
70 /**
71 * List of "skipped" pages. These are pages that will automatically continue
72 * to the next page on any GET request. To avoid breaking the "back" button,
73 * they need to be skipped during a back operation.
75 public $skippedPages;
77 /**
78 * Flag indicating that session data may have been lost.
80 public $showSessionWarning = false;
82 public $helpId = 0;
83 public $tabIndex = 1;
85 public $currentPageName;
87 /**
88 * Constructor.
90 * @param WebRequest $request
92 public function __construct( WebRequest $request ) {
93 parent::__construct();
94 $this->output = new WebInstallerOutput( $this );
95 $this->request = $request;
98 /**
99 * Main entry point.
101 * @param $session Array: initial session array
103 * @return Array: new session array
105 public function execute( array $session ) {
106 $this->session = $session;
108 if ( isset( $session['settings'] ) ) {
109 $this->settings = $session['settings'] + $this->settings;
112 $this->exportVars();
113 $this->setupLanguage();
115 if( $this->getVar( '_InstallDone' ) && $this->request->getVal( 'localsettings' ) )
117 $ls = new LocalSettingsGenerator( $this );
118 $this->request->response()->header('Content-type: text/plain');
120 $this->request->response()->header(
121 'Content-Disposition: attachment; filename="LocalSettings.php"'
124 echo $ls->getText();
125 return $this->session;
128 if ( isset( $session['happyPages'] ) ) {
129 $this->happyPages = $session['happyPages'];
130 } else {
131 $this->happyPages = array();
134 if ( isset( $session['skippedPages'] ) ) {
135 $this->skippedPages = $session['skippedPages'];
136 } else {
137 $this->skippedPages = array();
140 $lowestUnhappy = $this->getLowestUnhappy();
142 # Special case for Creative Commons partner chooser box.
143 if ( $this->request->getVal( 'SubmitCC' ) ) {
144 $page = $this->getPageByName( 'Options' );
145 $this->output->useShortHeader();
146 $page->submitCC();
147 return $this->finish();
150 if ( $this->request->getVal( 'ShowCC' ) ) {
151 $page = $this->getPageByName( 'Options' );
152 $this->output->useShortHeader();
153 $this->output->addHTML( $page->getCCDoneBox() );
154 return $this->finish();
157 # Get the page name.
158 $pageName = $this->request->getVal( 'page' );
160 if ( in_array( $pageName, $this->otherPages ) ) {
161 # Out of sequence
162 $pageId = false;
163 $page = $this->getPageByName( $pageName );
164 } else {
165 # Main sequence
166 if ( !$pageName || !in_array( $pageName, $this->pageSequence ) ) {
167 $pageId = $lowestUnhappy;
168 } else {
169 $pageId = array_search( $pageName, $this->pageSequence );
172 # If necessary, move back to the lowest-numbered unhappy page
173 if ( $pageId > $lowestUnhappy ) {
174 $pageId = $lowestUnhappy;
175 if ( $lowestUnhappy == 0 ) {
176 # Knocked back to start, possible loss of session data.
177 $this->showSessionWarning = true;
181 $pageName = $this->pageSequence[$pageId];
182 $page = $this->getPageByName( $pageName );
185 # If a back button was submitted, go back without submitting the form data.
186 if ( $this->request->wasPosted() && $this->request->getBool( 'submit-back' ) ) {
187 if ( $this->request->getVal( 'lastPage' ) ) {
188 $nextPage = $this->request->getVal( 'lastPage' );
189 } elseif ( $pageId !== false ) {
190 # Main sequence page
191 # Skip the skipped pages
192 $nextPageId = $pageId;
194 do {
195 $nextPageId--;
196 $nextPage = $this->pageSequence[$nextPageId];
197 } while( isset( $this->skippedPages[$nextPage] ) );
198 } else {
199 $nextPage = $this->pageSequence[$lowestUnhappy];
202 $this->output->redirect( $this->getUrl( array( 'page' => $nextPage ) ) );
203 return $this->finish();
206 # Execute the page.
207 $this->currentPageName = $page->getName();
208 $this->startPageWrapper( $pageName );
209 $localSettings = $this->getLocalSettingsStatus();
211 if( !$localSettings->isGood() ) {
212 $this->showStatusBox( $localSettings );
213 $result = 'output';
214 } else {
215 $result = $page->execute();
218 $this->endPageWrapper();
220 if ( $result == 'skip' ) {
221 # Page skipped without explicit submission.
222 # Skip it when we click "back" so that we don't just go forward again.
223 $this->skippedPages[$pageName] = true;
224 $result = 'continue';
225 } else {
226 unset( $this->skippedPages[$pageName] );
229 # If it was posted, the page can request a continue to the next page.
230 if ( $result === 'continue' && !$this->output->headerDone() ) {
231 if ( $pageId !== false ) {
232 $this->happyPages[$pageId] = true;
235 $lowestUnhappy = $this->getLowestUnhappy();
237 if ( $this->request->getVal( 'lastPage' ) ) {
238 $nextPage = $this->request->getVal( 'lastPage' );
239 } elseif ( $pageId !== false ) {
240 $nextPage = $this->pageSequence[$pageId + 1];
241 } else {
242 $nextPage = $this->pageSequence[$lowestUnhappy];
245 if ( array_search( $nextPage, $this->pageSequence ) > $lowestUnhappy ) {
246 $nextPage = $this->pageSequence[$lowestUnhappy];
249 $this->output->redirect( $this->getUrl( array( 'page' => $nextPage ) ) );
252 return $this->finish();
255 public function getLowestUnhappy() {
256 if ( count( $this->happyPages ) == 0 ) {
257 return 0;
258 } else {
259 return max( array_keys( $this->happyPages ) ) + 1;
264 * Start the PHP session. This may be called before execute() to start the PHP session.
266 public function startSession() {
267 $sessPath = $this->getSessionSavePath();
269 if( $sessPath != '' ) {
270 if( strval( ini_get( 'open_basedir' ) ) != '' ) {
271 // we need to skip the following check when open_basedir is on.
272 // The session path probably *wont* be writable by the current
273 // user, and telling them to change it is bad. Bug 23021.
274 } elseif( !is_dir( $sessPath ) || !is_writeable( $sessPath ) ) {
275 $this->showError( 'config-session-path-bad', $sessPath );
276 return false;
278 } else {
279 // If the path is unset it'll default to some system bit, which *probably* is ok...
280 // not sure how to actually get what will be used.
283 if( wfIniGetBool( 'session.auto_start' ) || session_id() ) {
284 // Done already
285 return true;
288 $this->phpErrors = array();
289 set_error_handler( array( $this, 'errorHandler' ) );
290 session_start();
291 restore_error_handler();
293 if ( $this->phpErrors ) {
294 $this->showError( 'config-session-error', $this->phpErrors[0] );
295 return false;
298 return true;
302 * Get the value of session.save_path
304 * Per http://www.php.net/manual/en/session.configuration.php#ini.session.save-path,
305 * this might have some additional preceding parts which need to be
306 * ditched
308 * @return String
310 private function getSessionSavePath() {
311 $path = ini_get( 'session.save_path' );
312 $path = ltrim( substr( $path, strrpos( $path, ';' ) ), ';');
314 return $path;
318 * Show an error message in a box. Parameters are like wfMsg().
320 public function showError( $msg /*...*/ ) {
321 $args = func_get_args();
322 array_shift( $args );
323 $args = array_map( 'htmlspecialchars', $args );
324 $msg = wfMsgReal( $msg, $args, false, false, false );
325 $this->output->addHTML( $this->getErrorBox( $msg ) );
329 * Temporary error handler for session start debugging.
331 public function errorHandler( $errno, $errstr ) {
332 $this->phpErrors[] = $errstr;
336 * Clean up from execute()
338 * @return array
340 public function finish() {
341 $this->output->output();
343 $this->session['happyPages'] = $this->happyPages;
344 $this->session['skippedPages'] = $this->skippedPages;
345 $this->session['settings'] = $this->settings;
347 return $this->session;
351 * Get a URL for submission back to the same script.
353 * @param $query: Array
355 public function getUrl( $query = array() ) {
356 $url = $this->request->getRequestURL();
357 # Remove existing query
358 $url = preg_replace( '/\?.*$/', '', $url );
360 if ( $query ) {
361 $url .= '?' . wfArrayToCGI( $query );
364 return $url;
368 * Get a WebInstallerPage from the main sequence, by ID.
370 * @param $id Integer
372 * @return WebInstallerPage
374 public function getPageById( $id ) {
375 return $this->getPageByName( $this->pageSequence[$id] );
379 * Get a WebInstallerPage by name.
381 * @param $pageName String
383 * @return WebInstallerPage
385 public function getPageByName( $pageName ) {
386 // Totally lame way to force autoload of WebInstallerPage.php
387 class_exists( 'WebInstallerPage' );
389 $pageClass = 'WebInstaller_' . $pageName;
391 return new $pageClass( $this );
395 * Get a session variable.
397 * @param $name String
398 * @param $default
400 public function getSession( $name, $default = null ) {
401 if ( !isset( $this->session[$name] ) ) {
402 return $default;
403 } else {
404 return $this->session[$name];
409 * Set a session variable.
411 public function setSession( $name, $value ) {
412 $this->session[$name] = $value;
416 * Get the next tabindex attribute value.
418 public function nextTabIndex() {
419 return $this->tabIndex++;
423 * Initializes language-related variables.
425 public function setupLanguage() {
426 global $wgLang, $wgContLang, $wgLanguageCode;
428 if ( $this->getSession( 'test' ) === null && !$this->request->wasPosted() ) {
429 $wgLanguageCode = $this->getAcceptLanguage();
430 $wgLang = $wgContLang = Language::factory( $wgLanguageCode );
431 $this->setVar( 'wgLanguageCode', $wgLanguageCode );
432 $this->setVar( '_UserLang', $wgLanguageCode );
433 } else {
434 $wgLanguageCode = $this->getVar( 'wgLanguageCode' );
435 $wgLang = Language::factory( $this->getVar( '_UserLang' ) );
436 $wgContLang = Language::factory( $wgLanguageCode );
441 * Retrieves MediaWiki language from Accept-Language HTTP header.
443 * @return string
445 public function getAcceptLanguage() {
446 global $wgLanguageCode;
448 $mwLanguages = Language::getLanguageNames();
449 $langs = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
451 foreach ( explode( ';', $langs ) as $splitted ) {
452 foreach ( explode( ',', $splitted ) as $lang ) {
453 $lang = trim( strtolower( $lang ) );
455 if ( $lang == '' || $lang[0] == 'q' ) {
456 continue;
459 if ( isset( $mwLanguages[$lang] ) ) {
460 return $lang;
463 $lang = preg_replace( '/^(.*?)(?=-[^-]*)$/', '\\1', $lang );
465 if ( $lang != '' && isset( $mwLanguages[$lang] ) ) {
466 return $lang;
471 return $wgLanguageCode;
475 * Called by execute() before page output starts, to show a page list.
477 * @param $currentPageName String
479 public function startPageWrapper( $currentPageName ) {
480 $s = "<div class=\"config-page-wrapper\">\n" .
481 "<div class=\"config-page-list\"><ul>\n";
482 $lastHappy = -1;
484 foreach ( $this->pageSequence as $id => $pageName ) {
485 $happy = !empty( $this->happyPages[$id] );
486 $s .= $this->getPageListItem(
487 $pageName,
488 $happy || $lastHappy == $id - 1,
489 $currentPageName
492 if ( $happy ) {
493 $lastHappy = $id;
497 $s .= "</ul><br/><ul>\n";
499 foreach ( $this->otherPages as $pageName ) {
500 $s .= $this->getPageListItem( $pageName, true, $currentPageName );
503 $s .= "</ul></div>\n". // end list pane
504 "<div class=\"config-page\">\n" .
505 Xml::element( 'h2', array(),
506 wfMsg( 'config-page-' . strtolower( $currentPageName ) ) );
508 $this->output->addHTMLNoFlush( $s );
512 * Get a list item for the page list.
514 * @param $pageName String
515 * @param $enabled Boolean
516 * @param $currentPageName String
518 * @return string
520 public function getPageListItem( $pageName, $enabled, $currentPageName ) {
521 $s = "<li class=\"config-page-list-item\">";
522 $name = wfMsg( 'config-page-' . strtolower( $pageName ) );
524 if ( $enabled ) {
525 $query = array( 'page' => $pageName );
527 if ( !in_array( $pageName, $this->pageSequence ) ) {
528 if ( in_array( $currentPageName, $this->pageSequence ) ) {
529 $query['lastPage'] = $currentPageName;
532 $link = Xml::element( 'a',
533 array(
534 'href' => $this->getUrl( $query )
536 $name
538 } else {
539 $link = htmlspecialchars( $name );
542 if ( $pageName == $currentPageName ) {
543 $s .= "<span class=\"config-page-current\">$link</span>";
544 } else {
545 $s .= $link;
547 } else {
548 $s .= Xml::element( 'span',
549 array(
550 'class' => 'config-page-disabled'
552 $name
556 $s .= "</li>\n";
558 return $s;
562 * Output some stuff after a page is finished.
564 public function endPageWrapper() {
565 $this->output->addHTMLNoFlush(
566 "</div>\n" .
567 "<br style=\"clear:both\"/>\n" .
568 "</div>" );
572 * Get HTML for an error box with an icon.
574 * @param $text String: wikitext, get this with wfMsgNoTrans()
576 public function getErrorBox( $text ) {
577 return $this->getInfoBox( $text, 'critical-32.png', 'config-error-box' );
581 * Get HTML for a warning box with an icon.
583 * @param $text String: wikitext, get this with wfMsgNoTrans()
585 public function getWarningBox( $text ) {
586 return $this->getInfoBox( $text, 'warning-32.png', 'config-warning-box' );
590 * Get HTML for an info box with an icon.
592 * @param $text String: wikitext, get this with wfMsgNoTrans()
593 * @param $icon String: icon name, file in skins/common/images
594 * @param $class String: additional class name to add to the wrapper div
596 public function getInfoBox( $text, $icon = 'info-32.png', $class = false ) {
597 $s =
598 "<div class=\"config-info $class\">\n" .
599 "<div class=\"config-info-left\">\n" .
600 Xml::element( 'img',
601 array(
602 'src' => '../skins/common/images/' . $icon,
603 'alt' => wfMsg( 'config-information' ),
605 ) . "\n" .
606 "</div>\n" .
607 "<div class=\"config-info-right\">\n" .
608 $this->parse( $text ) . "\n" .
609 "</div>\n" .
610 "<div style=\"clear: left;\"></div>\n" .
611 "</div>\n";
612 return $s;
616 * Get small text indented help for a preceding form field.
617 * Parameters like wfMsg().
619 public function getHelpBox( $msg /*, ... */ ) {
620 $args = func_get_args();
621 array_shift( $args );
622 $args = array_map( 'htmlspecialchars', $args );
624 $text = wfMsgReal( $msg, $args, false, false, false );
625 $html = $this->parse( $text, true );
626 $id = $this->helpId++;
627 $alt = wfMsg( 'help' );
629 return
630 "<div class=\"config-help-wrapper\">\n" .
631 "<div class=\"config-help-message\">\n" .
632 $html .
633 "</div>\n" .
634 "<div class=\"config-show-help\">\n" .
635 "<a href=\"#\">" .
636 wfMsgHtml( 'config-show-help' ) .
637 "</a></div>\n" .
638 "<div class=\"config-hide-help\">\n" .
639 "<a href=\"#\">" .
640 wfMsgHtml( 'config-hide-help' ) .
641 "</a></div>\n</div>\n";
645 * Output a help box.
647 public function showHelpBox( $msg /*, ... */ ) {
648 $args = func_get_args();
649 $html = call_user_func_array( array( $this, 'getHelpBox' ), $args );
650 $this->output->addHTML( $html );
654 * Show a short informational message.
655 * Output looks like a list.
657 public function showMessage( $msg /*, ... */ ) {
658 $args = func_get_args();
659 array_shift( $args );
660 $html = '<div class="config-message">' .
661 $this->parse( wfMsgReal( $msg, $args, false, false, false ) ) .
662 "</div>\n";
663 $this->output->addHTML( $html );
667 * Label a control by wrapping a config-input div around it and putting a
668 * label before it.
670 public function label( $msg, $forId, $contents ) {
671 if ( strval( $msg ) == '' ) {
672 $labelText = '&#160;';
673 } else {
674 $labelText = wfMsgHtml( $msg );
677 $attributes = array( 'class' => 'config-label' );
679 if ( $forId ) {
680 $attributes['for'] = $forId;
683 return
684 "<div class=\"config-input\">\n" .
685 Xml::tags( 'label',
686 $attributes,
687 $labelText ) . "\n" .
688 $contents .
689 "</div>\n";
693 * Get a labelled text box to configure a variable.
695 * @param $params Array
696 * Parameters are:
697 * var: The variable to be configured (required)
698 * label: The message name for the label (required)
699 * attribs: Additional attributes for the input element (optional)
700 * controlName: The name for the input element (optional)
701 * value: The current value of the variable (optional)
703 public function getTextBox( $params ) {
704 if ( !isset( $params['controlName'] ) ) {
705 $params['controlName'] = 'config_' . $params['var'];
708 if ( !isset( $params['value'] ) ) {
709 $params['value'] = $this->getVar( $params['var'] );
712 if ( !isset( $params['attribs'] ) ) {
713 $params['attribs'] = array();
716 return
717 $this->label(
718 $params['label'],
719 $params['controlName'],
720 Xml::input(
721 $params['controlName'],
722 30, // intended to be overridden by CSS
723 $params['value'],
724 $params['attribs'] + array(
725 'id' => $params['controlName'],
726 'class' => 'config-input-text',
727 'tabindex' => $this->nextTabIndex()
734 * Get a labelled password box to configure a variable.
736 * Implements password hiding
737 * @param $params Array
738 * Parameters are:
739 * var: The variable to be configured (required)
740 * label: The message name for the label (required)
741 * attribs: Additional attributes for the input element (optional)
742 * controlName: The name for the input element (optional)
743 * value: The current value of the variable (optional)
745 public function getPasswordBox( $params ) {
746 if ( !isset( $params['value'] ) ) {
747 $params['value'] = $this->getVar( $params['var'] );
750 if ( !isset( $params['attribs'] ) ) {
751 $params['attribs'] = array();
754 $params['value'] = $this->getFakePassword( $params['value'] );
755 $params['attribs']['type'] = 'password';
757 return $this->getTextBox( $params );
761 * Get a labelled checkbox to configure a boolean variable.
763 * @param $params Array
764 * Parameters are:
765 * var: The variable to be configured (required)
766 * label: The message name for the label (required)
767 * attribs: Additional attributes for the input element (optional)
768 * controlName: The name for the input element (optional)
769 * value: The current value of the variable (optional)
771 public function getCheckBox( $params ) {
772 if ( !isset( $params['controlName'] ) ) {
773 $params['controlName'] = 'config_' . $params['var'];
776 if ( !isset( $params['value'] ) ) {
777 $params['value'] = $this->getVar( $params['var'] );
780 if ( !isset( $params['attribs'] ) ) {
781 $params['attribs'] = array();
784 if( isset( $params['rawtext'] ) ) {
785 $labelText = $params['rawtext'];
786 } else {
787 $labelText = $this->parse( wfMsg( $params['label'] ) );
790 return
791 "<div class=\"config-input-check\">\n" .
792 "<label>\n" .
793 Xml::check(
794 $params['controlName'],
795 $params['value'],
796 $params['attribs'] + array(
797 'id' => $params['controlName'],
798 'class' => 'config-input-text',
799 'tabindex' => $this->nextTabIndex(),
802 $labelText . "\n" .
803 "</label>\n" .
804 "</div>\n";
808 * Get a set of labelled radio buttons.
810 * @param $params Array
811 * Parameters are:
812 * var: The variable to be configured (required)
813 * label: The message name for the label (required)
814 * itemLabelPrefix: The message name prefix for the item labels (required)
815 * values: List of allowed values (required)
816 * itemAttribs Array of attribute arrays, outer key is the value name (optional)
817 * commonAttribs Attribute array applied to all items
818 * controlName: The name for the input element (optional)
819 * value: The current value of the variable (optional)
821 public function getRadioSet( $params ) {
822 if ( !isset( $params['controlName'] ) ) {
823 $params['controlName'] = 'config_' . $params['var'];
826 if ( !isset( $params['value'] ) ) {
827 $params['value'] = $this->getVar( $params['var'] );
830 if ( !isset( $params['label'] ) ) {
831 $label = '';
832 } else {
833 $label = $this->parse( wfMsgNoTrans( $params['label'] ) );
836 $s = "<label class=\"config-label\">\n" .
837 $label .
838 "</label>\n" .
839 "<ul class=\"config-settings-block\">\n";
840 foreach ( $params['values'] as $value ) {
841 $itemAttribs = array();
843 if ( isset( $params['commonAttribs'] ) ) {
844 $itemAttribs = $params['commonAttribs'];
847 if ( isset( $params['itemAttribs'][$value] ) ) {
848 $itemAttribs = $params['itemAttribs'][$value] + $itemAttribs;
851 $checked = $value == $params['value'];
852 $id = $params['controlName'] . '_' . $value;
853 $itemAttribs['id'] = $id;
854 $itemAttribs['tabindex'] = $this->nextTabIndex();
856 $s .=
857 '<li>' .
858 Xml::radio( $params['controlName'], $value, $checked, $itemAttribs ) .
859 '&#160;' .
860 Xml::tags( 'label', array( 'for' => $id ), $this->parse(
861 wfMsgNoTrans( $params['itemLabelPrefix'] . strtolower( $value ) )
862 ) ) .
863 "</li>\n";
866 $s .= "</ul>\n";
867 return $s;
871 * Output an error or warning box using a Status object.
873 public function showStatusBox( $status ) {
874 if( !$status->isGood() ) {
875 $text = $status->getWikiText();
877 if( $status->isOk() ) {
878 $box = $this->getWarningBox( $text );
879 } else {
880 $box = $this->getErrorBox( $text );
883 $this->output->addHTML( $box );
887 public function showStatusMessage( $status ) {
888 $text = $status->getWikiText();
889 $this->output->addWikiText(
890 "<div class=\"config-message\">\n" .
891 $text .
892 "</div>"
897 * Convenience function to set variables based on form data.
898 * Assumes that variables containing "password" in the name are (potentially
899 * fake) passwords.
901 * @param $varNames Array
902 * @param $prefix String: the prefix added to variables to obtain form names
904 public function setVarsFromRequest( $varNames, $prefix = 'config_' ) {
905 $newValues = array();
907 foreach ( $varNames as $name ) {
908 $value = trim( $this->request->getVal( $prefix . $name ) );
909 $newValues[$name] = $value;
911 if ( $value === null ) {
912 // Checkbox?
913 $this->setVar( $name, false );
914 } else {
915 if ( stripos( $name, 'password' ) !== false ) {
916 $this->setPassword( $name, $value );
917 } else {
918 $this->setVar( $name, $value );
923 return $newValues;
927 * Get the starting tags of a fieldset.
929 * @param $legend String: message name
931 public function getFieldsetStart( $legend ) {
932 return "\n<fieldset><legend>" . wfMsgHtml( $legend ) . "</legend>\n";
936 * Get the end tag of a fieldset.
938 public function getFieldsetEnd() {
939 return "</fieldset>\n";
943 * Helper for Installer::docLink()
945 public function getDocUrl( $page ) {
946 $url = "{$_SERVER['PHP_SELF']}?page=" . urlencode( $page );
948 if ( in_array( $this->currentPageName, $this->pageSequence ) ) {
949 $url .= '&lastPage=' . urlencode( $this->currentPageName );
952 return $url;