2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Joel Kronenberg & Heidi Hazelton*/
6 /* Adaptive Technology Resource Centre / University of Toronto */
9 /* This program is free software. You can redistribute it and/or */
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /************************************************************************/
15 if (!defined('AT_INCLUDE_PATH')) { exit; }
18 if ($_POST['make_decision'])
20 //get list of decisions
22 if (is_array($_POST['d'])) {
23 foreach ($_POST['d'] as $sequenceID => $decision) {
24 $desc_query .= '&'.$sequenceID.'='.$decision;
28 $checker_url = AT_ACHECKER_URL. 'decisions.php?'
29 .'uri='.urlencode($_POST['pg_url']).'&id='.AT_ACHECKER_WEB_SERVICE_ID
30 .'&session='.$_POST['sessionid'].'&output=html'.$desc_query;
32 if (@file_get_contents($checker_url) === false) {
33 $msg->addInfo('DECISION_NOT_SAVED');
36 else if (isset($_POST['reverse']))
38 $reverse_url = AT_ACHECKER_URL. 'decisions.php?'
39 .'uri='.urlencode($_POST['pg_url']).'&id='.AT_ACHECKER_WEB_SERVICE_ID
40 .'&session='.$_POST['sessionid'].'&output=html&reverse=true&'.key($_POST['reverse']).'=N';
42 if (@file_get_contents($reverse_url) === false) {
43 $msg->addInfo('DECISION_NOT_REVERSED');
45 $msg->addInfo('DECISION_REVERSED');
52 echo '<input type="hidden" name="body_text" value="'.htmlspecialchars(stripslashes($_POST['body_text'])).'" />';
55 $msg->printInfos('SAVE_CONTENT');
63 if ($_POST['body_text'] != '') {
65 $_POST['content_path'] = $content_row['content_path'];
68 $pg_url = AT_BASE_HREF.'get_acheck.php/'.$_POST['cid'] . '.html';
70 $checker_url = AT_ACHECKER_URL.'checkacc.php?uri='.urlencode($pg_url).'&id='.AT_ACHECKER_WEB_SERVICE_ID
71 . '&guide=WCAG2-L2&output=html';
73 $report = @file_get_contents($checker_url);
75 if (stristr($report, '<div id="error">')) {
76 $msg->printErrors('INVALID_URL');
77 } else if ($report === false) {
78 $msg->printInfos('SERVICE_UNAVAILABLE');
80 echo '<input type="hidden" name="pg_url" value="'.$pg_url.'" />';
83 echo '<p>'._AT('access_credit').'</p>';
86 @unlink(AT_CONTENT_DIR . $_POST['cid'] . '.html');
89 $msg->printInfos('NO_PAGE_CONTENT');