Beispiel #1
0
             if ($action_contribs == 'move' && !empty($contribs_to_id)) {
                 $error = array_merge($error, $category_object->move_category_content($contribs_to_id));
             }
         }
         if (!sizeof($error)) {
             // Delete category
             $category_object->delete();
             // Redirect back to the previous category
             redirect(titania_url::build_url('manage/categories', array('c' => $parent_id)));
         }
     }
     phpbb::$template->assign_vars(array('S_DELETE_CATEGORY' => true, 'U_ACTION' => titania_url::build_url('manage/categories', array('c' => $category_id, 'action' => 'delete')), 'U_BACK' => 'c_' . $category_object->parent_id, 'CATEGORY' => $category_id, 'CATEGORY_NAME' => isset(phpbb::$user->lang[$category_object->category_name]) ? phpbb::$user->lang[$category_object->category_name] : $category_object->category_name, 'SECTION_NAME' => phpbb::$user->lang['DELETE_CATEGORY'] . ' - ' . (isset(phpbb::$user->lang[$category_object->category_name]) ? phpbb::$user->lang[$category_object->category_name] : $category_object->category_name), 'S_HAS_SUBCATS' => $category_object->right_id - $category_object->left_id > 1 ? true : false, 'S_MOVE_CATEGORY_OPTIONS' => generate_category_select($category_object->parent_id, true), 'ERROR_MSG' => sizeof($error) ? implode('<br />', $error) : ''));
     break;
 default:
     titania::_include('functions_display', 'titania_display_categories');
     titania_display_categories($category_id, 'categories', true);
     if ($category_id != 0) {
         // Breadcrumbs
         $category_object = new titania_category();
         $categories_ary = titania::$cache->get_categories();
         // Parents
         foreach (array_reverse(titania::$cache->get_category_parents($category_id)) as $row) {
             $category_object->__set_array($categories_ary[$row['category_id']]);
             titania::generate_breadcrumbs(array(isset(phpbb::$user->lang[$categories_ary[$row['category_id']]['category_name']]) ? phpbb::$user->lang[$categories_ary[$row['category_id']]['category_name']] : $categories_ary[$row['category_id']]['category_name'] => titania_url::build_url('manage/categories', array('c' => $row['category_id']))));
         }
         // Self
         $category_object->__set_array($categories_ary[$category_id]);
         titania::generate_breadcrumbs(array(isset(phpbb::$user->lang[$categories_ary[$category_id]['category_name']]) ? phpbb::$user->lang[$categories_ary[$category_id]['category_name']] : $categories_ary[$category_id]['category_name'] => titania_url::build_url('manage/categories', array('c' => $category_id))));
         // Second set of breadcrumbs for category navigation
         // Parents
         foreach (array_reverse(titania::$cache->get_category_parents($category_id)) as $row) {
Beispiel #2
0
      * Default (display category/contrib list)
      */
 /**
  * Default (display category/contrib list)
  */
 default:
     titania::_include('functions_display', 'titania_display_categories');
     // Get the category_id
     $category = request_var('c', '');
     $category_ary = explode('-', $category);
     if ($category_ary) {
         $category_id = array_pop($category_ary);
     } else {
         $category_id = (int) $category;
     }
     titania_display_categories($category_id);
     $categories_ary = false;
     if ($category_id != 0) {
         // Breadcrumbs
         $category_object = new titania_category();
         $categories_ary = titania::$cache->get_categories();
         // Parents
         foreach (array_reverse(titania::$cache->get_category_parents($category_id)) as $row) {
             $category_object->__set_array($categories_ary[$row['category_id']]);
             titania::generate_breadcrumbs(array(isset(phpbb::$user->lang[$categories_ary[$row['category_id']]['category_name']]) ? phpbb::$user->lang[$categories_ary[$row['category_id']]['category_name']] : $categories_ary[$row['category_id']]['category_name'] => titania_url::build_url($category_object->get_url())));
         }
         // Self
         $category_object->__set_array($categories_ary[$category_id]);
         titania::generate_breadcrumbs(array(isset(phpbb::$user->lang[$categories_ary[$category_id]['category_name']]) ? phpbb::$user->lang[$categories_ary[$category_id]['category_name']] : $categories_ary[$category_id]['category_name'] => titania_url::build_url($category_object->get_url())));
         // Get the child categories we want to select the contributions from
         $child_categories = array_keys(titania::$cache->get_category_children($category_id));