-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathImpExDisplay.php
878 lines (759 loc) · 23.9 KB
/
ImpExDisplay.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
<?php
/*======================================================================*\
|| ####################################################################
|| # vBulletin Impex
|| # ----------------------------------------------------------------
|| # All PHP code in this file is Copyright 2000-2014 vBulletin Solutions Inc.
|| # This code is made available under the Modified BSD License -- see license.txt
|| # http://www.vbulletin.com
|| ####################################################################
\*======================================================================*/
/**
* The Display object
*
* Currently HTML, just ;)
*
*
*
* @package ImpEx
*
*/
if (!class_exists('ImpExFunction')) { die('Direct class access violation'); }
class ImpExDisplay extends ImpExFunction
{
/**
* Class version
*
* This will allow the checking for interoprability of class version in diffrent
* versions of ImpEx
*
* @var string
*/
var $_version = '0.0.1';
var $_build_version = '1.104';
var $_target_versions = array (
'forum' => array(
'400' => 'vBulletin 4.0.* - 4.1.*',
'360' => 'vBulletin 3.7.* & 3.8.*',
'350' => 'vBulletin 3.5.*',
'309' => 'vBulletin 3.0.*'
),
'blog' => array(
'blog10' => 'vBulletin Blog 1.0.*',
'blog40' => 'vBulletin Blog 4.0.* - 4.1.*'
),
'cms' => array(
'cms10' => 'vBulletin Suite CMS 4.0.* - 4.1.*'
),
);
/**
* Store for display HTML
*
* Hold all the HTML during the life of the object till display is called
*
* @var string
*/
var $_screenstring ='';
/**
* Internal flags for the display functions
*
* Various state flags for the display
*
*
* @var string
*/
var $_screenbasic = array(
'title' => 'Import / Export',
'pageHTML' => '',
'showwarning' => 'TRUE',
'warning' => '',
'system' => 'NONE',
'choosesystem' => 'FALSE',
'displaylinks' => 'TRUE',
'autosubmit' => '0',
'donehead' => 'FALSE',
'displaymodules' => 'TRUE'
);
function ImpExDisplay()
{
}
/**
* Retrives the values needed to define a ImpExData object
*
* @param string mixed An accessor that appends a string (HTML) onto the pageHTML
*
* @return boolean
*/
function update_html($html)
{
$this->_screenbasic['pageHTML'] .= $html;
return TRUE;
}
/**
* Retrives the values needed to define a ImpExData object
*
* @param string mixed The name of the basic value or flag to update
* @param string mixed The value to update it with
*
* @return boolean
*/
function update_basic($name, $status)
{
if (empty($status) OR $this->_screenbasic["$name"] == NULL)
{
return FALSE;
}
else
{
$this->_screenbasic["$name"] = $status;
return TRUE;
}
}
/**
* HTML Page code - table text input
*
* @param string mixed Input title
* @param string mixed HTML element name
* @param string mixed The default value
* @param string mixed Calls htmlspecialchars on the value
* @param string mixed The size of the input
*
* @return string mixed The formed HTML
*/
function make_input_code($title, $name, $value = '', $htmlise = 1, $size = 35)
{
if ($htmlise)
{
$value = htmlspecialchars($value);
}
return "
<tr class=\"" . $this->get_row_bg() . "\" valign=\"top\">
<td>$title</td>
<td><input type=\"text\" size=\"$size\" name=\"$name\" value=\"$value\" /></td>
</tr>";
}
function make_select_input_code($title, $name, $select_array)
{
return "
<tr class=\"" . $this->get_row_bg() . "\" valign=\"top\">
<td>$title</td>
<td>" . $this->make_select($select_array, $name) . "</td>
</tr>";
}
/**
* HTML Page code - table header
*
* @param string mixed Table title
* @param string mixed HTML anchor name
* @param string mixed Calls htmlspecialchars on the value
* @param string mixed The collum span width
*
* @return string mixed The formed HTML
*/
function make_table_header($title, $htmlise = 1, $colspan = 2)
{
return "
<tr class=\"thead\">
<td colspan=\"$colspan\">" . $this->iif($htmlise, htmlspecialchars($title), $title) . "</td>
</tr>";
}
/**
* Just doing the alt for table rows
*
*/
function get_row_bg()
{
if (($bgcounter++ % 2) == 0)
{
return 'alt1';
}
else
{
return 'alt2';
}
}
/**
* HTML Page code - form header
*
* @param string mixed The target of the form
* @param string mixed The action value
* @param int 0|1 whether to use = ENCTYPE=multipart/form-data
* @param int 0|1 whether to add the beginings of a table after the <form tag
*
* @return string mixed The formed HTML
*/
function do_form_header($phpscript, $action, $uploadform = 0, $addtable = 1, $name = 'name')
{
$return_string ='';
$return_string = "\n<form action=\"$phpscript.php\" " . $this->iif($uploadform, "ENCTYPE=\"multipart/form-data\" ", '') . " name=\"$name\" method=\"post\">";
if ($addtable == 1)
{
$return_string .= "\n<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" align=\"center\" width=\"90%\" class=\"tblborder\">";
}
return $return_string;
}
/**
* HTML Page code - form footer
*
* @param string mixed The submit name
* @param string mixed The reset name
* @param int mixed The collum span width
* @param string mixed Text for the back button ( onclick="history.back(1)" )
*
* @return string mixed The formed HTML
*/
function do_form_footer($submitname = 'Submit', $resetname = 'Reset', $colspan = 2, $goback = '')
{
$tableadded = 1;
$return_string = '';
$return_string = $this->iif($tableadded == 1, "\n\t<tr id='submitrow'>\n\t<td colspan='$colspan' align='center'>", "<p><center>");
$return_string .= "\n\t<p id='submitrow'>\n\t<input type=\"submit\" value=\" $submitname \" accesskey=\"s\" />";
if ($resetname != '')
{
$return_string .= "\n\t<input type=\"reset\" value=\" $resetname \" />\n";
}
if ($goback != '')
{
$return_string .= "\n\t<input type=\"button\" value=\" $goback \" onclick=\"history.back(1)\" />\n";
}
$return_string .= $this->iif($tableadded == 1, "</p></td>\n</tr>\n</table>\n</td>\n</tr>\n</table>\n", "</p></center>\n");
$return_string .= "\n</form>";
return $return_string;
}
/**
* HTML Page code - form footer
*
* @param string mixed The submit name
* @param string mixed The reset name
* @param int mixed The collum span width
* @param string mixed Text for the back button ( onclick="history.back(1)" )
*
* @return string mixed The formed HTML
*/
function make_description($text, $htmlise = 0)
{
$return_string = "<tr class='" . $this->get_row_bg() . "' valign='top'><td colspan='2'>" . $this->iif($htmlise == 0, $text, htmlspecialchars($text)) . "</td></tr>\n";
return $return_string;
}
/**
* HTML Page code - form footer
*
* @param string mixed The hidden value name
* @param string mixed The value
* @param int 1|0 htmlspecialchars($value)
*
* @return string mixed The formed HTML
*/
function make_hidden_code($name, $value = '', $htmlise = 1)
{
if ($htmlise)
{
$value = htmlspecialchars($value);
}
$return_string = "\n<input type=\"hidden\" name=\"$name\" value=\"$value\" />";
return $return_string;
}
/**
* HTML Page code - yes no
*
* @param string mixed The title of the radio group
* @param string mixed The name of the value
* @param int 1|0 The inital setting of the yes / no
*
* @return string mixed The formed HTML
*/
function make_yesno_code($title, $name, $value = 1)
{
// Makes code for input buttons yes\no similar to make_input_code
$string =
"<tr class='" . $this->get_row_bg() . "' valign='top'>" .
"<td><p>$title</p></td>\n<td><p>Yes<input type='radio' name='$name' value='1' " .
$this->iif($value == 1 OR ($name == 'pmpopup' AND $value == 2), 'checked="checked"', '') . " /> No <input type='radio' name='$name' value='0' " .
$this->iif($value == 0, 'checked="checked"', '') . ' />' .
$this->iif($value == 2 AND $name == 'customtitle', " User Set (no html)<input type='radio' name='$name' value='2' checked=\"checked\" />", '') .
"</p></td>\n</tr>";
return $string;
}
/**
* HTML Page code - displays table with the states of the current modules and buttons depending on
* the state of the object (not run, running, run). If a object is running no like code is generated
*
* @param object sessionobject The current session object
*
* @return string mixed The formed HTML
*/
function display_modules(&$sessionobject)
{
$string = '<table class="tborder" cellpadding="6" cellspacing="0" border="0" align="center" width="90%">';
$_done_objects = 0;
$_failed_objects = 0;
$_time_taken = 0;
if ($this->_screenbasic['displaylinks'] == 'TRUE')
{
$string .= "
<tr>
<td class=\"tcat\" colspan=\"6\" align=\"center\"><strong>" . $this->phrases['title'] . " :: " . $sessionobject->_session_vars['system'] . "</strong></td>
</tr>
<tr align=\"center\">
<td class=\"thead\" colspan=\"2\" align=\"left\">" . $this->phrases['module'] . "</td>
<td class=\"thead\">" . $this->phrases['action'] . "</td>
<td class=\"thead\">" . $this->phrases['successful'] . "</td>
<td class=\"thead\">" . $this->phrases['failed'] . "</td>
<td class=\"thead\" align=\"right\">" . $this->phrases['timetaken'] . "</td>
</tr>";
}
// -1 at the moment to take care of the 000.php module
$num_modules = $sessionobject->get_number_of_modules();
for ($i = 1; $i <= $num_modules - 3; $i++)
{
// TODO: The clean up modules, loaded in index
# // Look for the final two
# if ($i == $num_modules -2)
# {
# $position = '901';
# }
# elseif ($i == $num_modules -1)
# {
# $position = '910';
# }
# else
# {
$position = str_pad($i, 3, '0', STR_PAD_LEFT);
# }
$taken = 0;
if ($this->_screenbasic['displaylinks'] == 'TRUE')
{
if (intval($sessionobject->return_stats($position, '_time_taken')) > 60)
{
$taken = intval($sessionobject->return_stats($position, '_time_taken') / 60) . ' min(s)';
}
else
{
$taken = intval($sessionobject->return_stats($position, '_time_taken')) . ' sec(s)';
}
$string .= "
<tr align=\"center\">
<td class=\"alt2\" align=\"left\">$position</td>
<td class=\"alt1\" align=\"left\">" . $sessionobject->get_module_string($position) . "</td>
<td class=\"alt2\">
<form action=\"index.php\" method=\"post\" style=\"display:inline\">
<input type=\"hidden\" name=\"module\" value=\"$position\" />
<input type=\"submit\" value=\"" . $this->iif(($sessionobject->get_session_var($position) == 'FINISHED'), $this->phrases['redo'], $this->phrases['start_module']) . "\" />
</form>
</td>
<td class=\"alt1\">" . $sessionobject->return_stats($position, '_objects_done') . "</td>
<td class=\"alt2\">" . $sessionobject->return_stats($position, '_objects_failed') . "</td>
<td class=\"alt1\" align=\"right\">$taken</td>
</tr>";
$_time_taken += intval($sessionobject->return_stats($position, '_time_taken'));
$_done_objects += intval($sessionobject->return_stats($position, '_objects_done'));
$_failed_objects += intval($sessionobject->return_stats($position, '_objects_failed'));
}
else
{
$string .= "
<tr>
<td><b>$position</b> " . $sessionobject->get_module_string($position) . "</td>
<td>" . $this->_modules["$position"] . "</td>
</tr>";
}
}
if ($this->_screenbasic['displaylinks'] == 'TRUE')
{
if($_time_taken > 60)
{
$_time_taken = ($_time_taken / 60);
$_append = $this->phrases['minute_title'];
}
else
{
$_append = $this->phrases['seconds_title'];
}
$string .= "
<tr>
<td class=\"tfoot\" colspan=\"3\" align=\"right\"><strong>" . $this->phrases['totals'] . "</strong></td>
<td class=\"tfoot\" align=\"center\"><strong>$_done_objects</strong></td>
<td class=\"tfoot\" align=\"center\"><strong>$_failed_objects</strong></td>
<td class=\"tfoot\" align=\"right\"><strong>" . round($_time_taken, 2) . $_append . "</strong></td>
</tr>";
}
$string .= '</table>';
return $string;
}
/**
* Class version - Finds a module version by includeing the file and creating one then accessing the
* local version number (need to be updated to use an accessor)
*
* @see choose_system
*
* @param strinf systemname the subdirectory that comes after systems/
* @param int XXX A three digit number corrisponding to the module number that you are quering
*
* @return string|boolean mixed The formed HTML
*/
function module_ver($file, $num)
{
$modulepath = 'impex/systems/' . $file . '/' . $num . '.php';
$details = array('title' => '', 'version' => '', 'homepage' => '');
$tit = $ver = $hom = FALSE;
if (file_exists($modulepath))
{
$base_file = file($modulepath);
}
else
{
return false;
}
$details['product'] = 'forum';
foreach($base_file as $line)
{
$line = trim($line);
if(strpos($line, '$_product'))
{
$details[product] = substr($line, strpos($line,"'")+1, -2);
#$prod = true;
}
if(strpos($line, '$_modulestring'))
{
$details[title] = substr($line, strpos($line,"'")+1, -2);
$tit = true;
}
if(strpos($line, '$_version'))
{
$details[version] = substr($line, strpos($line,"'")+1, -2);
$ver = true;
}
if(strpos($line, '$_homepage'))
{
$details[homepage] = substr($line, strpos($line,"'")+1, -2);
$hom = true;
}
if($tit AND $ver AND $hom)
{
continue;
}
}
unset($base_file);
return $details;
}
/**
* Choose system - Lists the aviable systems to be imported from depending on what is in systems/
* local version number (need to be updated to use an accessor)
*
*
* @param object sessionobject The current session object
*
* @return string mixed The formed HTML
*/
function choose_system(&$sessionobject)
{
$return = $this->do_form_header('index', 'post');
$return .= $this->make_table_header('');
$return .= $this->make_hidden_code('module', '000');
$form .= $this->phrases['select_system'] . ' <select name="system">';
$each = '<hr><h4 align="center">' . $this->phrases['installed_systems'] . '</h4><table width="100%">';
$systems_list = array();
$system_details = array();
if ($handle = opendir(IDIR . '/systems'))
{
while (false !== ($file = readdir($handle)))
{
#if ($file=='vBlogetin') { continue; }
if ($file[0] != '.' AND $file != '.svn' AND $file != 'index.html' AND substr($file, -4) != '.zip' )
{
if ($details = $this->module_ver($file, '000'))
{
$system_details["$file"] = $details;
$title = $details['title'];
$product = $details['product'];
if (doubleval($details['version']))
{
$title .= " ($details[version])";
}
}
else
{
$title = $file;
}
$systems_list[$product]["$file"] = $title;
}
}
closedir($handle);
}
foreach($systems_list as $id => $product)
{
natcasesort($systems_list[$id]);
}
$system_count = min(3, count($systems_list));
$each .= '<tr>';
do
{
$each .= '<th>System</th><th>Version</th>';
$system_count--;
}
while($system_count > 0);
$each .= '</tr><tr>';
$i = 1;
$rows = 0;
foreach ($systems_list AS $product => $product_array)
{
$form .= '<optgroup label="'.$product.'">';
foreach ($product_array AS $file => $title)
{
$form .= '<option value="' . $file . '">' . $i . ' . ' . $title . '</option>';
if ($system_details["$file"])
{
$details =& $system_details["$file"];
$rows++;
$each .= '
<td>' . $i . ' . <a target="_blank" href="' . $details['homepage'] .'">' . $details['title'] . '</a></td>
<td align="center"> <b>' . $details['version'] . '</b></td>
';
if($rows == 3)
{
$each .= "\n</tr><tr>";
$rows = 0;
}
}
$i++;
}
$form .= '</optgroup>';
}
$form .= '</select>';
$each .= '</table>';
$to = $this->phrases['select_target_system'] . '<select name="targetsystem">';
foreach ($this->_target_versions AS $product => $prod_list)
{
$to .= '<optgroup label="'.$product.'">';
foreach($prod_list AS $ver => $text)
{
$to .= "<option value=\"{$ver}\">{$text}</option>";
}
$to .= '</optgroup>';
}
$to .= "</select>";
$return .= $this->make_description($form, 0, 1, '', 'center');
$return .= $this->make_description($to, 0, 1, '', 'center');
$return .= $this->make_description($each, 0, 1, '', 'center');
$return .= $this->do_form_footer($this->phrases['start_import']);
return $return;
}
/**
* Outputs the content of the headder before index.php is called, ensures that
* the <html <head <body tags are out putted correctly and not disrupted by an echo() etc
*
* Output is augmented by object state and internal flags
*
* @param string mixed The output to be displayed, usally the $_screenstring.
*
* @return string mixed The formed HTML
*/
function make_select($select_array, $select_name)
{
$return_string = '<select name="' . $select_name . '">';
foreach ($select_array as $select_value => $select_display)
{
$return_string .= '<option value="' . $select_value . '">' . $select_display . '</option>';
}
$return_string .= '</select>';
return $return_string;
}
/**
* Outputs the content of the headder before index.php is called, ensures that
* the <html <head <body tags are out putted correctly and not disrupted by an echo() etc
*
* Output is augmented by object state and internal flags
*
* @param string mixed The output to be displayed, usally the $_screenstring.
*
* @return string mixed The formed HTML
*/
function display_now($screentext)
{
$string = $this->page_header();
// TODO: Where do we want the modules status ? Probally here and update the interface to be all nice and groovy :)
// $string .= $this->display_modules();
$this->_screenbasic['displaymodules'] = 'FALSE';
$string .= $screentext;
echo "\n" . $string;
flush();
}
function display_error($screentext)
{
$this->display_now($screentext);
}
/**
* HTML Page code - returns the html page header code depending on the internal flag autosubmit
*
* @return string mixed The formed HTML
*/
function page_header()
{
if ($this->_screenbasic['donehead'] != 'FALSE')
{
return '';
}
if (!$this->_screenbasic['title'] OR $this->_screenbasic['title'] == 'NONE')
{
$outtitle = $this->phrases['title'];
}
else
{
$outtitle = $this->_screenbasic['title'];
}
$css = '<style type="text/css">.isucc { color: green; } .ifail { color: red; }</style><link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />';
if ($this->_screenbasic['autosubmit'] == '0')
{
$string = "<html>\n\t<head>\n\t<title>{$this->_screenbasic['title']}</title>\n\t{$css}\n\t</head>\n\t<body>";
}
else
{
$string = '<html><head><title>' . $outtitle . '</title>' . $css . '</head><body onload="document.name.submit();">';
}
$string .= "\n\t<b>" . $this->phrases['remove'] . "</b>\n";
$string .= "\n\t<b><br>" . $this->phrases['build_version'] . $this->_build_version . "</b>\n";
$this->_screenbasic['donehead'] = 'TRUE';
return $string;
}
/**
* HTML Page code - returns the html page footer code
*
* @return string mixed The formed HTML
*/
function page_footer()
{
$string = '<br><table align="center"><tr><td><a href="http://www.vbulletin.com/docs/html/impex_cleanup" target="_blank">' . $this->phrases['finished_import'] . '</a></td></tr></table>';
$string .= '</body></html>';
return $string;
}
/**
* Main display - returns the current HTML stored in the object
*
* @see display_modules
* @see choose_system
*
* @param object sessionobject The current session object
*
* @return string mixed The formed HTML
*/
function display(&$sessionobject)
{
if ($this->_screenbasic['showwarning'] == 'TRUE')
{
$string .= $this->_screenbasic['warning'];
}
if ($this->_screenbasic['displaymodules'] != 'FALSE')
{
$string .= $this->display_modules($sessionobject);
}
if ($this->_screenbasic['choosesystem'] == 'TRUE')
{
// TODO: here
#$string .= $this->choose_target_system($sessionobject);
$string .= $this->choose_system($sessionobject);
}
$string .= $this->_screenbasic['pageHTML'];
return $string;
}
/**
* Return the display string for the module complete
*
* @param string mixed The name of the module
* @param int mixed The seconds taken to complete
*
* @return mixed string|NULL
*/
function module_finished($modulestring, $seconds, $successful, $failed)
{
if($seconds <= 1)
{
return "<p align=\"center\">{$this->phrases['module']} <b>{$modulestring}</b>. <i>{$this->phrases['successful']}</i>, : 1 {$this->phrases['second']}.</p>
<p align=\"center\"> {$this->phrases['successful']}: <b>$successful</b>. {$this->phrases['failed']}: <b>$failed</b>.</p>";
}
else
{
return "<p align=\"center\">{$this->phrases['module']} : <b>$modulestring</b>. <i>{$this->phrases['successful']}</i>, : $seconds {$this->phrases['second']}.</p>
<p align=\"center\"> {$this->phrases['successful']}: <b>$successful</b>. {$this->phrases['failed']}: <b>$failed</b>.</p>";
}
}
function print_redirect($gotopage, $timeout = 0.5)
{
if (step_through)
{
return $this->print_redirect_001($gotopage, $timeout);
}
else
{
// performs a delayed javascript page redirection
// get rid of & if there are any...
$gotopage = str_replace('&', '&', $gotopage);
echo '<p align="center" class="smallfont"><a href="' . $gotopage . '" onclick="clearTimeout(timerID);"></a></p>';
echo "\n<script type=\"text/javascript\">\n";
if ($timeout == 0)
{
echo "window.location=\"$gotopage\";";
}
else
{
echo "myvar = \"\"; timeout = " . ($timeout*10) . ";
function exec_refresh()
{
window.status=\"Redirecting\"+myvar; myvar = myvar + \" .\";
timerID = setTimeout(\"exec_refresh();\", 100);
if (timeout > 0)
{ timeout -= 1; }
else { clearTimeout(timerID); window.status=\"\"; window.location=\"$gotopage\"; }
}
exec_refresh();";
}
echo "\n</script>\n";
}
}
function print_redirect_001($gotopage, $timeout = 0.5)
{
$rt = '';
$rt .= '<div align="center">';
$rt .= '<FORM METHOD="LINK" ACTION="'.$gotopage.'">';
$rt .= '<INPUT TYPE="submit" VALUE="' . $this->phrases['continue'] . '">';
$rt .= '</FORM>';
$rt .= '</div>';
echo $rt;
}
function print_per_page_pass($count, $datatypename, $startat)
{
$to = $count+$startat;
$rt = "<h4>{$this->phrases['importing']} {$count} {$datatypename}</h4>";
$rt .= "<p><b>{$this->phrases['from']}</b> : {$startat} :: <b>{$this->phrases['to']}</b> : {$to} </p>";
echo $rt;
}
}
class CLI_ImpExDisplay extends ImpExDisplay
{
function update_html($html) { return true; }
function update_basic($name, $status) { return true; }
function make_input_code($title, $name, $value = '', $htmlise = 1, $size = 35) { return true; }
function make_table_header($title, $htmlise = 1, $colspan = 2) { return true; }
function get_row_bg() { return true; }
function do_form_header($phpscript, $action, $uploadform = 0, $addtable = 1, $name = 'name') { return true; }
function do_form_footer($submitname = 'Submit', $resetname = 'Reset', $colspan = 2, $goback = '') { return true; }
function make_description($text, $htmlise = 0) { return true; }
function make_hidden_code($name, $value = '', $htmlise = 1) { return true; }
function make_yesno_code($title, $name, $value = 1) { return true; }
function display_modules(&$sessionobject) { return true; }
function module_ver($file, $num) { return true; }
function choose_system(&$sessionobject) { return true; }
function make_select($select_array, $select_name) { return true; }
function display_now($screentext)
{
echo ".";
return true;
}
function display_error($screentext) { return true; }
function page_header() { return true; }
function page_footer() { return true; }
function display(&$sessionobject) { return true; }
function module_finished($modulestring, $seconds, $successful, $failed) { return true; }
function print_redirect($gotopage, $timeout = 0.5) { return true; }
}
/*======================================================================*/
?>