<commit_before><?php
/*
 * Xibo - Digitial Signage - http://www.xibo.org.uk
 * Copyright (C) 2009 <NAME>
 *
 * This file is part of Xibo.
 *
 * Xibo is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version. 
 *
 * Xibo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Xibo.  If not, see <http://www.gnu.org/licenses/>.
 */ 
defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");

class faultDAO
{
	private $db;
	private $user;
	
	function __construct(database $db, user $user) 
	{
		$this->db 	=& $db;
		$this->user =& $user;
	}
	
	function displayPage() 
	{
	
		include("template/pages/fault_view.php");
		
		return false;
	}
	
	function on_page_load() 
	{
		return '';
	}
	
	function echo_page_heading() 
	{
		echo 'Report a Fault';
		return true;
	}
	
	function ReportForm()
	{
		$db 	=& $this->db;
		$user 	=& $this->user;
		$output = '';
		
		$config = new Config($db);

		$output .= '<div class="ReportFault">';		
		$output .= '<ol>';		
		$output .= '<li><p>Check that the Environment passes all the Xibo Environment checks.</p>';		
		$output .= $config->CheckEnvironment();
		$output .= '</li>';

		$output .= '<li><p>Turn ON full auditing and debugging.</p>';
		$output .= '	<form class="XiboForm" action="index.php?p=admin" method="post">';
		$output .= '		<input type="hidden" name="q" value="SetMaxDebug" />';
		$output .= '		<input type="submit" value="Turn ON Debugging" />';
		$output .= '	</form>';
		$output .= '</li>';

		$output .= '<li><p>Recreate the Problem in a new window.</p>';		
		$output .= '</li>';
		
		$output .= '<li><p>Automatically collect and export relevant information into a text file. Please save this file to your PC.</p>';
		$output .= '<a href="index.php?p=fault&q=CollectData" title="Collect Data">Collect and Save Data</a>';	
		$output .= '</li>';

		$output .= '<li><p>Turn full auditing and debugging OFF.</p>';	
		$output .= '	<form class="XiboForm" action="index.php?p=admin" method="post">';
		$output .= '		<input type="hidden" name="q" value="SetMinDebug" />';
		$output .= '		<input type="submit" value="Turn OFF Debugging" />';
		$output .= '	</form>';	
		$output .= '</li>';
		
		$output .= '<li><p>Click on the below link to open the bug report page for this Xibo release. Describe the problem and upload the file you obtained earlier.</p>';		
		$output .= '<a href="https://bugs.launchpad.net/xibo/1.0/+filebug" title="File a bug report" target="_blank">File a bug report in Launchpad</a>';
		$output .= '</li>';
		
		$output .= '</ol>';
		$output .= '</div>';
		
		echo $output;	
		return;
	}
	
	function CollectData()
	{
		$db =& $this->db;
		
		// We want to output a load of stuff to the browser as a text file.
		header('Content-Type: text/plain');
		header('Content-Disposition: attachment; filename="troubleshoot.txt"');
		header("Content-Transfer-Encoding: binary");
		header('Accept-Ranges: bytes');<commit_msg>[server] Added translation strings to fault.class.php<commit_after><?php
/*
 * Xibo - Digitial Signage - http://www.xibo.org.uk
 * Copyright (C) 2009 <NAME>
 *
 * This file is part of Xibo.
 *
 * Xibo is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version. 
 *
 * Xibo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Xibo.  If not, see <http://www.gnu.org/licenses/>.
 */ 
defined('XIBO') or die(__("Sorry, you are not allowed to directly access this page.") . '<br />' . __("Please press the back button in your browser."));

class faultDAO
{
	private $db;
	private $user;
	
	function __construct(database $db, user $user) 
	{
		$this->db 	=& $db;
		$this->user =& $user;
	}
	
	function displayPage() 
	{
	
		include("template/pages/fault_view.php");
		
		return false;
	}
	
	function on_page_load() 
	{
		return '';
	}
	
	function echo_page_heading() 
	{
		echo __('Report a Fault');
		return true;
	}
	
	function ReportForm()
	{
		$db 	=& $this->db;
		$user 	=& $this->user;
		$output = '';
		
		$config = new Config($db);

		$output .= '<div class="ReportFault">';		
		$output .= '<ol>';		
		$output .= '<li><p>' . __('Check that the Environment passes all the Xibo Environment checks.') . '</p>';		
		$output .= $config->CheckEnvironment();
		$output .= '</li>';

		$output .= '<li><p>' . __('Turn ON full auditing and debugging.') . '</p>';
		$output .= '	<form class="XiboForm" action="index.php?p=admin" method="post">';
		$output .= '		<input type="hidden" name="q" value="SetMaxDebug" />';
		$output .= '		<input type="submit" value="' . __('Turn ON Debugging') . '" />';
		$output .= '	</form>';
		$output .= '</li>';

		$output .= '<li><p>' . __('Recreate the Problem in a new window.') . '</p>';		
		$output .= '</li>';
		
		$output .= '<li><p>' . __('Automatically collect and export relevant information into a text file.') . ' ' . __('Please save this file to your PC.') . '</p>';
		$output .= '<a href="index.php?p=fault&q=CollectData" title="Collect Data">' . __('Collect and Save Data') . '</a>';	
		$output .= '</li>';

		$output .= '<li><p>' . __('Turn full auditing and debugging OFF.') . '</p>';	
		$output .= '	<form class="XiboForm" action="index.php?p=admin" method="post">';
		$output .= '		<input type="hidden" name="q" value="SetMinDebug" />';
		$output .= '		<input type="submit" value="' . __('Turn OFF Debugging') . ' />';
		$output .= '	</form>';	
		$output .= '</li>';
		
		$output .= '<li><p>' . __('Click on the below link to open the bug report page for this Xibo release.') . ' ' . __(' Describe the problem and upload the file you obtained earlier.') . '</p>';		
		$output .= '<a href="https://bugs.launchpad.net/xibo/1.0/+filebug" title="File a bug report" target="_blank">' . __('File a bug report in Launchpad') . '</a>';
		$output .= '</li>';
		
		$output .= '</ol>';
		$output .= '</div>';
		
		echo $output;	
		return;
	}
	
	function CollectData()
	{
		$db =& $this->db;
		
		// We want to output a load of stuff to the browser as a text file.
		header('Content-Type: text/plain');
		header('Content-Disposition: attachment; filename="troubleshoot.txt"');
		header("Content-Transfer-Encoding: binary");
		header('Accept-Ranges: bytes');
{'fraction_non_alphanumeric': 0.1780588318885889, 'fraction_numerical': 0.001989484155179764, 'mean_word_length': 3.4264150943396228, 'pattern_counts': {'":': 0, '<': 91, '<?xml version=': 0, '>': 101, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4245306', 'n_tokens_mistral': 2474, 'n_tokens_neox': 2223, 'n_words': 743}