[Customisation Database Commits] [customisation-db] Allow editing the subject in quick edit. Ticket #63032.

Cesar G prototech91 at gmail.com
Sun Apr 15 13:01:47 BST 2012



commit fb8ac9af3539cb22bb9581b4c0bd3cefb2b2b962
Author: Cesar G <prototech91 at gmail.com>
Date:   Fri Apr 13 02:44:19 2012 -0700

    Allow editing the subject in quick edit. Ticket #63032.

diff --git a/titania/includes/objects/post.php b/titania/includes/objects/post.php
index 09178c1..d552890 100644
--- a/titania/includes/objects/post.php
+++ b/titania/includes/objects/post.php
@@ -174,6 +174,8 @@ class titania_post extends titania_message_object
 			$error[] = phpbb::$user->lang['EMPTY_SUBJECT'];
 		}
 
+		$this->post_subject = truncate_string($this->post_subject);
+
 		$message_length = utf8_strlen($this->post_text);
 		if ($message_length < (int) phpbb::$config['min_post_chars'])
 		{
diff --git a/titania/includes/tools/posting.php b/titania/includes/tools/posting.php
index e2f0d12..298013a 100644
--- a/titania/includes/tools/posting.php
+++ b/titania/includes/tools/posting.php
@@ -265,6 +265,7 @@ class titania_posting
 			add_form_key('postform');
 
 			phpbb::$template->assign_vars(array(
+				'SUBJECT'		=> $post_object->post_subject,
 				'MESSAGE'		=> $post_message,
 
 				'U_QR_ACTION'	=> $post_object->get_url('quick_edit'),
@@ -307,6 +308,7 @@ class titania_posting
 		$for_edit = $post_object->generate_text_for_edit();
 
 		// Set the post text
+		$post_object->post_subject = utf8_normalize_nfc(request_var('subject', '', true));
 		$post_object->post_text = utf8_normalize_nfc(request_var('message', '', true));
 
 		// Generate for storage based on previous options
@@ -332,6 +334,7 @@ class titania_posting
 		$parsed_attachments = $attachments->parse_attachments($message);
 
 		// echo the message (returned to the JS to display in the place of the old message)
+		echo '<span>' . censor_text($post_object->post_subject) . '</span>';
 		echo $message;
 
 		garbage_collection();
diff --git a/titania/js/common.js b/titania/js/common.js
index 0747243..9e58b06 100644
--- a/titania/js/common.js
+++ b/titania/js/common.js
@@ -113,6 +113,9 @@ $(document).ready(function(){
 						data: $(quickeditor).parent().serialize() + '&submit=1',
 						success: function(html){
 							$(quickeditor).parent().replaceWith('<div class="content text-content">' + html + '</div>');
+							var subject = $('.content:not(.original_post)', postbody).children('span:first-child');
+							$('h3 a', postbody).html($(subject).html());
+							$(subject).remove();
 						}
 					});
 
diff --git a/titania/styles/default/template/posting/quickedit_editor.html b/titania/styles/default/template/posting/quickedit_editor.html
index db032d1..69c0ae4 100644
--- a/titania/styles/default/template/posting/quickedit_editor.html
+++ b/titania/styles/default/template/posting/quickedit_editor.html
@@ -1,4 +1,5 @@
 <form method="post" action="{U_QR_ACTION}">
+	<label for="subject">{L_SUBJECT}:</label><input type="text" class="inputbox autowidth" value="{SUBJECT}" tabindex="1" maxlength="60" size="45" id="subject" name="subject"><br /><br />
 	<textarea style="height: 9em;" name="message" class="inputbox quickedit content elastic">{MESSAGE}</textarea>
 	<fieldset class="submit-buttons">
 		{S_FORM_TOKEN}




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://code.phpbb.com/pipermail/customisationdb-commits/attachments/20120415/4037187c/attachment-0001.html>


More information about the customisationdb-commits mailing list