23 include_once(
"./classes/class.ilObjectGUI.php");
45 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
50 $this->lng->loadLanguageModule(
'mcst');
62 global $rbacsystem,
$ilErr,$ilAccess;
64 $next_class = $this->ctrl->getNextClass($this);
65 $cmd = $this->ctrl->getCmd();
69 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
71 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
76 case 'ilpermissiongui':
77 $this->tabs_gui->setTabActive(
'perm_settings');
78 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
80 $ret =& $this->ctrl->forwardCommand($perm_gui);
86 $cmd =
"editSettings";
103 global $rbacsystem, $ilAccess;
105 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
107 $this->tabs_gui->addTarget(
"mcst_edit_settings",
108 $this->ctrl->getLinkTarget($this,
"editSettings"),
109 array(
"editSettings",
"view"));
112 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
114 $this->tabs_gui->addTarget(
"perm_settings",
115 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
116 array(),
'ilpermissiongui');
125 $this->tabs_gui->setTabActive(
'mcst_edit_settings');
136 foreach ($this->settings->getPurposeSuffixes() as $purpose => $filetypes) {
137 $purposeSuffixes[$purpose] = explode(
",", preg_replace(
"/[^\w,]/",
"", strtolower(
$_POST[$purpose])));
140 $this->settings->setPurposeSuffixes($purposeSuffixes);
141 $this->settings->setDefaultAccess (
$_POST[
"defaultaccess"]);
142 $this->settings->setMimeTypes (explode(
",",
$_POST[
"mimetypes"]));
144 $this->settings->save();
148 $ilCtrl->redirect($this,
"view");
158 $ilCtrl->redirect($this,
"view");
167 include_once(
'Modules/MediaCast/classes/class.ilMediaCastSettings.php');
179 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
182 $form->setFormAction($this->ctrl->getFormAction($this));
183 $form->setTitle($this->lng->txt(
'settings'));
184 $form->addCommandButton(
'saveSettings',$this->lng->txt(
'save'));
185 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
189 $radio_option =
new ilRadioOption($lng->txt(
"mcst_visibility_users"),
"users");
190 $radio_group->addOption($radio_option);
191 $radio_option =
new ilRadioOption($lng->txt(
"mcst_visibility_public"),
"public");
192 $radio_group->addOption($radio_option);
193 $radio_group->
setInfo($lng->txt(
"mcst_news_item_visibility_info"));
194 $radio_group->setRequired(
false);
195 $radio_group->setValue($this->settings->getDefaultAccess());
196 #$ch->addSubItem($radio_group);
197 $form->addItem($radio_group);
200 foreach ($this->settings->getPurposeSuffixes() as $purpose => $filetypes)
202 $text =
new ilTextInputGUI($lng->txt(
"mcst_".strtolower($purpose).
"_settings_title"),$purpose);
203 $text->
setValue(implode(
",",$filetypes));
204 $text->setInfo($lng->txt(
"mcst_".strtolower($purpose).
"_settings_info"));
205 $form->addItem($text);
209 $text->
setInfo($lng->txt(
"mcst_mimetypes_info"));
212 if (is_array($this->settings->getMimeTypes()))
213 $text->setValue(implode(
",",$this->settings->getMimeTypes()));
214 $form->addItem($text);
216 $this->tpl->setContent($form->getHTML());