33 $this->form_action = $a_val;
34 $this->multipart = $a_multipart;
35 $this->form_target = $a_target;
45 return $this->form_action;
53 $this->lead_img = array(
"img" => $a_img,
"alt" => $a_alt);
63 $this->hidden = $a_val;
104 public function addButton($a_txt, $a_cmd, $a_target =
"", $a_acc_key =
"", $a_additional_attrs =
'',
107 $this->items[] = array(
"type" =>
"button",
"txt" => $a_txt,
"cmd" => $a_cmd,
108 "target" => $a_target,
"acc_key" => $a_acc_key,
'add_attrs' => $a_additional_attrs,
121 $this->items[] = array(
"type" =>
"fbutton",
"txt" => $a_txt,
"cmd" => $a_cmd,
122 "acc_key" => $a_acc_key);
130 $this->items[] = array(
"type" =>
"input",
"input" => $a_item,
"label" => $a_output_label);
138 $this->items[] = array(
"type" =>
"separator");
146 $this->items[] = array(
"type" =>
"text",
"text" => $a_text);
154 $this->items[] = array(
"type" =>
"spacer",
"width" => $a_width);
165 function addLink($a_caption, $a_url, $a_disabled =
false)
167 $this->items[] = array(
"type" =>
"link",
"txt" => $a_caption,
"cmd" => $a_url,
"disabled" => $a_disabled);
177 $this->open_form_tag = $a_val;
197 $this->close_form_tag = $a_val;
217 $this->form_name = $a_val;
237 $tpl =
new ilTemplate(
"tpl.toolbar.html",
true,
true,
"Services/UIComponent/Toolbar");
238 if (count($this->items) > 0)
240 foreach($this->items as $item)
242 switch ($item[
"type"])
245 $tpl->setCurrentBlock(
"button");
246 $tpl->setVariable(
"BTN_TXT", $item[
"txt"]);
247 $tpl->setVariable(
"BTN_LINK", $item[
"cmd"]);
248 if ($item[
"target"] !=
"")
250 $tpl->setVariable(
"BTN_TARGET",
'target="'.$item[
"target"].
'"');
252 if ($item[
"id"] !=
"")
254 $tpl->setVariable(
"BID",
'id="'.$item[
"id"].
'"');
256 if ($item[
"acc_key"] !=
"")
258 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
259 $tpl->setVariable(
"BTN_ACC_KEY",
262 if(($item[
'add_attrs']))
264 $tpl->setVariable(
'BTN_ADD_ARG',$item[
'add_attrs']);
266 $tpl->parseCurrentBlock();
267 $tpl->touchBlock(
"item");
271 $tpl->setCurrentBlock(
"form_button");
272 $tpl->setVariable(
"SUB_TXT", $item[
"txt"]);
273 $tpl->setVariable(
"SUB_CMD", $item[
"cmd"]);
274 $tpl->parseCurrentBlock();
275 $tpl->touchBlock(
"item");
281 $tpl->setCurrentBlock(
"input_label");
282 $tpl->setVariable(
"TXT_INPUT", $item[
"input"]->getTitle());
283 $tpl->parseCurrentBlock();
285 $tpl->setCurrentBlock(
"input");
286 $tpl->setVariable(
"INPUT_HTML", $item[
"input"]->getToolbarHTML());
287 $tpl->parseCurrentBlock();
288 $tpl->touchBlock(
"item");
292 $tpl->touchBlock(
"separator");
293 $tpl->touchBlock(
"item");
297 $tpl->setCurrentBlock(
"text");
298 $tpl->setVariable(
"VAL_TEXT", $item[
"text"]);
299 $tpl->touchBlock(
"item");
303 $tpl->touchBlock(
"spacer");
308 $tpl->setVariable(
"SPACER_WIDTH", $item[
"width"]);
309 $tpl->touchBlock(
"item");
313 if ($item[
"disabled"] ==
false) {
314 $tpl->setCurrentBlock(
"link");
315 $tpl->setVariable(
"LINK_TXT", $item[
"txt"]);
316 $tpl->setVariable(
"LINK_URL", $item[
"cmd"]);
317 $tpl->parseCurrentBlock();
318 $tpl->touchBlock(
"item");
322 $tpl->setCurrentBlock(
"link_disabled");
323 $tpl->setVariable(
"LINK_DISABLED_TXT", $item[
"txt"]);
325 $tpl->parseCurrentBlock();
326 $tpl->touchBlock(
"item");
332 $tpl->setVariable(
"TXT_FUNCTIONS", $lng->txt(
"functions"));
333 if ($this->lead_img[
"img"] !=
"")
335 $tpl->setCurrentBlock(
"lead_image");
336 $tpl->setVariable(
"IMG_SRC", $this->lead_img[
"img"]);
337 $tpl->setVariable(
"IMG_ALT", $this->lead_img[
"alt"]);
338 $tpl->parseCurrentBlock();
346 $tpl->setCurrentBlock(
"form_open");
348 if ($this->multipart)
350 $tpl->setVariable(
"ENC_TYPE",
'enctype="multipart/form-data"');
352 if ($this->form_target !=
"")
354 $tpl->setVariable(
"TARGET",
' target="'.$this->form_target.
'" ');
356 if ($this->form_name !=
"")
361 $tpl->parseCurrentBlock();
365 $tpl->touchBlock(
"form_close");
370 if ($this->
getId() !=
"")
372 $tpl->setVariable(
"ID",
' id="'.$this->
getId().
'" ');
378 $tpl->setVariable(
"STYLE",
' style="display:none;" ');