Exemplo n.º 1
0
/**
 * returns the html code for the full select 
 * for all categories, for a specific group
 *
 * @param int group_id the group for categorization
 * @return string html code for the full select
 */
function trove_get_html_allcat_selectfull($group_id)
{
    $html = "";
    $CATROOTS = trove_getallroots();
    while (list($catroot, $fullname) = each($CATROOTS)) {
        $html .= "\n<HR>\n<P><B>{$fullname}</B> " . help_button('trove_cat', $catroot) . "\n";
        $res_grpcat = db_query('SELECT trove_cat_id FROM trove_group_link WHERE ' . 'group_id=' . db_ei($group_id) . ' AND trove_cat_root=' . db_ei($catroot) . ' ORDER BY trove_group_id');
        for ($i = 1; $i <= $GLOBALS['TROVE_MAXPERROOT']; $i++) {
            // each drop down, consisting of all cats in each root
            $name = "root{$i}" . "[{$catroot}]";
            // see if we have one for selection
            if ($row_grpcat = db_fetch_array($res_grpcat)) {
                $selected = $row_grpcat["trove_cat_id"];
            } else {
                $selected = 0;
            }
            $html .= trove_get_html_cat_selectfull($catroot, $selected, $name);
        }
    }
    return $html;
}
Exemplo n.º 2
0
            }
        }
    }
    session_redirect('/project/admin/?group_id=' . $group_id);
}
project_admin_header(array('title' => _('Group Trove Information'), 'group' => $group_id));
echo _('<h3>Edit Trove Categorization</h3><p>Select up to three locations for this project in each of the Trove root categories. If the project does not require any or all of these locations, simply select "None Selected".</p><p> IMPORTANT: Projects should be categorized in the most specific locations available in the map. Simultaneous categorization in a specific category AND a parent category will result in only the more specific categorization being accepted</p>.');
?>

<form action="<?php 
echo getStringFromServer('PHP_SELF');
?>
" method="post">

<?php 
$CATROOTS = trove_getallroots();
while (list($catroot, $fullname) = each($CATROOTS)) {
    print "\n<hr />\n<p><strong>{$fullname}</strong> " . help_button('trove_cat', $catroot) . "</p>\n";
    $res_grpcat = db_query("\n\t\tSELECT trove_cat_id\n\t\tFROM trove_group_link\n\t\tWHERE group_id='{$group_id}'\n\t\tAND trove_cat_root='{$catroot}'");
    for ($i = 1; $i <= $TROVE_MAXPERROOT; $i++) {
        // each drop down, consisting of all cats in each root
        $name = "root{$i}" . "[{$catroot}]";
        // see if we have one for selection
        if ($row_grpcat = db_fetch_array($res_grpcat)) {
            $selected = $row_grpcat["trove_cat_id"];
        } else {
            $selected = 0;
        }
        trove_catselectfull($catroot, $selected, $name);
    }
}