Page 1 of 1

[FAQ] AJAX Quick Edit

Posted: Fri 9. Oct 2009, 14:13
by Marc

Add an "Advanced Edit Button" to Quick Edit

Posted: Fri 9. Oct 2009, 14:27
by Marc
Version: 1.0.9

Open quickedit.php
Find:

Code: Select all

        'MAX_FONT_SIZE'            => (int) $config['max_post_font_size'], 
After add:

Code: Select all

        'U_ADVANCED_EDIT'        => (!$user->data['is_registered']) ? '' : ((($auth->acl_get('f_edit', $row['forum_id']) && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_edit', $row['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$row['forum_id']}&p={$row['post_id']}") : ''),
        'L_ADVANCED_EDIT'        => 'Advanced Edit', 
For prosilver based styles:
Open styles/*yourstyle*/template/quickedit.html
Find:

Code: Select all

<input class="button2" type="button" onclick="cancel_changes({POST_ID});" value="{L_CANCEL}" style="font-size:0.9em;" />
After add:

Code: Select all

<input class="button2" type="button" onclick="parent.location='{U_ADVANCED_EDIT}';" value="{L_ADVANCED_EDIT}" style="font-size:0.9em;" />
For subsilver2 based styles:
Open styles/*yourstyle*/template/quickedit.html
Find:

Code: Select all

<input class="button2" type="button" onclick="cancel_changes({POST_ID});" value="{L_CANCEL}" style="font-size:0.9em;" />
After add:

Code: Select all

<input class="button2" type="button" onclick="parent.location='{U_ADVANCED_EDIT}';" value="{L_ADVANCED_EDIT}" style="font-size:0.9em;" />

Open Advanced Edit when clicking on "Quickedit" the second t

Posted: Fri 12. Feb 2010, 18:29
by Marc
Open styles/*yourstyle*/template/quickedit.html
Find:

Code: Select all

<input class="button2" type="button" onclick="advanced_edit({POST_ID}, '{U_ADVANCED_EDIT}');" value="{L_ADVANCED_EDIT}" style="font-size:0.9em;" />
Replace with:

Code: Select all

<input class="button2" id="advanced_edit" type="button" onclick="advanced_edit({POST_ID}, '{U_ADVANCED_EDIT}');" value="{L_ADVANCED_EDIT}" style="font-size:0.9em;" />
Find:

Code: Select all

var open_quick_edit = 0;
After add:

Code: Select all

var check_post_id = 0;
Find:

Code: Select all

	if (open_quick_edit != 1 && check == null)
	{
		divname = 'postdiv' + post_id;
		document.getElementById('postdiv' + post_id).innerHTML = '<img src="{T_THEME_PATH}/images/ajax-loader.gif" style="margin: 60px auto; display: block;" />';
		get_text(post_id);
		open_quick_edit = 1;
	}
Replace with:

Code: Select all

	if (open_quick_edit != 1 && check == null)
	{
		divname = 'postdiv' + post_id;
		document.getElementById('postdiv' + post_id).innerHTML = '<img src="{T_THEME_PATH}/images/ajax-loader.gif" style="margin: 60px auto; display: block;" />';
		get_text(post_id);
		open_quick_edit = 1;
		check_post_id = post_id;
	}
	else if (open_quick_edit == 1 && check != null && check_post_id == post_id)
	{
		document.getElementById('advanced_edit').onclick();
	}