/**
* displays filter information for a user
*
*/
function filter_display(&$brainstorm, $userid, $groupid)
{
    $responses = brainstorm_get_responses($brainstorm->id, 0, $groupid, false);
    $responsesids = array_keys($responses);
    $statuses = filter_get_status($brainstorm->id, $userid, $groupid, false);
    $statusesids = array_keys($statuses);
    $strsource = get_string('sourcedata', 'brainstorm');
    $strfiltered = get_string('filtereddata', 'brainstorm');
    ?>
<style>
.match{ background-color : #25B128 }
.nomatch{ background-color : #CE0909 }
</style>
<table cellspacing="5">
    <tr valign="top">
        <td>
            <table cellspacing="5">
                <tr>
                    <th>
                        &nbsp;
                    </th>
                    <th>
                        <?php 
    echo $strsource;
    ?>
                    </th>
                 </tr>
<?php 
    $i = 0;
    foreach ($responses as $response) {
        $match = in_array($response->id, $statusesids) ? 'match' : '';
        ?>
                <tr>
                    <th class="<?php 
        echo $match;
        ?>
">
                        <b><?php 
        echo $i + 1;
        ?>
.</b>
                    </th>
                    <td>
                        <?php 
        echo $response->response;
        ?>
                    </td>
                 </tr>
<?php 
        $i++;
    }
    ?>
            </table>
        </td>
        <td>
<?php 
    if ($statuses) {
        ?>
            <table cellspacing="5">
                <tr>
                    <th>
                        &nbsp;
                    </th>
                    <th>
                        <?php 
        echo $strfiltered;
        ?>
                    </th>
                 </tr>
<?php 
        $i = 0;
        foreach ($statuses as $status) {
            $match = in_array($status->itemsource, $responsesids) ? 'match' : '';
            ?>
                <tr>
                    <th class="<?php 
            echo $match;
            ?>
">
                        <b><?php 
            echo $i + 1;
            ?>
.</b>
                    </th>
                    <td>
                        <?php 
            echo $status->response;
            ?>
                    </td>
                 </tr>
<?php 
            $i++;
        }
        ?>
            </table>
<?php 
    } else {
        print_simple_box(get_string('nofilteringinprogress', 'brainstorm'));
    }
    ?>
        </td>
    </tr>
</table>
<?php 
}
* Module Brainstorm V2
* Operator : filter
* @author Valery Fremaux
* @package Brainstorm 
* @date 20/12/2007
*/
include_once "{$CFG->dirroot}/mod/brainstorm/operators/{$page}/locallib.php";
include_once "{$CFG->dirroot}/mod/brainstorm/operators/operator.class.php";
?>
<center>
<?php 
$current_operator = new BrainstormOperator($brainstorm->id, $page);
print_heading(get_string('myfilter', 'brainstorm'));
filter_display($brainstorm, null, $currentgroup);
/// printing status for other users
$otherstatuses = filter_get_status($brainstorm->id, 0, $currentgroup, true);
/// sorting and dispatching
foreach ($otherstatuses as $astatus) {
    $others[$astatus->userid][] = $astatus;
}
print_heading(get_string('otherfilters', 'brainstorm'));
print_simple_box_start('center');
$cols = 0;
if (!empty($others)) {
    ?>
<table>
    <tr>
        <td>
<?php 
    foreach (array_keys($others) as $userid) {
        $user = get_record('user', 'id', $userid);
* @author Valery Fremaux
* @package Brainstorm 
* @date 20/12/2007
*/
include_once $CFG->dirroot . "/mod/brainstorm/operators/{$page}/locallib.php";
include_once "{$CFG->dirroot}/mod/brainstorm/operators/operator.class.php";
?>
<center>
<?php 
print_heading("<img src=\"{$CFG->wwwroot}/mod/brainstorm/operators/{$page}/pix/enabled_small.gif\" align=\"left\" width=\"40\" /> " . get_string("organizing{$page}", 'brainstorm'));
$responses = brainstorm_get_responses($brainstorm->id, 0, 0);
if (!isset($current_operator)) {
    // if was not set by a controller
    $current_operator = new BrainstormOperator($brainstorm->id, $page);
}
$filterstatus = filter_get_status($brainstorm->id);
/// module seems it is not configured
if (!isset($current_operator->configdata->maxideasleft)) {
    print_simple_box(get_string('notconfigured', 'brainstorm'));
    return;
}
/// print organizing interface
$toeliminate = max(0, count($responses) - $current_operator->configdata->maxideasleft);
print_simple_box(get_string('responses', 'brainstorm') . " <span id=\"leftcount\">{$toeliminate}</span>" . ' ' . get_string('responsestoeliminate', 'brainstorm'));
if (isset($current_operator->configdata->requirement)) {
    print_simple_box($current_operator->configdata->requirement);
}
?>
<form name="filterform" method="post" action="view.php">
<input type="hidden" name="id" value="<?php 
p($cm->id);