本文整理汇总了PHP中Container::setPostHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::setPostHTML方法的具体用法?PHP Container::setPostHTML怎么用?PHP Container::setPostHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Container
的用法示例。
在下文中一共展示了Container::setPostHTML方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: visitFixedOrganizer
/**
* 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: buildContent
//.........这里部分代码省略.........
\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: buildContent
//.........这里部分代码省略.........
\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
示例4: addBlockControls
/**
* 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;
}