/[drupal]/contributions/modules/index/includes/index.overview.inc
ViewVC logotype

Diff of /contributions/modules/index/includes/index.overview.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.4, Thu Apr 23 21:33:05 2009 UTC revision 1.1.2.5, Mon Oct 19 01:19:46 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: index.overview.inc,v 1.1.2.3 2009/04/22 19:28:33 xano Exp $  // $Id: index.overview.inc,v 1.1.2.4 2009/04/23 21:33:05 xano Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 10  Line 10 
10   * List all existing indexes.   * List all existing indexes.
11   */   */
12  function index_overview() {  function index_overview() {
13      $header = array(
14        t('Title'),
15        array(
16          'data' => t('Operations'),
17          'colspan' => 2,
18        ),
19      );
20    $rows = array();    $rows = array();
21    $result = db_query("SELECT iid, title FROM {index_index} ORDER BY title");    $result = db_query("SELECT iid, title FROM {index_index} ORDER BY title");
22    while ($row = db_fetch_object($result)) {    while ($row = db_fetch_object($result)) {
23      $rows[] = array(      $rows[] = array(
24        $row->title,        $row->title,
25        l(t('Edit'), 'admin/build/index/edit/' . $row->iid),        l(t('edit'), 'admin/build/index/edit/' . $row->iid),
26        l(t('Delete'), 'admin/build/index/delete/' . $row->iid),        l(t('delete'), 'admin/build/index/delete/' . $row->iid),
27      );      );
28    }    }
29    if (count($rows)) {    if (!count($rows)) {
30      $header = array(array(      $rows[] = array(array(
31        'data' => t('Title'),        'data' => t('You have no indexes. <a href="!index_form_add">Add a new one</a>.', array('!index_form_add' => url('admin/build/index/add'))),
32        'colspan' => 3,        'colspan' => 3,
33      ));      ));
     return theme('table', $header, $rows);  
   }  
   else {  
     return t('You have no idexes yet. Please <a href="!index_form_add">add one</a>.', array('!index_form_add' => url('admin/build/index/add')));  
34    }    }
35    
36      return theme('table', $header, $rows);
37  }  }

Legend:
Removed from v.1.1.2.4  
changed lines
  Added in v.1.1.2.5

  ViewVC Help
Powered by ViewVC 1.1.2