<?php
/**
 * unit_resreadview.php - Is this file used any more? Should delete it soon.
 * 							  The file download link has chnaged but not here yet.
 *
 * @author $Author: dtong $
 * @version $Id: unit_resread_view.php,v 1.15 2011/05/20 06:36:51 dtong Exp $
 * @copyright Copyright (c) 2009, Tiller Software Co., Ltd.
*/
?>

<html>
<head>
<?php
	osa_appcss_include();
	$this->load->view('template/jscript_globalvars_view');
?>
<link rel="stylesheet" href='<?php echo osa_include_path()?>js/float/dhtmlwindow.css' type="text/css" media="screen" />
<script type="text/javascript" src="<?php echo osa_include_path()?>js/float/dhtmlwindow.js"></script>
<script type="text/javascript" src="<?php echo osa_include_path()?>js/sys.js"></script>
<script type="text/javascript" src="<?php echo osa_include_path()?>js/app.js"></script>
<script type="text/javascript" src="<?php echo osa_include_path()?>js/tiny_mce/plugins/asciimath/js/ASCIIMathMLwFallback.js"></script>
<script type="text/javascript" src="<?php echo osa_include_path()?>js/tiny_mce/plugins/asciisvg/js/ASCIIsvgPI.js"></script>
<script type="text/javascript">
	hiddenOBJ(''); //fix bug IE when used ASCIIMath
</script>
<title></title>
</head>
<body>
<br />
<div class="reswin_title"><?php echo $template->getval('_title_read')?></div>
<div class="reswin_readdesc"><?php echo htmlspecialchars_decode( osa_process_readtext($db->text1) ) ?></div>
<?php
if ( isset($uploadfiles) && $uploadfiles != FALSE ) {
	foreach ($uploadfiles as $file) {
		$href= base_url() . "unit/resource/file/{$file->id}/" . urlencode($file->filename);
		$html = '';
		$html .= " <div class='reswin_read_upload_desc'> ";
		$html .= lang('unit_uploadedfile') . ': ';
		$html .= "<a onclick=\"return downloadWindow('{$href}')\" target=\"_blank\" href=\"" . $href . '">' .
									$file->filename . '</a></b> (' . osa_filesizestr($file->size) . ')<br />';
		$html .= "</div>";
		echo $html;
	}
}
//multi url
if (isset($res_urls) && $res_urls != FALSE){
	foreach ($res_urls as $value ){
		$thisurl = $value->url;
		if ($thisurl != FALSE ){
			$html = '';
			$html .= " <div class='reswin_read_upload_desc'> ";
			$html .= lang('unit_uploadedurl') . ': ';
			$link = 'http://' . $thisurl;
			$html .= "<a target='_blank' href='{$link}'>" .$link.'</a>';
			$html .= "</div>";
			echo $html;
		}
	}
}

?>
<br />
<center>
<input type="button" value="<?php echo $template->getval('_close_text')?>" name="close" <?php osa_btn()?>
				onClick="parent.closeDhtmlWindow('resource');" />
</center>
</body>
</html>