ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilWorkspaceAccessGUI Class Reference

ACL access handler GUI. More...

+ Collaboration diagram for ilWorkspaceAccessGUI:

Public Member Functions

 __construct ($a_node_id, $a_access_handler, $a_is_portfolio=false, $a_footer=null)
 executeCommand ()
 addPermissionHandler ()
 removePermission ()

Data Fields

const PERMISSION_REGISTERED = -1
const PERMISSION_ALL_PASSWORD = -3
const PERMISSION_ALL = -5

Protected Member Functions

 setObjectTitle ()
 restore object title
 getAccessHandler ()
 share ()
 initPasswordForm ()
 showPasswordForm (ilPropertyFormGUI $a_form=null)
 savePasswordForm ()

Protected Attributes

 $ctrl
 $lng
 $node_id
 $access_handler
 $footer

Detailed Description

Constructor & Destructor Documentation

ilWorkspaceAccessGUI::__construct (   $a_node_id,
  $a_access_handler,
  $a_is_portfolio = false,
  $a_footer = null 
)

Definition at line 28 of file class.ilWorkspaceAccessGUI.php.

References $ilCtrl, and $lng.

{
global $ilCtrl, $lng;
$this->ctrl = $ilCtrl;
$this->lng = $lng;
$this->node_id = $a_node_id;
$this->access_handler = $a_access_handler;
$this->is_portfolio = (bool)$a_is_portfolio;
$this->footer = $a_footer;
}

Member Function Documentation

ilWorkspaceAccessGUI::addPermissionHandler ( )

Definition at line 182 of file class.ilWorkspaceAccessGUI.php.

References $_REQUEST, getAccessHandler(), ilUtil\sendSuccess(), and showPasswordForm().

{
switch($_REQUEST["action"])
{
case "user":
$this->ctrl->setParameterByClass("ilmailsearchgui", "ref", "wsp");
$this->ctrl->redirectByClass("ilmailsearchgui");
case "group":
$this->ctrl->setParameterByClass("ilmailsearchgroupsgui", "ref", "wsp");
$this->ctrl->redirectByClass("ilmailsearchgroupsgui");
case "course":
$this->ctrl->setParameterByClass("ilmailsearchcoursesgui", "ref", "wsp");
$this->ctrl->redirectByClass("ilmailsearchcoursesgui");
case "registered":
$this->getAccessHandler()->addPermission($this->node_id, self::PERMISSION_REGISTERED);
ilUtil::sendSuccess($this->lng->txt("wsp_permission_registered_info"), true);
$this->ctrl->redirect($this, "share");
case "password":
$this->showPasswordForm();
break;
case "all":
$this->getAccessHandler()->addPermission($this->node_id, self::PERMISSION_ALL);
ilUtil::sendSuccess($this->lng->txt("wsp_permission_all_info"), true);
$this->ctrl->redirect($this, "share");
}
}

+ Here is the call graph for this function:

ilWorkspaceAccessGUI::executeCommand ( )

Definition at line 40 of file class.ilWorkspaceAccessGUI.php.

References $_REQUEST, $cmd, $tpl, and setObjectTitle().

{
global $ilTabs, $tpl;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
switch($next_class)
{
case "ilmailsearchcoursesgui";
$ilTabs->setBackTarget($this->lng->txt("back"),
$this->ctrl->getLinkTarget($this, "share"));
include_once('Services/Contact/classes/class.ilMailSearchCoursesGUI.php');
$csearch = new ilMailSearchCoursesGUI($this->access_handler, $this->node_id);
$this->ctrl->setReturn($this, 'share');
$this->ctrl->forwardCommand($csearch);
$this->setObjectTitle();
break;
case "ilmailsearchgroupsgui";
$ilTabs->setBackTarget($this->lng->txt("back"),
$this->ctrl->getLinkTarget($this, "share"));
include_once('Services/Contact/classes/class.ilMailSearchGroupsGUI.php');
$gsearch = new ilMailSearchGroupsGUI($this->access_handler, $this->node_id);
$this->ctrl->setReturn($this, 'share');
$this->ctrl->forwardCommand($gsearch);
$this->setObjectTitle();
break;
case "ilmailsearchgui";
$ilTabs->setBackTarget($this->lng->txt("back"),
$this->ctrl->getLinkTarget($this, "share"));
include_once('Services/Contact/classes/class.ilMailSearchGUI.php');
$usearch = new ilMailSearchGUI($this->access_handler, $this->node_id);
$this->ctrl->setReturn($this, 'share');
$this->ctrl->forwardCommand($usearch);
$this->setObjectTitle();
break;
case "ilpublicuserprofilegui";
$ilTabs->clearTargets();
$ilTabs->setBackTarget($this->lng->txt("back"),
$this->ctrl->getLinkTarget($this, "share"));
include_once('./Services/User/classes/class.ilPublicUserProfileGUI.php');
$prof = new ilPublicUserProfileGUI($_REQUEST["user"]);
$prof->setBackUrl($this->ctrl->getLinkTarget($this, "share"));
$tpl->setContent($prof->getHTML());
break;
default:
// $this->prepareOutput();
if(!$cmd)
{
$cmd = "share";
}
return $this->$cmd();
}
return true;
}

+ Here is the call graph for this function:

ilWorkspaceAccessGUI::getAccessHandler ( )
protected

Definition at line 125 of file class.ilWorkspaceAccessGUI.php.

References $access_handler.

Referenced by addPermissionHandler(), removePermission(), savePasswordForm(), and share().

{
}

+ Here is the caller graph for this function:

ilWorkspaceAccessGUI::initPasswordForm ( )
protected

