Пример #1
0
 /**
  * Buttons
  * -------------------------
  **/
 public function Buttons($button)
 {
     if (is_array($button)) {
         if (isset($button['id'])) {
             $id = "id=\"" . $button['id'] . "\"";
         } else {
             $id = false;
         }
         if (isset($button['icon'])) {
             $title = X::Icon($button['icon']);
             if (isset($button['name'])) {
                 $name = "name=\"{$button['name']}\"";
             } else {
                 $name = "name=\"" . @$button['icon'] . "\"";
             }
             if (isset($button['color'])) {
                 $class = "class=\"{$button['color']}\"";
             }
             $BUTTON = "<a {$id} {$name}>{$title}</a>";
         } else {
             $title = "value=\"{$button['title']}\"";
             if (isset($button['name'])) {
                 $name = "name=\"{$button['name']}\"";
             } else {
                 $name = "name=\"" . @$button['id'] . "\"";
             }
             if (isset($button['color'])) {
                 $class = "class=\"{$button['color']}\"";
             } else {
                 $class = false;
             }
             $BUTTON = "<input type=\"button\" {$class} {$title} {$name} {$id} />";
         }
         $this->FORM[$this->id][] = $BUTTON;
     } elseif ($button !== false) {
         $this->FORM[$this->id][] = $button;
     }
 }