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; }
/** * Force a INPUT disabled. You can set the disable flag * to TRUE and use a specific type but if you know the * input is disabled, simply use this method. * * @param string $name name of the input (should be ignored) */ public function input_static($name, $placeholder = null) { $attributes = array('type' => $type, 'class' => "form-control {$this->input_size}"); if ($this->angularCtrl) { $attributes['ng-model'] = $this->angular_model($name); } else { $attributes['value'] = $attributes['name'] = $name; } if ($this->forId) { $attributes['id'] = $this->forId; } else { $attributes['id'] = uniqid('input'); } if ($placeholder) { $attributes['placeholder'] = $placeholder; } if ($this->disabled) { // Add the disable qttribute $attributes[] = 'disabled'; } else { if ($this->required) { // Add the required qttribute // Not compatible with DISABLED. $attributes[] = 'required'; } } // $ret = std::tag('input', $attributes) . "\n"; //$ret .= $this->hint_text(); $ret = std::tag("p", ['class' => "form-control-static"]) . std::html($this->find($name)) . "</p>\n"; $ret = $this->horizontal($ret); return $ret; return $this->input('text', $name, $placeholder); }