You are here

function _node_expire_get_date_entry_elements in Node expire 8

Same name and namespace in other branches
  1. 7 node_expire.module \_node_expire_get_date_entry_elements()

Gets condition for date entry elements.

This depends on value of variable node_expire_date_entry_elements and also is date_popup module of date module installed or not.

Return value

int 0 - use text fields 1 - use date popups

3 calls to _node_expire_get_date_entry_elements()
NodeExpireAdminSettings::buildForm in src/Form/NodeExpireAdminSettings.php
Form constructor.
node_expire_admin_settings in ./node_expire.admin.inc
Administrative settings.
_node_expire_form_alter_nodeform in ./node_expire.nodeapi.inc
Implements hook_form_alter().

File

./node_expire.module, line 334
Set a timer into your content, allowing you to perform customized actions.

Code

function _node_expire_get_date_entry_elements() {

  // No date_popup module.
  if (!\Drupal::moduleHandler()
    ->moduleExists('date_popup')) {
    return 0;
  }

  // Legacy mode.
  if (\Drupal::config('node_expire.settings')
    ->get('node_expire_handle_content_expiry') == 0) {
    return 0;
  }
  return \Drupal::config('node_expire.settings')
    ->get('node_expire_date_entry_elements');
}