| 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 |
| 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 |
} |
} |