| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- class NTKActionList
- {
- function NTKActionList($id)
- {
- $this->id = $id;
-
- $this->rows = array();
- }
-
- function addAction($label, $action, $icon, $details)
- {
- $this->rows[] = array($label, $action, $icon, $details);
- }
-
- function getHtml()
- {
- $html .= "<div style=\"overflow: auto;\">";
- $html .= "<table id=\"$this->id\" class=\"actionlist\" cellspacing=\"0\" style=\"width: 100%;\">\n";
-
- $color = False;
-
- $color_actions .= " onmousedown=\"this.className = 'actionlist_line_down'\"";
- $color_actions .= " onmouseup=\"this.className = 'actionlist_line_over'\"";
- $color_actions .= " onmouseover=\"this.className = 'actionlist_line_over'\"";
- $color_actions .= " onmouseout=\"this.className = 'actionlist_color_line'\"";
-
- $plain_actions .= " onmousedown=\"this.className = 'actionlist_line_down'\"";
- $plain_actions .= " onmouseup=\"this.className = 'actionlist_line_over'\"";
- $plain_actions .= " onmouseover=\"this.className = 'actionlist_line_over'\"";
- $plain_actions .= " onmouseout=\"this.className = 'actionlist_plain_line'\"";
-
- for($i = 0; $i < count($this->rows); $i++)
- {
- if($color)
- {
- $html .= "<tr class=\"listview_color_line\" onclick=\"$this->rows[$i][1]\" $color_actions>\n";
- $color = False;
- }
- else
- {
- $html .= "<tr class=\"listview_plain_line\" onclick=\"$this->rows[$i][1]\" $plain_actions>\n";
- $color = True;
- }
-
- $html .= "<td>\n";
- $html .= "<img src=\"".$this->rows[$i][2]."\" border=\"0\">".$this->rows[$i][0]."\n";
- $html .= "</td>\n";
-
- $html .= "</tr>\n";
- }
-
- $html .= "</table>\n";
- $html .= "</div>";
-
- return $html;
- }
- }
- ?>
|