<?php


function M_DIST_DESC_HTML($TYPE, $VALUE) {
global $thiss, $ARG1, $ARG1_VAL, $result;

if ($TYPE == 'POST_VERIFY') {
//echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;">';print_r($_REQUEST);echo'</pre>';
	return;
}

if ($_SESSION['CURRENT_MENU'] == $thiss->DETECT_EDIT_FUNCTION || $_SESSION['LAST_MENU'] == $thiss->DETECT_EDIT_FUNCTION) {
	if ($_SESSION[$thiss->DETECT_TABLE_COLUMN]['WIEVID'] == $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['ID']) {

// TODO: update data from DB to SES - $_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']

		//if (strlen($_SESSION[$thiss->DETECT_TABLE_COLUMN][EDITRECORD][__FUNCTION__]) > 0) {}

		echo '<font size=-1>';
		CREATE_MENUFUNC_INIT_2('M_DIST_DESC_HTML', 'M_DIST_DESC_HTML', 'EDIT_HTML', 'EDYTUJ HTML');
		echo '</font>';

		if ($_SESSION['CURRENT_MENU'] == 'M_DIST_DESC_HTML') {
			echo '<form action="" method="POST">';
			echo '<input type="hidden" name="FUNCTION_INIT" value="UPDATEDB" />';
			echo '<table cellspacing=0 cellpadding=4 border=0>';
			echo'<tr>';
				echo'<td>';
			GETFORMITEM(stripslashes($_SESSION[$thiss->DETECT_TABLE_COLUMN]['EDITRECORD']['M_DIST_DESC_HTML']), $_SESSION[$thiss->DETECT_TABLE_COLUMN]['TYPE']['M_DIST_DESC_HTML'], 'M_DIST_DESC_HTML');
				echo'</td>';
				echo'<td style="vertical-align:top;">';
					echo '<p>' . "<b>Podział tekstu na strony:</b>";
						echo '<br />' . " - w miejsce podziału strony klknij <code>'Insert page break'</code> ";
						$st = "background:#F0F0EE url(stuff/tiny_mce/themes/advanced/img/icons.gif) no-repeat 20px 20px; background-position: 0 -40px;";
						echo '<img src="stuff/i/blank.gif" style="' . $st . '" width="20" height="20" />';
					echo '</p>';
					echo '<p>' . "<b>Wstawianie linka:</b>";
						echo '<br />' . " - zaznacz tekst, który ma być linkiem";
						echo '<br />' . " - kliknij <code>'insert/edit link'</code> ";
						$st = "background:#F0F0EE url(stuff/tiny_mce/themes/advanced/img/icons.gif) no-repeat 20px 20px; background-position: -500px 0;";
						echo '<img src="stuff/i/blank.gif" style="' . $st . '" width="20" height="20" />';
						echo '<br />' . " - wpisz adres w pole <code>'Link URL'</code> lub wybierz z listy <code>'Link list'</code>" ;
						echo "<i>(Na li¶cie 'Link list' znajduj± się linki do plików z katalogu projektu)</i>";
						echo '<br />' . " - w polu <code>'Target'</code> można ustawić, żeby link otwierał się w nowym oknie: <code>'Open in new window (_blank)'</code>";
					echo '</p>';
					
				echo'</td>';
			echo'</tr>';

			echo '<tr>';
				echo '<td colspan="2" align="center">';
					echo '<input type="submit" value="      Zapisz      ">';
				echo '</td>';
			echo '</tr>';
			echo '</table>';
			echo '</form>';
			CREATE_MENUFUNC_NOTD_INIT($_SESSION['LAST_MENU'], 'POWROT<img src=icon/back.gif border=0 alt=POWROT>');
			echo '<hr>';

			if ($ARG1_VAL == 'EDIT_HTML') {
				echo'<!-- Load jQuery -->';
				echo'<script type="text/javascript" src="stuff/jquery.js"></script>';

				echo'<!-- Load TinyMCE -->';
				echo'<script type="text/javascript" src="stuff/tiny_mce/jquery.tinymce.js"></script>';
				echo'<!-- config -->';
?>
<script type="text/javascript">

jQuery().ready(function(){
jQuery('textarea[name=M_DIST_DESC_HTML]').width('800px').height('600px').tinymce({
// Location of TinyMCE script
script_url : 'stuff/tiny_mce/tiny_mce.js',

// General options
theme : "advanced",
plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,

// Example content CSS (should be your site CSS)
content_css : "stuff/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",

// prevent changing absolute url to relative
relative_urls: false,
remove_script_host: false,

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

</script>
	<?php
			}
		}// if ($_SESSION['CURRENT_MENU'] == 'M_DIST_DESC_HTML')
	}
}

}













