You are here

function gallery_assist_info_data in Gallery Assist 6

Info data.

1 string reference to 'gallery_assist_info_data'
gallery_assist_menu in ./gallery_assist.module
Implementation of hook_menu().

File

./gallery_assist.admin.inc, line 12
Administration page from Gallery Assist.

Code

function gallery_assist_info_data() {
  $info = array();

  // Version.
  $info['drupal_version'] = array(
    '#value' => '<div><strong>Drupal</strong> version: ' . VERSION . '</div>',
    '#weight' => 0,
  );
  $info['jq_version'] = array(
    '#value' => '<div>Current used <strong>JQuery</strong> version: <script>var version = $().jquery; document.write(version)</script></div>',
    '#weight' => 1,
  );
  $names = array_values(gallery_assist_get_assignments());

  // Assignments.
  $assigs = '<div>GA <strong>Assignments</strong>:';
  $assigs .= theme('item_list', $names, NULL, 'ul');
  $assigs .= '</div>';
  $info['assignments'] = array(
    '#value' => $assigs,
    '#weight' => 2,
  );

  // Assist modules.
  $result = db_query("SELECT * FROM {system} WHERE name LIKE '%gallery_assist%'");
  while ($r = db_fetch_object($result)) {
    $info_file = drupal_parse_info_file(drupal_get_path('module', $r->name) . '/' . $r->name . '.info');
    if (!empty($info_file['name'])) {
      if ($r->status == 1) {
        $name = ga_bold($info_file['name'], $r->status);
      }
      else {
        $name = ga_bold($info_file['name'], $r->status);
        $name = l($name, 'admin/build/modules', array(
          'fragment' => 'gallery_assist',
          'attributes' => array(
            'title' => 'Go to modules list to enable.',
          ),
        ));
      }
      $rows[] = array(
        array(
          'data' => $name,
          'class' => 'ga-nowrap',
        ),
        array(
          'data' => $r->status == 1 ? t('enabled') : t('disabled'),
        ),
        array(
          'data' => $info_file['version'],
          'class' => 'ga-nowrap',
        ),
        array(
          'data' => $info_file['description'],
          'style' => 'ga-fullwidth',
        ),
      );
    }
  }
  $plural = count($rows) > 1 ? 's' : '';
  $header = array(
    l('Module' . $plural, 'admin/build/modules'),
    'Status',
    'Version',
    'Description',
  );
  $info['modules'] = array(
    '#value' => theme('table', $header, $rows),
    '#weight' => 3,
  );
  $info['copy'] = array(
    '#value' => '<div id="ga-devel-by">' . gallery_assist_info_line() . '</div>',
    '#weight' => 100,
  );
  $output = drupal_render($info);
  return $output;
}