Location: PHPKode > projects > openRiverbed > template/default/article_ajax_editform.tpl
<div id="article_ajax_edit_form" style="display:none">
	<div id="article_status_editor" class="status-{{$l_status}}">
			<div><strong>{{$l_status_label}} / {{$l_edit_time}} / {{$l_author_name}}</strong></div>
	</div>
	<div id="article-edit-top">

			<a href="#" id="editbutton-text"
			onclick="set_texteditbutton_style()"
			><img src="./bilder/edit.gif"/>{{$l_core_message_article_edit}}</a>
			<a href="#" id="editbutton-image"
			onclick="set_imageeditbutton_style()"
			><img src="./bilder/new_img.gif"/>{{$l_core_message_picture_edit}}</a>
			<a href="#" id="editbutton-preview"
			onclick="set_previeweditbutton_style()"
			><img src="./bilder/lupe.gif"/>{{$l_core_button_preview}}</a>
	</div>

	<div id ="textdata" class="article-edit">

		<input type="hidden" id="f_content_art_id" name="f_content_art_id" value="{{$art_id}}"/>
		<input type="hidden" id="f_content_id" name="f_content_id" value="{{$content_id}}"/>

		<dl class="formdata">
		<dt>
		<label for="f_content_title">{{$l_core_label_title}}</label>
		<input id="f_content_title" class="title" type="text" name="f_content_title" value="" onchange="set_save_button()"/>
		</dt>
		<dt>
		<label for="f_subtitle">{{$l_core_label_subtitle}}</label>
		<input id="f_content_subtitle" class="subtitle" type="text" name="f_content_subtitle" value="" onchange="set_save_button()"/>
		</dt>
		<dt>
		<label for="f_content">{{$l_core_label_text}}</label>
		<textarea id="f_content" name="f_content" cols="42" rows="15"></textarea>
		</dt>
		</dl>
		<div class="button">
			<a id="button_article_save" href="#"
					onclick="tinyMCE.triggerSave();xajax_save_article(xajax.getFormValues('main', false, 'f_content')); return false;">
							<img src="./bilder/speichern1.gif"/>
							{{$l_core_button_save}}
			</a>
			<div id="article-status-message" class="message"></div>
		</div>
	</div>


	<div id="imagedata" class="article-edit" style="display:none;">

		<div id="picture_edit_mode" style="display:none">
			<label for="f_image_destination">{{$l_core_label_image_selection}}</label>
			<select id="f_image_destination" name="f_image_destination">
				<option id="opt1" value="all" selected="selected" >
					{{$l_core_label_image_option}}
				</option>
			</select>
			<div id="image-preview">
				<p>
					<img id="thumb_short" src="" alt="Image"/>
					{{$l_core_description_image_size_list}}
				</p>

				<p>
					<img id="thumb_big" src="" alt="Image" />
					{{$l_core_description_image_size_zoom}}
				</p>
			</div>
			<div class="clear">&nbsp;</div>
		</div>

		<input id="f_image_id" type="hidden" name="f_image_id" value=""/>
		<label for="f_image_file">{{$l_core_label_image_upload}} </label>
		<div id="image_upload_hint" class="message">{{$l_label_image_upload_in_progress}}</div>
		<div id="image_upload_div">
        	<input id="f_image_file" type="file" name="f_image_file"
         		onchange="	if($F('f_content_id')==''){
		         				$('f_image_file').value='';
		         				window.alert('{{$l_label_image_upload_not_allowed}}');
		         				return false;
		         			}else{
		         				$('image_upload_div').hide();
		         				$('image_upload_hint').show();
		         				xajax.upload('image_upload','main');
		         				document.main.submit();
		         				$('f_image_file').value=''}"/>
		</div>
		<div id="image_upload_message" class="message" style="display:none"></div>

		<label for="f_image_text">{{$l_core_label_image_caption}}</label>
		<textarea id="f_image_text" name="f_image_text"></textarea>
		<div class="button">
			<a href="#" id="button_image_save"
					onclick="xajax_save_image_text(xajax.getFormValues('main')); return false;">
							<img src="./bilder/speichern1.gif"/>
							{{$l_core_button_save}}
			</a>
			<a href="#" id="button_del_image"
					onclick="$('image_upload_message').innerHTML='{{$l_core_message_picture_del}}';$('image_upload_message').show(),xajax_del_image(xajax.getFormValues('main')); return false;">
							<img src=""/>
							{{$l_core_button_del_image}}
			</a>
			<a href="#" id="button_new_image"
					onclick="make_new_picture_mode(); return false;">
							<img src="./bilder/new_img.gif"/>
							{{$l_core_button_add_image}}
			</a>
		</div>

		<h2>{{$l_core_message_picture_preview}}</h2>
		<div id="image-preview-list">

		</div><!--#####ende image-preview#####-->
		<div class="clear">&nbsp;</div>

	</div><!--#####article-edit#####-->
	<div id="article_output" style="display:none;"></div>

	<div class="button-blue">
			<a href="#"
					onclick="xajax_all_article(); return false;">
							<img src="./bilder/abort.gif" alt="abort"/>
							{{$l_core_but_break}}
			</a>
			<input type="hidden" id="f_content_published" name="f_content_published" value="{{$f_content_published}}"/>
			<a id="publish_article" href="#"
					onclick="tinyMCE.triggerSave(true, true);xajax_publish_article(xajax.getFormValues('main', false, 'f_content')); return false;">
							<img src="./bilder/www.gif" alt="toggle publish"/>
							{{$l_core_button_publish}}
			</a>
			<a href="#"
				onclick="	if (confirm('{{$l_confirm_delete_begin}}{{$l_confirm_delete_end}}')){
								xajax_del_article($F('f_content_id'));return false;
							}
							else{
								return false;
							}">
				<img src="./bilder/delete.gif" alt="delete"/>{{$l_core_button_delete}}</a>

		</div>
		<div class="clear">&nbsp;</div>

	<script type="text/javascript">
	tinyMCE_GZ.init({
		plugins : 'inlinepopups,advimage,contextmenu',
		themes : 'advanced,contextmenu',
		languages : '{{$f_lang_2}}',
		entity_encoding : 'raw',
		disk_cache : true,
		debug : false
	});
	</script>
	<script language="javascript" type="text/javascript">
	set_texteditbutton_style();
	tinyMCE.init({
				mode : 'none',
				//elements : 'f_content',
				theme : 'advanced',
				external_image_list_url : 'index.php?f_action_id=6000000&f_article_id=',
				plugins : 'inlinepopups,contextmenu,advimage,imagemanager',
				onchange_callback: 'set_save_button',
				init_instance_callback : 'register_init_instance',
				languages : '{{$f_lang_2}}',
				dialog_type : 'modal',
				convert_urls : false,
				content_css : '{{$tpl_editor_css_datei}}',
				entity_encoding : 'raw',
				theme_advanced_buttons1 : 'bold,italic,justifyleft,justifycenter,justifyright,bullist,numlist',
				theme_advanced_buttons2 : 'separator,link,unlink,separator,image,removeformat,formatselect{{$tpl_tiny_button_adds}}',
				theme_advanced_buttons3 : '',
				theme_advanced_toolbar_location : 'top',
				theme_advanced_toolbar_align : 'left',
				theme_advanced_statusbar_location : 'bottom',
				//theme_advanced_resizing : true,
				//theme_advanced_source_editor_width : '500',
				width : '100%',
				button_tile_map : true,
				extended_valid_elements : 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]'
				});
	function set_save_button() {
		//alert('test');
		Element.setStyle('button_article_save', {color:'#00DDFF'});
	}
	var orb_editor_inst = '';
	function register_init_instance(inst) {
		orb_editor_inst = inst.editorId
	}
	function mce_reset() {
		if (!orb_editor_inst) {
			tinyMCE.execCommand('mceAddControl',false,'f_content');
		}
		tinyMCE.execCommand('mceFocus',true,orb_editor_inst);
		tinyMCE.updateContent('f_content');
		//tinyMCE.execInstanceCommand(orb_editor_inst, 'mceInsertRawHTML',false,$('f_content').innerHTML);
		//tinyMCE.triggerSave();
		//tinyMCE.execInstanceCommand(orb_editor_inst, 'mceRepaint');
		tinyMCE.execCommand('mceBeginUndoLevel');
		//alert('Test:'+orb_editor_inst);
	}
	function make_edit_picture_mode() {
		/* variable Parameter der Funktion */
		//$('image_action_label').innerHTML = '{{$l_core_label_image_action_change}}';
		$('f_image_id').value=arguments[0];
		$('thumb_short').src=arguments[2];
		$('thumb_big').src=arguments[1];
		$('f_image_text').value = arguments[3];
		$('image_upload_hint').hide();
		$('image_upload_div').show();
		if (!$('opt2')) {
			Element.remove('opt1');
			new Insertion.Top('f_image_destination',
			'<option id="opt1" value="all" selected="selected" >{{$l_core_select_image_size_all}}</option><option id="opt2" value="short">{{$l_core_select_image_size_list}}</option><option id="opt3" value="normal">{{$l_core_select_image_size_zoom}}</option>');

		}
		else {

		}

		if (Element.getStyle('picture_edit_mode', 'display')=='none') {
			Effect.BlindDown('picture_edit_mode');
			/*Element.toggle('picture_edit_mode');
			*/
			//$('button_new_image').show();
			$('button_del_image').show();
		}

	}
	function make_new_picture_mode() {
		//$('image_action_label').innerHTML = '{{$l_core_label_image_action_new}}';
		$('f_image_id').value= -1;
		$('f_image_text').value = '';
		$('f_image_file').value = '';
		$('image_upload_hint').hide();
		$('image_upload_div').show();
		if ($('opt2')) {
			Element.remove('opt1');
			Element.remove('opt2');
			Element.remove('opt3');
			new Insertion.Top('f_image_destination',
			'<option id="opt1" value="all" selected="selected" >{{$l_core_label_image_size_all}}</option>');
		}
		$('picture_edit_mode').hide();
		$('button_new_image').hide();
		$('button_del_image').hide();
		//$('image-preview-list').innerHTML = '';
		$('thumb_short').src='';
		$('thumb_big').src='';
	}

	function set_texteditbutton_style() {
		$('textdata').show();$('imagedata').hide();$('article_output').hide();
			Element.setStyle('editbutton-text', {color:'#000000', backgroundImage:'url(./bilder/bg_headedit_hover.jpg)'} );
			Element.setStyle('editbutton-image', {color:'#999999', backgroundImage:'url(./bilder/bg_headedit2.jpg)'} );
			Element.setStyle('editbutton-preview', {color:'#999999', backgroundImage:'url(./bilder/bg_headedit2.jpg)'} );
			;return false;
	}
	function set_imageeditbutton_style() {
		$('textdata').hide();$('imagedata').show();$('article_output').hide();
		Element.setStyle('editbutton-text', {color:'#999999', backgroundImage:'url(./bilder/bg_headedit2.jpg)'} );
		Element.setStyle('editbutton-image', {color:'#000000', backgroundImage:'url(./bilder/bg_headedit_hover.jpg)'} );
		Element.setStyle('editbutton-preview', {color:'#999999', backgroundImage:'url(./bilder/bg_headedit2.jpg)'} );
		//xajax.initFileInputs();
		;return false;
	}
	function set_previeweditbutton_style() {
		$('textdata').hide();$('imagedata').hide();$('article_output').show();
			Element.setStyle('editbutton-text', {color:'#999999', backgroundImage:'url(./bilder/bg_headedit2.jpg)'} );
			Element.setStyle('editbutton-image', {color:'#999999', backgroundImage:'url(./bilder/bg_headedit2.jpg)'} );
			Element.setStyle('editbutton-preview', {color:'#000000', backgroundImage:'url(./bilder/bg_headedit_hover.jpg)'} );
			;return false;
	}

	pic_nr = 0;
	max_pics = 10;
	function change_hightlight(new_pic_nr) {
		Element.addClassName('multipic_link_'+new_pic_nr, 'active');
		Element.removeClassName('multipic_link_'+pic_nr, 'active');

		pic_nr = new_pic_nr;
	}

	function change_next() {
		if (pic_nr < max_pics-1) {
			$('image_article').src=image_list[pic_nr+1];
			$('image_text_long').innerHTML=text_list[pic_nr+1];
			change_hightlight(pic_nr+1);
		}
	}

	function change_prev() {
		if (pic_nr>0) {
			$('image_article').src=image_list[pic_nr-1];
			$('image_text_long').innerHTML=text_list[pic_nr-1];
			change_hightlight(pic_nr-1);
		}
	}
	</script>
</div>
<!--##### ende template article_ajax_edit_form #####-->
Return current item: openRiverbed