HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux newsites.squeezer-software.com 6.8.0-90-generic #91-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 18 14:14:30 UTC 2025 x86_64
User: www-data (33)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/sites/orpis/sites/all/modules/contrib/variable/variable_admin/variable_admin.module
<?php
/**
 * @file
 * Variable API module - Admin UI
 */

/**
 * Implements hook_menu().
 */
function variable_admin_menu() {
  $items['admin/config/system/variable'] = array(
    'title' => 'Variables',
    'description' => 'Variable settings for mixed modules.',
    'page callback' => 'variable_admin_page_group',
    'file' => 'variable_admin.inc',
    'access arguments' => array('administer site configuration'),
  );
  $items['admin/config/system/variable/group'] = array(
    'title' => 'Groups',
    'description' => 'Variables per group.',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/config/system/variable/module'] = array(
    'title' => 'Modules',
    'description' => 'Variables per module.',
    'page callback' => 'variable_admin_page_module',
    'file' => 'variable_admin.inc',
    'access arguments' => array('administer site configuration'),
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/config/system/variable/edit/%'] = array(
    'title' => 'Edit variable',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('variable_edit_form', 5),
    'access callback' => 'variable_access',
    'access arguments' => array(5),
  );
  if (module_exists('variable_realm')) {
    $items['admin/config/system/variable/realm'] = array(
      'title' => 'Realms',
      'description' => 'Configure realms.',
      'page callback' => 'drupal_get_form',
      'page arguments' => array('variable_admin_realm_overview'),
      'file' => 'variable_admin.inc',
      'access arguments' => array('administer site configuration'),
      'type' => MENU_LOCAL_TASK,
    );
    $items['admin/config/system/variable/realm/overview'] = array(
      'title' => 'Overview',
      'description' => 'Configure realms.',
      'type' => MENU_DEFAULT_LOCAL_TASK,
      'weight' => -10
    );
    $weight = 0;
    foreach (variable_realm_list_all() as $realm => $controller) {
      $items['admin/config/system/variable/realm/' . $realm] = array(
        'title callback' => 'variable_admin_realm_title',
        'title arguments' => array($realm),
        'description' => 'Configure realm variables.',
        'page callback' => 'variable_admin_realm_info',
        'page arguments' => array($realm),
        'access callback' => 'variable_admin_realm_access',
        'access arguments' => array($realm),
        'file' => 'variable_admin.inc',
        'type' => MENU_LOCAL_TASK,
        'weight' => $weight++,
      );
    }
    $items['admin/config/system/variable/realm/%/edit'] = array(
      'title' => 'Edit',
      'description' => 'Edit realm variables.',
      'page callback' => 'variable_admin_realm_edit',
      'page arguments' => array(5),
      'access callback' => 'variable_admin_realm_access',
      'access arguments' => array(5, 'select'),
      'file' => 'variable_admin.inc',
    );
    $items['admin/config/system/variable/realm/%/configure'] = array(
      'title' => 'Configure',
      'description' => 'Configure realm variables.',
      'page callback' => 'drupal_get_form',
      'page arguments' => array('variable_realm_select_variables_form', 5),
      'access callback' => 'variable_admin_realm_access',
      'access arguments' => array(5, 'select'),
      'file' => 'variable_realm.form.inc',
      'file path' => drupal_get_path('module', 'variable_realm'),
    );
  }
  return $items;
}

/**
 * Check permission for administering realm
 */
function variable_admin_realm_access($realm_name, $property = 'title') {
  if ($info = variable_realm_info($realm_name)) {
    return !empty($info[$property]) && user_access('administer site configuration');
  }
}

/**
 * Retrieve title of given realm.
 */
function variable_admin_realm_title($realm) {
  $info = variable_realm_info($realm);
  return isset($info['title']) ? $info['title'] : $realm;
}