Location: PHPKode > projects > mediaIndex > classes/group.default.php
<?php
/**
 * $Id: group.default.php,v 1.11 2004/11/26 20:39:10 openface Exp $      
 *
 *               _ _        _         _                 
 *  _ __  ___ __| (_)__ _  (_)_ _  __| |_____ _____ _ _ 
 * | '  \/ -_) _` | / _` | | | ' \/ _` / -_) \ / -_) '_|
 * |_|_|_\___\__,_|_\__,_| |_|_||_\__,_\___/_\_\___|_|  
 *                                                     
 *     Standalone Indexer Script for Media Files
 *        jason hines, <hide@address.com>
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Library General Public License as
 * published by the Free Software Foundation; either version 2 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 Library
 * General Public License for more details.
 */

/**
 * Default Group class.  All group classes must extend this class
 * to implement their own specific behavior.
 *
 * @version     $Revision: 1.11 $
 * @package     mediaIndexer
 * @subpackage  groups  
 * @author      jason hines, <hide@address.com>
 */

class defaultGroup { 

    /**
     * Human friendly group name
     */
    public $groupName = "Other";

    /**
     * Print all files in this media type's group.
     */
    public function printGroup($files) {
        echo "<table border=\"0\" class=\"group\">\n";
        echo "<tr>\n";
        $cnt = 0;
        $width = 100 / _NUMCOLUMNS;
        $nrows = count($files);
        foreach ($files as $file) {
            $cnt++;
            echo "<td class=\"cell\" valign=\"top\" width=\"{$width}%\">\n";
            $file->handlerRef->printListing($file);

            // print comment count
            $sql = "SELECT count(id) FROM comments WHERE hash = '{$file->hash}'";
            $comments = sqlite_single_query($GLOBALS['gDb'],$sql);
            if ($comments > 0) {
                echo "<br /><a class=\"comments\" href=\"?file={$file->path}\">({$comments} comments)</a>\n";
            }
            echo "</td>\n";
            if ($cnt / _NUMCOLUMNS == floor($cnt / _NUMCOLUMNS) && $cnt < $nrows) {
                echo "</tr>\n<tr>\n";
            }
        }
        echo "</tr></table>\n";
    }

    public function printInfo(file $file) {
        // notta
    }
}

?>
Return current item: mediaIndex