Draft Editing/Loading Changes

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
Post Reply
User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Draft Editing/Loading Changes

Post by MichaelC »

I propose that you get the full post editor when editing drafts as currently all it gives you is a text box to edit drafts but as it is a full post it should have the full editor.

Drafts are quite often used for longer posts that you might work on, on a few times until your done (post it) so it shouldn't be expected that they will always be using the load draft button.

I also propose that after loading a draft and then re-pressing save draft it should edit the previous draft, not create a second draft.

Thoughts?
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: Draft Editing/Loading Changes

Post by imkingdavid »

MichaelC wrote:I propose that you get the full post editor when editing drafts as currently all it gives you is a text box to edit drafts but as it is a full post it should have the full editor.

Drafts are quite often used for longer posts that you might work on, on a few times until your done (post it) so it shouldn't be expected that they will always be using the load draft button.
I can agree to this. It would probably be best to just make posting_editor.html work in the drafts screen instead of recreating it there.
I also propose that after loading a draft and then re-pressing save draft it should edit the previous draft, not create a second draft.

Thoughts?
What we could do I suppose is add a new hidden field like "loaded_draft_id" which, if present, is used when the Save draft button is pressed.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: Draft Editing/Loading Changes

Post by MichaelC »

imkingdavid wrote:
MichaelC wrote:I propose that you get the full post editor when editing drafts as currently all it gives you is a text box to edit drafts but as it is a full post it should have the full editor.

Drafts are quite often used for longer posts that you might work on, on a few times until your done (post it) so it shouldn't be expected that they will always be using the load draft button.
I can agree to this. It would probably be best to just make posting_editor.html work in the drafts screen instead of recreating it there.
That was what i was expecting.
imkingdavid wrote:
I also propose that after loading a draft and then re-pressing save draft it should edit the previous draft, not create a second draft.

Thoughts?
What we could do I suppose is add a new hidden field like "loaded_draft_id" which, if present, is used when the Save draft button is pressed.
This is already done (the former part) as when you submit the post after loading then it deleted the draft so shouldn't be hard to do.
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

keith10456
Registered User
Posts: 523
Joined: Sat Apr 22, 2006 10:29 pm
Contact:

Re: Draft Editing/Loading Changes

Post by keith10456 »

+1.

Always wondered why it wasn't like that.

User avatar
DionDesigns
Registered User
Posts: 51
Joined: Sat Apr 21, 2012 4:29 am
Location: Uncertain due to momentum
Contact:

Re: Draft Editing/Loading Changes

Post by DionDesigns »

You already get the full post editor for drafts. The only reason the buttons/smileys aren't being displayed is because posting_editor.html and posting_buttons.html have some conditionals which aren't defined in ucp_main.php. Here's what is needed. Just above these lines:

Code: Select all

		// Set desired template
		$this->tpl_name = 'ucp_main_' . $mode;
Add:

Code: Select all

		if (isset($edit))
		{
			include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
			generate_smilies('inline', $draft['forum_id']);

			$bbcode_status	= ($config['allow_bbcode'] && $auth->acl_get('f_bbcode', $draft['forum_id'])) ? true : false;
			$smilies_status	= ($config['allow_smilies'] && $auth->acl_get('f_smilies', $draft['forum_id'])) ? true : false;
			$img_status		= ($bbcode_status && $auth->acl_get('f_img', $draft['forum_id'])) ? true : false;
			$url_status		= ($config['allow_post_links']) ? true : false;
			$flash_status	= ($bbcode_status && $auth->acl_get('f_flash', $draft['forum_id']) && $config['allow_post_flash']) ? true : false;

			$template->assign_vars(array(
				'S_BBCODE_ALLOWED'		=> $bbcode_status,
				'S_SMILIES_ALLOWED'		=> $smilies_status,
				'S_LINKS_ALLOWED'		=> $url_status,
				'S_BBCODE_IMG'			=> $img_status,
				'S_BBCODE_URL'			=> $url_status,
				'S_BBCODE_FLASH'		=> $flash_status,
				'S_BBCODE_QUOTE'		=> true,
				'BBCODE_STATUS'			=> ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
				'IMG_STATUS'			=> ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
				'FLASH_STATUS'			=> ($flash_status) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
				'SMILIES_STATUS'		=> ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
				'URL_STATUS'			=> ($bbcode_status && $url_status) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'],
			));
		}
And you'll now have the smileys and editor buttons available for editing drafts.

Post Reply