public static function actionList(array $actions, $separator = " | ") { $ret = ""; $nbAction = 0; foreach ($actions as $action) { if ($nbAction > 0) { $ret .= $separator; } list($icon, $url) = explode('|', $action); list($icon, $tooltip) = explode(":", "{$icon}:"); if ($icon) { $img = std::tag("img", array("src" => $icon, "border" => 0, "alt" => $tooltip)); } else { // No image provided $img = std::html($tooltip); } $ret .= std::tag("a", array("href" => $url)) . $img . "</a>"; $nbAction++; } return $ret; }
protected function encapsule($btns) { $ret = ""; if ($this->mode == self::HORIZONTAL) { $ret .= std::tagln("div", ['class' => "form-group"]); $ret .= std::tag('div', array('class' => $this->horiz_label_class)) . " </div>\n"; $ret .= std::tagln('div', array('class' => $this->horiz_field_class)) . "{$btns}</div>\n"; $ret .= "</div>\n"; } else { $ret .= $btns; } return $ret; }