ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilPortfolioTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Table/classes/class.ilTable2GUI.php");
5
15{
16 protected $user_id;
17
21 function __construct($a_parent_obj, $a_parent_cmd, $a_user_id)
22 {
23 global $ilCtrl, $lng;
24
25 $this->user_id = (int)$a_user_id;
26
27 parent::__construct($a_parent_obj, $a_parent_cmd);
28
29 $this->setTitle($lng->txt("prtf_portfolios"));
30
31 $this->addColumn($this->lng->txt(""), "", "1");
32 $this->addColumn($this->lng->txt("title"), "title", "50%");
33 $this->addColumn($this->lng->txt("online"), "is_online");
34 $this->addColumn($this->lng->txt("prtf_default_portfolio"), "is_default");
35 $this->addColumn($this->lng->txt("actions"));
36
37 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
38 $this->setRowTemplate("tpl.portfolio_row.html", "Modules/Portfolio");
39
40 $this->addMultiCommand("confirmPortfolioDeletion", $lng->txt("delete"));
41 $this->addCommandButton("saveTitles", $lng->txt("prtf_save_status_and_titles"));
42
43 $this->getItems();
44
45 $lng->loadLanguageModule("wsp");
46
47 include_once('./Services/Link/classes/class.ilLink.php');
48 }
49
50 protected function getItems()
51 {
52 global $ilUser;
53
54 include_once "Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php";
55 $access_handler = new ilPortfolioAccessHandler();
56
57 include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
59
60 $this->shared_objects = $access_handler->getObjectsIShare(false);
61
62 $this->setData($data);
63 }
64
68 protected function fillRow($a_set)
69 {
70 global $lng, $ilCtrl;
71
72 $this->tpl->setCurrentBlock("title_form");
73 $this->tpl->setVariable("VAL_ID", $a_set["id"]);
74 $this->tpl->setVariable("VAL_TITLE", ilUtil::prepareFormOutput($a_set["title"]));
75 $this->tpl->parseCurrentBlock();
76
77 if(in_array($a_set["id"], $this->shared_objects))
78 {
79 $this->tpl->setCurrentBlock("shared");
80 $this->tpl->setVariable("TXT_SHARED", $lng->txt("wsp_status_shared"));
81 $this->tpl->parseCurrentBlock();
82 }
83
84 $this->tpl->setCurrentBlock("chck");
85 $this->tpl->setVariable("VAL_ID", $a_set["id"]);
86 $this->tpl->parseCurrentBlock();
87
88 $this->tpl->setCurrentBlock("edit");
89 $this->tpl->setVariable("VAL_ID", $a_set["id"]);
90 $this->tpl->setVariable("STATUS_ONLINE",
91 ($a_set["is_online"]) ? " checked=\"checked\"" : "");
92 $this->tpl->setVariable("VAL_DEFAULT",
93 ($a_set["is_default"]) ? $lng->txt("yes") : "");
94 $this->tpl->parseCurrentBlock();
95
96 $prtf_path = array(get_class($this->parent_obj), "ilobjportfoliogui");
97
98 $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", $a_set["id"]);
99 $this->tpl->setCurrentBlock("action");
100
101 $this->tpl->setVariable("URL_ACTION",
102 $ilCtrl->getLinkTargetByClass($prtf_path, "preview"));
103 $this->tpl->setVariable("TXT_ACTION", $lng->txt("user_profile_preview"));
104 $this->tpl->parseCurrentBlock();
105
106 $this->tpl->setVariable("URL_ACTION",
107 $ilCtrl->getLinkTargetByClass($prtf_path, "view"));
108 $this->tpl->setVariable("TXT_ACTION", $lng->txt("prtf_edit_portfolio"));
109 $this->tpl->parseCurrentBlock();
110
111 $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", "");
112
113 if($a_set["is_online"])
114 {
115 if(!$a_set["is_default"])
116 {
117 $ilCtrl->setParameter($this->parent_obj, "prt_id", $a_set["id"]);
118
119 $this->tpl->setVariable("URL_ACTION",
120 $ilCtrl->getLinkTarget($this->parent_obj, "setDefaultConfirmation"));
121 $this->tpl->setVariable("TXT_ACTION", $lng->txt("prtf_set_as_default"));
122 $this->tpl->parseCurrentBlock();
123
124 $ilCtrl->setParameter($this->parent_obj, "prt_id", "");
125 }
126 else
127 {
128 $this->tpl->setVariable("URL_ACTION",
129 $ilCtrl->getLinkTarget($this->parent_obj, "unsetDefault"));
130 $this->tpl->setVariable("TXT_ACTION", $lng->txt("prtf_unset_as_default"));
131 $this->tpl->parseCurrentBlock();
132 }
133 }
134 }
135
136}?>
static getPortfoliosOfUser($a_user_id)
Get views of user.
Access handler for portfolio.
__construct($a_parent_obj, $a_parent_cmd, $a_user_id)
Constructor.
fillRow($a_set)
Fill table row.
Class ilTable2GUI.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
global $ilUser
Definition: imgupload.php:15