2 require_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
14 protected static $js_path =
"./Modules/StudyProgramme/templates/js/";
37 parent::__construct();
39 foreach(
$config as $key=>$value) {
40 $setterMethod =
"set".ucfirst($key);
41 if(method_exists($this, $setterMethod)) {
42 $setterMethod($value);
47 $this->
setName(self::$default_from_name);
58 public static function addJavaScript($add_form_loader =
false, $js_base_path = null) {
62 $js_path = (isset($js_base_path))? $js_base_path : self::$js_path;
64 $tpl->addJavaScript(
$js_path.
'ilAsyncPropertyFormGUI.js');
66 $global_config =
"$.ilAsyncPropertyForm.global_config.error_message_template = '".self::getErrorMessageTemplate().
"'; $.ilAsyncPropertyForm.global_config.async_form_name = '".self::$default_from_name.
"';";
67 self::addOnLoadCode(
'global_config', $global_config);
69 if($add_form_loader) {
70 self::addOnLoadCode(
'form_loader',
'$("body").ilAsyncPropertyForm();');
93 if(!$this->check_input_called) {
98 foreach($this->
getItems() as $item) {
101 if(method_exists($item,
"getAlert") && $item->getAlert() !=
"") {
102 $errors[] =
array(
'key'=>$item->getFieldId(),
'message'=>$item->getAlert());
127 $tpl =
new ilTemplate(
"tpl.property_form.html",
true,
true,
"Services/Form");
129 $tpl->setCurrentBlock(
"alert");
131 $tpl->setVariable(
"ALT_ALERT",
$lng->txt(
"alert"));
132 $tpl->setVariable(
"TXT_ALERT",
"[TXT_ALERT]");
133 $tpl->parseCurrentBlock();
134 $content = trim(
$tpl->get(
"alert"));
149 throw new ilException(
"You cannot clone into a already filled form!");
152 $reflect =
new ReflectionClass($this);
153 $properties = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
155 foreach($properties as $property) {
156 $this->{$property->getName()} = $property->getValue($form_to_clone);
159 foreach($form_to_clone->
getItems() as $item) {
181 if(!isset(self::$js_on_load_added[
$id])) {
182 $tpl->addOnLoadCode($content);
183 self::$js_on_load_added[
$id] = $content;
193 self::addJavaScript($this->
isAsync());
195 return parent::getHTML();
204 if(isset(
$_POST[
'cmd'])) {
219 $a_formaction .=
"&cmdMode=asynch";
222 $this->formaction = $a_formaction;
243 return self::$default_from_name;
266 self::$default_from_name = $a_name;
268 parent::setName($a_name);
Base class for ILIAS Exception handling.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.