ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPortfolioRepositoryGUI Class Reference

Portfolio repository gui class. More...

+ Collaboration diagram for ilPortfolioRepositoryGUI:

Public Member Functions

 __construct ()
 executeCommand ()
 setTabs ()

Protected Member Functions

 setLocator ()
 checkAccess ($a_permission, $a_portfolio_id=null)
 show ()
 saveTitles ()
 confirmPortfolioDeletion ()
 deletePortfolios ()
 unsetDefault ()
 setDefaultConfirmation ()
 Confirm sharing when setting default.
 setDefaultGlobal ()
 setDefaultRegistered ()
 setDefault ($a_prtf_id)
 showOtherFilter ()
 showOther ($a_load_data=true)
 applyShareFilter ()
 resetShareFilter ()

Protected Attributes

 $user_id
 $access_handler

Detailed Description

Portfolio repository gui class.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

ilPortfolioRepositoryGUI: ilObjPortfolioGUI

Definition at line 16 of file class.ilPortfolioRepositoryGUI.php.

Constructor & Destructor Documentation

ilPortfolioRepositoryGUI::__construct ( )

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

References $ilUser, and $lng.

{
global $lng, $ilUser;
$lng->loadLanguageModule("prtf");
$lng->loadLanguageModule("user");
include_once('./Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php');
$this->access_handler = new ilPortfolioAccessHandler();
$this->user_id = $ilUser->getId();
}

Member Function Documentation

ilPortfolioRepositoryGUI::applyShareFilter ( )
protected

Definition at line 338 of file class.ilPortfolioRepositoryGUI.php.

References showOther().

{
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
$tbl = new ilWorkspaceShareTableGUI($this, "showOther", $this->access_handler);
$tbl->resetOffset();
$tbl->writeFilterToSession();
$this->showOther();
}

+ Here is the call graph for this function:

ilPortfolioRepositoryGUI::checkAccess (   $a_permission,
  $a_portfolio_id = null 
)
protected

Definition at line 95 of file class.ilPortfolioRepositoryGUI.php.

Referenced by deletePortfolios(), saveTitles(), setDefault(), setDefaultConfirmation(), setDefaultGlobal(), setDefaultRegistered(), and unsetDefault().

{
if($a_portfolio_id)
{
return $this->access_handler->checkAccess($a_permission, "", $a_portfolio_id);
}
// currently only object-based permissions
return true;
}

+ Here is the caller graph for this function:

ilPortfolioRepositoryGUI::confirmPortfolioDeletion ( )
protected

Definition at line 159 of file class.ilPortfolioRepositoryGUI.php.

References $_POST, $ilCtrl, $lng, $tpl, ilObject2\_lookupTitle(), and ilUtil\sendInfo().

