/**
  * Visit a fixed organizer and return the GUI component [a container] 
  * that corresponds to it. Traverse-to/add child components.
  * 
  * @param object FixedOrganizerSiteComponent $organizer
  * @return object Component
  * @access public
  * @since 4/3/06
  */
 public function visitFixedOrganizer(FixedOrganizerSiteComponent $organizer)
 {
     $authZ = Services::getService("AuthZ");
     $idManager = Services::getService("Id");
     if ($authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify"), $organizer->getQualifierId())) {
         $tdStyles = 'border: 1px solid #F00; padding: 6px;';
     } else {
         $tdStyles = '';
     }
     $guiContainer = new Container(new TableLayout($organizer->getNumColumns(), $tdStyles), BLANK, 1);
     // Add controls bar and border
     $authZ = Services::getService("AuthZ");
     $idManager = Services::getService("Id");
     if ($authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.add_children"), $organizer->getQualifierId())) {
         $canAdd = true;
     } else {
         $canAdd = false;
     }
     $numCells = $organizer->getTotalNumberOfCells();
     for ($i = 0; $i < $numCells; $i++) {
         $child = $organizer->getSubcomponentForCell($i);
         if (is_object($child)) {
             $childComponent = $child->acceptVisitor($this);
             if ($childComponent) {
                 $guiContainer->add($childComponent, $child->getWidth(), null, null, TOP);
             } else {
                 $childComponent = $guiContainer->add(new Blank(), $child->getWidth(), null, null, TOP);
             }
         } else {
             $this->_emptyCellContainers[$organizer->getId() . '_cell:' . $i] = $guiContainer;
             $this->_emptyCellPlaceholders[$organizer->getId() . '_cell:' . $i] = $guiContainer->addPlaceholder();
             $childComponent = $guiContainer->getComponent($this->_emptyCellPlaceholders[$organizer->getId() . '_cell:' . $i]);
         }
         if ($canAdd) {
             $this->wrapAsDroppable($childComponent, $organizer->getId() . "_cell:" . $i, array_keys($organizer->getVisibleComponentsForPossibleAdditionToCell($i)));
         }
     }
     if ($authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify"), $organizer->getQualifierId())) {
         $controlsHTML = $this->getBarPreHTML('#F00', $organizer, '1px') . $this->getControlsHTML($organizer, $organizer->getDisplayName(), $organizer->acceptVisitor($this->_controlsVisitor), '#F00', '#F99', '#F66', 0, '1px');
         $guiContainer->setPreHTML($controlsHTML . "\n<div style='z-index: 0;'>" . $guiContainer->getPreHTML($null = null));
         $guiContainer->setPostHTML($guiContainer->getPostHTML($null = null) . "</div>" . $this->getBarPostHTML());
         if (count($organizer->getVisibleDestinationsForPossibleAddition())) {
             $this->wrapAsDraggable($guiContainer, $organizer->getId(), 'FixedOrganizer');
         }
     }
     return $guiContainer;
 }
