2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 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 /************************************************************************/
13 define('TR_INCLUDE_PATH', '../../include/');
15 require(TR_INCLUDE_PATH.'vitals.inc.php');
16 require(TR_INCLUDE_PATH.'../home/editor/editor_tab_functions.inc.php');
18 global $_course_id, $_content_id, $contentManager;
20 Utility::authenticate(TR_PRIV_ISAUTHOR);
25 require(TR_INCLUDE_PATH.'header.inc.php');
26 $msg->printInfos('NO_PAGE_CONTENT');
27 require (TR_INCLUDE_PATH.'footer.inc.php');
31 if (isset($contentManager)) $content_row = $contentManager->getContentPage($cid);
33 if (!$content_row || !isset($contentManager)) {
34 require(TR_INCLUDE_PATH.'header.inc.php');
35 $msg->printErrors('MISSING_CONTENT');
36 require (TR_INCLUDE_PATH.'footer.inc.php');
40 $course_base_href = '';
41 $content_base_href = '';
44 if ($_POST['make_decision'])
46 //get list of decisions
48 if (is_array($_POST['d'])) {
49 foreach ($_POST['d'] as $sequenceID => $decision) {
50 $desc_query .= '&'.$sequenceID.'='.$decision;
54 $checker_url = TR_ACHECKER_URL. 'decisions.php?'
55 .'uri='.urlencode($_POST['pg_url']).'&id='.TR_ACHECKER_WEB_SERVICE_ID
56 .'&session='.$_POST['sessionid'].'&output=html'.$desc_query;
58 if (@file_get_contents($checker_url) === false) {
59 $msg->addInfo('DECISION_NOT_SAVED');
62 else if (isset($_POST['reverse']))
64 $reverse_url = TR_ACHECKER_URL. 'decisions.php?'
65 .'uri='.urlencode($_POST['pg_url']).'&id='.TR_ACHECKER_WEB_SERVICE_ID
66 .'&session='.$_POST['sessionid'].'&output=html&reverse=true&'.key($_POST['reverse']).'=N';
68 if (@file_get_contents($reverse_url) === false) {
69 $msg->addInfo('DECISION_NOT_REVERSED');
71 $msg->addInfo('DECISION_REVERSED');
75 $popup = intval($_GET['popup']);
76 require(TR_INCLUDE_PATH.'header.inc.php');
78 <form action="<?php echo $_SERVER['PHP_SELF']; ?>?popup=1" method="post" name="form">
81 echo ' <input type="hidden" name="body_text" value="'.htmlspecialchars(stripslashes($_POST['body_text'])).'" />';
82 echo ' <input type="hidden" name="_cid" value="'.$cid.'" />';
85 $msg->printInfos('SAVE_CONTENT');
93 if ($_POST['body_text'] != '') {
95 $_POST['content_path'] = $content_row['content_path'];
98 $pg_url = TR_BASE_HREF.'get_acheck.php/'.$cid . '.html';
99 $checker_url = TR_ACHECKER_URL.'checkacc.php?uri='.urlencode($pg_url).'&id='.TR_ACHECKER_WEB_SERVICE_ID
100 . '&guide=WCAG2-L2&output=html';
102 $report = @file_get_contents($checker_url);
104 if (stristr($report, '<div id="error">')) {
105 $msg->printErrors('INVALID_URL');
106 } else if ($report === false) {
107 $msg->printInfos('SERVICE_UNAVAILABLE');
109 echo ' <input type="hidden" name="pg_url" value="'.$pg_url.'" />';
112 echo ' <p>'._AT('access_credit').'</p>';
115 @unlink(TR_CONTENT_DIR . $cid . '.html');
118 $msg->printInfos('NO_PAGE_CONTENT');
124 require(TR_INCLUDE_PATH.'footer.inc.php');