3 This is the ATutor admin plog module page. It allows an admin user
\r
4 to set or edit the URL for the plog installation for ATutor, and edit
\r
5 the plog location URL.
\r
7 define('AT_INCLUDE_PATH', '../../include/');
\r
8 require (AT_INCLUDE_PATH.'vitals.inc.php');
\r
10 // switch the comments in the two lines to switch between LifeType 1.0.2 and 1.1
\r
11 //require ('sync_plog11.php');
\r
12 require ('sync_plog.php');
\r
15 // Insert the initial pLog location in the ATutor config table
\r
16 if($_REQUEST['saved_plog_url'] == 1){
\r
17 if($_REQUEST['plog_url'] == ''){
\r
18 $msg->addError('PLOG_URL_ADD_EMPTY');
\r
20 $plog_url = addslashes(stripslashes($_REQUEST['plog_url']));
\r
21 $sql = "INSERT INTO ".TABLE_PREFIX."config VALUES('plog', '".$plog_url."')";
\r
22 if(!$result = mysql_query($sql)){
\r
23 $msg->addError('PLOG_URL_ADD_FAILED');
\r
25 $msg->addFeedback('PLOG_URL_ADD_SAVED');
\r
30 // Update the pLog location if it is being edited
\r
31 if($_REQUEST['edited_plog_url'] == 1){
\r
32 if($_REQUEST['plog_url'] == ''){
\r
34 $msg->addError('PLOG_URL_ADD_EMPTY');
\r
35 // $_POST['edit_plog_url'] = 1;
\r
39 $plog_url = addslashes(stripslashes($_REQUEST['plog_url']));
\r
40 $sql = "UPDATE ".TABLE_PREFIX."config SET value='".$plog_url."' WHERE name = 'plog'";
\r
41 if(!$result = mysql_query($sql)){
\r
43 $msg->addError('PLOG_URL_ADD_FAILED');
\r
47 $msg->addFeedback('PLOG_URL_ADD_SAVED');
\r
54 //Check to see if the url to plog exists in the db
\r
55 $sql = 'SELECT * from '.TABLE_PREFIX.'config WHERE name="plog"';
\r
56 $result = mysql_query($sql, $db);
\r
58 while($row = mysql_fetch_array($result)){
\r
59 $plog_url_db = $row[1];
\r
62 require (AT_INCLUDE_PATH.'header.inc.php');
\r
64 // Display the form the enter the initial pLog URL, or display the form to edit the location
\r
65 if($plog_url_db == '' || $_POST['edit_plog_url']){
\r
68 <div class="input-form">
\r
70 <p><?php echo _AT('plog_add_url'); ?>
\r
72 <div class="row buttons">
\r
73 <form action="<?php $_SERVER['PHP_SELF']?>" method="post">
\r
75 <?php if($_POST['edit_plog_url']){ ?>
\r
76 <input type="hidden" name="edited_plog_url" value="1">
\r
78 <input type="hidden" name="saved_plog_url" value="1">
\r
80 <?php if($_POST['edit_plog_url']){ ?>
\r
81 <input type="text" name="plog_url" value="<?php echo $plog_url_db; ?>" size="80" length="150" />
\r
83 <input type="text" name="plog_url" value="<?php echo $plog_url; ?>" size="80" length="150" />
\r
86 <input type="submit" value="<?php echo _AT('plog_save'); ?>" style="botton">
\r
94 <div class="input-form">
\r
96 <p><?php echo _AT('plog_sync'); ?></p>
\r
97 <p> <strong><?php echo $plog_sync; ?> </strong> </p>
\r
98 <div class="row buttons">
\r
99 <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
\r
100 <input type="hidden" name="plog_sync" value="1">
\r
101 <input type="submit" value="<?php echo _AT('plog_sync_button'); ?>" style="botton">
\r
106 <div class="input-form">
\r
108 <p><?php echo _AT('plog_location'); ?></p>
\r
109 <p> <strong><?php echo $plog_url_db; ?> </strong> </p>
\r
110 <div class="row buttons">
\r
111 <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
\r
112 <input type="hidden" name="edit_plog_url" value="1">
\r
113 <input type="submit" value="<?php echo _AT('plog_edit'); ?>" style="botton">
\r
120 <div class="input-form">
\r
124 // Display the pLog admin screen, or login screen
\r
126 <iframe name="plog" id="plog" title="pLog" scrolling="yes" src="<?php echo $plog_url_db; ?>admin.php" height="800" width="100%" align="center" style="border:thin white solid; align:center;"></iframe>
\r
129 require (AT_INCLUDE_PATH.'footer.inc.php'); ?>