PageRenderTime 141ms CodeModel.GetById 81ms app.highlight 5ms RepoModel.GetById 35ms app.codeStats 0ms

/administrator/popups/contentwindow.php

https://bitbucket.org/dgough/annamaria-daneswood-25102012
PHP | 104 lines | 58 code | 11 blank | 35 comment | 13 complexity | 570a689aca98415dfbb7caeaacc41e72 MD5 | raw file
  1<?php
  2/**
  3* @version $Id: contentwindow.php 5862 2006-11-27 22:54:44Z Saka $
  4* @package Joomla
  5* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
  6* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
  7* Joomla! is free software. This version may have been modified pursuant
  8* to the GNU General Public License, and as distributed it includes or
  9* is derivative of works licensed under the GNU General Public License or
 10* other free or open source software licenses.
 11* See COPYRIGHT.php for copyright notices and details.
 12*/
 13
 14// Set flag that this is a parent file
 15define( "_VALID_MOS", 1 );
 16
 17require_once( '../includes/auth.php' );
 18include_once ( $mosConfig_absolute_path . '/language/' . $mosConfig_lang . '.php' );
 19
 20// limit access to functionality
 21$option = strval( mosGetParam( $_SESSION, 'option', '' ) );
 22$task 	= strval( mosGetParam( $_SESSION, 'task', '' ) );
 23
 24switch ($option) {
 25	case 'com_content':
 26	case 'com_typedcontent':
 27		if ( $task != 'edit' && $task != 'editA'  && $task != 'new' ) {
 28			echo _NOT_AUTH;
 29			return;
 30		}
 31		break;
 32
 33	default:
 34		echo _NOT_AUTH;
 35		return;
 36		break;
 37}
 38
 39$css = mosGetParam( $_REQUEST, 't', '' );
 40
 41// css file handling
 42// check to see if template exists
 43if ( $css != '' && is_dir($mosConfig_absolute_path .'/templates/'. $css .'/css/template_css.css' )) {
 44	$css 	= $css;
 45} else if ( $css == '' ) {
 46	$css 	= 'rhuk_solarflare_ii';
 47}
 48
 49$iso = split( '=', _ISO );
 50// xml prolog
 51echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
 52?>
 53<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 54<html xmlns="http://www.w3.org/1999/xhtml">
 55<base href="<?php echo($mosConfig_live_site); ?>/" />
 56<head>
 57<title>Content Preview</title>
 58<link rel="stylesheet" href="templates/<?php echo $css;?>/css/template_css.css" type="text/css" />
 59	<script>
 60		var form = window.opener.document.adminForm
 61		var title = form.title.value;
 62
 63		var alltext = form.introtext.value;
 64		alltext = alltext.replace('<hr id="system-readmore" \/>',"")
 65		
 66		//if (form.fulltext) {
 67		//	alltext += form.fulltext.value;
 68		//}
 69
 70		// do the images
 71		var temp = new Array();
 72		/*
 73		for (var i=0, n=form.imagelist.options.length; i < n; i++) {
 74			value = form.imagelist.options[i].value;
 75			parts = value.split( '|' );
 76
 77			temp[i] = '<img src="images/stories/' + parts[0] + '" align="' + parts[1] + '" border="' + parts[3] + '" alt="' + parts[2] + '" hspace="6" />';
 78		}
 79
 80		var temp2 = alltext.split( '{mosimage}' );
 81
 82		var alltext = temp2[0];
 83
 84		for (var i=0, n=temp2.length-1; i < n; i++) {
 85			alltext += temp[i] + temp2[i+1];
 86		}*/
 87	</script>
 88<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
 89</head>
 90<body style="background-color:#FFFFFF">
 91<table align="center" width="90%" cellspacing="2" cellpadding="2" border="0">
 92	<tr>
 93		<td class="contentheading" colspan="2"><script>document.write(title);</script></td>
 94	</tr>
 95	<tr>
 96		<script>document.write("<td valign=\"top\" height=\"90%\" colspan=\"2\">" + alltext + "</td>");</script>
 97	</tr>
 98	<tr>
 99		<td align="right"><a href="#" onClick="window.close()">Close</a></td>
100		<td align="left"><a href="javascript:;" onClick="window.print(); return false">Print</a></td>
101	</tr>
102</table>
103</body>
104</html>