phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

[RFC] Move inbox to top module in UCP Private Messages Tab

Publish your own request for comments or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.1/Ascraeus and 3.2/Arsia.

Re: [RFC] Move inbox to top module in UCP Private Messages T

Postby brunoais » Thu Jan 26, 2012 6:54 pm

Anyway, I think the inbox should be the default but the place where everything is (buttons essentially) should remain the same.
is that what this is about?
brunoais
Registered User
 
Posts: 626
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Move inbox to top module in UCP Private Messages T

Postby MichaelC » Thu Jan 26, 2012 8:48 pm

The order of modules in UCP --> Private Messages is:

Compose PM
Manage PM Drafts
--------------------
Inbox
Outbox
Sent messages
------------------
Rules, folders and settings.


This would change it to:

Inbox
Outbox
Sent Messages
---------------------
Compose Messages
Manage PM Drafts
---------------------
Rules, Folders and Settings.


So when your in the UCP and you select the Private Messages Tab then it comes up with the inbox module, not the compose message module.
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
MichaelC
Website Team
Website Team
 
Posts: 797
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Move inbox to top module in UCP Private Messages T

Postby brunoais » Sat Jan 28, 2012 10:41 am

Bad news. The 3 things:
Inbox, Outbox, Sent Messages
Are not modules in the system, they are treated seperatly.
It's impossible to rearrange them and get that effect.
I studied the situation and the only solution I found is a way I don't like. Hammering the result.
mcp.php (or anyone in the way of choosing):
ADD:
Code: Select all

if($id == 176){
    $id = 'ucp_pm';
}
 


But I believe that way is wrong but is the only way I found to solve it.

The problem behind this is simple:
The folder system for pm is not a module.
The compose pm is a module (same for the rest of the visible options outside that group)
The phpbb system defaults obligatory to the first (sub-)module when the i is a number.
If i is a number, the inbox can never be the default selection.
What this does it to pick the id of the pm module. If it is the same, replace it with a string the main system can identify and understand that it reefers to the pm module specifically. When that happens, it's the inbox what appears by default.

Any other suggestions about how I can solve this without using a hammering like this?
Is making an extra query to the DB a valid option to find if the id corresponds to the PM system?

[hr]

Another way to attack this (according to my findings) is when the links are formed.
I don't know how much impact does this give but a way that seems possible is to use the module_basename instead of module_id when building the links.
I just found this option and I'll try to apply it. I'll see if I'm able to do this properly. Seems like a better way than hammering the option.

SQL:
Code: Select all
UPDATE modules SET  module_basename = 'ucp_pm' WHERE module_id = 176

About line 149:
Replace:
Code: Select all

$u_title 
$module_url $delim 'i=' . (($item_ary['cat']) ? $item_ary['id'] : $item_ary['name'] . (($item_ary['is_duplicate']) ? '&icat=' $current_id '') . '&mode=' $item_ary['mode']);
 

With:
Code: Select all

$u_title 
$module_url $delim 'i=' . (($item_ary['cat']) ? (!empty($item_ary['name']) ? $item_ary['name'] : $item_ary['id'] ) : $item_ary['name'] . (($item_ary['is_duplicate']) ? '&icat=' $current_id '') . '&mode=' $item_ary['mode']);
 


With this it'll use named menus when available. I don't know the limitations of this option, though. Is it problematic? If two categories have the same basename it's possible that the system will collapse if I use this.

Which option is best? I can't find a better one to solve this. Any proposals?
brunoais
Registered User
 
Posts: 626
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Move inbox to top module in UCP Private Messages T

Postby MichaelC » Sat Jan 28, 2012 8:50 pm

Bizarre. I just looked in the ACP and apparently the order there is:

View Messages (Hidden)
Compose PM
Manage PM Drafts
Rules, Folders and Settings
PM Popup (Hidden)

I've had a look around and can't see anything similar to this so maybe it should be changed (to modules) for consistency?
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
MichaelC
Website Team
Website Team
 
Posts: 797
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Move inbox to top module in UCP Private Messages T

Postby imkingdavid » Sat Jan 28, 2012 9:13 pm

Unknown Bliss wrote:Bizarre. I just looked in the ACP and apparently the order there is:

View Messages (Hidden)
Compose PM
Manage PM Drafts
Rules, Folders and Settings
PM Popup (Hidden)

I've had a look around and can't see anything similar to this so maybe it should be changed (to modules) for consistency?

Inbox/Outbox/Sentbox are all folders, not modules. It wouldn't make sense to change them to modules because then how would you handle adding new folders?

Perhaps if the folders listing were moved above the Compose module link they would be loaded by default? But I'm not entirely sure how that works at the moment.
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
imkingdavid
Development Team
Development Team
 
Posts: 900
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] Move inbox to top module in UCP Private Messages T

