<?php
function smarty_function_htmleditor( $params, $template ){
	return '<script language="javascript" type="text/javascript">
	/* <![CDATA[ */
	$().ready(function() {
		tinymce.init({
			language : \'pl\', //dostêpne jêzyki: be, cs, da, de, el, en_GB, es, fr_FR, hu_HU, is_IS, it, lt, lv, nb_NO, nl, pl, pt_PT, ro, ru, sk, sl_SI, sv_SE, tr, uk
			selector : \'textarea#' . change2Url( $params['sName'] ) . '\',
			script_url : \'plugins/tinymce_jq/tinymce.min.js\',
			plugins : "anchor,charmap,hr,image,link,emoticons,code,textcolor,table,visualchars,visualblocks,nonbreaking",
			image_advtab: true,
			tools : "inserttable",
			toolbar : [ "undo redo | styleselect fontselect fontsizeselect | bold italic forecolor backcolor", "alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | visualchars visualblocks nonbreaking" ],
			link_list : "admin.php?p=files-list_links&iPage=' . $GLOBALS['iPage'] . '&iProduct=' . $GLOBALS['iProduct'] . '&iBox=' . $GLOBALS['iBox'] . '",
			image_list : "admin.php?p=files-list_images&iPage=' . $GLOBALS['iPage'] . '&iProduct=' . $GLOBALS['iProduct'] . '&iBox=' . $GLOBALS['iBox'] . '",
			convert_urls: false
		});
	});
	/* ]]> */
	</script>
	<textarea name="' . $params['sName'] . '" id="' . change2Url( $params['sName'] ) . '" rows="20" cols="100" style="width:' . $params['iW'] . ';height:' . $params['iH'] . ';" tabindex="1">' . htmlspecialchars( $params['sContent'] ) . '</textarea>';
}