35 $this->form_action = $a_val;
36 $this->multipart = $a_multipart;
37 $this->form_target = $a_target;
47 return $this->form_action;
55 $this->lead_img = array(
"img" => $a_img,
"alt" => $a_alt);
65 $this->hidden = $a_val;
105 $this->prevent_double_submission = $a_val;
128 public function addButton($a_txt, $a_cmd, $a_target =
"", $a_acc_key =
"", $a_additional_attrs =
'',
129 $a_id =
"", $a_class =
'submit')
131 $this->items[] = array(
"type" =>
"button",
"txt" => $a_txt,
"cmd" => $a_cmd,
132 "target" => $a_target,
"acc_key" => $a_acc_key,
'add_attrs' => $a_additional_attrs,
133 "id" => $a_id,
"class" => $a_class);
147 function addFormButton($a_txt, $a_cmd, $a_acc_key =
"", $a_primary =
false, $a_class =
false)
149 $this->items[] = array(
"type" =>
"fbutton",
"txt" => $a_txt,
"cmd" => $a_cmd,
150 "acc_key" => $a_acc_key,
"primary" => $a_primary,
"class" => $a_class);
158 $this->items[] = array(
"type" =>
"input",
"input" => $a_item,
"label" => $a_output_label);
168 $this->items[] = array(
"type" =>
"button_obj",
"instance" => $a_button);
177 $this->items[] = array(
"type" =>
"dropdown",
"txt" => $a_txt,
"dd_html" => $a_dd_html);
186 $this->items[] = array(
"type" =>
"separator");
194 $this->items[] = array(
"type" =>
"text",
"text" => $a_text);
202 $this->items[] = array(
"type" =>
"spacer",
"width" => $a_width);
213 function addLink($a_caption, $a_url, $a_disabled =
false)
215 $this->items[] = array(
"type" =>
"link",
"txt" => $a_caption,
"cmd" => $a_url,
"disabled" => $a_disabled);
225 $this->open_form_tag = $a_val;
245 $this->close_form_tag = $a_val;
265 $this->form_name = $a_val;
285 $tpl =
new ilTemplate(
"tpl.toolbar.html",
true,
true,
"Services/UIComponent/Toolbar");
286 if (count($this->items) > 0)
288 foreach($this->items as $item)
290 switch ($item[
"type"])
293 $tpl->setCurrentBlock(
"button");
294 $tpl->setVariable(
"BTN_TXT", $item[
"txt"]);
295 $tpl->setVariable(
"BTN_LINK", $item[
"cmd"]);
296 if ($item[
"target"] !=
"")
298 $tpl->setVariable(
"BTN_TARGET",
'target="'.$item[
"target"].
'"');
300 if ($item[
"id"] !=
"")
302 $tpl->setVariable(
"BID",
'id="'.$item[
"id"].
'"');
304 if ($item[
"acc_key"] !=
"")
306 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
307 $tpl->setVariable(
"BTN_ACC_KEY",
310 if(($item[
'add_attrs']))
312 $tpl->setVariable(
'BTN_ADD_ARG',$item[
'add_attrs']);
314 $tpl->setVariable(
'BTN_CLASS',$item[
'class']);
315 $tpl->parseCurrentBlock();
316 $tpl->touchBlock(
"item");
320 $tpl->setCurrentBlock(
"form_button");
321 $tpl->setVariable(
"SUB_TXT", $item[
"txt"]);
322 $tpl->setVariable(
"SUB_CMD", $item[
"cmd"]);
325 $tpl->setVariable(
"SUB_CLASS",
" emphsubmit");
327 else if($item[
"class"])
329 $tpl->setVariable(
"SUB_CLASS",
" ".$item[
"class"]);
331 $tpl->parseCurrentBlock();
332 $tpl->touchBlock(
"item");
336 $tpl->setCurrentBlock(
"button_instance");
337 $tpl->setVariable(
"BUTTON_OBJ", $item[
"instance"]->render());
338 $tpl->parseCurrentBlock();
339 $tpl->touchBlock(
"item");
345 $tpl->setCurrentBlock(
"input_label");
346 $tpl->setVariable(
"TXT_INPUT", $item[
"input"]->getTitle());
347 $tpl->parseCurrentBlock();
349 $tpl->setCurrentBlock(
"input");
350 $tpl->setVariable(
"INPUT_HTML", $item[
"input"]->getToolbarHTML());
351 $tpl->parseCurrentBlock();
352 $tpl->touchBlock(
"item");
357 $tpl->setCurrentBlock(
"dropdown");
358 $tpl->setVariable(
"TXT_DROPDOWN", $item[
"txt"]);
359 $tpl->setVariable(
"DROP_DOWN", $item[
"dd_html"]);
360 $tpl->parseCurrentBlock();
361 $tpl->touchBlock(
"item");
367 $tpl->touchBlock(
"separator");
368 $tpl->touchBlock(
"item");
372 $tpl->setCurrentBlock(
"text");
373 $tpl->setVariable(
"VAL_TEXT", $item[
"text"]);
374 $tpl->touchBlock(
"item");
378 $tpl->touchBlock(
"spacer");
383 $tpl->setVariable(
"SPACER_WIDTH", $item[
"width"]);
384 $tpl->touchBlock(
"item");
388 if ($item[
"disabled"] ==
false) {
389 $tpl->setCurrentBlock(
"link");
390 $tpl->setVariable(
"LINK_TXT", $item[
"txt"]);
391 $tpl->setVariable(
"LINK_URL", $item[
"cmd"]);
392 $tpl->parseCurrentBlock();
393 $tpl->touchBlock(
"item");
397 $tpl->setCurrentBlock(
"link_disabled");
398 $tpl->setVariable(
"LINK_DISABLED_TXT", $item[
"txt"]);
400 $tpl->parseCurrentBlock();
401 $tpl->touchBlock(
"item");
407 $tpl->setVariable(
"TXT_FUNCTIONS", $lng->txt(
"functions"));
408 if ($this->lead_img[
"img"] !=
"")
410 $tpl->setCurrentBlock(
"lead_image");
411 $tpl->setVariable(
"IMG_SRC", $this->lead_img[
"img"]);
412 $tpl->setVariable(
"IMG_ALT", $this->lead_img[
"alt"]);
413 $tpl->parseCurrentBlock();
421 $tpl->setCurrentBlock(
"form_open");
425 $tpl->setVariable(
"FORM_CLASS",
"preventDoubleSubmission");
427 if ($this->multipart)
429 $tpl->setVariable(
"ENC_TYPE",
'enctype="multipart/form-data"');
431 if ($this->form_target !=
"")
433 $tpl->setVariable(
"TARGET",
' target="'.$this->form_target.
'" ');
435 if ($this->form_name !=
"")
440 $tpl->parseCurrentBlock();
444 $tpl->touchBlock(
"form_close");
449 if ($this->
getId() !=
"")
451 $tpl->setVariable(
"ID",
' id="'.$this->
getId().
'" ');
457 $tpl->setVariable(
"HIDDEN_CLASS",
'ilNoDisplay');