/[libdata]/trunk/admin/scribe_debug.phtml
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/admin/scribe_debug.phtml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 73 - (show annotations)
Thu Mar 18 21:27:37 2004 UTC (20 years, 1 month ago) by dpavlin
File size: 2829 byte(s)
sync trunk to HEAD of pear-db (without changes specific to PEAR which will be dropped)

1 <?php
2 // Load globals
3 require_once ("global_vars.php");
4
5 // Includes
6 require_once ($GLOBAL_ADMIN_INC."sessionClass.php");
7 require_once ($GLOBAL_ADMIN_INC."accessClass.php");
8 require_once ("db_connect.php");
9 require_once ($GLOBAL_ADMIN_INC."app_controls.php");
10 require_once ($GLOBAL_ADMIN_INC."scribe_application.php");
11 require_once ($GLOBAL_ADMIN_INC."scribe_fix.php");
12
13 // HTML header
14 printf("<HTML>\n");
15 printf("<HEAD>\n");
16 printf("<title>CourseLib/PageScribe Page Debugger</title>\n");
17 printf("<link rel=\"stylesheet\" href=\"%s\" type=\"text/css\">\n", $GLOBAL_ADMIN_CSS);
18 printf("</HEAD>\n");
19
20
21 // Page header
22 require_once ($GLOBAL_ADMIN_HEADER);
23
24
25 // Collect access information
26 if (isset($libsession)) {
27
28 // Fetch session information
29 $sessionClass = new sessionClass("", $libsession, "", "");
30 $accessClass = new accessClass($sessionClass);
31
32 // Load user session variables
33 $sess_time_human = $sessionClass->time_human;
34 $sess_staff_account = $sessionClass->staff_account;
35 $sess_access_level = $accessClass->access_level;
36 $sess_access = $accessClass->access;
37 $sess_last_name = $accessClass->last_name;
38 $sess_first_name = $accessClass->first_name;
39 }
40
41
42 // cookie must be set
43 if(isset($libsession) && $sess_access_level >= 1000) {
44
45 printf("<h2>CourseLib/PageScribe Page Debugger</h2>\n");
46
47 // Determine if page exists
48 $exists = existsRow($con, "page", "page_id", $page_id);
49
50 if ($exists == 1){
51
52 // Debugger
53 $passed = errorTrap($con, $page_id);
54
55 }
56 else printf("Page %s not found!", $page_id);
57
58
59 // If failed, allow a fix
60 if ($passed == 0) {
61
62 printf("<br><br><center>\n");
63 printf("<table width=\"90%%\" class=\"backLight\" border=\"1\">\n");
64 printf("<tr><td class=\"cellPlain\">Error(s) Found (#%d)</td></tr>\n", $page_id);
65 printf("<tr><td><br>\n");
66 printf("<b>Page Fix Options</b><br>\n");
67 printf("Note: the following options range from least to most destructive. It is ");
68 printf("recommended that least destructive methods are tried first, moving to ");
69 printf("moving to progressively more destructive only as necessary.<br><br>");
70 printf("<form method =\"post\" action = \"scribe_fix.phtml?page_id=%d\">\n", $page_id);
71 printf("<select name =\"method\">\n");
72 printf("<option value=\"1\">Attach orphans to foster parent</option>\n");
73 printf("<option value=\"2\">Delete fostered children and their descendants</option>\n");
74 printf("<option value=\"3\">Purge all parent-children relationships!</option>\n");
75 printf("</select>\n");
76 printf("<input type=\"submit\" value=\"Fix this Page\">\n");
77 printf("<br><br>\n");
78 printf("</td></form></tr></table>\n");
79
80 }
81
82 // Link to return to admin console
83 adminReturn($sess_access_level);
84
85 } // logged in
86
87 // No access
88 else require_once ($GLOBAL_NO_ACCESS);
89
90 // Page footer
91 require_once ($GLOBAL_ADMIN_FOOTER);
92 ?>
93
94 </body>
95 </html>

  ViewVC Help
Powered by ViewVC 1.1.26