You are here

function scald_admin_atoms in Scald: Media Management made easy 6

Same name and namespace in other branches
  1. 7 includes/scald.admin.inc \scald_admin_atoms()

The Scald Admin page for Scald Atoms.

1 string reference to 'scald_admin_atoms'
scald_menu in ./scald.module
Implementation of hook_menu().

File

./scald.admin.inc, line 208

Code

function scald_admin_atoms() {
  $content = t('
    <h3>Scald Atoms</h3>

    <h4>Currently, there are ' . db_result(db_query("SELECT COUNT(*) FROM {scald_atoms}")) . ' Atoms registered with Scald Core.</h4>

    <p>Enable the Views module to get an handy paginated table with filters which will allow you to browse your atoms</p>

  ');

  // @@@TODO: Turn this into a nice little table which gives totals by type and by provider as well as giving the base_description by provider.
  $scald_config = variable_get('scald_config', 0);
  $atoms_results = db_query("\n    SELECT\n      *\n    FROM\n      {scald_atom_providers}\n    ORDER BY\n      type\n  ");
  $content .= '<ol>';
  $first = TRUE;
  $current = '';
  while ($atom_raw = db_fetch_array($atoms_results)) {
    if ($current != $atom_raw['type']) {
      $current = $atom_raw['type'];
      if (!$first) {
        $content .= '</ul></li>';
      }
      else {
        $first = FALSE;
      }
      $content .= '
        <li>
          <strong>' . check_plain($scald_config->types[$atom_raw['type']]['title']) . '</strong> Atoms are based on:
          <ul>
      ';
    }
    $content .= '<li>' . check_plain($atom_raw['base_description']) . ' (Provided by <code>' . $atom_raw['provider'] . '.module</code>)</li>';
  }
  $content .= '</ul></li></ol>';
  return $content;
}