Location: PHPKode > projects > SQL Familytree > document/category.php
<?php

//////////////////////////////////////////////////////////////////////
//
// $Id: category.php,v 1.3 2002/02/04 18:15:10 carney Exp $
//
// Copyright (C) 2002 Michael Carney
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//

//////////////////////////////////////////////////////////////////////

function category_submit_handler(&$vars,&$errors)
{
    include_once("util/misc.php");
    // The main change that we have to make is to set the item string to be the
    // title
    global $form_input;
    if (navigator_find_ancestor("category",$form_input["category"]["id"],$form_input["category"]["category"]))
    {
        $errors["category"] = "categoryCycle";
        return;
    }
    return 0;
}

function category_display_handler($id)
{
    global $category;
    $category             = $id;

    $doc_type_select = doc_type_select();
    $member_select   = member_select(); 
    $bodytext  = "";
    $query     = "SELECT CONCAT('<a href=\"document.php?did=',id,'\">',title,'</a>') as Document,
                             $member_select,
                             $doc_type_select,
                             DATE_FORMAT(created,'%m/%d/%Y') as Created,
                             document.subtext as Summary
                  FROM document
                  WHERE category='$id'";

    set_http_get_var_default("sort_col", "Created");
    set_http_get_var_default("sort_dir", "desc");
    $bodytext                 .= query_to_table($query);
    global $p;
    $vars["category_toc"] = $bodytext; 
    $p->openPageSection('category', $vars);
    $p->closePageSection('category');
}

?>
Return current item: SQL Familytree