50 Fakoli::usingFeature(
"tree");
80 if(preg_match(
'/\//', $statusBlock))
81 $this->statusBlockHandler = $statusBlock;
83 $this->statusBlockView = $statusBlock;
88 if(count($this->items) == 0)
return;
92 foreach($this->statusCategories as $statusTitle => $status)
94 if (array_key_exists($status, $this->items))
96 $tree =
new TreeControl(
"statusTree$status",
"",
"tree",
false, $this->width);
98 $tree->indent =
"0px";
100 $category = $this->items[$status];
102 foreach($category as $item)
104 $pkName = $item->getPrimaryKey();
106 $node = $this->
getNode($item, $pkName);
108 if($this->statusBlockView)
114 $subNode =
new TreeNode(
"block_{$item->$pkName}",
117 $subNode->leafStyle =
"";
118 if($this->statusBlockHandler)
120 $subNode->onDemand =
"{$this->statusBlockHandler}?$pkName={$item->$pkName}";
122 $node->add($subNode);
138 $node =
new TreeNode(
"status_{$item->$pkName}", $item->getTitle(),
139 null,
false,
"tree_list_closed",
"tree_list_open");
140 $node->leafStyle =
"tree_list_open";
157 if (count($this->items) > 0)
159 foreach($this->statusCategories as $statusTitle => $status)
161 if (array_key_exists($status, $this->items))
163 echo
"<h3>$statusTitle</h3>\n";
164 $this->trees[$status]->writeHTML();
170 echo
"<br/><em>$this->emptyMessage</em><br/>";
202 echo
"<div class=\"status_block\">";
204 echo
"<div id=\"col2\"><br/>";
220 $html =
"<div class=\"status_block\">";
222 $html .=
"<div id=\"col2\" style=\"float: right\"><br/>\n";
224 $html .=
"</div>\n<br/>\n";
254 function writeButton($url, $icon, $text, $newWindow =
false, $class =
"")
256 echo $this->
getButtonHTML($url, $icon, $text, $newWindow, $class);
262 $target =
"target='_blank'";
264 $class = (!$class) ?
"button" : $class;
265 $img = ($icon) ?
"<img src='$icon' style='border: none'>" :
"";
267 $html =
"<p><a $target class=\"$class\" href=\"$url\">
268 $img $text </a></p>";
275 $this->
writeButton($this->item->getViewUrl(), $this->iconView,
"View this {$this->activityName}",
false);
280 $this->
writeButton($this->item->getEditUrl(), $this->iconEdit,
"Edit this {$this->activityName}",
false);
285 echo $this->getDeleteButtonHTML($class);
290 $url = $this->item->getViewUrl();
292 echo
"<a class=\"button\" href=\"$url\" onclick=\"popup('$url', '_blank', 750, 600); return false;\">
293 <img src=\"$this->iconView\" alt=\"View\"/> View this $this->activityName </a><br/>";
299 $class = (!$class) ?
"button" : $class;
302 $message =
"Are you sure you want to delete this {$this->activityName}?";
304 $html =
"<p><a href=\"$this->deleteUrl\" class=\"$class\"
305 onclick=\"return confirm('$message');\">
306 $icon Delete this $this->activityName</a></p>";
314 $html = $this->
getButtonHTML($this->item->getEditUrl(), $this->iconEdit,
"Edit this {$this->activityName}", $newWindow);
321 $html = $this->
getButtonHTML($this->item->getViewUrl(), $this->iconView,
"View this {$this->activityName}", $newWindow);
getButtonHTML($url, $icon, $text, $newWindow=false, $class="")
getDeleteButton($class="")
writeDeleteButton($class="")
writeButton($url, $icon, $text, $newWindow=false, $class="")
getEditButton($class="", $newWindow=false)
StatusTrees($items, $statusCategories, $statusBlock)
The TreeControl provides a class that can be used to generate dynamic tree controls for use in PHP fo...
TreeNode represents a node in the tree.