[FAQ] AJAX Quick Edit

Current Version: 1.0.11
Released: 02/12/2010
Benutzeravatar
Marc
Administrator
Administrator
Beiträge: 619
Registriert: Di 2. Sep 2008, 23:48
phpbb.com: Marc
Wohnort: Munich

[FAQ] AJAX Quick Edit

Beitrag von Marc »

Bild

Benutzeravatar
Marc
Administrator
Administrator
Beiträge: 619
Registriert: Di 2. Sep 2008, 23:48
phpbb.com: Marc
Wohnort: Munich

Add an "Advanced Edit Button" to Quick Edit

Beitrag von Marc »

Version: 1.0.9

Open quickedit.php
Find:

Code: Alles auswählen

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

Code: Alles auswählen

        '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: Alles auswählen

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

Code: Alles auswählen

<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: Alles auswählen

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

Code: Alles auswählen

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

Benutzeravatar
Marc
Administrator
Administrator
Beiträge: 619
Registriert: Di 2. Sep 2008, 23:48
phpbb.com: Marc
Wohnort: Munich

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

Beitrag von Marc »

Open styles/*yourstyle*/template/quickedit.html
Find:

Code: Alles auswählen

<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: Alles auswählen

<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: Alles auswählen

var open_quick_edit = 0;
After add:

Code: Alles auswählen

var check_post_id = 0;
Find:

Code: Alles auswählen

	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: Alles auswählen

	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();
	}
Bild