You are here

function checklistapi_compact_mode in Checklist API 7

Determines whether the current user is in compact mode.

Compact mode shows checklist forms with less description text.

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

If the user does not have the cookie, the default value is given by the system variable 'checklistapi_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.

Return value

bool TRUE when in compact mode, or FALSE when in expanded mode.

2 calls to checklistapi_compact_mode()
checklistapi_checklist_form in ./checklistapi.pages.inc
Page callback: Form constructor for the checklist form.
theme_checklistapi_compact_link in ./checklistapi.pages.inc
Returns HTML for a link to show or hide inline item descriptions.

File

./checklistapi.pages.inc, line 209
Page callbacks for the Checklist API module.

Code

function checklistapi_compact_mode() {
  return isset($_COOKIE['Drupal_visitor_checklistapi_compact_mode']) ? $_COOKIE['Drupal_visitor_checklistapi_compact_mode'] : variable_get('checklistapi_compact_mode', FALSE);
}