-# You may pass a "where clause" for the db query.
-function admin_pages_display_listing($where = 'order by concat(nav_title,title)') {
- $rows = db_get_assocs('cms_pages', 'id,filename,coalesce(nullif(nav_title,\'\'), title) as title', $where);
- if($rows == false || count($rows) == 0) {
- tem_set('listings', array('empty_listing' => true));
- return;
- }
-
- # make sure there's something clickable
- foreach($rows as &$row) {
- if($row['filename'] == '') {
- $row['filename'] = '-- offline --';
- }
- if($row['title'] == '') {
- $row['title'] = '-- untitled --';
- }
- }
- tem_set('listings', array(
- 'populated_listing' => true,
- 'rows' => $rows));
- return true;
-}
-