24 include_once(
'./Services/Object/classes/class.ilObjectGUI.php');
55 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
58 parent::__construct($a_data, $a_id,$a_call_by_reference,$a_prepare_output);
60 $lng->loadLanguageModule(
'objref');
76 if(isset(
$_GET[
'creation_mode']) &&
$_GET[
'creation_mode'] == self::MODE_CREATE)
81 $next_class = $ilCtrl->getNextClass($this);
82 $cmd = $ilCtrl->getCmd();
88 case "ilpropertyformgui":
89 $form = $this->
initForm($this->creation_mode ? self::MODE_CREATE : self::MODE_EDIT);
90 $this->ctrl->forwardCommand(
$form);
93 case 'ilpermissiongui':
94 $ilTabs->setTabActive(
'perm_settings');
95 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
119 if($this->
object instanceof
ilObject)
121 $ilLocator->addItem($this->
object->getPresentationTitle(),$this->ctrl->getLinkTarget($this));
133 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->
object->getTargetRefId());
134 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
146 $new_type = $_REQUEST[
"new_type"];
147 if(!$ilAccess->checkAccess(
"create_".$this->getReferenceType(),
'',
$_GET[
"ref_id"], $new_type))
149 $ilErr->raiseError($this->lng->txt(
"permission_denied"),$ilErr->MESSAGE);
152 $this->tpl->setContent(
$form->getHTML());
167 if(!(
int) $_REQUEST[
'target_id'])
173 if(!$ilAccess->checkAccess(
'visible',
'',(
int) $_REQUEST[
'target_id']))
180 parent::saveObject();
185 return $this->
initForm(self::MODE_CREATE);
194 $a_new_object->setTargetId($target_obj_id);
196 $a_new_object->setTitleType($this->form->getInput(
'title_type'));
199 $a_new_object->
setTitle($this->form->getInput(
'title'));
205 $this->ctrl->setParameter($this,
'ref_id',$a_new_object->
getRefId());
206 $this->ctrl->setParameter($this,
'creation_mode',0);
207 $this->ctrl->redirect($this,
'firstEdit');
232 $ilTabs->setTabActive(
'settings');
246 protected function initForm($a_mode = self::MODE_EDIT)
248 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
249 include_once
'./Services/ContainerReference/classes/class.ilContainerReference.php';
252 if ($a_mode == self::MODE_CREATE) {
253 $form->setTitle($this->lng->txt($this->getReferenceType().
'_new' ));
255 $this->ctrl->setParameter($this,
'creation_mode', $a_mode);
256 $this->ctrl->setParameter($this,
'new_type', $_REQUEST[
'new_type']);
260 $form->setTitle($this->lng->txt(
'edit'));
263 $form->setFormAction($this->ctrl->getFormAction($this));
264 if ($a_mode == self::MODE_CREATE)
266 $form->addCommandButton(
'save', $this->lng->txt(
'create'));
267 $form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
271 $form->addCommandButton(
'update', $this->lng->txt(
'save'));
276 if ($a_mode == self::MODE_EDIT)
285 $reuse =
new ilRadioOption($this->lng->txt(
'objref_reuse_title'));
287 $ttype->addOption($reuse);
289 $custom =
new ilRadioOption($this->lng->txt(
'objref_custom_title'));
296 $title->setRequired(
true);
298 if($a_mode == self::MODE_EDIT)
303 $custom->addSubItem(
$title);
304 $ttype->addOption($custom);
305 $form->addItem($ttype);
307 include_once(
"./Services/Form/classes/class.ilRepositorySelector2InputGUI.php");
312 $repo->getExplorerGUI()->setTypeWhiteList(array_merge(
314 array(
"root",
"cat",
"grp",
"fold",
"crs"))
316 $repo->setInfo($this->lng->txt($this->getReferenceType().
'_edit_info'));
318 if($a_mode == self::MODE_EDIT)
320 $repo->getExplorerGUI()->setPathOpen($this->
object->getTargetRefId());
321 $repo->setValue($this->
object->getTargetRefId());
324 $form->addItem($repo);
336 if(
$form->checkInput())
338 $this->
object->setTitleType(
$form->getInput(
'title_type'));
341 $this->
object->setTitle(
$form->getInput(
'title'));
344 if(!$ilAccess->checkAccess(
'visible',
'',(
int)
$form->getInput(
'target_id')) ||
354 $this->
object->setTargetId($target_obj_id);
357 $this->
object->update();
359 $this->ctrl->redirect($this,
'edit');
361 $form->setValuesByPost();
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
This class represents an option in a radio group.
executeCommand()
Execute command.
const MAX_SELECTION_ENTRIES
getTargetType()
get target type
initForm($a_mode=self::MODE_EDIT)
Init title form.
const TITLE_LENGTH
max length of object title
createObject()
Create object.
afterSave(ilObject $a_new_object)
Class ilObject Basic functions for all objects.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
initCreateForm($a_new_type)
setCreationMode($a_mode=true)
if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! ...
setTitle($a_title)
set object title
prepareOutput($a_show_subobjects=true)
prepare output
editObject(ilPropertyFormGUI $form=null)
edit title
setValue($a_value)
Set Value.
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Constructor.
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
This class represents a text property in a property form.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
addLocatorItems()
Add locator item ilLocatorGUI $ilLocator.
redirectObject()
redirect to target
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
firstEditObject()
show edit screen without info message
Create new PHPExcel object
obj_idprivate
getRefId()
get reference id public
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
updateObject()
update title
update()
update object in db
getReferenceType()
get reference type