diff options
author | rvelices <rv-github@modusoptimus.com> | 2007-02-27 01:56:16 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2007-02-27 01:56:16 +0000 |
commit | 47512ce6a64fa356214c162a8313480c6aed41d2 (patch) | |
tree | a0e35e2f89ef789f380adc5b8951444c189de4e7 /include/section_init.inc.php | |
parent | bfb4b15d2f75835033d9bbb865edd77dcb282bb6 (diff) |
- refactoring page['category'] before 1.7 release
page['category'] is not an id anymore, but an associative array of category info
all of page['cat_xxx'] or page['uppercats'] merged into one
simplifies calls to make_index_url
give plugins a clean start for page variables for version 1.7
git-svn-id: http://piwigo.org/svn/trunk@1861 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/section_init.inc.php')
-rw-r--r-- | include/section_init.inc.php | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/include/section_init.inc.php b/include/section_init.inc.php index 4239ebd93..4434ec542 100644 --- a/include/section_init.inc.php +++ b/include/section_init.inc.php @@ -34,15 +34,14 @@ * */ -// "index.php?/category/12-foo/start-24&action=fill_caddie" or -// "index.php/category/12-foo/start-24&action=fill_caddie" +// "index.php?/category/12-foo/start-24" or +// "index.php/category/12-foo/start-24" // must return : // // array( // 'section' => 'categories', -// 'category' => 12, +// 'category' => array('id'=>12, ...), // 'start' => 24 -// 'action' => 'fill_caddie' // ); $page['items'] = array(); @@ -87,7 +86,7 @@ if (script_basename() == 'picture') // basename without file extention {// url compatibility with versions below 1.6 $url = make_picture_url( array( 'section' => 'categories', - 'category' => $_GET['cat'], + 'category' => get_cat_info($_GET['cat']), 'image_id' => $_GET['image_id'] ) ); redirect($url); @@ -360,15 +359,9 @@ if ('categories' == $page['section']) $page, array( 'comment' => $result['comment'], - 'cat_dir' => $result['dir'], - 'cat_name' => $result['name'], - 'cat_site_id' => $result['site_id'], - 'cat_uploadable' => $result['uploadable'], - 'cat_commentable' => $result['commentable'], - 'cat_id_uppercat' => $result['id_uppercat'], - 'uppercats' => $result['uppercats'], + 'category' => $result, 'title' => - get_cat_display_name($result['name'], '', false), + get_cat_display_name($result['upper_names'], '', false), ) ); } @@ -395,7 +388,7 @@ if ('categories' == $page['section']) {// flat categories mode if ( isset($page['category']) ) { - $subcat_ids = get_subcat_ids( array($page['category']) ); + $subcat_ids = get_subcat_ids( array($page['category']['id']) ); $where_sql = 'category_id IN ('.implode(',',$subcat_ids).')'; } else @@ -405,7 +398,7 @@ if ('categories' == $page['section']) } else {// Normal mode - $where_sql = 'category_id = '.$page['category']; + $where_sql = 'category_id = '.$page['category']['id']; } // Main query |