Пример #2
0
    /**
     * Build the content for this action
     * 
     * @return void
     * @access public
     * @since 4/26/05
     */
    function buildContent()
    {
        $defaultTextDomain = textdomain("polyphony");
        $actionRows = $this->getActionRows();
        $pageRows = new Container(new YLayout(), OTHER, 1);
        $harmoni = Harmoni::instance();
        $harmoni->request->startNamespace("polyphony-agents");
        $harmoni->request->passthrough();
        // register this action as the return-point for the following operations:
        $harmoni->history->markReturnURL("polyphony/agents/add_to_group");
        $harmoni->history->markReturnURL("polyphony/agents/remove_from_group");
        $agentManager = Services::getService("Agent");
        $idManager = Services::getService("Id");
        $everyoneId = $idManager->getId("edu.middlebury.agents.everyone");
        $usersId = $idManager->getId("edu.middlebury.agents.users");
        $allGroupsId = $idManager->getId("edu.middlebury.agents.all_groups");
        /*********************************************************
         * the agent search form
         *********************************************************/
        // Users header
        $actionRows->add(new Heading(_("Users"), 2), "100%", null, LEFT, CENTER);
        ob_start();
        $self = $harmoni->request->quickURL();
        $lastCriteria = $harmoni->request->get("search_criteria");
        $search_criteria_name = RequestContext::name("search_criteria");
        $search_type_name = RequestContext::name("search_type");
        print _("Search For Users") . ": ";
        print <<<END
\t\t<form action='{$self}' method='post'>
\t\t\t<div>
\t\t\t<input type='text' name='{$search_criteria_name}' value='{$lastCriteria}' />
\t\t\t<br /><select name='{$search_type_name}'>
END;
        $searchTypes = $agentManager->getAgentSearchTypes();
        while ($searchTypes->hasNext()) {
            $type = $searchTypes->next();
            $typeString = htmlspecialchars($type->getDomain() . "::" . $type->getAuthority() . "::" . $type->getKeyword());
            print "\n\t\t<option value='{$typeString}'";
            if ($harmoni->request->get("search_type") == $typeString) {
                print " selected='selected'";
            }
            print ">{$typeString}</option>";
        }
        print "\n\t</select>";
        print "\n\t<br /><input type='submit' value='" . _("Search") . "' />";
        print "\n\t<a href='" . $harmoni->request->quickURL() . "'>";
        print "<input type='button' value='" . _("Clear") . "' /></a>";
        print "\n</div>\n</form>";
        $actionRows->add(new Block(ob_get_contents(), STANDARD_BLOCK), "100%", null, LEFT, CENTER);
        ob_end_clean();
        /*********************************************************
         * the agent search results
         *********************************************************/
        ob_start();
        if (($search_criteria = $harmoni->request->get('search_criteria')) && ($search_type = $harmoni->request->get('search_type'))) {
            $typeParts = explode("::", @html_entity_decode($search_type, ENT_COMPAT, 'UTF-8'));
            $searchType = new HarmoniType($typeParts[0], $typeParts[1], $typeParts[2]);
            $agents = new MultiIteratorIterator();
            $agents->addIterator($agentManager->getAgentsBySearch($search_criteria, $searchType));
            $agents->addIterator($agentManager->getGroupsBySearch($search_criteria, $searchType));
            print "search: " . $search_criteria;
            print <<<END
\t\t
\t\t
\t\t<table>
\t\t\t<tr>
\t\t\t\t<td valign='top'>
\t\t\t\t\t<div style='
\t\t\t\t\t\tborder: 1px solid #000; 
\t\t\t\t\t\twidth: 15px; 
\t\t\t\t\t\theight: 15px;
\t\t\t\t\t\ttext-align: center;
\t\t\t\t\t\ttext-decoration: none;
\t\t\t\t\t\tfont-weight: bold;
\t\t\t\t\t'>
\t\t\t\t\t\t-
\t\t\t\t\t</div>
\t\t\t\t</td>
\t\t\t\t<td>
END;
            print "\n\t\t\t" . _("Search Results");
            print <<<END
\t\t\t\t</td>
\t\t\t</tr>
\t\t</table>
\t\t<div style='
\t\t\tmargin-left: 13px; 
\t\t\tmargin-right: 0px; 
\t\t\tmargin-top:0px; 
\t\t\tpadding-left: 10px;
\t\t\tborder-left: 1px solid #000;
\t\t'>
END;
            while ($agents->hasNext()) {
                $agent = $agents->next();
                group_membershipAction::printMember($agent);
                print "<br />";
            }
            print "\n</div>";
            $pageRows->add(new Block(ob_get_contents(), STANDARD_BLOCK), "100%", null, LEFT, CENTER);
            ob_end_clean();
        }
        /*********************************************************
         * Groups
         *********************************************************/
        $pageRows->add(new Heading(_("Groups"), 2), "100%", null, LEFT, CENTER);
        // Define some global variables to store javascript array definitions
        // for validating adding/removing inputs.
        $GLOBALS['decendent_groups_string'] = "";
        $GLOBALS['child_groups_string'] = "";
        $GLOBALS['child_agents_string'] = "";
        // Loop through all of the Root Groups
        $groups = $agentManager->getGroupsBySearch($null = null, new Type("Agent & Group Search", "edu.middlebury.harmoni", "RootGroups"));
        while ($groups->hasNext()) {
            $group = $groups->next();
            $groupId = $group->getId();
            // Create a layout for this group using the GroupPrinter
            ob_start();
            GroupPrinter::printGroup($group, $harmoni, 2, array($this, "printGroup"), array($this, "printMember"));
            $groupLayout = new Block(ob_get_contents(), STANDARD_BLOCK);
            ob_end_clean();
            $pageRows->add($groupLayout, "100%", null, LEFT, CENTER);
        }
        /*********************************************************
         * Javascript for validating checkboxes,
         * Form Definition.
         *********************************************************/
        ob_start();
        // Create translated errorstrings
        $cannotAddGroup = _("Cannot add group");
        $toItsself = _("to itself");
        $deselecting = _("Deselecting");
        $toOwnDesc = _("to its own descendent");
        $groupString = _("Group");
        $isAlreadyInGroup = _("is alread in this group");
        $agentString = _("Agent");
        $fromItsself = _("from itself");
        $cannotRemoveGroup = _("Cannot remove group");
        $notInGroup = _("is not in this group");
        $confirmAdd = _("Are you sure that you wish to add the selected Groups and Agents to Group");
        $confirmRemove = _("Are you sure that you wish to remove the selected Groups and Agents from Group");
        $destinationgroup_name = RequestContext::name("destinationgroup");
        $operation_name = RequestContext::name("operation");
        $actionURL = $harmoni->request->quickURL("agents", "add_to_group");
        // Print out a Javascript function for submitting our groups choices
        $decendentGroups = $GLOBALS['decendent_groups_string'];
        $childGroups = $GLOBALS['child_groups_string'];
        $childAgents = $GLOBALS['child_agents_string'];
        print <<<END
\t\t
\t\t<script type='text/javascript'>
\t\t//<![CDATA[ 
\t\t
\t\t\t// Validate ancestory and submit to add checked to the group
\t\t\tfunction submitCheckedToGroup ( destGroupId ) {
\t\t\t\tvar f;
\t\t\t\tvar form;
\t\t\t\tfor (i = 0; i < document.forms.length; i++) {
\t\t\t\t\tf = document.forms[i];\t\t\t
\t\t\t\t\tif (f.id == 'memberform') {
\t\t\t\t\t\tform = f;
\t\t\t\t\t\tbreak;
\t\t\t\t\t}
\t\t\t\t}
\t\t\t\t
\t\t\t\tvar elements = form.elements;
\t\t\t\tvar i;
\t\t\t\tvar numToAdd = 0;
\t\t\t\t\t\t
\t\t\t\tfor (i = 0; i < elements.length; i++) {
\t\t\t\t\tvar element = elements[i];
\t\t\t\t\t
\t\t\t\t\tif (element.type == 'checkbox' && element.checked == true) {
\t\t\t\t\t\t
\t\t\t\t\t\tif (element.className == 'group') {
\t\t\t\t\t\t\t// Check that the destination is not the new member
\t\t\t\t\t\t\tif ( element.id == destGroupId ) {
\t\t\t\t\t\t\t\talert ("{$cannotAddGroup} " + element.id + " {$toItsself}. {$deselecting}...");
\t\t\t\t\t\t\t\telement.checked = false;
\t\t\t\t\t\t\t\tcontinue;
\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t// Check that the destination is not a decendent of the new member
\t\t\t\t\t\t\tif ( in_array(destGroupId, decendentGroups[element.id]) ) {
\t\t\t\t\t\t\t\talert ("{$cannotAddGroup} " + element.id + " {$toOwnDesc}.  {$deselecting}...");
\t\t\t\t\t\t\t\telement.checked = false;
\t\t\t\t\t\t\t\tcontinue;
\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t// Check that the new member is not already a child of the destination
\t\t\t\t\t\t\tif ( in_array(element.id, childGroups[destGroupId]) ) {
\t\t\t\t\t\t\t\talert ("{$groupString} " + element.id + " {$isAlreadyInGroup}.  {$deselecting}...");
\t\t\t\t\t\t\t\telement.checked = false;
\t\t\t\t\t\t\t\tcontinue;
\t\t\t\t\t\t\t}
\t\t\t\t\t\t} else {
\t\t\t\t\t\t\t// Check that the new member is not already a child of the destination
\t\t\t\t\t\t\tif ( in_array(element.id, childAgents[destGroupId]) ) {
\t\t\t\t\t\t\t\talert ("{$agentString} " + element.id + " {$isAlreadyInGroup}.  {$deselecting}...");
\t\t\t\t\t\t\t\telement.checked = false;
\t\t\t\t\t\t\t\tcontinue;
\t\t\t\t\t\t\t}
\t\t\t\t\t\t}
\t\t\t\t\t\t
\t\t\t\t\t\t// If we haven't skipped back to the top of the loop yet, increment our ticker.
\t\t\t\t\t\tnumToAdd++;
\t\t\t\t\t}
\t\t\t\t}
\t\t\t\t
\t\t\t\t
\t\t\t\tif (numToAdd && confirm("{$confirmAdd} " + destGroupId + "?")) {
\t\t\t\t\tform.destinationgroup.value = destGroupId;
\t\t\t\t\tform.submit();
\t\t\t\t}
\t\t\t}
\t\t\t
\t\t\t// Validate that the check are children and submit to remove them from the group
\t\t\tfunction submitCheckedFromGroup ( destGroupId ) {
\t\t\t\tvar f;
\t\t\t\tvar form;
\t\t\t\tfor (i = 0; i < document.forms.length; i++) {
\t\t\t\t\tf = document.forms[i];\t\t\t
\t\t\t\t\tif (f.id == 'memberform') {
\t\t\t\t\t\tform = f;
\t\t\t\t\t\tbreak;
\t\t\t\t\t}
\t\t\t\t}\t\t
\t\t\t\t
\t\t\t\tvar elements = form.elements;
\t\t\t\tvar i;
\t\t\t\tvar numToAdd = 0;
\t\t\t\t\t\t\t\t
\t\t\t\tfor (i = 0; i < elements.length; i++) {
\t\t\t\t\tvar element = elements[i];
\t\t\t\t\t
\t\t\t\t\tif (element.type == 'checkbox' && element.checked == true) {
\t\t\t\t\t\t// Check that the destination is not the new member
\t\t\t\t\t\tif ( element.id == destGroupId ) {
\t\t\t\t\t\t\talert ("{$cannotRemoveGroup} " + element.id + " {$fromItsself}. {$deselecting}...");
\t\t\t\t\t\t\telement.checked = false;
\t\t\t\t\t\t\tcontinue;
\t\t\t\t\t\t}
\t\t\t\t\t\t
\t\t\t\t\t\tif (element.className == 'group') {\t\t\t\t\t
\t\t\t\t\t\t\t// Check that the new member is not already a child of the destination
\t\t\t\t\t\t\tif ( !in_array(element.id, childGroups[destGroupId]) ) {
\t\t\t\t\t\t\t\talert ("{$groupString} " + element.id + " {$notInGroup}.  {$deselecting}...");
\t\t\t\t\t\t\t\telement.checked = false;
\t\t\t\t\t\t\t\tcontinue;
\t\t\t\t\t\t\t}
\t\t\t\t\t\t} else {
\t\t\t\t\t\t\t// Check that the new member is not already a child of the destination
\t\t\t\t\t\t\tif ( !in_array(element.id, childAgents[destGroupId]) ) {
\t\t\t\t\t\t\t\talert ("{$agentString} " + element.id + " {$notInGroup}.  {$deselecting}...");
\t\t\t\t\t\t\t\telement.checked = false;
\t\t\t\t\t\t\t\tcontinue;
\t\t\t\t\t\t\t}
\t\t\t\t\t\t}
\t\t\t\t\t\t
\t\t\t\t\t\t// If we haven't skipped back to the top of the loop yet, increment our ticker.
\t\t\t\t\t\tnumToAdd++;
\t\t\t\t\t}
\t\t\t\t}
\t\t\t\t
\t\t\t\tif (numToAdd && confirm("{$confirmRemove} " + destGroupId + "?")) {
\t\t\t\t\tform.destinationgroup.value = destGroupId;
\t\t\t\t\tform.action = form.action.replace('add_to_group','remove_from_group');
\t\t\t\t\tform.submit();
\t\t\t\t}
\t\t\t}
\t\t\t
\t\t\tfunction in_array( aValue, anArray) {
\t\t\t\tfor (i = 0; i < anArray.length; i++) {
\t\t\t\t\tif (anArray[i] == aValue)
\t\t\t\t\t\treturn true;
\t\t\t\t}
\t\t\t\t
\t\t\t\treturn false;
\t\t\t}
\t\t\t
\t\t\t// Decendent Groups
\t\t\tvar decendentGroups = new Array ();
{$decendentGroups}
\t\t
\t\t\t// Child Groups
\t\t\tvar childGroups = new Array ();
{$childGroups}
\t\t\t
\t\t\t// Child Agents
\t\t\tvar childAgents = new Array ();
{$childAgents}
\t\t\t
\t\t//]]> 
\t\t</script>
\t\t
\t\t<form id='memberform' method='post' action='{$actionURL}'>
\t\t<input type='hidden' id='destinationgroup' name='{$destinationgroup_name}' value=''/>
\t\t
END;
        $pageRows->setPreHTML(ob_get_contents());
        ob_end_clean();
        $pageRows->setPostHTML("</form>");
        // In order to preserve proper nesting on the HTML output, the checkboxes
        // are all in the pagerows layout instead of actionrows.
        $actionRows->add($pageRows, null, null, CENTER, CENTER);
        textdomain($defaultTextDomain);
    }
Пример #3
0
    /**
     * Build the content for this action
     * 
     * @return void
     * @access public
     * @since 4/26/05
     */
    function buildContent()
    {
        $defaultTextDomain = textdomain("polyphony");
        $actionRows = $this->getActionRows();
        $pageRows = new Container(new YLayout(), OTHER, 1);
        $harmoni = Harmoni::instance();
        // start our namespace
        $harmoni->history->markReturnURL("polyphony/authorization/edit_authorizations");
        $harmoni->request->startNamespace("polyphony-authorizations");
        $harmoni->request->passthrough();
        $agentManager = Services::getService("Agent");
        $idManager = Services::getService("Id");
        $everyoneId = $idManager->getId("edu.middlebury.agents.everyone");
        $usersId = $idManager->getId("edu.middlebury.agents.users");
        /*********************************************************
         * Buttons
         *********************************************************/
        ob_start();
        print "<table width='100%'><tr><td align='left'>";
        print "<a href='" . $harmoni->request->quickURL("admin", "main") . "'><button>" . _("Return to the Admin Tools") . "</button></a>";
        print "</td><td align='right'>";
        print "<input type='button'";
        print " onclick='Javascript:submitAgentChoice()'";
        print " value='" . _("Edit Authorizations for the selected User/Group") . " --&gt;' />";
        print "</td></tr></table>";
        $submit = new Block(ob_get_contents(), STANDARD_BLOCK);
        $actionRows->add($submit, "100%", null, LEFT, CENTER);
        ob_end_clean();
        // Users header
        $actionRows->add(new Heading("Users", 2), "100%", null, LEFT, CENTER);
        /*********************************************************
         * the agent search form
         *********************************************************/
        ob_start();
        $self = $harmoni->request->quickURL();
        $lastCriteria = $harmoni->request->get('search_criteria');
        $search_criteria_name = RequestContext::name('search_criteria');
        $search_type_name = RequestContext::name('search_type');
        print _("Search For Users") . ": ";
        print <<<END
\t\t<form action='{$self}' method='post'>
\t\t\t<div>
\t\t\t<input type='text' name='{$search_criteria_name}' value='{$lastCriteria}' />
\t\t\t<br /><select name='{$search_type_name}'>
END;
        $searchTypes = $agentManager->getAgentSearchTypes();
        while ($searchTypes->hasNext()) {
            $type = $searchTypes->next();
            $typeString = $type->getDomain() . "::" . $type->getAuthority() . "::" . $type->getKeyword();
            print "\n\t\t<option value='" . htmlspecialchars($typeString, ENT_QUOTES) . "'";
            if ($harmoni->request->get("search_type") == $typeString) {
                print " selected='selected'";
            }
            print ">" . htmlspecialchars($typeString) . "</option>";
        }
        print "\n\t</select>";
        print "\n\t<br /><input type='submit' value='" . _("Search") . "' />";
        print "\n\t<a href='" . $harmoni->request->quickURL() . "'>";
        print "\n\t\t<input type='button' value='" . _("Clear") . "' />\n\t</a>";
        print "\n</div>\n</form>";
        $actionRows->add(new Block(ob_get_contents(), STANDARD_BLOCK));
        ob_end_clean();
        /*********************************************************
         * Form and Javascript
         *********************************************************/
        // In order to preserve proper nesting on the HTML output put the form
        // around the row layout
        ob_start();
        $errorString = _("You must select a User or Group.");
        $agentFieldName = RequestContext::name("agentId");
        print <<<END
\t\t
\t\t<script type='text/javascript'>
\t\t//<![CDATA[ 
\t\t
\t\t\t// Make sure a selection has been made and submit if it has.
\t\t\tfunction submitAgentChoice() {
\t\t\t\tvar f;\t\t
\t\t\t\tfor (i = 0; i < document.forms.length; i++) {
\t\t\t\t\tf = document.forms[i];\t\t\t
\t\t\t\t\tif (f.id == 'chooseform') {
\t\t\t\t\t\tvar form = f;
\t\t\t\t\t\tbreak;
\t\t\t\t\t}
\t\t\t\t}
\t\t\t\t
\t\t\t\tvar radioArray = form.agentId;
\t\t\t\tvar isChecked = false;
\t\t\t\t
\t\t\t\tfor (i=0; i<radioArray.length; i++) {
\t\t\t\t\tif (radioArray[i].checked) {
\t\t\t\t\t\tisChecked = true;
\t\t\t\t\t}
\t\t\t\t}
\t\t\t\t
\t\t\t\tif (isChecked) {
\t\t\t\t\tform.submit();
\t\t\t\t} else {
\t\t\t\t\talert("{$errorString}");
\t\t\t\t}
\t\t\t}
\t\t\t
\t\t//]]> 
\t\t</script>
\t\t
END;
        print "<form id='chooseform' method='post' action='" . $harmoni->request->quickURL("authorization", "edit_authorizations") . "'>\n";
        $pageRows->setPreHTML(ob_get_contents());
        ob_end_clean();
        $pageRows->setPostHTML("</form>");
        /*********************************************************
         * the agent search results
         *********************************************************/
        $search_criteria = $harmoni->request->get("search_criteria");
        $search_type = $harmoni->request->get("search_type");
        if ($search_criteria && $search_type) {
            $typeParts = explode("::", $search_type);
            $searchType = new HarmoniType($typeParts[0], $typeParts[1], $typeParts[2]);
            $agents = new MultiIteratorIterator();
            $agents->addIterator($agentManager->getGroupsBySearch($search_criteria, $searchType));
            $agents->addIterator($agentManager->getAgentsBySearch($search_criteria, $searchType));
            print <<<END
\t\t
\t\t
\t\t<table>
\t\t\t<tr>
\t\t\t\t<td valign='top'>
\t\t\t\t\t<div style='
\t\t\t\t\t\tborder: 1px solid #000; 
\t\t\t\t\t\twidth: 15px; 
\t\t\t\t\t\theight: 15px;
\t\t\t\t\t\ttext-align: center;
\t\t\t\t\t\ttext-decoration: none;
\t\t\t\t\t\tfont-weight: bold;
\t\t\t\t\t'>
\t\t\t\t\t\t-
\t\t\t\t\t</div>
\t\t\t\t</td>
\t\t\t\t<td>
END;
            print "\n\t\t\t" . _("Search Results");
            print <<<END
\t\t\t\t</td>
\t\t\t</tr>
\t\t</table>
\t\t<div style='
\t\t\tmargin-left: 13px; 
\t\t\tmargin-right: 0px; 
\t\t\tmargin-top:0px; 
\t\t\tpadding-left: 10px;
\t\t\tborder-left: 1px solid #000;
\t\t'>
END;
            while ($agents->hasNext()) {
                $agent = $agents->next();
                if ($agent->isGroup()) {
                    $this->printGroup($agent);
                } else {
                    $this->printMember($agent);
                }
                print "<br />";
            }
            print "\n</div>";
            $pageRows->add(new Block(ob_get_contents(), STANDARD_BLOCK), "100%", null, LEFT, CENTER);
            ob_end_clean();
        }
        /*********************************************************
         * Groups
         *********************************************************/
        // Users header
        $pageRows->add(new Heading(_("Groups"), 2), "100%", null, LEFT, CENTER);
        // Loop through all of the Groups
        $childGroupIds = array();
        $groups = $agentManager->getGroupsBySearch($null = null, new Type("Agent & Group Search", "edu.middlebury.harmoni", "RootGroups"));
        while ($groups->hasNext()) {
            $group = $groups->next();
            $groupId = $group->getId();
            // Create a layout for this group using the GroupPrinter
            ob_start();
            GroupPrinter::printGroup($group, $harmoni, 2, array($this, "printGroup"), array($this, "printMember"));
            $groupLayout = new Block(ob_get_contents(), STANDARD_BLOCK);
            ob_end_clean();
            $pageRows->add($groupLayout, "100%", null, LEFT, CENTER);
        }
        $pageRows->add($submit, "100%", null, LEFT, CENTER);
        $actionRows->add($pageRows);
        $harmoni->request->endNamespace();
        textdomain($defaultTextDomain);
    }
 /**
  * Add controls to the block
  * 
  * @param object BlockSiteComponent $block
  * @param object Container $guiContainer
  * @return object Container The guiContainer
  * @access public
  * @since 5/24/07
  */
 function addBlockControls(BlockSiteComponent $block, Container $guiContainer)
 {
     // Add controls bar and border
     $authZ = Services::getService("AuthZ");
     $idManager = Services::getService("Id");
     if ($authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify"), $block->getQualifierId())) {
         $controlsHTML = $this->getBarPreHTML('#090', $block) . $this->getControlsHTML($block, "<em>" . $this->_classNames['Block'] . "</em>", $block->acceptVisitor($this->_controlsVisitor), '#090', '#9F9', '#6C6', 0, '0px', Segue_Selection::instance()->getAddLink($block));
         $guiContainer->setPreHTML($controlsHTML . $guiContainer->getPreHTML($null = null));
         $guiContainer->setPostHTML($this->getBarPostHTML());
     }
     return $guiContainer;
 }