ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilObjBlogListGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once "Services/Object/classes/class.ilObjectListGUI.php";
6
16{
20 public function init()
21 {
22 $this->copy_enabled = true;
23 $this->delete_enabled = true;
24 $this->cut_enabled = true;
25 $this->subscribe_enabled = true;
26 $this->link_enabled = true; // #10498
27 $this->info_screen_enabled = true;
28 $this->type = "blog";
29 $this->gui_class_name = "ilobjbloggui";
30
31 // general commands array
32 include_once('./Modules/Blog/classes/class.ilObjBlogAccess.php');
33 $this->commands = ilObjBlogAccess::_getCommands();
34 }
35
36 public function getCommands()
37 {
38 $commands = parent::getCommands();
39
40 // #10182 - handle edit and contribute
41 $permissions = array();
42 foreach ($commands as $idx => $item) {
43 if ($item["lang_var"] == "edit" && $item["granted"]) {
44 $permissions[$item["permission"]] = $idx;
45 }
46 }
47 if (sizeof($permissions) == 2) {
48 unset($commands[$permissions["contribute"]]);
49 }
50
51 return $commands;
52 }
53}
An exception for terminatinating execution or to throw for unit testing.
static _getCommands()
get commands
Class ilObjBlogListGUI.
getCommands()
get all current commands for a specific ref id (in the permission context of the current user)
Class ilObjectListGUI.