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 =
'',
105 $a_id =
"", $a_class =
'submit')
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,
109 "id" => $a_id,
"class" => $a_class);
121 $this->items[] = array(
"type" =>
"fbutton",
"txt" => $a_txt,
"cmd" => $a_cmd,
122 "acc_key" => $a_acc_key,
"primary" => $a_primary);
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->setVariable(
'BTN_CLASS',$item[
'class']);
267 $tpl->parseCurrentBlock();
268 $tpl->touchBlock(
"item");
272 $tpl->setCurrentBlock(
"form_button");
273 $tpl->setVariable(
"SUB_TXT", $item[
"txt"]);
274 $tpl->setVariable(
"SUB_CMD", $item[
"cmd"]);
277 $tpl->setVariable(
"SUB_CLASS",
" emphsubmit");
279 $tpl->parseCurrentBlock();
280 $tpl->touchBlock(
"item");
286 $tpl->setCurrentBlock(
"input_label");
287 $tpl->setVariable(
"TXT_INPUT", $item[
"input"]->getTitle());
288 $tpl->parseCurrentBlock();
290 $tpl->setCurrentBlock(
"input");
291 $tpl->setVariable(
"INPUT_HTML", $item[
"input"]->getToolbarHTML());
292 $tpl->parseCurrentBlock();
293 $tpl->touchBlock(
"item");
297 $tpl->touchBlock(
"separator");
298 $tpl->touchBlock(
"item");
302 $tpl->setCurrentBlock(
"text");
303 $tpl->setVariable(
"VAL_TEXT", $item[
"text"]);
304 $tpl->touchBlock(
"item");
308 $tpl->touchBlock(
"spacer");
313 $tpl->setVariable(
"SPACER_WIDTH", $item[
"width"]);
314 $tpl->touchBlock(
"item");
318 if ($item[
"disabled"] ==
false) {
319 $tpl->setCurrentBlock(
"link");
320 $tpl->setVariable(
"LINK_TXT", $item[
"txt"]);
321 $tpl->setVariable(
"LINK_URL", $item[
"cmd"]);
322 $tpl->parseCurrentBlock();
323 $tpl->touchBlock(
"item");
327 $tpl->setCurrentBlock(
"link_disabled");
328 $tpl->setVariable(
"LINK_DISABLED_TXT", $item[
"txt"]);
330 $tpl->parseCurrentBlock();
331 $tpl->touchBlock(
"item");
337 $tpl->setVariable(
"TXT_FUNCTIONS", $lng->txt(
"functions"));
338 if ($this->lead_img[
"img"] !=
"")
340 $tpl->setCurrentBlock(
"lead_image");
341 $tpl->setVariable(
"IMG_SRC", $this->lead_img[
"img"]);
342 $tpl->setVariable(
"IMG_ALT", $this->lead_img[
"alt"]);
343 $tpl->parseCurrentBlock();
351 $tpl->setCurrentBlock(
"form_open");
353 if ($this->multipart)
355 $tpl->setVariable(
"ENC_TYPE",
'enctype="multipart/form-data"');
357 if ($this->form_target !=
"")
359 $tpl->setVariable(
"TARGET",
' target="'.$this->form_target.
'" ');
361 if ($this->form_name !=
"")
366 $tpl->parseCurrentBlock();
370 $tpl->touchBlock(
"form_close");
375 if ($this->
getId() !=
"")
377 $tpl->setVariable(
"ID",
' id="'.$this->
getId().
'" ');
383 $tpl->setVariable(
"STYLE",
' style="display:none;" ');