本文整理汇总了PHP中Tree::addChild方法的典型用法代码示例。如果您正苦于以下问题:PHP Tree::addChild方法的具体用法?PHP Tree::addChild怎么用?PHP Tree::addChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tree
的用法示例。
在下文中一共展示了Tree::addChild方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Tree
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
G::LoadClass("tree");
G::LoadClass("triggerLibrary");
$triggerLibrary = triggerLibrary::getSingleton();
$triggerLibraryO = $triggerLibrary->getRegisteredClasses();
$oTree = new Tree();
$oTree->nodeType = "blank";
$oTree->name = "Triggers";
$oTree->showSign = false;
$div1Style = strpos($_SERVER["HTTP_USER_AGENT"], "MSIE") !== false ? " style=\"margin-top: 0.65em;\"" : null;
$oNode =& $oTree->addChild("TRI_CUSTOM", "<div" . $div1Style . "><span onclick=\"currentPopupWindow.remove(); triggerNewCustom();\" style=\"cursor: pointer;\"><img src=\"/images/50px-Edit.png\" width=\"15px\" heigth=\"15px\" valing=\"middle\" alt=\"\" /> <strong>" . G::LoadTranslation("ID_CUSTOM_TRIGGER") . "</strong></span><br /><span onclick=\"currentPopupWindow.remove(); triggerNewCustom();\" style=\"cursor: pointer;\"><small><em>" . G::LoadTranslation("ID_CUSTOM_TRIGGER_DESCRIPTION") . "</em></small></span></div>", array("nodeType" => "parent"));
$oNode =& $oTree->addChild("TRI_COPY", "<div style=\"margin-top: 1.25em;\"><span onclick=\"currentPopupWindow.remove(); triggerCopy();\" style=\"cursor: pointer;\"><img src=\"/images/documents/_editcopy.png\" width=\"15px\" heigth=\"15px\" valing=\"middle\" alt=\"\" /> <strong>" . G::LoadTranslation("ID_TRIGGER_COPY_OPTION") . "</strong></span><br /><span onclick=\"currentPopupWindow.remove(); triggerCopy();\" style=\"cursor: pointer;\"><small><em>" . G::LoadTranslation("ID_TRIGGER_COPY_OPTION_DESCRIPTION") . "</em></small></span></div>", array("nodeType" => "parent"));
$triggerLibraryOCount = count($triggerLibraryO);
foreach ($triggerLibraryO as $keyLibrary => $libraryObj) {
$libraryName = $libraryObj->info["name"];
$libraryIcon = isset($libraryObj->info["icon"]) && $libraryObj->info["icon"] != "" ? $libraryObj->info["icon"] : "/images/browse.gif";
$libraryDescription = trim(str_replace("*", "", implode(" ", $libraryObj->info["description"])));
$triggerCount = count($libraryObj->methods);
if ($triggerCount > 0) {
//Sort alpha
ksort($libraryObj->methods, SORT_STRING);
//Now the Triggers
//Library Father (Name + Description)
$oNode =& $oTree->addChild($keyLibrary, " <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td nowrap=\"nowrap\" valign=\"top\"><span onclick=\"tree.expand(this.parentNode);\" style=\"cursor: pointer;\"><img src=\"" . $libraryIcon . "\" width=\"15px\" heigth=\"15px\" valing=\"middle\" alt=\"\" /> <b>" . $libraryName . " ({$triggerCount})</b></td></tr><tr><td class=\"\"><span onclick=\"tree.expand(this.parentNode);\" style=\"cursor: pointer;\"><small><i>{$libraryDescription}</i></small></span></td></tr></table>", array("nodeType" => "parent"));
$oNode->contracted = $triggerLibraryOCount == 1 ? false : true;
//Library Childs (available methods)
示例2: htmlentities
$tree->width = "350px";
$tree->value = '
<div class="boxTopBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="boxContentBlue">
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
<tr>
<td class="userGroupTitle">' . G::loadTranslation("ID_ASSIGN_GROUP_TO") . ' ' . $aRow['USR_FIRSTNAME'] . ' ' . $aRow['USR_LASTNAME'] . '</td>
</tr>
</table>
</div>
<div class="boxBottomBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="userGroupLink"><a href="#" onclick="showUserGroups(\'' . $_GET['sUserUID'] . '\');return false;">' . G::LoadTranslation('ID_BACK_TO_GROUP_LIST') . '</a></div>';
$tree->showSign = false;
$allGroups = $groups->getAllGroups();
foreach ($allGroups as $group) {
$ID_ASSIGN = G::LoadTranslation('ID_ASSIGN');
$groupUID = htmlentities($group->getGrpUid());
$userUID = $_GET['sUserUID'];
$GROUP_TITLE = strip_tags($group->getGrpTitle());
$html = <<<innerHTML
\t <table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>
\t <tr>
\t <td width='250px' class='treeNode' style='border:0px;background-color:transparent;'>{$GROUP_TITLE}</td>\t
\t <td class='treeNode' style='border:0px;background-color:transparent;'>[<a href="#" onclick="saveUserGroup('{$groupUID}','{$userUID}');return false;">{$ID_ASSIGN}</a>]</td>
\t </tr>
\t </table>
innerHTML;
$ch =& $tree->addChild($group->getGrpUid(), $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/users.png" />';
}
print $tree->render();
示例3: Cases
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
<tr>
<td class="userGroupTitle">Steps List</td>
</tr>
</table>
</div>
<div class="boxBottomBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
';
$tree->showSign = false;
G::LoadClass('case');
$o = new Cases();
$steps = $o->getAllDynaformsStepsToRevise($_GET['APP_UID']);
$APP_UID = $_GET['APP_UID'];
$DEL_INDEX = $_GET['DEL_INDEX'];
$html = "\r\n <table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>\r\n <tr>\r\n <td class='treeNode' style='border:0px;background-color:transparent;'><b>Dynaforms<b></td>\r\n </tr>\r\n </table>";
$ch =& $tree->addChild("", $html, array('nodeType' => 'child'));
$ch->point = '</span><img src="/images/plus.gif" />';
$i = 1;
$PRO_UID = '';
$DYN_UID = '';
foreach ($steps as $step) {
require_once 'classes/model/Dynaform.php';
$od = new Dynaform();
$dynaformF = $od->Load($step['STEP_UID_OBJ']);
$n = $step['STEP_POSITION'];
$TITLE = " - " . $dynaformF['DYN_TITLE'];
$DYN_UID = $dynaformF['DYN_UID'];
$PRO_UID = $step['PRO_UID'];
$html = "\r\n <table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>\r\n <tr>\r\n <td class='treeNode' style='border:0px;background-color:transparent;'><span id='focus{$i}'></td>\r\n <td class='treeNode' style='border:0px;background-color:transparent;'> {$n} </td>\r\n <td class='treeNode' style='border:0px;background-color:transparent;'>\r\n\t\t \t<a href=\"cases_StepToRevise?type=DYNAFORM&ex={$i}&PRO_UID={$PRO_UID}&DYN_UID={$DYN_UID}&APP_UID={$APP_UID}&position=" . $step['STEP_POSITION'] . "&DEL_INDEX={$DEL_INDEX}\">{$TITLE}</a>\r\n\t\t </td>\r\n </tr>\r\n </table>";
$ch =& $tree->addChild("", $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/ftv2mnode.gif" />';
示例4: __toString
{
array_push($path, $this->id);
if ($this->id == $id) {
return 1;
}
foreach ($this->children as $child) {
if (1 == $child->find_path($id, $path)) {
return 1;
}
array_pop($path);
}
}
public function __toString()
{
return $this->node . ' ' . $this->id . "\n";
}
}
$dom = new Tree('DOM', 'ROOT');
$body = new Tree('BODY', 1);
$div1 = new Tree('DIV', 'div-1');
$div2 = new Tree('DIV', 'my-id');
$a = new Tree("A", 'some-link');
$dom->addChild($body);
$body->addChild($div1);
$body->addChild($div2);
$div2->addChild($a);
$path1 = $path2 = array();
$dom->find_path('div-1', $path1);
$dom->find_path('some-link', $path2);
echo implode(' ', $path1), "\n";
echo implode(' ', $path2), "\n";
示例5: foreach
$aRow['STEP_NAME'] = $aFields['OUT_DOC_TITLE'];
break;
case 'EXTERNAL':
$aRow['STEP_NAME'] = 'unknown ' . $aRow['STEP_UID'];
foreach ($externalSteps as $key => $val) {
if ($val->sStepId == $aRow['STEP_UID_OBJ']) {
$aRow['STEP_NAME'] = $val->sStepTitle;
}
}
break;
}
$oCriteria = $oProcessMap->getStepTriggersCriteria($aRow['STEP_UID'], $_SESSION['TASK'], 'BEFORE');
$iCantidad1 = StepTriggerPeer::doCount($oCriteria);
$oCriteria = $oProcessMap->getStepTriggersCriteria($aRow['STEP_UID'], $_SESSION['TASK'], 'AFTER');
$iCantidad2 = StepTriggerPeer::doCount($oCriteria);
$oNode =& $oTree->addChild($aRow['STEP_UID'], ' <span onclick="tree.expand(this.parentNode);" style="cursor: pointer;">' . $aRow['STEP_NAME'] . ' - ' . G::LoadTranslation('ID_TRIGGERS') . ' (<span id="TRIG_' . $aRow['STEP_UID'] . '">' . ($iCantidad1 + $iCantidad2) . '</span>)' . '</span>', array('nodeType' => 'parent'));
$oNode->contracted = true;
$oAux1 =& $oNode->addChild('before_node', '<span onclick="tree.expand(this.parentNode);showTriggers(\'' . $aRow['STEP_UID'] . '\', \'BEFORE\');" style="cursor: pointer;">' . G::LoadTranslation('ID_BEFORE') . ' - ' . G::LoadTranslation('ID_TRIGGERS') . ' (<span id="TRIG_' . $aRow['STEP_UID'] . '_BEFORE">' . $iCantidad1 . '</span>) </span>', array('nodeType' => 'parent'));
$oAux1->plus = "<span style='cursor:pointer;display:block;width:15;height:10px;' onclick='tree.expand(this.parentNode);showTriggers(\"" . $aRow['STEP_UID'] . "\", \"BEFORE\");'></span>";
$oAux1->contracted = true;
$oAux2 =& $oAux1->addChild($aRow['STEP_UID'] . '_before_node', '<span id="triggersSpan_' . $aRow['STEP_UID'] . '_BEFORE"></span>', array('nodeType' => 'parentBlue'));
$oAux1 =& $oNode->addChild('after_node', '<span onclick="tree.expand(this.parentNode);showTriggers(\'' . $aRow['STEP_UID'] . '\', \'AFTER\');" style="cursor: pointer;">' . G::LoadTranslation('ID_AFTER') . ' - ' . G::LoadTranslation('ID_TRIGGERS') . ' (<span id="TRIG_' . $aRow['STEP_UID'] . '_AFTER">' . $iCantidad2 . '</span>) </span>', array('nodeType' => 'parent'));
$oAux1->plus = "<span style='cursor:pointer;display:block;width:15;height:10px;' onclick='tree.expand(this.parentNode);showTriggers(\"" . $aRow['STEP_UID'] . "\", \"AFTER\");'></span>";
$oAux1->contracted = true;
$oAux2 =& $oAux1->addChild($aRow['STEP_UID'] . '_after_node', '<span id="triggersSpan_' . $aRow['STEP_UID'] . '_AFTER"></span>', array('nodeType' => 'parentBlue'));
$oDataset->next();
}
$oCriteria = $oProcessMap->getStepTriggersCriteria(-1, $_SESSION['TASK'], 'BEFORE');
$iCantidad1 = StepTriggerPeer::doCount($oCriteria);
$oCriteria = $oProcessMap->getStepTriggersCriteria(-2, $_SESSION['TASK'], 'BEFORE');
$iCantidad2 = StepTriggerPeer::doCount($oCriteria);
示例6: htmlentities
$allWebservices[] = 'InputDocumentList';
$allWebservices[] = 'InputDocumentProcessList';
$allWebservices[] = 'OutputDocumentList';
$allWebservices[] = 'RemoveDocument';
$allWebservices[] = 'TaskCase';
$allWebservices[] = 'ReassignCase';
$allWebservices[] = 'removeUserFromGroup';
foreach ($allWebservices as $ws) {
$ID_TEST = G::LoadTranslation('ID_TEST');
$UID = htmlentities($ws);
$WS_TITLE = strip_tags($ws);
$htmlGroup = '';
$htmlGroup .= "<table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>";
$htmlGroup .= "<tr>";
$htmlGroup .= "<td width='250px' class='treeNode' style='border:0px;background-color:transparent;'>";
$htmlGroup .= "{$WS_TITLE}</td>";
$htmlGroup .= "<td class='treeNode' style='border:0px;background-color:transparent;'>";
if ($WS_TITLE != 'SendFiles') {
if ($WS_TITLE == 'Login' || $wsSessionId != '') {
$htmlGroup .= "[<a href='#' onclick=\"showFormWS('{$UID}');return false;\">{$ID_TEST}</a>]";
}
} else {
if (isset($_SESSION['WS_SESSION_ID']) && $_SESSION['WS_SESSION_ID'] != '') {
$htmlGroup .= "[<a href='#' onclick=\"showUploadFilesForm();return false;\">{$ID_TEST}</a>]";
}
}
$htmlGroup .= "</td></tr></table>";
$ch =& $tree->addChild($ws, $htmlGroup, array('nodeType' => 'child'));
$ch->point = '<img src="/images/trigger.gif" />';
}
print $tree->render();
示例7: openPMFolder
function openPMFolder()
{
$WIDTH_PANEL = 350;
G::LoadClass ('tree');
$folderContent = $oPMFolder->getFolderList ($_POST ['folderID'] != '0' ?
$_POST ['folderID'] == 'NA' ? "" : $_POST ['folderID'] : $rootFolder);
//krumo($folderContent);
if (! is_array ($folderContent)) {
echo $folderContent;
exit ();
}
$tree = new Tree ();
$tree->name = 'DMS';
$tree->nodeType = "blank";
//$tree->width="350px";
$tree->value = '';
$tree->showSign = false;
$i = 0;
foreach ($folderContent as $key => $obj) {
$i ++;
//if ($obj->item_type=="F") {
$RowClass = ($i % 2 == 0) ? 'Row1' : 'Row2';
$id_delete = G::LoadTranslation('ID_DELETE');
$id_edit = G::LoadTranslation('ID_EDIT');
$htmlGroup = <<<GHTML
<table cellspacing='0' cellpadding='0' border='1' style='border:0px;' width="100%" class="pagedTable">
<tr id="{$i}" onmouseout="setRowClass(this, '{$RowClass}')" onmouseover="setRowClass(this, 'RowPointer')"
class="{$RowClass}" style="cursor:hand">
<td width='' class='treeNode' style='border:0px;background-color:transparent;'><a href="#"
onclick="focusRow(this, 'Selected');openPMFolder('{$obj['FOLDER_UID']}','{$_POST['rootfolder']}');">
<img src="/images/folderV2.gif" border = "0" valign="middle" /> {$obj['FOLDER_NAME']}</a>
<a href="#" onclick="deletePMFolder('{$obj['FOLDER_UID']}','{$_POST['rootfolder']}');"> {$id_delete}</a>
</td>
</tr>
</table>
<div id="child_{$obj['FOLDER_UID']}"></div>
GHTML;
$ch = & $tree->addChild ($key, $htmlGroup, array ('nodeType' => 'child'));
$ch->point = ' ';
}
$RowClass = ($i % 2 == 0) ? 'Row1' : 'Row2';
$key = 0;
if ($_POST ['folderID'] == '0') {
$notInFolderLabel = G::LoadTranslation ('ID_NOT_IN_FOLDER');
$htmlGroup = <<<GHTML
<table cellspacing='0' cellpadding='0' border='1' style='border:0px;' width="100%" class="pagedTable">
<tr id="{$i}" onclick="focusRow(this, 'Selected');openPMFolder('NA');"
onmouseout="setRowClass(this, '{$RowClass}')" onmouseover="setRowClass(this, 'RowPointer')" class="{$RowClass}">
<td width='' class='treeNode' style='border:0px;background-color:transparent;'><a href="#" onclick="">
<img src="/images/folderV2.gif" border = "0" valign="middle" /> - {$notInFolderLabel} -</a> </td>
</tr>
</table>
<div id="child_NA"></div>
GHTML;
$ch = & $tree->addChild ($key, $htmlGroup, array ('nodeType' => 'child'));
$ch->point = ' ';
}
print ($tree->render ()) ;
}
示例8: personTree
/**
* Returns an XML tree for use in further test cases
*
* @return xml.Tree
*/
protected function personTree()
{
$t = new Tree('person');
$t->root()->setAttribute('id', '1549');
$t->addChild(new Node('firstName', 'Timm'));
$t->addChild(new Node('lastName', 'Friebe'));
$t->addChild(new Node('location', 'Karlsruhe'));
$t->addChild(new Node('location', 'Germany'));
return $t;
}
示例9: array
if (file_exists($classFile)) {
require_once $classFile;
$sClassName = $sNamespace . 'class';
$obj = new $sClassName();
if (method_exists($obj, 'getExternalStepTitle')) {
$stepTitle = $obj->getExternalStepTitle($aRow->getStepUidObj(), $tasUid, $aRow->getStepPosition());
}
}
}
}
break;
default:
$stepTitle = $aRow->getStepUid();
}
//$oNode =& $oTree->addChild($aRow->getStepUid(), ' ' . $aRow->getStepNameObj(), array('nodeType'=>'parent') );
$oNode =& $oTree->addChild($aRow->getStepUid(), ' ' . $stepTitle, array('nodeType' => 'parent'));
$oNode->plus = '';
$oNode->minus = '';
switch ($aRow->getStepTypeObj()) {
case 'DYNAFORM':
$sOptions = '<table width="70%" cellpadding="0" cellspacing="0" border="0"><tr>';
$sOptions .= '<td width="100%" class="treeNode"><a style="' . ($_GET['TYPE'] == 'DYNAFORM' && ($_GET['UID'] == $aRow->getStepUidObj() && $_GET['ACTION'] == 'EDIT') ? 'background-color:orange;color:white;padding-left:5px;padding-right:5px; ' : '') . '" href="../cases/cases_Step?TYPE=' . $aRow->getStepTypeObj() . '&UID=' . $aRow->getStepUidObj() . '&POSITION=' . $aRow->getStepPosition() . '&ACTION=EDIT">' . G::LoadTranslation('ID_EDIT') . '</a></td>';
$sOptions .= '</tr></table>';
$oAux =& $oNode->addChild($aRow->getStepUid() . '_node', $sOptions, array('nodeType' => 'child'));
break;
case 'OUTPUT_DOCUMENT':
$sOptions = '<table width="70%" cellpadding="0" cellspacing="0" border="0"><tr>';
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDocumentPeer::APP_UID, $_SESSION['APPLICATION']);
$oCriteria->add(AppDocumentPeer::DEL_INDEX, $_SESSION['INDEX']);
$oCriteria->add(AppDocumentPeer::DOC_UID, $aRow->getStepUidObj());
示例10: performance
public function performance()
{
$s = microtime(TRUE);
$t = new Tree();
for ($i = 0; $i < 100; $i++) {
$c = $t->addChild(new Node('child', NULL, array('id' => $i)));
for ($j = 0; $j < 100; $j++) {
$c->addChild(new Node('elements', str_repeat('x', $j)));
}
}
$l = strlen($t->getSource(INDENT_NONE));
printf('%d bytes, %.3f seconds', $l, microtime(TRUE) - $s);
}
示例11: Tree
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
G::LoadClass('tree');
G::LoadClass('triggerLibrary');
$triggerLibrary = triggerLibrary::getSingleton();
$triggerLibraryO = $triggerLibrary->getRegisteredClasses();
$oTree = new Tree();
$oTree->nodeType = 'blank';
$oTree->name = 'Triggers';
$oTree->showSign = false;
$oNode =& $oTree->addChild('TRI_CUSTOM', ' <table border="0" cellpadding="0" cellspacing="0"><tr><td nowrap valign="top"><span onclick="currentPopupWindow.remove();triggerNewCustom();" style="cursor: pointer;" >' . "<img src='/images/50px-Edit.png' width='15px' heigth='15px' valing='middle'> <b>" . G::LoadTranslation('ID_CUSTOM_TRIGGER') . " </b></td></tr><tr><td class=''><span onclick='currentPopupWindow.remove();triggerNewCustom();' style='cursor: pointer;' ><small><i>" . G::LoadTranslation('ID_CUSTOM_TRIGGER_DESCRIPTION') . "</i></small></span></td></tr></table>", array('nodeType' => 'parent'));
$triggerLibraryOCount = count($triggerLibraryO);
foreach ($triggerLibraryO as $keyLibrary => $libraryObj) {
$libraryName = $libraryObj->info['name'];
$libraryIcon = isset($libraryObj->info['icon']) && $libraryObj->info['icon'] != "" ? $libraryObj->info['icon'] : "/images/browse.gif";
$libraryDescription = trim(str_replace("*", "", implode(" ", $libraryObj->info['description'])));
$triggerCount = count($libraryObj->methods);
if ($triggerCount > 0) {
//Sort alpha
ksort($libraryObj->methods, SORT_STRING);
//Now the Triggers
//Library Father (Name + Description)
$oNode =& $oTree->addChild($keyLibrary, ' <table border="0" cellpadding="0" cellspacing="0"><tr><td nowrap valign="top"><span onclick="tree.expand(this.parentNode);" style="cursor: pointer;" >' . "<img src='" . $libraryIcon . "' width='15px' heigth='15px' valing='middle'> <b>" . $libraryName . " ({$triggerCount})</b></td></tr><tr><td class=''><span onclick='tree.expand(this.parentNode);' style='cursor: pointer;' ><small><i>{$libraryDescription}</i></small></span></td></tr></table>", array('nodeType' => 'parent'));
$oNode->contracted = $triggerLibraryOCount == 1 ? false : true;
//Library Childs (available methods)
foreach ($libraryObj->methods as $methodName => $methodObject) {
示例12: htmlentities
<div class="boxContentBlue">
<table width="100%" style="margin:0px;" cellspacing="0" cellpadding="0">
<tr>
<td class="userGroupTitle">' . G::loadTranslation("ID_USER_GROUPS") . ' ' . $aRow['USR_FIRSTNAME'] . ' ' . $aRow['USR_LASTNAME'] . '</td>
</tr>
</table>
</div>
<div class="boxBottomBlue"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="userGroupLink"><a href="#" onclick="showUserGroupInterface(\'' . $_GET['sUserUID'] . '\');return false;">' . G::LoadTranslation('ID_ASSIGN_GROUP') . '</a></div>';
$tree->showSign = false;
$allGroups = $groups->getUserGroups($_GET['sUserUID']);
foreach ($allGroups as $group) {
$ID_DELETE = G::LoadTranslation('ID_DELETE');
$groupUID = htmlentities($group->getGrpUid());
$userUID = $_GET['sUserUID'];
$GROUP_TITLE = strip_tags($group->getGrpTitle());
$html = <<<innerHTML
\t <table cellspacing='0' cellpadding='0' border='1' style='border:0px;'>
\t <tr>
\t <td width='250px' class='treeNode' style='border:0px;background-color:transparent;'>{$GROUP_TITLE}</td>\t
\t <td class='treeNode' style='border:0px;background-color:transparent;'>[<a href="#" onclick="deleteGroup('{$groupUID}','{$userUID}');return false;">{$ID_DELETE}</a>]</td>
\t </tr>
\t </table>
innerHTML;
$ch =& $tree->addChild($group->getGrpUid(), $html, array('nodeType' => 'child'));
$ch->point = '<img src="/images/users.png" />';
}
if ($groups->getNumberGroups($_GET['sUserUID']) == 0) {
$ch =& $tree->addChild('', G::LoadTranslation('ID_MSG_NORESULTS_USERGROUP'), array('nodeType' => 'child'));
}
print $tree->render();
示例13: Tree
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
G::LoadClass('tree');
$oTree = new Tree();
$oTree->nodeType = "blank";
$oTree->name = 'Information';
$oTree->showSign = false;
$oNode =& $oTree->addChild('1', '<a class="linkInBlue" href="#" onclick="showProcessMap();return false;">' . G::LoadTranslation('ID_PROCESS_MAP') . '</a>', array('nodeType' => 'parentBlue'));
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';
$oNode =& $oTree->addChild('2', '<a class="linkInBlue" href="#" onclick="showProcessInformation();return false;">' . G::LoadTranslation('ID_PROCESS_INFORMATION') . '</a>', array('nodeType' => 'parentBlue'));
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';
if ($_SESSION['TASK'] != -1) {
$oNode =& $oTree->addChild('3', '<a class="linkInBlue" href="#" onclick="showTaskInformation();return false;">' . G::LoadTranslation('ID_TASK_INFORMATION') . '</a>', array('nodeType' => 'parentBlue'));
$oNode->plus = '';
$oNode->minus = '';
$oNode->point = '';
}
$oNode =& $oTree->addChild('4', '<a class="linkInBlue" href="#" onclick="showTransferHistory();return false;">' . G::LoadTranslation('ID_CASE_HISTORY') . '</a>', array('nodeType' => 'parentBlue'));
$oNode->plus = '';
示例14: microtime
$time_start = microtime(true);
$filename = 'words.txt';
if (!file_exists($filename)) {
print 'File ' . $filename . ' not exists!';
return;
}
// reads all input words separated by new-lines
$words = file($filename, FILE_IGNORE_NEW_LINES + FILE_SKIP_EMPTY_LINES);
$tree = new Tree('!');
$c = '';
// creates first-level tree with first-word-letters children
for ($i = 0; $i < count($words); $i++) {
$words[$i] = strtolower(trim($words[$i]));
if ($c != $words[$i][0]) {
$c = $words[$i][0];
$tree->addChild($c, $i);
}
}
// recursively creates children
recurse($tree);
$time_end = microtime(true);
$time = $time_end - $time_start;
print "Create Tree {$time} seconds\n";
$time_start = microtime(true);
// saves binary serialized tree to file
$fp = fopen('tree.txt', 'w+b');
save_tree($tree, $fp);
fclose($fp);
$time_end = microtime(true);
$time = $time_end - $time_start;
print "Save Tree {$time} seconds\n";
示例15: Cases
$oCase = new Cases();
$aFields = $oCase->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX']);
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDelayPeer::APP_UID, $_SESSION['APPLICATION']);
$oCriteria->add(AppDelayPeer::APP_DEL_INDEX, $_SESSION['INDEX']);
$oCriteria->add(AppDelayPeer::APP_TYPE, 'PAUSE');
$oCriteria->add(AppDelayPeer::APP_DISABLE_ACTION_USER, null);
$oDataset = AppDelayPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
global $RBAC;
switch ($aFields['APP_STATUS']) {
case 'DRAFT':
if (!$aRow) {
$oNode =& $oTree->addChild('1', '<a id="spause" class="linkInBlue" href="#" onclick="pauseCase();return false;">' . G::LoadTranslation('ID_PAUSED_CASE') . '</a></span><a id="scpause" class="linkInBlue" href="#" onclick="cancelPauseCase();return false;" style="display:none">' . G::LoadTranslation('ID_CANCEL') . ' ' . strtolower(G::LoadTranslation('ID_PAUSED_CASE')) . '</a><div id="pausediv" style="display:none"></div>', array('nodeType' => 'parentBlue'));
} else {
$oNode =& $oTree->addChild('1', '<a class="linkInBlue" href="#" onclick="unpauseCase();return false;">' . G::LoadTranslation('ID_UNPAUSE') . '</a>', array('nodeType' => 'parentBlue'));
}
$oNode =& $oTree->addChild('2', '<a class="linkInBlue" href="#" onclick="deleteCase(\'' . $APP_UID . '\');return false;">' . G::LoadTranslation('ID_DELETE') . '</a>', array('nodeType' => 'parentBlue'));
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) {
$oNode =& $oTree->addChild('3', '<a class="linkInBlue" href="#" onclick="view_reassignCase(\'' . $APP_UID . '\');return false;">' . G::LoadTranslation('ID_REASSIGN') . '</a>', array('nodeType' => 'parentBlue'));
}
break;
case 'TO_DO':
if (!$aRow) {
$oNode =& $oTree->addChild('1', '<a id="spause" class="linkInBlue" href="#" onclick="pauseCase();return false;">' . G::LoadTranslation('ID_PAUSED_CASE') . '</a></span><a id="scpause" class="linkInBlue" href="#" onclick="cancelPauseCase();return false;" style="display:none">' . G::LoadTranslation('ID_CANCEL') . ' ' . strtolower(G::LoadTranslation('ID_PAUSED_CASE')) . '</a><div id="pausediv" style="display:none"></div>', array('nodeType' => 'parentBlue'));
if ($cant == 1) {
$oNode =& $oTree->addChild('2', '<a class="linkInBlue" href="#" onclick="cancelCase();return false;">' . G::LoadTranslation('ID_CANCEL') . '</a>', array('nodeType' => 'parentBlue'));
}
} else {