From c55dbbc995e152af3f2c88662101b0643d2e171a Mon Sep 17 00:00:00 2001 From: vdigital Date: Fri, 23 May 2008 22:38:14 +0000 Subject: Removed file/folder git-svn-id: http://piwigo.org/svn/trunk@2358 68402e56-0260-453c-a942-63ccdbb3a9ee --- BSF/admin/cat_list.php | 253 ------------------------------------------------- 1 file changed, 253 deletions(-) delete mode 100644 BSF/admin/cat_list.php (limited to 'BSF/admin/cat_list.php') diff --git a/BSF/admin/cat_list.php b/BSF/admin/cat_list.php deleted file mode 100644 index b8407c2f8..000000000 --- a/BSF/admin/cat_list.php +++ /dev/null @@ -1,253 +0,0 @@ - $id, 'rank' => ++$current_rank)); - } - $fields = array('primary' => array('id'), 'update' => array('rank')); - mass_updates(CATEGORIES_TABLE, $fields, $datas); - - update_global_rank(); -} - -// +-----------------------------------------------------------------------+ -// | initialization | -// +-----------------------------------------------------------------------+ - -$categories = array(); - -$base_url = get_root_url().'admin.php?page=cat_list'; -$navigation = ''; -$navigation.= l10n('home'); -$navigation.= ''; - -// +-----------------------------------------------------------------------+ -// | virtual categories management | -// +-----------------------------------------------------------------------+ -// request to delete a virtual category / not for an adviser -if (isset($_GET['delete']) and is_numeric($_GET['delete']) and !is_adviser()) -{ - delete_categories(array($_GET['delete'])); - array_push($page['infos'], l10n('cat_virtual_deleted')); - update_global_rank(); -} -// request to add a virtual category -else if (isset($_POST['submitAdd'])) -{ - $output_create = create_virtual_category( - $_POST['virtual_name'], - @$_GET['parent_id'] - ); - - if (isset($output_create['error'])) - { - array_push($page['errors'], $output_create['error']); - } - else - { - array_push($page['infos'], $output_create['info']); - } -} -// save manual category ordering -else if (isset($_POST['submitOrder'])) -{ - asort($_POST['catOrd'], SORT_NUMERIC); - save_categories_order(array_keys($_POST['catOrd'])); - - array_push( - $page['infos'], - l10n('Categories manual order was saved') - ); -} -// sort categories alpha-numerically -else if (isset($_POST['submitOrderAlphaNum'])) -{ - $query = ' -SELECT id, name - FROM '.CATEGORIES_TABLE.' - WHERE id_uppercat '. - (!isset($_GET['parent_id']) ? 'IS NULL' : '= '.$_GET['parent_id']).' -;'; - $result = pwg_query($query); - while ($row = mysql_fetch_assoc($result)) - { - $categories[ $row['id'] ] = strtolower($row['name']); - } - - asort($categories, SORT_REGULAR); - save_categories_order(array_keys($categories)); - - array_push( - $page['infos'], - l10n('Categories ordered alphanumerically') - ); -} - -// +-----------------------------------------------------------------------+ -// | Navigation path | -// +-----------------------------------------------------------------------+ - -if (isset($_GET['parent_id'])) -{ - $navigation.= $conf['level_separator']; - - $navigation.= get_cat_display_name_from_id( - $_GET['parent_id'], - $base_url.'&parent_id=', - false - ); -} -// +-----------------------------------------------------------------------+ -// | template initialization | -// +-----------------------------------------------------------------------+ -$template->set_filename('categories', 'admin/cat_list.tpl'); - -$form_action = PHPWG_ROOT_PATH.'admin.php?page=cat_list'; -if (isset($_GET['parent_id'])) -{ - $form_action.= '&parent_id='.$_GET['parent_id']; -} - -$template->assign(array( - 'CATEGORIES_NAV'=>$navigation, - 'F_ACTION'=>$form_action, - )); - -// +-----------------------------------------------------------------------+ -// | Categories display | -// +-----------------------------------------------------------------------+ - -$categories = array(); - -$query = ' -SELECT id, name, permalink, dir, rank, status - FROM '.CATEGORIES_TABLE; -if (!isset($_GET['parent_id'])) -{ - $query.= ' - WHERE id_uppercat IS NULL'; -} -else -{ - $query.= ' - WHERE id_uppercat = '.$_GET['parent_id']; -} -$query.= ' - ORDER BY rank ASC -;'; -$categories = hash_from_query($query, 'id'); - -// get the categories containing images directly -$categories_with_images = array(); -if ( count($categories) ) -{ - $query = ' -SELECT DISTINCT category_id - FROM '.IMAGE_CATEGORY_TABLE.' - WHERE category_id IN ('.implode(',', array_keys($categories)).')'; - $categories_with_images = array_flip( array_from_query($query, 'category_id') ); -} - -$template->assign('categories', array()); -$base_url = get_root_url().'admin.php?page='; -foreach ($categories as $category) -{ - $cat_list_url = $base_url.'cat_list'; - - $self_url = $cat_list_url; - if (isset($_GET['parent_id'])) - { - $self_url.= '&parent_id='.$_GET['parent_id']; - } - - $tpl_cat = - array( - 'NAME' => $category['name'], - 'ID' => $category['id'], - 'RANK' => $category['rank']*10, - - 'U_JUMPTO' => make_index_url( - array( - 'category' => $category - ) - ), - - 'U_CHILDREN' => $cat_list_url.'&parent_id='.$category['id'], - 'U_EDIT' => $base_url.'cat_modify&cat_id='.$category['id'], - - 'IS_VIRTUAL' => empty($category['dir']) - ); - - if (empty($category['dir'])) - { - $tpl_cat['U_DELETE'] = $self_url.'&delete='.$category['id']; - } - - if ( array_key_exists($category['id'], $categories_with_images) ) - { - $tpl_cat['U_MANAGE_ELEMENTS']= - $base_url.'element_set&cat='.$category['id']; - } - - if ('private' == $category['status']) - { - $tpl_cat['U_MANAGE_PERMISSIONS']= - $base_url.'cat_perm&cat='.$category['id']; - } - $template->append('categories', $tpl_cat); -} -// +-----------------------------------------------------------------------+ -// | sending html code | -// +-----------------------------------------------------------------------+ -$template->assign_var_from_handle('ADMIN_CONTENT', 'categories'); -?> -- cgit v1.2.3