{
global $ilCtrl, $tpl, $lng;
if (!is_array($_POST["prtfs"]) || count($_POST["prtfs"]) == 0)
{
ilUtil::sendInfo($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "show");
}
else
{
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("prtf_sure_delete_portfolios"));
$cgui->setCancel($lng->txt("cancel"), "show");
$cgui->setConfirm($lng->txt("delete"), "deletePortfolios");
foreach ($_POST["prtfs"] as $id)
{
$cgui->addItem("prtfs[]", $id, ilObjPortfolio::_lookupTitle($id));
}
$tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

ilPortfolioRepositoryGUI::deletePortfolios ( )
protected

Definition at line 186 of file class.ilPortfolioRepositoryGUI.php.

References $_POST, $ilCtrl, $lng, $user_id, checkAccess(), and ilUtil\sendSuccess().

{
global $lng, $ilCtrl;
if (is_array($_POST["prtfs"]))
{
foreach ($_POST["prtfs"] as $id)
{
if($this->checkAccess("write", $id))
{
$portfolio = new ilObjPortfolio($id, false);
if ($portfolio->getOwner() == $this->user_id)
{
$this->access_handler->removePermission($id);
$portfolio->delete();
}
}
}
}
ilUtil::sendSuccess($lng->txt("prtf_portfolio_deleted"), true);
$ilCtrl->redirect($this, "show");
}

+ Here is the call graph for this function:

ilPortfolioRepositoryGUI::executeCommand ( )

Definition at line 34 of file class.ilPortfolioRepositoryGUI.php.

References $_REQUEST, $cmd, $ilCtrl, $lng, $tpl, ilUtil\getImagePath(), setLocator(), and setTabs().

{
global $ilCtrl, $lng, $tpl, $ilTabs;
$next_class = $ilCtrl->getNextClass($this);
$cmd = $ilCtrl->getCmd("show");
$tpl->setTitle($lng->txt("portfolio"));
$tpl->setTitleIcon(ilUtil::getImagePath("icon_prtf.svg"),
$lng->txt("portfolio"));
switch($next_class)
{
case "ilobjportfoliogui":
if($cmd != "preview")
{
$this->setLocator();
$ilTabs->setBack2Target($lng->txt("prtf_tab_portfolios"),
$ilCtrl->getLinkTarget($this, "show"));
}
include_once('./Modules/Portfolio/classes/class.ilObjPortfolioGUI.php');
$gui = new ilObjPortfolioGUI($_REQUEST["prt_id"]);
$ilCtrl->forwardCommand($gui);
break;
default:
$this->setLocator();
$this->setTabs();
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilPortfolioRepositoryGUI::resetShareFilter ( )
protected

Definition at line 348 of file class.ilPortfolioRepositoryGUI.php.

References showOther().

{
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
$tbl = new ilWorkspaceShareTableGUI($this, "showOther", $this->access_handler);
$tbl->resetOffset();
$tbl->resetFilter();
$this->showOther();
}

+ Here is the call graph for this function:

ilPortfolioRepositoryGUI::saveTitles ( )
protected

Definition at line 128 of file class.ilPortfolioRepositoryGUI.php.

References $_POST, $ilCtrl, $lng, checkAccess(), and ilUtil\sendSuccess().

{
global $ilCtrl, $lng;
foreach($_POST["title"] as $id => $title)
{
if(trim($title))
{
if($this->checkAccess("write", $id))
{
$portfolio = new ilObjPortfolio($id, false);
$portfolio->setTitle($title);
if(is_array($_POST["online"]) && in_array($id, $_POST["online"]))
{
$portfolio->setOnline(true);
}
else
{
$portfolio->setOnline(false);
}
$portfolio->update();
}
}
}
ilUtil::sendSuccess($lng->txt("saved_successfully"), true);
$ilCtrl->redirect($this, "show");
}

+ Here is the call graph for this function:

ilPortfolioRepositoryGUI::setDefault (   $a_prtf_id)
protected

Definition at line 290 of file class.ilPortfolioRepositoryGUI.php.

References $ilCtrl, $ilUser, $lng, checkAccess(), ilUtil\sendSuccess(), and ilObjPortfolio\setUserDefault().

Referenced by setDefaultConfirmation(), setDefaultGlobal(), and setDefaultRegistered().

{
global $ilCtrl, $lng, $ilUser;
if($a_prtf_id && $this->checkAccess("write"))
{
// #12845
if($this->access_handler->hasGlobalPermission($a_prtf_id))
{
$ilUser->setPref("public_profile", "g");
$ilUser->writePrefs();
}
else if($this->access_handler->hasRegisteredPermission($a_prtf_id))
{
$ilUser->setPref("public_profile", "y");
$ilUser->writePrefs();
}
else
{
return;
}
ilObjPortfolio::setUserDefault($this->user_id, $a_prtf_id);
ilUtil::sendSuccess($lng->txt("settings_saved"), true);
}
$ilCtrl->redirect($this, "show");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPortfolioRepositoryGUI::setDefaultConfirmation ( )
protected

Confirm sharing when setting default.

Definition at line 233 of file class.ilPortfolioRepositoryGUI.php.

References $_REQUEST, $ilCtrl, $lng, $tpl, checkAccess(), and setDefault().

{
global $ilCtrl, $lng, $tpl;
$prtf_id = (int)$_REQUEST["prt_id"];
if($prtf_id && $this->checkAccess("write"))
{
// if already shared, no need to ask again
if($this->access_handler->hasRegisteredPermission($prtf_id) ||
$this->access_handler->hasGlobalPermission($prtf_id))
{
return $this->setDefault($prtf_id);
}
$ilCtrl->setParameter($this, "prt_id", $prtf_id);
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("prtf_set_default_publish_confirmation"));
$cgui->setCancel($lng->txt("yes"), "setDefaultGlobal");
$cgui->setConfirm($lng->txt("no"), "setDefaultRegistered");
$tpl->setContent($cgui->getHTML());
return;
}
$ilCtrl->redirect($this, "show");
}

+ Here is the call graph for this function:

ilPortfolioRepositoryGUI::setDefaultGlobal ( )
protected

Definition at line 264 of file class.ilPortfolioRepositoryGUI.php.

References $_REQUEST, $ilCtrl, checkAccess(), ilWorkspaceAccessGUI\PERMISSION_ALL, and setDefault().

{
global $ilCtrl;
$prtf_id = (int)$_REQUEST["prt_id"];
if($prtf_id && $this->checkAccess("write"))
{
$this->access_handler->addPermission($prtf_id, ilWorkspaceAccessGUI::PERMISSION_ALL);
$this->setDefault($prtf_id);
}
$ilCtrl->redirect($this, "show");
}

+ Here is the call graph for this function:

ilPortfolioRepositoryGUI::setDefaultRegistered ( )
protected

Definition at line 277 of file class.ilPortfolioRepositoryGUI.php.

References $_REQUEST, $ilCtrl, checkAccess(), ilWorkspaceAccessGUI\PERMISSION_REGISTERED, and setDefault().

{
global $ilCtrl;
$prtf_id = (int)$_REQUEST["prt_id"];
if($prtf_id && $this->checkAccess("write"))
{
$this->access_handler->addPermission($prtf_id, ilWorkspaceAccessGUI::PERMISSION_REGISTERED);
$this->setDefault($prtf_id);
}
$ilCtrl->redirect($this, "show");
}

+ Here is the call graph for this function:

ilPortfolioRepositoryGUI::setLocator ( )
protected

Definition at line 85 of file class.ilPortfolioRepositoryGUI.php.

References $ilCtrl, $lng, and $tpl.

Referenced by executeCommand().

{
global $ilLocator, $lng, $ilCtrl, $tpl;
$ilLocator->addItem($lng->txt("portfolio"),
$ilCtrl->getLinkTarget($this, "show"));
$tpl->setLocator();
}

+ Here is the caller graph for this function:

ilPortfolioRepositoryGUI::setTabs ( )

Definition at line 70 of file class.ilPortfolioRepositoryGUI.php.

References $ilCtrl, and $lng.

Referenced by executeCommand().

{
global $ilTabs, $lng, $ilCtrl, $ilHelp;
$ilHelp->setScreenIdComponent("prtf");
$ilTabs->addTab("mypf", $lng->txt("prtf_tab_portfolios"),
$ilCtrl->getLinkTarget($this));
$ilTabs->addTab("otpf", $lng->txt("prtf_tab_other_users"),
$ilCtrl->getLinkTarget($this, "showotherFilter"));
$ilTabs->activateTab("mypf");
}

+ Here is the caller graph for this function:

ilPortfolioRepositoryGUI::show ( )
protected

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

References $ilCtrl, $lng, $tpl, and ilLinkButton\getInstance().

{
global $tpl, $lng, $ilToolbar, $ilCtrl;
include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
$button->setCaption("prtf_add_portfolio");
$button->setUrl($ilCtrl->getLinkTargetByClass("ilObjPortfolioGUI", "create"));
$ilToolbar->addButtonInstance($button);
include_once "Modules/Portfolio/classes/class.ilPortfolioTableGUI.php";
$table = new ilPortfolioTableGUI($this, "show", $this->user_id);
include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
$tpl->setContent($table->getHTML().ilDiskQuotaHandler::getStatusLegend());
}

+ Here is the call graph for this function:

ilPortfolioRepositoryGUI::showOther (   $a_load_data = true)
protected

Definition at line 327 of file class.ilPortfolioRepositoryGUI.php.

References $tpl.

Referenced by applyShareFilter(), resetShareFilter(), and showOtherFilter().

{
global $tpl, $ilTabs;
$ilTabs->activateTab("otpf");
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
$tbl = new ilWorkspaceShareTableGUI($this, "showOther", $this->access_handler, null, $a_load_data);
$tpl->setContent($tbl->getHTML());
}

+ Here is the caller graph for this function:

ilPortfolioRepositoryGUI::showOtherFilter ( )
protected

Definition at line 322 of file class.ilPortfolioRepositoryGUI.php.

References showOther().

{
$this->showOther(false);
}

+ Here is the call graph for this function:

ilPortfolioRepositoryGUI::unsetDefault ( )
protected

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

References $ilCtrl, $ilUser, $lng, checkAccess(), ilUtil\sendSuccess(), and ilObjPortfolio\setUserDefault().

{
global $ilCtrl, $lng, $ilUser;
if($this->checkAccess("write"))
{
// #12845
$ilUser->setPref("public_profile", "n");
$ilUser->writePrefs();
ilUtil::sendSuccess($lng->txt("prtf_unset_default_share_info"), true);
}
$ilCtrl->redirect($this, "show");
}

+ Here is the call graph for this function:

Field Documentation

ilPortfolioRepositoryGUI::$access_handler
protected

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

ilPortfolioRepositoryGUI::$user_id
protected

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

Referenced by deletePortfolios().


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