Postby brunoais » Sun Jan 29, 2012 9:13 am

imkingdavid wrote:Perhaps if the folders listing were moved above the Compose module link they would be loaded by default? But I'm not entirely sure how that works at the moment.

That may be called wierd but the complete folders system is not a module.
The folders is a complete separated system. It cannot be moved, disabled, deleted, etc... It's not a module.

For prosilver, the theme was hammered so that 2 things appear at the top, then the folders, then the rest of the things. That's how it is coded.
(I believe subsilver2 has something similar)

What should we do about that?
brunoais
Registered User
 
Posts: 626
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Move inbox to top module in UCP Private Messages T

Postby MichaelC » Mon Jan 30, 2012 12:19 am

brunoais wrote:
imkingdavid wrote:Perhaps if the folders listing were moved above the Compose module link they would be loaded by default? But I'm not entirely sure how that works at the moment.

That may be called wierd but the complete folders system is not a module.
The folders is a complete separated system. It cannot be moved, disabled, deleted, etc... It's not a module.

For prosilver, the theme was hammered so that 2 things appear at the top, then the folders, then the rest of the things. That's how it is coded.
(I believe subsilver2 has something similar)

What should we do about that?


Recode it so that in your words, it has hammered in, folders at the top, then everything else?
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
MichaelC
Website Team
Website Team
 
Posts: 797
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Move inbox to top module in UCP Private Messages T

Postby brunoais » Mon Jan 30, 2012 3:00 pm

Unknown Bliss wrote:
brunoais wrote:
imkingdavid wrote:Perhaps if the folders listing were moved above the Compose module link they would be loaded by default? But I'm not entirely sure how that works at the moment.

That may be called wierd but the complete folders system is not a module.
The folders is a complete separated system. It cannot be moved, disabled, deleted, etc... It's not a module.

For prosilver, the theme was hammered so that 2 things appear at the top, then the folders, then the rest of the things. That's how it is coded.
(I believe subsilver2 has something similar)

What should we do about that?


Recode it so that in your words, it has hammered in, folders at the top, then everything else?

Pull request denied. As I expected, the changes I made were considered wrong and this is no way of solving the thing.
Any suggestions about how to make this thing work?
brunoais
Registered User
 
Posts: 626
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Move inbox to top module in UCP Private Messages T

Postby imkingdavid » Wed Feb 01, 2012 9:35 pm

EDIT: The following post is inaccurate, as I found after trying stuff out. Apparently modules are handled differently if you use the numeric id rather than the string (name) in the URL. Fun. Not.

Alright, so here's the situation as I understand it.

Viewing folders is handled by the "view" mode of the ucp_pm module. However, that mode is hidden by default (aka "display" is set to false).

In includes/functions_module.php, here is line 405:
Code: Select all
($item_ary['parent'] === $category && !$item_ary['cat'] && !$icat && $item_ary['display']) || 

That is the part of the conditional that is tripped when only a category id (in this case i=176 in the URL) is given. The kicker is the last part of the conditional: && $item_ary['display']
As you can see, it would show the 'view' mode by default if it were displayed. You can test this by setting it to display in the ACP. However, this causes both "View messages" and "Inbox" (or any folder name chosen) to display as active on the page (white with red text) which can be confusing and is not ideal. EDIT: However, if you set the view module to display = false and then manually go to &mode=view, then it will display the inbox while not displaying the "View messages" thing on the side.

The fix I can think of is allowing modules to set a "default" module. This would be a broader fix outside of the scope of this RFC itself, and this RFC would depend on that one. The way to do this would be to add to the modules table a default_mode column and then regardless of "display", as long as that mode is enabled, display that by default. If it is not active, then go by the current behavior. EDIT: Note that if we do that fix, we will need to also let it fall back on the current behavior when no default mode is specified.

Does that make sense?
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
imkingdavid
Development Team
Development Team
 
Posts: 900
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] Move inbox to top module in UCP Private Messages T

Postby imkingdavid » Fri Feb 03, 2012 2:24 am

Originally, it was recommended to move the folders to the top so that they would be loaded by default. However, as we found out, the 'view' mode is first but is set to display none, so it is skipped when the module is accessed via ID.

So the solution to the real problem (folders not showing by default) is no longer to move the folders to the top. So I propose that we actually keep them where they are. I say this for the following reasons:
1) people are used to it in phpBB
2) in email programs, such as gmail, compose is at the top and folders are displayed beneath. It's like an unwritten convention in how to display things, and it's what I (and I suspect many others) expect.

What do you think?
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
imkingdavid
Development Team
Development Team
 
Posts: 900
Joined: Thu Jul 30, 2009 12:06 pm

Previous Next

Return to [3.x] RFCs

Who is online

Users browsing this forum: No registered users and 10 guests