Definition at line 225 of file class.ilWorkspaceAccessGUI.php.

References ilFormPropertyGUI\setRequired().

Referenced by savePasswordForm(), and showPasswordForm().

{
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt("wsp_set_permission_all_password"));
$password = new ilPasswordInputGUI($this->lng->txt("password"), "password");
$password->setRequired(true);
$form->addItem($password);
$form->addCommandButton('savepasswordform', $this->lng->txt("save"));
$form->addCommandButton('share', $this->lng->txt("cancel"));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilWorkspaceAccessGUI::removePermission ( )

Definition at line 214 of file class.ilWorkspaceAccessGUI.php.

References $_REQUEST, getAccessHandler(), and ilUtil\sendSuccess().

{
if($_REQUEST["obj_id"])
{
$this->getAccessHandler()->removePermission($this->node_id, (int)$_REQUEST["obj_id"]);
ilUtil::sendSuccess($this->lng->txt("wsp_permission_removed"), true);
}
$this->ctrl->redirect($this, "share");
}

+ Here is the call graph for this function:

ilWorkspaceAccessGUI::savePasswordForm ( )
protected

Definition at line 253 of file class.ilWorkspaceAccessGUI.php.

References getAccessHandler(), initPasswordForm(), ilUtil\sendSuccess(), and showPasswordForm().

{
$form = $this->initPasswordForm();
if($form->checkInput())
{
$this->getAccessHandler()->addPermission($this->node_id,
self::PERMISSION_ALL_PASSWORD, md5($form->getInput("password")));
ilUtil::sendSuccess($this->lng->txt("wsp_permission_all_info"), true);
$this->ctrl->redirect($this, "share");
}
$form->setValuesByPost();
$this->showPasswordForm($form);
}

+ Here is the call graph for this function:

ilWorkspaceAccessGUI::setObjectTitle ( )
protected

restore object title

Returns
string

Definition at line 110 of file class.ilWorkspaceAccessGUI.php.

References $node_id, $tpl, and ilObject\_lookupTitle().

Referenced by executeCommand().

{
global $tpl;
if(!$this->is_portfolio)
{
$obj_id = $this->access_handler->getTree()->lookupObjectId($this->node_id);
}
else
{
$obj_id = $this->node_id;
}
$tpl->setTitle(ilObject::_lookupTitle($obj_id));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilWorkspaceAccessGUI::share ( )
protected

Definition at line 130 of file class.ilWorkspaceAccessGUI.php.

References $ilSetting, $ilUser, $tpl, ilParticipants\_getMembershipByType(), and getAccessHandler().

{
global $ilToolbar, $tpl, $ilUser, $ilSetting;
$options = array();
$options["user"] = $this->lng->txt("wsp_set_permission_single_user");
include_once 'Modules/Group/classes/class.ilGroupParticipants.php';
$grp_ids = ilGroupParticipants::_getMembershipByType($ilUser->getId(), 'grp');
if(sizeof($grp_ids))
{
$options["group"] = $this->lng->txt("wsp_set_permission_group");
}
include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
$crs_ids = ilCourseParticipants::_getMembershipByType($ilUser->getId(), 'crs');
if(sizeof($crs_ids))
{
$options["course"] = $this->lng->txt("wsp_set_permission_course");
}
if(!$this->getAccessHandler()->hasRegisteredPermission($this->node_id))
{
$options["registered"] = $this->lng->txt("wsp_set_permission_registered");
}
if($ilSetting->get("enable_global_profiles"))
{
if(!$this->getAccessHandler()->hasGlobalPasswordPermission($this->node_id))
{
$options["password"] = $this->lng->txt("wsp_set_permission_all_password");
}
if(!$this->getAccessHandler()->hasGlobalPermission($this->node_id))
{
$options["all"] = $this->lng->txt("wsp_set_permission_all");
}
}
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$actions = new ilSelectInputGUI("", "action");
$actions->setOptions($options);
$ilToolbar->addInputItem($actions);
$ilToolbar->setFormAction($this->ctrl->getFormAction($this));
$ilToolbar->addFormButton($this->lng->txt("add"), "addpermissionhandler");
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessTableGUI.php";
$table = new ilWorkspaceAccessTableGUI($this, "share", $this->node_id, $this->getAccessHandler());
$tpl->setContent($table->getHTML().$this->footer);
}

+ Here is the call graph for this function:

ilWorkspaceAccessGUI::showPasswordForm ( ilPropertyFormGUI  $a_form = null)
protected

Definition at line 242 of file class.ilWorkspaceAccessGUI.php.

References $tpl, and initPasswordForm().

Referenced by addPermissionHandler(), and savePasswordForm().

{
global $tpl;
if(!$a_form)
{
$a_form = $this->initPasswordForm();
}
$tpl->setContent($a_form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilWorkspaceAccessGUI::$access_handler
protected

Definition at line 20 of file class.ilWorkspaceAccessGUI.php.

Referenced by getAccessHandler().

ilWorkspaceAccessGUI::$ctrl
protected

Definition at line 17 of file class.ilWorkspaceAccessGUI.php.

ilWorkspaceAccessGUI::$footer
protected

Definition at line 21 of file class.ilWorkspaceAccessGUI.php.

ilWorkspaceAccessGUI::$lng
protected

Definition at line 18 of file class.ilWorkspaceAccessGUI.php.

Referenced by __construct().

ilWorkspaceAccessGUI::$node_id
protected

Definition at line 19 of file class.ilWorkspaceAccessGUI.php.

Referenced by setObjectTitle().


The documentation for this class was generated from the following file: