2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
14 define('AT_INCLUDE_PATH', '../../../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
17 require(AT_INCLUDE_PATH.'../mods/_core/editor/editor_tab_functions.inc.php');
19 $cid = intval($_POST['cid']);
22 require(AT_INCLUDE_PATH.'header.inc.php');
23 $missing_fields[] = _AT('content_id');
24 $msg->addError(array('EMPTY_FIELDS', $missing_fields));
25 require (AT_INCLUDE_PATH.'footer.inc.php');
29 $result = $contentManager->getContentPage($cid);
31 if (!($content_row = @mysql_fetch_assoc($result))) {
32 require(AT_INCLUDE_PATH.'header.inc.php');
33 $msg->printErrors('PAGE_NOT_FOUND');
34 require (AT_INCLUDE_PATH.'footer.inc.php');
38 $course_base_href = '';
39 $content_base_href = '';
42 if ($_POST['make_decision'])
44 //get list of decisions
46 if (is_array($_POST['d'])) {
47 foreach ($_POST['d'] as $sequenceID => $decision) {
48 $desc_query .= '&'.$sequenceID.'='.$decision;
52 $checker_url = AT_ACHECKER_URL. 'decisions.php?'
53 .'uri='.urlencode($_POST['pg_url']).'&id='.AT_ACHECKER_WEB_SERVICE_ID
54 .'&session='.$_POST['sessionid'].'&output=html'.$desc_query;
56 if (@file_get_contents($checker_url) === false) {
57 $msg->addInfo('DECISION_NOT_SAVED');
60 else if (isset($_POST['reverse']))
62 $reverse_url = AT_ACHECKER_URL. 'decisions.php?'
63 .'uri='.urlencode($_POST['pg_url']).'&id='.AT_ACHECKER_WEB_SERVICE_ID
64 .'&session='.$_POST['sessionid'].'&output=html&reverse=true&'.key($_POST['reverse']).'=N';
66 if (@file_get_contents($reverse_url) === false) {
67 $msg->addInfo('DECISION_NOT_REVERSED');
69 $msg->addInfo('DECISION_REVERSED');
73 require(AT_INCLUDE_PATH.'header.inc.php');
75 <form action="<?php echo $_SERVER['PHP_SELF']; ?>?popup=1" method="post" name="form">
78 echo ' <input type="hidden" name="body_text" value="'.htmlspecialchars(stripslashes($_POST['body_text'])).'" />';
79 echo ' <input type="hidden" name="cid" value="'.$_POST['cid'].'" />';
82 $msg->printInfos('SAVE_CONTENT');
90 if ($_POST['body_text'] != '') {
92 $_POST['content_path'] = $content_row['content_path'];
95 $pg_url = AT_BASE_HREF.'get_acheck.php/'.$_POST['cid'] . '.html';
96 $checker_url = AT_ACHECKER_URL.'checkacc.php?uri='.urlencode($pg_url).'&id='.AT_ACHECKER_WEB_SERVICE_ID
97 . '&guide=WCAG2-L2&output=html';
99 $report = @file_get_contents($checker_url);
101 if (stristr($report, '<div id="error">')) {
102 $msg->printErrors('INVALID_URL');
103 } else if ($report === false) {
104 $msg->printInfos('SERVICE_UNAVAILABLE');
106 echo ' <input type="hidden" name="pg_url" value="'.$pg_url.'" />';
109 echo ' <p>'._AT('access_credit').'</p>';
112 @unlink(AT_CONTENT_DIR . $_POST['cid'] . '.html');
115 $msg->printInfos('NO_PAGE_CONTENT');
121 require(AT_INCLUDE_PATH.'footer.inc.php');