API page: http://api.drupal.org/api/drupal/core--modules--system--system.module/fu...

Describe the problem you have found:

This has pretty tangled logic which the docs don't cover at all.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim’s picture

Status: Active » Needs review
FileSize
743 bytes

Here's a patch.

jhodgdon’s picture

Status: Needs review » Needs work

Seems like a good thing to fix, thanks!

The documentation in the patch needs some cleanup:
- All lines should wrap as close to 80 characters as possible without going over.
- Needs some copy editing (grammar etc.).
- "ie" should be "i.e.,".
- "UI" should be written out as "user interface".

It's also actually not accurate to say there is no user interface for this. There is a path for it (admin/compact), so if someone visits admin/compact/on or admin/compact/off, it will turn compact mode on/off. theme_system_compact_link() makes these links, and this is called in several places in the code.

joachim’s picture

admin/compact sets the cookie; it doesn't set the variable.

jhodgdon’s picture

True. But the patch says "This is hidden, ie there is no UI to control it,...", without explaining whether "this" refers to the cookie or the variable. I read it to say that there was no user interface for anything related to this function.

So, I don't think it would hurt to be clear, or to point out the UI for the cookie, or at least @see the related functions. Right?

sven.lauer’s picture

While we are improving the docs for this function, wouldn't it be nice to explain what compact mode _is_?

jhodgdon’s picture

Yes, that too.

joachim’s picture

Status: Needs work » Needs review

Shan't bother with a patch while we refine the text:

Determines if the current user is in compact mode.

Compact mode shows certain administration pages with less description text, such as the configuration page and the permissions page.

Whether the user is in compact mode is determined by a cookie, which is set for the user by system_admin_compact_page().

If the user does not have the cookie, the default value is given by the system variable 'admin_compact_mode'. This does not have a user interface to set it; i.e. it is a hidden variable which can be set in the settings.php file.
jhodgdon’s picture

Looks pretty good...

A couple of grammar/usage/typographical nitpicks:
- "i.e.", as you are using it, needs a comma after it. Or "i.e." could just be left out without changing the meaning in any way, I think?
- "Determines if" -> "Determines whether"

Also, maybe this explanatory text should mention that if the admin_compact_mode variable is not set, it defaults to FALSE?

jhodgdon’s picture

Status: Needs review » Needs work

forgot status change on previous comment

joachim’s picture

Status: Needs work » Needs review
Determines whether the current user is in compact mode.

Compact mode shows certain administration pages with less description text, such as the configuration page and the permissions page.

Whether the user is in compact mode is determined by a cookie, which is set for the user by system_admin_compact_page().

If the user does not have the cookie, the default value is given by the system variable 'admin_compact_mode', which itself defaults to FALSE. This does not have a user interface to set it: it is a hidden variable which can be set in the settings.php file.
jhodgdon’s picture

That looks reasonable - I think it's ready for a patch. Thanks!

joachim’s picture

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, looks good to me!

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x and back-ported to 7.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

cweagans’s picture

Issue tags: +Needs backport to D7