/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. // Set flag that this is a parent file
  14. define( "_VALID_MOS", 1 );
  15. require_once( '../includes/auth.php' );
  16. include_once ( $mosConfig_absolute_path . '/language/' . $mosConfig_lang . '.php' );
  17. // limit access to functionality
  18. $option = strval( mosGetParam( $_SESSION, 'option', '' ) );
  19. $task = strval( mosGetParam( $_SESSION, 'task', '' ) );
  20. switch ($option) {
  21. case 'com_content':
  22. case 'com_typedcontent':
  23. if ( $task != 'edit' && $task != 'editA' && $task != 'new' ) {
  24. echo _NOT_AUTH;
  25. return;
  26. }
  27. break;
  28. default:
  29. echo _NOT_AUTH;
  30. return;
  31. break;
  32. }
  33. $css = mosGetParam( $_REQUEST, 't', '' );
  34. // css file handling
  35. // check to see if template exists
  36. if ( $css != '' && is_dir($mosConfig_absolute_path .'/templates/'. $css .'/css/template_css.css' )) {
  37. $css = $css;
  38. } else if ( $css == '' ) {
  39. $css = 'rhuk_solarflare_ii';
  40. }
  41. $iso = split( '=', _ISO );
  42. // xml prolog
  43. echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
  44. ?>
  45. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  46. <html xmlns="http://www.w3.org/1999/xhtml">
  47. <base href="<?php echo($mosConfig_live_site); ?>/" />
  48. <head>
  49. <title>Content Preview</title>
  50. <link rel="stylesheet" href="templates/<?php echo $css;?>/css/template_css.css" type="text/css" />
  51. <script>
  52. var form = window.opener.document.adminForm
  53. var title = form.title.value;
  54. var alltext = form.introtext.value;
  55. alltext = alltext.replace('<hr id="system-readmore" \/>',"")
  56. //if (form.fulltext) {
  57. // alltext += form.fulltext.value;
  58. //}
  59. // do the images
  60. var temp = new Array();
  61. /*
  62. for (var i=0, n=form.imagelist.options.length; i < n; i++) {
  63. value = form.imagelist.options[i].value;
  64. parts = value.split( '|' );
  65. temp[i] = '<img src="images/stories/' + parts[0] + '" align="' + parts[1] + '" border="' + parts[3] + '" alt="' + parts[2] + '" hspace="6" />';
  66. }
  67. var temp2 = alltext.split( '{mosimage}' );
  68. var alltext = temp2[0];
  69. for (var i=0, n=temp2.length-1; i < n; i++) {
  70. alltext += temp[i] + temp2[i+1];
  71. }*/
  72. </script>
  73. <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
  74. </head>
  75. <body style="background-color:#FFFFFF">
  76. <table align="center" width="90%" cellspacing="2" cellpadding="2" border="0">
  77. <tr>
  78. <td class="contentheading" colspan="2"><script>document.write(title);</script></td>
  79. </tr>
  80. <tr>
  81. <script>document.write("<td valign=\"top\" height=\"90%\" colspan=\"2\">" + alltext + "</td>");</script>
  82. </tr>
  83. <tr>
  84. <td align="right"><a href="#" onClick="window.close()">Close</a></td>
  85. <td align="left"><a href="javascript:;" onClick="window.print(); return false">Print</a></td>
  86. </tr>
  87. </table>
  88. </body>
  89. </html>