You are here

function checklistapi_compact_mode_is_on in Checklist API 8

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. If the user does not have the cookie, the setting defaults to off.

Return value

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

1 call to checklistapi_compact_mode_is_on()
ChecklistapiChecklistForm::buildForm in src/Form/ChecklistapiChecklistForm.php
Form constructor.

File

./checklistapi.module, line 91
An API for creating fillable, persistent checklists.

Code

function checklistapi_compact_mode_is_on() {

  // PHP converts dots into underscores in cookie names.
  return (bool) \Drupal::request()->cookies
    ->get('Drupal_visitor_checklistapi_compact_mode', FALSE);
}