32 public function __construct($a_parent_obj, $a_parent_cmd =
'')
36 $this->db = $DIC->database();
37 $this->copyright_id = $a_parent_obj->getEntryId();
38 $this->lng = $DIC->language();
39 $this->lng->loadLanguageModule(
'meta');
41 $this->
setId(
"mdcopusage" . $this->copyright_id);
42 parent::__construct($a_parent_obj, $a_parent_cmd);
52 $this->
setTitle($md_entry->getTitle());
54 $this->
addColumn($this->lng->txt(
'object'),
'object');
55 $this->
addColumn($this->lng->txt(
'meta_references'),
'references');
56 $this->
addColumn($this->lng->txt(
'meta_copyright_sub_items'),
'subitems');
57 $this->
addColumn($this->lng->txt(
'owner'),
'owner');
59 $this->
setRowTemplate(
"tpl.show_copyright_usages_row.html",
"Services/MetaData");
61 $this->getParentObject(),
87 $this->lng->txt(
"object") .
" " . $this->lng->txt(
"title")
89 $this->filter[
"title"] =
$title->getValue();
92 $this->objects = array();
94 $this->objects[$item] = $this->lng->txt(
"obj_" . $item);
97 $item->setOptions(array(
"" =>
"-") + $this->objects);
98 $this->filter[
"object"] = $item->getValue();
108 if ($this->filter[
"title"]) {
109 $filter[
"title"] = $this->filter[
"title"];
112 if ($this->filter[
'object']) {
113 $filter[
'object'] = $this->filter[
'object'];
122 $f = $DIC->ui()->factory();
123 $r = $DIC->ui()->renderer();
125 $icon =
$f->icon()->standard($a_set[
'type'], $this->lng->txt($a_set[
'type']),
"medium");
126 $this->tpl->setVariable(
'OBJ_TYPE_ICON',
$r->render(
$icon));
127 $this->tpl->setVariable(
'TITLE', $a_set[
'title']);
128 $this->tpl->setVariable(
"DESCRIPTION", $a_set[
'desc']);
129 if ($a_set[
'references']) {
131 $path->enableHideLeaf(
false);
132 $path->enableDisplayCut(
true);
133 $path->enableTextOnly(
false);
135 foreach ($a_set[
'references'] as $reference) {
136 $this->tpl->setCurrentBlock(
"references");
137 $this->tpl->setVariable(
"REFERENCE",
$path->getPath(ROOT_FOLDER_ID, $reference));
138 $this->tpl->parseCurrentBlock();
142 $this->tpl->setVariable(
'SUB_ITEMS', $a_set[
'sub_items']);
145 if ($a_set[
'owner_link']) {
146 $this->tpl->setCurrentBlock(
"link_owner");
147 $this->tpl->setVariable(
"OWNER_LINK", $a_set[
'owner_link']);
148 $this->tpl->setVariable(
'OWNER', $a_set[
'owner_name']);
149 $this->tpl->parseCurrentBlock();
151 $this->tpl->setCurrentBlock(
"owner");
152 $this->tpl->setVariable(
'OWNER', $a_set[
'owner_name']);
153 $this->tpl->parseCurrentBlock();
166 foreach ($db_data as $item) {
167 $obj_id = $item[
'obj_id'];
168 if ($filters[
'title']) {
173 if ($filters[
'object']) {
195 $query =
"SELECT DISTINCT obj_type FROM il_meta_rights " .
196 "WHERE description = " . $this->db->quote(
'il_copyright_entry__' . IL_INST_ID .
'__' . $this->copyright_id,
'text') .
197 " AND rbac_id = obj_id";
211 $query =
"SELECT rbac_id, obj_id, obj_type FROM il_meta_rights " .
212 "WHERE description = " . $this->db->quote(
'il_copyright_entry__' . IL_INST_ID .
'__' . $this->copyright_id,
'text') .
213 ' AND rbac_id != ' . $this->db->quote(0,
'integer') .
220 "obj_id" =>
$row[
'rbac_id'],
221 "obj_type" =>
$row[
'obj_type']
229 $query =
"SELECT count(rbac_id) total FROM il_meta_rights " .
230 "WHERE rbac_id = " . $this->db->quote($a_rbac_id) .
231 " AND rbac_id <> obj_id";
236 return $row[
'total'];
Creates a path for a start and endnode.
collectData(array $filters)
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.
static _lookupTitle($a_id)
lookup object title
getParentCmd()
Get parent command.
static _getAllReferences($a_id)
get all reference ids of object
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
getCurrentFilter()
Get current filter settings.
__construct($a_parent_obj, $a_parent_cmd='')
ilCopyrightUsageGUI constructor.
static _lookupDescription($a_id)
lookup object description
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
getCountSubItemsFromDB($a_rbac_id)
static _lookupOwner($a_id)
lookup object owner
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static _lookupType($a_id, $a_reference=false)
lookup object type
init()
init table columns, ...
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
parse()
Parse table content.
static getProfileLink($a_usr_id)
Get link to personal profile Return empty string in case of not public profile.