Location: PHPKode > projects > ADbNewsSender > ADbNewsSender_2.0.4/protected/admin/specialheaders/drafts.php.inc
<?php
//Copyright (c) Florian Grannemann
//Last change in version: 2.0.2
/*
    ******************************************************************************
    ADbNewsSender 2

    Copyright (C) 2009  Florian Grannemann (hide@address.com)
    Website: http://adbnewssender.sf.net



    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    any later version.

    This program 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 General Public License for more details.

    You should have received a copy of the GNU General Public License			
    along with this program.  If not, see http://www.gnu.org/licenses/
    ******************************************************************************
*/
//Adding TinyMCE 
//The TinyMCE librarys are licensed under LGPL

//is  TinyMCE enabled?
if($MyCFG->get_config_value("EnableTinyMCE")=="yes")
{
//yes: 
   
   
    if($_REQUEST["DraftsOption"] =="edit")
    {
	 //if a file has been uploaded:
	if($_FILES["uploadfile".$_SESSION["CurrentNL"]]['tmp_name'])
	{
	    if(!$_FILES["uploadfile".$_SESSION["CurrentNL"]]["error"])
	    {
		if($_FILES["uploadfile".$_SESSION["CurrentNL"]]["type"]!="text/html")
		{
		    $_SESSION["Drafts".$_SESSION["CurrentNL"]."_type"]="text";
		}
		else
		{
		    $_SESSION["Drafts".$_SESSION["CurrentNL"]."_type"]="html";
		}
	    
	    }
	}
   
	  //setting default newsletter type to html:
	if(!$_SESSION["Drafts".$_SESSION["CurrentNL"]."_type"])
	{
	    $_SESSION["Drafts".$_SESSION["CurrentNL"]."_type"]="html";

	}
	 //because toggeling TinyMCE from hide to show via javascript caused some problems when submiting the form
	//i had to let the form do a submit()  after changing the newsletter type.
    
	if($_REQUEST["Drafts".$_SESSION["CurrentNL"]."_type"])
	{
	    $_SESSION["Drafts".$_SESSION["CurrentNL"]."_type"]=$_REQUEST["Drafts".$_SESSION["CurrentNL"]."_type"];
	    $_SESSION["Drafts".$_SESSION["CurrentNL"]."_Body"]=$_REQUEST["Drafts".$_SESSION["CurrentNL"]."_Body"];
	    $_SESSION["Drafts".$_SESSION["CurrentNL"]."_Subject"]=$_REQUEST["Drafts".$_SESSION["CurrentNL"]."_Subject"];

	}



?>

<!-- TinyMCE -->
<script type="text/javascript" src="specialheaders/tinymce/tiny_mce.js"></script>
<script type="text/javascript">
<?php

	if($_SESSION["Drafts".$_SESSION["CurrentNL"]."_type"] =="html")
	{
		//including tinyMCE language settings:
		include "$path_to_languagefolder/tinymce_language.php.inc";

?>

	tinyMCE.init({
		// General options
		language: "<?php print $TinyMCELangPack;?>",
		mode : "textareas",
		theme : "advanced",
		relative_urls : false,
		remove_script_host : false,
		plugins : "safari,pagebreak,style,layer,table,advhr,advimage,advlink,iespell,insertdatetime,media,searchreplace,print,paste,directionality,fullscreen,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups",
		
		// Theme options

		theme_advanced_buttons1 : "newdocument,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,inserttime,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,iespell,media,advhr",
		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,
		height:"270",
		//width:"60px",
		// Example word content CSS (should be your site CSS) this one removes paragraph margins
		content_css : "",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});

<?PHP } ?>
    
function switchEditor()
{
    document.EditDraft.DraftsOption.value="edit";
    
	 
    document.EditDraft.submit();
    
}


</script>
<!-- /TinyMCE -->
<?
	
    }








}
//if not, nothing will happen.

?>


Return current item: ADbNewsSender