ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjBlogGUI Class Reference

Class ilObjBlogGUI. More...

+ Inheritance diagram for ilObjBlogGUI:
+ Collaboration diagram for ilObjBlogGUI:

Public Member Functions

 __construct (int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
 
 getType ()
 
 getItems ()
 
 executeCommand ()
 
 getRenderedContent ()
 
 infoScreen ()
 this one is called from the info button in the repository More...
 
 infoScreenForward ()
 
 createPosting ()
 Create new posting. More...
 
 render ()
 Render object context. More...
 
 getHTML ()
 Return embeddable HTML chunk. More...
 
 preview ()
 Render fullscreen presentation. More...
 
 export (bool $a_with_comments=false)
 Build and deliver export file. More...
 
 renderFullScreen (string $a_content, string $a_navigation)
 Build fullscreen context. More...
 
 renderFullscreenHeader (ilGlobalTemplateInterface $a_tpl, int $a_user_id, bool $a_export=false)
 Render banner, user name. More...
 
 renderList (array $items, string $a_cmd="preview", string $a_link_template="", bool $a_show_inactive=false, string $a_export_directory="")
 Build posting month list. More...
 
 renderToolbarNavigation (array $a_items, bool $single_posting=false)
 Toolbar navigation. More...
 
 renderNavigation (string $a_list_cmd="render", string $a_posting_cmd="preview", string $a_link_template=null, bool $a_show_inactive=false, int $a_blpg=0)
 Build navigation blocks. More...
 
 getKeywords (bool $a_show_inactive, ?int $a_posting_id=null)
 Get keywords for single posting or complete blog. More...
 
 buildExportFile (bool $a_include_comments=false, bool $print_version=false)
 Build export file. More...
 
 getNotesSubId ()
 
 disableNotes (bool $a_value=false)
 
 filterItemsByKeyword (array $a_items, string $a_keyword)
 
 approve ()
 
 contributors ()
 
 addUserFromAutoComplete ()
 Autocomplete submit. More...
 
 addContributor (array $a_user_ids=array(), ?string $a_user_type=null)
 Centralized method to add contributors. More...
 
 confirmRemoveContributor ()
 Used in ilContributorTableGUI. More...
 
 removeContributor ()
 
 deactivateAdmin ()
 
 setContentStyleSheet (ilGlobalTemplateInterface $a_tpl=null)
 
 printViewSelection ()
 
 printPostings ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 executeCommand ()
 execute command More...
 
 getIdType ()
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. More...
 
 setCreationMode (bool $mode=true)
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 
- Public Member Functions inherited from ilDesktopItemHandling
 addToDeskObject ()
 
 removeFromDeskObject ()
 

Static Public Member Functions

static lookupSubObjectTitle (int $a_blog_id, int $a_posting_id)
 Get title for blog posting (used in ilNotesGUI) More...
 
static _goto (string $a_target)
 Deep link. More...
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $obj, ?int $callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Data Fields

bool $prtf_embed = false
 
- Data Fields inherited from ilObject2GUI
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 initCreationForms (string $new_type)
 
 afterSave (ilObject $new_object)
 
 setSettingsSubTabs (string $a_active)
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 
 getEditFormCustomValues (array &$a_values)
 
 updateCustom (ilPropertyFormGUI $form)
 
 setTabs ()
 
 triggerAssignmentTool ()
 
 getListItems (bool $a_show_inactive=false)
 Filter blog postings by month, keyword or author. More...
 
 buildEmbedded (string $a_content, string $a_nav)
 Combine content (list/posting) and navigation to html chunk. More...
 
 buildPostingList (int $a_obj_id)
 Gather all blog postings. More...
 
 buildExportLink (string $a_template, string $a_type, string $a_id)
 Build export link. More...
 
 renderNavigationByDate (array $a_items, string $a_list_cmd="render", string $a_posting_cmd="preview", ?string $a_link_template=null, bool $a_show_inactive=false, int $a_blpg=0)
 Build navigation by date block. More...
 
 renderNavigationByKeywords (string $a_list_cmd="render", bool $a_show_inactive=false, string $a_link_template="", int $a_blpg=0)
 Build navigation by keywords block. More...
 
 renderNavigationByAuthors (array $a_items, string $a_list_cmd="render", bool $a_show_inactive=false)
 
 addHeaderActionForCommand (string $a_cmd)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null, bool $is_preview=false)
 
 setNotification ()
 
 filterInactivePostings ()
 Filter inactive items from items list. More...
 
 isAdmin ()
 Check if user has admin access (approve, may edit & deactivate all postings) More...
 
 addLocatorItems ()
 
 exportWithComments ()
 Handle export choice. More...
 
 forwardExport ()
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil. More...
 
 setTitleAndDescription ()
 
 omitLocator (bool $omit=true)
 
 getTargetFrame (string $cmd, string $target_frame="")
 
 setTargetFrame (string $cmd, string $target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 checkPermission (string $perm, string $cmd="", string $type="", int $ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId (int $ref_id, string $cmd="")
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 
 showActions ()
 
 getTabs ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 addAdoptContentLinkToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 

Protected Attributes

ILIAS Repository Profile ProfileGUI $profile_gui
 
ILIAS Repository Profile ProfileAdapter $profile
 
ILIAS Blog Access BlogAccess $blog_access
 
ILIAS Blog InternalDomainService $domain
 
ILIAS Blog InternalGUIService $gui
 
string $rendered_content = ""
 
ILIAS Notes Service $notes
 
ILIAS Blog ReadingTime BlogSettingsGUI $reading_time_gui
 
ILIAS Blog ReadingTime ReadingTimeManager $reading_time_manager
 
StandardGUIRequest $blog_request
 
ilHelpGUI $help
 
ilTabsGUI $tabs
 
ilNavigationHistory $nav_history
 
ilRbacAdmin $rbacadmin
 
string $month = ""
 
array $items = []
 
string $keyword = ""
 
int $author = null
 
bool $month_default = false
 
int $gtp = 0
 
string $edt
 
int $blpg = 0
 
int $old_nr = 0
 
int $ppage = 0
 
int $user_page = 0
 
string $prvm
 
int $ntf = 0
 
int $apid = 0
 
string $new_type = ""
 
int $prt_id = 0
 
bool $disable_notes = false
 
ContextServices $tool_context
 
ILIAS HTTP Services $http
 
ILIAS DI UIServices $ui
 
ILIAS Style Content GUIService $content_style_gui
 
ILIAS Style Content Object ObjectFacade $content_style_domain
 
- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
int $request_ref_id
 
int $id_type
 
int $parent_id
 
string $type
 
string $html
 
int $object_id
 
int $node_id = null
 
array $creation_forms = []
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjBlogGUI::__construct ( int  $a_id = 0,
int  $a_id_type = self::REPOSITORY_NODE_ID,
int  $a_parent_node_id = 0 
)

Definition at line 74 of file class.ilObjBlogGUI.php.

References $blog_request, $DIC, $gui, XapiProxy\$req, $service, ILIAS\MetaData\Repository\Validation\Data\__construct(), buildPostingList(), ILIAS\Repository\ctrl(), ilObject2GUI\getAccessHandler(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\locator(), ilBlogPosting\lookupBlogId(), ILIAS\Repository\object(), ILIAS\Repository\profile(), ILIAS\Repository\settings(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

78  {
79  global $DIC;
80 
81  // other services
82  $cs = $DIC->contentStyle();
83  $this->tool_context = $DIC->globalScreen()->tool()->context();
84  $this->notes = $DIC->notes();
85 
86  // internal service
87  $service = $DIC->blog()->internal();
88 
89  $this->domain = $domain = $service->domain();
90  $this->gui = $gui = $service->gui();
91 
92  $this->settings = $domain->settings();
93  $this->user = $domain->user();
94  $this->tree = $domain->repositoryTree();
95  $this->rbac_review = $domain->rbac()->review();
96  $this->rbacadmin = $domain->rbac()->admin();
97  $this->lng = $domain->lng();
98 
99  $gui = $service->gui();
100  $this->gui = $gui;
101  $this->help = $gui->help();
102  $this->tabs = $gui->tabs();
103  $this->toolbar = $gui->toolbar();
104  $this->ui = $gui->ui();
105  $this->locator = $gui->locator();
106  $this->http = $gui->http();
107 
108  $this->nav_history = $DIC["ilNavigationHistory"];
109  $this->ctrl = $gui->ctrl();
110 
111  $this->blog_request = $gui->standardRequest();
112 
114  $this->gtp = $req->getGotoPage();
115  $this->edt = $req->getEditing();
116  $this->blpg = $req->getBlogPage();
117  $this->old_nr = $req->getOldNr();
118  $this->ppage = $req->getPPage();
119  $this->user_page = $req->getUserPage();
120  $this->new_type = $req->getNewType();
121  $this->prvm = $req->getPreviewMode();
122  $this->ntf = $req->getNotification();
123  $this->apid = $req->getApId();
124  $this->month = $req->getMonth();
125  $this->keyword = $req->getKeyword();
126  $this->author = $req->getAuthor();
127  $this->prt_id = $req->getPrtId();
128 
129  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
130 
131  $blog_page = $this->blog_request->getBlogPage();
132  if ($blog_page > 0 &&
133  ilBlogPosting::lookupBlogId($blog_page) !== $this->object->getId()) {
134  throw new ilException("Posting ID does not match blog.");
135  }
136 
137  $blog_id = 0;
138  if ($this->object) {
139  // gather postings by month
140  $this->items = $this->buildPostingList($this->object->getId());
141  if ($this->items) {
142  // current month (if none given or empty)
143  if (!$this->month || !$this->items[$this->month]) {
144  $m = array_keys($this->items);
145  $this->month = array_shift($m);
146  $this->month_default = true;
147  }
148  }
149 
150  $this->ctrl->setParameter($this, "bmn", $this->month);
151  $blog_id = $this->object->getId();
152  }
153 
154  $this->lng->loadLanguageModule("blog");
155  $this->ctrl->saveParameter($this, "prvm");
156 
157  $this->content_style_gui = $cs->gui();
158  if (is_object($this->object)) {
159  if ($this->id_type !== self::REPOSITORY_NODE_ID) {
160  $this->content_style_domain = $cs->domain()->styleForObjId($this->object->getId());
161  } else {
162  $this->content_style_domain = $cs->domain()->styleForRefId($this->object->getRefId());
163  }
164  }
165 
166  $this->reading_time_gui = new \ILIAS\Blog\ReadingTime\BlogSettingsGUI($blog_id);
167  $this->reading_time_manager = $domain->readingTime();
168  $this->notes = $DIC->notes();
169  $owner = $this->object?->getOwner() ?? 0;
170  $this->blog_access = $domain->blogAccess(
171  $this->getAccessHandler(),
172  $this->node_id,
173  $this->id_type,
174  $this->user->getId(),
175  $owner
176  );
177  $this->profile = $domain->profile();
178  $this->profile_gui = $gui->profile();
179  }
ILIAS Blog InternalDomainService $domain
buildPostingList(int $a_obj_id)
Gather all blog postings.
StandardGUIRequest $blog_request
ILIAS Blog InternalGUIService $gui
catch(\Exception $e) $req
Definition: xapiproxy.php:93
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
__construct(VocabulariesInterface $vocabularies)
static lookupBlogId(int $a_posting_id)
$service
Definition: ltiservices.php:43
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjBlogGUI::_goto ( string  $a_target)
static

Deep link.

Definition at line 2683 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$access, $DIC, ilObjectGUI\$id, and ilRBACAccessHandler\checkAccess().

2683  : void
2684  {
2685  global $DIC;
2686 
2687  $ilCtrl = $DIC->ctrl();
2688  $access = $DIC->access();
2689 
2690  $id = explode("_", $a_target);
2691  if (substr($a_target, -3) === "wsp") {
2692  $ilCtrl->setParameterByClass("ilSharedResourceGUI", "wsp_id", $id[0]);
2693 
2694  if (count($id) >= 2) {
2695  if (is_numeric($id[1])) {
2696  $ilCtrl->setParameterByClass("ilSharedResourceGUI", "gtp", $id[1]);
2697  } else {
2698  $ilCtrl->setParameterByClass("ilSharedResourceGUI", "kwd", $id[1]);
2699  }
2700  if (($id[2] ?? "") === "edit") {
2701  $ilCtrl->setParameterByClass("ilSharedResourceGUI", "edt", $id[2]);
2702  }
2703  }
2704  $ilCtrl->redirectByClass("ilSharedResourceGUI", "");
2705  } else {
2706  $ilCtrl->setParameterByClass("ilRepositoryGUI", "ref_id", $id[0]);
2707 
2708  if (count($id) >= 2) {
2709  if (is_numeric($id[1])) {
2710  $ilCtrl->setParameterByClass("ilRepositoryGUI", "gtp", $id[1]);
2711  } else {
2712  $ilCtrl->setParameterByClass("ilRepositoryGUI", "kwd", $id[1]);
2713  }
2714 
2715  if (($id[2] ?? "") === "edit") {
2716  $ilCtrl->setParameterByClass("ilRepositoryGUI", "edt", $id[2]);
2717  }
2718  }
2719  if ($access->checkAccess("read", "", (int) $id[0])) {
2720  $ilCtrl->redirectByClass("ilRepositoryGUI", "preview");
2721  }
2722  if ($access->checkAccess("visible", "", (int) $id[0])) {
2723  $ilCtrl->redirectByClass("ilRepositoryGUI", "infoScreen");
2724  }
2725  }
2726  }
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance) ...
global $DIC
Definition: feed.php:28
ilAccessHandler $access
+ Here is the call graph for this function:

◆ addContributor()

ilObjBlogGUI::addContributor ( array  $a_user_ids = array(),
?string  $a_user_type = null 
)

Centralized method to add contributors.

Definition at line 2542 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilObject2GUI\$rbac_review, $rbacadmin, ilRbacAdmin\assignUser(), ilObject2GUI\checkPermissionBool(), contributors(), ILIAS\Repository\int(), ILIAS\Repository\object(), and ilLanguage\txt().

Referenced by addUserFromAutoComplete().

2545  : void {
2546  $ilCtrl = $this->ctrl;
2547  $lng = $this->lng;
2548  $rbacreview = $this->rbac_review;
2550  $a_user_type = (int) $a_user_type;
2551 
2552  if (!$this->checkPermissionBool("write")) {
2553  return;
2554  }
2555 
2556  if (!count($a_user_ids) || !$a_user_type) {
2557  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"));
2558  $this->contributors();
2559  return;
2560  }
2561 
2562  // get contributor role
2563  $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
2564  if (!in_array($a_user_type, $local_roles)) {
2565  $this->tpl->setOnScreenMessage('failure', $lng->txt("missing_perm"));
2566  $this->contributors();
2567  return;
2568  }
2569 
2570  foreach ($a_user_ids as $user_id) {
2571  $user_id = (int) $user_id;
2572  $a_user_type = (int) $a_user_type;
2573  if (!$rbacreview->isAssigned($user_id, $a_user_type)) {
2574  $rbacadmin->assignUser($a_user_type, $user_id);
2575  }
2576  }
2577 
2578  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
2579  $ilCtrl->redirect($this, "contributors");
2580  }
ilRbacReview $rbac_review
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
assignUser(int $a_rol_id, int $a_usr_id)
Assigns an user to a role.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
ilRbacAdmin $rbacadmin
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addHeaderActionForCommand()

ilObjBlogGUI::addHeaderActionForCommand ( string  $a_cmd)
protected

Definition at line 2243 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$ctrl, ilObject2GUI\$user, ilObjectGUI\addHeaderAction(), ANONYMOUS_USER_ID, initHeaderAction(), ilObjectGUI\insertHeaderAction(), and ilCtrl\setParameter().

Referenced by executeCommand().

2245  : void {
2246  $ilUser = $this->user;
2247  $ilCtrl = $this->ctrl;
2248  // preview?
2249  if ($a_cmd === "preview" || $a_cmd === "previewEmbedded" || $a_cmd === "previewFullscreen" || $this->prvm) {
2250  // notification
2251  if ($ilUser->getId() !== ANONYMOUS_USER_ID) {
2252  if (!$this->prvm) {
2253  $ilCtrl->setParameter($this, "prvm", "fsc");
2254  }
2255  $this->insertHeaderAction($this->initHeaderAction(null, null, true));
2256  if (!$this->prvm) {
2257  $ilCtrl->setParameter($this, "prvm", "");
2258  }
2259  }
2260  } else {
2261  $this->addHeaderAction();
2262  }
2263  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
insertHeaderAction(?ilObjectListGUI $list_gui=null)
Insert header action into main template.
initHeaderAction(?string $sub_type=null, ?int $sub_id=null, bool $is_preview=false)
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
addHeaderAction()
Add header action menu.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLocatorItems()

ilObjBlogGUI::addLocatorItems ( )
protected

Definition at line 2434 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$locator, ilObject2GUI\$node_id, ilLocatorGUI\addItem(), ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

2434  : void
2435  {
2436  $ilLocator = $this->locator;
2437 
2438  if (is_object($this->object)) {
2439  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "preview"), "", $this->node_id);
2440  }
2441  }
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
ilLocatorGUI $locator
+ Here is the call graph for this function:

◆ addUserFromAutoComplete()

ilObjBlogGUI::addUserFromAutoComplete ( )

Autocomplete submit.

Definition at line 2509 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$lng, ilObject2GUI\$user, ilObjUser\_lookupId(), addContributor(), contributors(), ILIAS\Repository\int(), and ilLanguage\txt().

2509  : void
2510  {
2511  $lng = $this->lng;
2512 
2513  $user_login = $this->blog_request->getUserLogin();
2514  $user_type = $this->blog_request->getUserType();
2515 
2516  if (trim($user_login) === '') {
2517  $this->tpl->setOnScreenMessage('failure', $lng->txt('msg_no_search_string'));
2518  $this->contributors();
2519  return;
2520  }
2521  $users = explode(',', $user_login);
2522 
2523  $user_ids = array();
2524  foreach ($users as $user) {
2525  $user_id = ilObjUser::_lookupId($user);
2526 
2527  if (!$user_id) {
2528  $this->tpl->setOnScreenMessage('failure', $lng->txt('user_not_known'));
2529  $this->contributors();
2530  return;
2531  }
2532 
2533  $user_ids[] = (int) $user_id;
2534  }
2535 
2536  $this->addContributor($user_ids, $user_type);
2537  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _lookupId($a_user_str)
addContributor(array $a_user_ids=array(), ?string $a_user_type=null)
Centralized method to add contributors.
+ Here is the call graph for this function:

◆ afterSave()

ilObjBlogGUI::afterSave ( ilObject  $new_object)
protected

Definition at line 203 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$ctrl, ILIAS\Repository\lng(), and ilCtrl\redirect().

203  : void
204  {
205  $ilCtrl = $this->ctrl;
206 
207  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
208  $ilCtrl->redirect($this, "");
209  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ approve()

ilObjBlogGUI::approve ( )

Definition at line 2443 of file class.ilObjBlogGUI.php.

References $post, ILIAS\Repository\ctrl(), isAdmin(), and ILIAS\Repository\lng().

2443  : void
2444  {
2445  if ($this->isAdmin() && $this->apid > 0) {
2446  $post = new ilBlogPosting($this->apid);
2447  $post->setApproved(true);
2448  $post->setBlogNodeId($this->node_id, ($this->id_type == self::WORKSPACE_NODE_ID));
2449  $post->update(true, false, true, "new"); // #13434
2450 
2451  $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
2452  }
2453 
2454  $this->ctrl->redirect($this, "render");
2455  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isAdmin()
Check if user has admin access (approve, may edit & deactivate all postings)
$post
Definition: ltitoken.php:49
+ Here is the call graph for this function:

◆ buildEmbedded()

ilObjBlogGUI::buildEmbedded ( string  $a_content,
string  $a_nav 
)
protected

Combine content (list/posting) and navigation to html chunk.

Definition at line 1191 of file class.ilObjBlogGUI.php.

Referenced by executeCommand(), and getHTML().

1194  : string {
1195  $wtpl = new ilTemplate("tpl.blog_embedded.html", true, true, "Modules/Blog");
1196  $wtpl->setVariable("VAL_LIST", $a_content);
1197  $wtpl->setVariable("VAL_NAVIGATION", $a_nav);
1198  return $wtpl->get();
1199  }
+ Here is the caller graph for this function:

◆ buildExportFile()

ilObjBlogGUI::buildExportFile ( bool  $a_include_comments = false,
bool  $print_version = false 
)

Build export file.

Definition at line 2207 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$type, ilExport\_createExportDirectory(), ilExport\_getExportDirectory(), and ILIAS\Repository\object().

Referenced by export().

2210  : string {
2211  $type = "html";
2212  $format = explode("_", $this->blog_request->getFormat());
2213  if (($format[1] ?? "") === "comments" || $a_include_comments) {
2214  $a_include_comments = true;
2215  $type = "html_comments";
2216  }
2217 
2218  // create export file
2219  ilExport::_createExportDirectory($this->object->getId(), $type, "blog");
2220  $exp_dir = ilExport::_getExportDirectory($this->object->getId(), $type, "blog");
2221 
2222  $subdir = $this->object->getType() . "_" . $this->object->getId();
2223  if ($print_version) {
2224  $subdir .= "print";
2225  }
2226 
2227  $blog_export = new \ILIAS\Blog\Export\BlogHtmlExport($this, $exp_dir, $subdir);
2228  $blog_export->setPrintVersion($print_version);
2229  $blog_export->includeComments($a_include_comments);
2230  return $blog_export->exportHTML();
2231  }
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object.
static _createExportDirectory(int $a_obj_id, string $a_export_type="xml", string $a_obj_type="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildExportLink()

ilObjBlogGUI::buildExportLink ( string  $a_template,
string  $a_type,
string  $a_id 
)
protected

Build export link.

Definition at line 1679 of file class.ilObjBlogGUI.php.

References getKeywords().

Referenced by renderList(), renderNavigationByDate(), and renderNavigationByKeywords().

1683  : string {
1684  return \ILIAS\Blog\Export\BlogHtmlExport::buildExportLink($a_template, $a_type, $a_id, $this->getKeywords(false));
1685  }
getKeywords(bool $a_show_inactive, ?int $a_posting_id=null)
Get keywords for single posting or complete blog.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildPostingList()

ilObjBlogGUI::buildPostingList ( int  $a_obj_id)
protected

Gather all blog postings.

Definition at line 1352 of file class.ilObjBlogGUI.php.

References $items, $month, ilBlogPosting\getAllPostings(), and IL_CAL_DATE.

Referenced by __construct().

1354  : array {
1355  $author_found = false;
1356 
1357  $items = array();
1358  foreach (ilBlogPosting::getAllPostings($a_obj_id) as $posting) {
1359  if ($this->author &&
1360  ($posting["author"] == $this->author ||
1361  (is_array($posting["editors"] ?? false) && in_array($this->author, $posting["editors"])))) {
1362  $author_found = true;
1363  }
1364 
1365  $month = substr($posting["created"]->get(IL_CAL_DATE), 0, 7);
1366  $items[$month][$posting["id"]] = $posting;
1367  }
1368 
1369  if ($this->author && !$author_found) {
1370  $this->author = null;
1371  }
1372 
1373  return $items;
1374  }
static getAllPostings(int $a_blog_id, int $a_limit=1000, int $a_offset=0)
Get all postings of blog.
const IL_CAL_DATE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmRemoveContributor()

ilObjBlogGUI::confirmRemoveContributor ( )

Used in ilContributorTableGUI.

Definition at line 2585 of file class.ilObjBlogGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

2585  : void
2586  {
2587  $ids = $this->blog_request->getIds();
2588 
2589  if (count($ids) === 0) {
2590  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("select_one"), true);
2591  $this->ctrl->redirect($this, "contributors");
2592  }
2593 
2594  $confirm = new ilConfirmationGUI();
2595  $confirm->setHeaderText($this->lng->txt('blog_confirm_delete_contributors'));
2596  $confirm->setFormAction($this->ctrl->getFormAction($this, 'removeContributor'));
2597  $confirm->setConfirm($this->lng->txt('delete'), 'removeContributor');
2598  $confirm->setCancel($this->lng->txt('cancel'), 'contributors');
2599 
2600  foreach ($ids as $user_id) {
2601  $confirm->addItem(
2602  'id[]',
2603  (string) $user_id,
2604  $this->profile_gui->getNamePresentation($user_id, false, "", true)
2605  );
2606  }
2607 
2608  $this->tpl->setContent($confirm->getHTML());
2609  }
+ Here is the call graph for this function:

◆ contributors()

ilObjBlogGUI::contributors ( )

Definition at line 2462 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilObject2GUI\$node_id, $tabs, ilObject2GUI\$toolbar, ilObject2GUI\$tpl, ilObject2GUI\checkPermissionBool(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), ILIAS\Repository\object(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

Referenced by addContributor(), addUserFromAutoComplete(), and removeContributor().

2462  : void
2463  {
2464  $ilTabs = $this->tabs;
2465  $ilToolbar = $this->toolbar;
2466  $ilCtrl = $this->ctrl;
2467  $lng = $this->lng;
2468  $tpl = $this->tpl;
2469 
2470  if (!$this->checkPermissionBool("write")) {
2471  return;
2472  }
2473 
2474  $ilTabs->activateTab("contributors");
2475 
2476  $local_roles = $this->object->getAllLocalRoles($this->node_id);
2477 
2478  // add member
2480  $this,
2481  $ilToolbar,
2482  array(
2483  'auto_complete_name' => $lng->txt('user'),
2484  'submit_name' => $lng->txt('add'),
2485  'add_search' => true,
2486  'add_from_container' => $this->node_id,
2487  'user_type' => $local_roles
2488  ),
2489  true
2490  );
2491 
2492  $other_roles = $this->object->getRolesWithContributeOrRedact($this->node_id);
2493  if ($other_roles) {
2494  $this->tpl->setOnScreenMessage('info', sprintf($lng->txt("blog_contribute_other_roles"), implode(", ", $other_roles)));
2495  }
2496 
2497  $tbl = $this->gui->contributor()->ilContributorTableGUI(
2498  $this,
2499  "contributors",
2500  $this->object->getAllLocalRoles($this->node_id)
2501  );
2502 
2503  $tpl->setContent($tbl->getHTML());
2504  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilToolbarGUI $toolbar
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
static fillAutoCompleteToolbar(object $parent_object, ilToolbarGUI $toolbar=null, array $a_options=[], bool $a_sticky=false)
array( auto_complete_name = $lng->txt('user'), auto_complete_size = 15, user_type = array(ilCoursePar...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createPosting()

ilObjBlogGUI::createPosting ( )

Create new posting.

Definition at line 956 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$ctrl, ilObject2GUI\$user, ilObject\getTitle(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

956  : void
957  {
958  $ilCtrl = $this->ctrl;
959  $ilUser = $this->user;
960 
961  $title = $this->blog_request->getTitle();
962  if ($title) {
963  // create new posting
964  $posting = new ilBlogPosting();
965  $posting->setTitle($title);
966  $posting->setBlogId($this->object->getId());
967  $posting->setActive(false);
968  $posting->setAuthor($ilUser->getId());
969  $posting->create(false);
970 
971  // switch month list to current month (will include new posting)
972  $ilCtrl->setParameter($this, "bmn", date("Y-m"));
973 
974  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $posting->getId());
975  $ilCtrl->redirectByClass("ilblogpostinggui", "edit");
976  } else {
977  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("msg_no_title"), true);
978  $ilCtrl->redirect($this, "render");
979  }
980  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ deactivateAdmin()

ilObjBlogGUI::deactivateAdmin ( )

Definition at line 2642 of file class.ilObjBlogGUI.php.

References $post, ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

2642  : void
2643  {
2644  if ($this->checkPermissionBool("write") && $this->apid > 0) {
2645  // ilBlogPostingGUI::deactivatePage()
2646  $post = new ilBlogPosting($this->apid);
2647  $post->setApproved(false);
2648  $post->setActive(false);
2649  $post->update(true, false, false);
2650 
2651  $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
2652  }
2653 
2654  $this->ctrl->redirect($this, "render");
2655  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
$post
Definition: ltitoken.php:49
+ Here is the call graph for this function:

◆ disableNotes()

ilObjBlogGUI::disableNotes ( bool  $a_value = false)

Definition at line 2238 of file class.ilObjBlogGUI.php.

2238  : void
2239  {
2240  $this->disable_notes = $a_value;
2241  }

◆ executeCommand()

ilObjBlogGUI::executeCommand ( )

Definition at line 568 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$ctrl, $disable_notes, $gtp, ilObject2GUI\$lng, $nav_history, $tabs, ilObject2GUI\$tpl, ilObjectGUI\addHeaderAction(), addHeaderActionForCommand(), buildEmbedded(), ilObject2GUI\checkPermission(), ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilBlogPosting\exists(), filterInactivePostings(), ilObject2GUI\getAccessHandler(), ilObject2GUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), infoScreenForward(), ilObjBlogAccess\isCommentsExportPossible(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\loadStandardTemplate(), ILIAS\Repository\object(), ilObject2GUI\prepareOutput(), preview(), renderFullScreen(), renderNavigation(), renderToolbarNavigation(), ilGlobalTemplateInterface\setContent(), setContentStyleSheet(), ilObject2GUI\setLocator(), ilGlobalTemplateInterface\setRightContent(), setSettingsSubTabs(), setTabs(), ILIAS\Repository\tabs(), triggerAssignmentTool(), and ilLanguage\txt().

568  : void
569  {
570  $ilCtrl = $this->ctrl;
571  $tpl = $this->tpl;
572  $ilTabs = $this->tabs;
573  $lng = $this->lng;
574  $ilNavigationHistory = $this->nav_history;
575 
576 
577  $next_class = $ilCtrl->getNextClass($this);
578 
579  if ($next_class !== "ilexportgui") {
580  $this->triggerAssignmentTool();
581  }
582 
583  // goto link to blog posting
584  if ($this->gtp > 0) {
585  $page_id = $this->gtp;
586  if (ilBlogPosting::exists($this->object_id, $page_id)) {
587  // #12312
588  $ilCtrl->setCmdClass("ilblogpostinggui");
589  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $page_id);
590  if ($this->edt === "edit") {
591  $ilCtrl->redirectByClass("ilblogpostinggui", "edit");
592  } else {
593  $ilCtrl->redirectByClass("ilblogpostinggui", "previewFullscreen");
594  }
595  } else {
596  $this->tpl->setOnScreenMessage('failure', $lng->txt("blog_posting_not_found"));
597  }
598  }
599 
600 
601  $cmd = $ilCtrl->getCmd();
602 
603  // add entry to navigation history
604  if (($this->id_type === self::REPOSITORY_NODE_ID) && !$this->getCreationMode() &&
605  $this->getAccessHandler()->checkAccess("read", "", $this->node_id)) {
606  // see #22067
607  $link = $ilCtrl->getLinkTargetByClass(["ilrepositorygui", "ilObjBlogGUI"], "preview");
608  $ilNavigationHistory->addItem($this->node_id, $link, "blog");
609  }
610  switch ($next_class) {
611  case 'ilblogpostinggui':
612  $this->ctrl->saveParameter($this, "user_page");
613  if (!$this->prtf_embed) {
615  }
616 
617  if (!$this->checkPermissionBool("read") && !$this->prtf_embed) {
618  $this->tpl->setOnScreenMessage('info', $lng->txt("no_permission"));
619  return;
620  }
621 
622  // #9680
623  if ($this->id_type === self::REPOSITORY_NODE_ID) {
624  $this->setLocator();
625  }
626 
627  $style_sheet_id = $this->content_style_domain->getEffectiveStyleId();
628 
629  $bpost_gui = new ilBlogPostingGUI(
630  $this->node_id,
631  $this->getAccessHandler(),
632  $this->blpg,
633  $this->old_nr,
634  ($this->object->getNotesStatus() && !$this->disable_notes),
635  $this->blog_access->mayEditPosting($this->blpg),
636  $style_sheet_id
637  );
638 
639  // keep preview mode through notes gui (has its own commands)
640  switch ($cmd) {
641  // blog preview
642  case "previewFullscreen":
643  $ilCtrl->setParameter($this, "prvm", "fsc");
644  break;
645 
646  // blog in portfolio
647  case "previewEmbedded":
648  $ilCtrl->setParameter($this, "prvm", "emb");
649  break;
650 
651  // edit
652  default:
653  $this->setContentStyleSheet();
654 
655 
656  if (!$this->prtf_embed) {
657  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $this->blpg);
658  $this->tabs_gui->addNonTabbedLink(
659  "preview",
660  $lng->txt("blog_preview"),
661  $this->ctrl->getLinkTargetByClass("ilblogpostinggui", "previewFullscreen")
662  );
663  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", "");
664  } else {
665  $this->ctrl->setParameterByClass("ilobjportfoliogui", "user_page", $this->ppage);
666  $this->tabs_gui->addNonTabbedLink(
667  "preview",
668  $lng->txt("blog_preview"),
669  $this->ctrl->getLinkTargetByClass("ilobjportfoliogui", "preview")
670  );
671  $this->ctrl->setParameterByClass("ilobjportfoliogui", "user_page", "");
672  }
673  break;
674  }
675 
676  // keep preview mode through notes gui
677  if ($this->prvm) {
678  $cmd = "preview" . (($this->prvm === "fsc") ? "Fullscreen" : "Embedded");
679  }
680  if (in_array($cmd, array("previewFullscreen", "previewEmbedded"))) {
681  $this->renderToolbarNavigation($this->items, true);
682  }
683  $ret = $ilCtrl->forwardCommand($bpost_gui);
684  if (!$ilTabs->back_target) {
685  $ilCtrl->setParameter($this, "bmn", "");
686  $ilTabs->setBackTarget(
687  $lng->txt("back"),
688  $ilCtrl->getLinkTarget($this, "")
689  );
690  }
691 
692  if ($ret != "") {
693  // $is_owner = $this->object->getOwner() == $ilUser->getId();
694  $is_owner = $this->blog_access->mayContribute();
695  $is_active = $bpost_gui->getBlogPosting()->getActive();
696 
697  // do not show inactive postings
698  if (($cmd === "previewFullscreen" || $cmd === "previewEmbedded")
699  && !$is_owner && !$is_active) {
700  $this->ctrl->redirect($this, "preview");
701  }
702 
703  switch ($cmd) {
704  // blog preview
705  case "previewFullscreen":
706  $this->addHeaderActionForCommand($cmd);
707  $this->filterInactivePostings();
708  $nav = $this->renderNavigation("preview", $cmd);
709  $this->renderFullScreen($ret, $nav);
710  break;
711 
712  // blog in portfolio
713  case "previewEmbedded":
714  $this->addHeaderActionForCommand($cmd);
715  $this->filterInactivePostings();
716  $nav = $this->renderNavigation("gethtml", $cmd);
717  // this is important for embedded blog pages!
718  $this->rendered_content = $this->buildEmbedded($ret, $nav);
719  return;
720 
721  // ilias/editor
722  default:
723  // infos about draft status / snippet
724  $info = array();
725  if (!$is_active) {
726  // single author blog (owner) in personal workspace
727  if ($this->id_type === self::WORKSPACE_NODE_ID) {
728  $info[] = $lng->txt("blog_draft_info");
729  } else {
730  $info[] = $lng->txt("blog_draft_info_contributors");
731  }
732  }
733  $public_action = false;
734  if ($cmd !== "history" && $cmd !== "edit" && $is_active && empty($info)) {
735  $info[] = $lng->txt("blog_new_posting_info");
736  $public_action = true;
737  }
738  if ($this->object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved()) {
739  // #9737
740  $info[] = $lng->txt("blog_posting_edit_approval_info");
741  }
742  if ($public_action) {
743  $this->tpl->setOnScreenMessage('success', implode("<br />", $info));
744  } else {
745  if (count($info) > 0) {
746  $this->tpl->setOnScreenMessage('info', implode("<br />", $info));
747  }
748  }
749 
750  // revert to edit cmd to avoid confusion
751  $tpl->setContent($ret);
752  if ($cmd !== "edit") {
753  $this->addHeaderActionForCommand("render");
754  $nav = $this->renderNavigation("render", $cmd, "", $is_owner);
755  $tpl->setRightContent($nav);
756  } else {
757  $this->tabs->setBackTarget("", "");
758  }
759  break;
760  }
761  }
762  break;
763 
764  case "ilinfoscreengui":
765  $this->prepareOutput();
766  $this->addHeaderActionForCommand("render");
767  $this->infoScreenForward();
768  break;
769 
770  case "ilnotegui":
771  $this->preview();
772  break;
773 
774  case "ilcommonactiondispatchergui":
776  $gui->enableCommentsSettings(false);
777  $this->prepareOutput();
778  $this->ctrl->forwardCommand($gui);
779  break;
780 
781  case "ilpermissiongui":
782  $this->prepareOutput();
783  $ilTabs->activateTab("id_permissions");
784  $perm_gui = new ilPermissionGUI($this);
785  $this->ctrl->forwardCommand($perm_gui);
786  break;
787 
788  case "ilobjectcopygui":
789  $this->prepareOutput();
790  $cp = new ilObjectCopyGUI($this);
791  $cp->setType("blog");
792  $this->ctrl->forwardCommand($cp);
793  break;
794 
795  case 'ilrepositorysearchgui':
796  $this->prepareOutput();
797  $ilTabs->activateTab("contributors");
798  $rep_search = new ilRepositorySearchGUI();
799  $rep_search->setTitle($this->lng->txt("blog_add_contributor"));
800  $rep_search->setCallback($this, 'addContributor', $this->object->getAllLocalRoles($this->node_id));
801  $this->ctrl->setReturn($this, 'contributors');
802  $this->ctrl->forwardCommand($rep_search);
803  break;
804 
805  case 'ilexportgui':
806  $this->prepareOutput();
807  $ilTabs->activateTab("export");
808  $exp_gui = new ilExportGUI($this);
809  $exp_gui->addFormat("xml");
810  $exp_gui->addFormat("html", "", $this, "buildExportFile"); // #13419
811  if (ilObjBlogAccess::isCommentsExportPossible($this->object->getId())) {
812  $exp_gui->addFormat("html_comments", "HTML (" . $this->lng->txt("blog_incl_comments") . ")", $this, "buildExportFile");
813  }
814  $ilCtrl->forwardCommand($exp_gui);
815  break;
816 
817  case "ilobjectcontentstylesettingsgui":
818  $this->checkPermission("write");
819  $this->prepareOutput();
820  $this->addHeaderAction();
821  $ilTabs->activateTab("settings");
822  $this->setSettingsSubTabs("style");
823 
824 
825  if ($this->id_type === self::REPOSITORY_NODE_ID) {
826  $settings_gui = $this->content_style_gui
827  ->objectSettingsGUIForRefId(
828  null,
829  $this->object->getRefId()
830  );
831  } else {
832  $settings_gui = $this->content_style_gui
833  ->objectSettingsGUIForObjId(
834  null,
835  $this->object->getId()
836  );
837  }
838  $this->ctrl->forwardCommand($settings_gui);
839  break;
840 
841 
842  case "ilblogexercisegui":
843  $this->ctrl->setReturn($this, "render");
844  $gui = $this->gui->exercise()->ilBlogExerciseGUI($this->node_id);
845  $this->ctrl->forwardCommand($gui);
846  break;
847 
848  case 'ilobjnotificationsettingsgui':
849  $this->prepareOutput();
850  $ilTabs->activateTab("settings");
851  $this->setSettingsSubTabs("notifications");
852  $gui = new ilObjNotificationSettingsGUI($this->object->getRefId());
853  $this->ctrl->forwardCommand($gui);
854  break;
855 
856  default:
857  if ($cmd !== "gethtml") {
858  // desktop item handling, must be toggled before header action
859  if ($cmd === "addToDesk" || $cmd === "removeFromDesk") {
860  $this->{$cmd . "Object"}();
861  if ($this->prvm) {
862  $cmd = "preview";
863  } else {
864  $cmd = "render";
865  }
866  $ilCtrl->setCmd($cmd);
867  }
868  $this->addHeaderActionForCommand($cmd);
869  }
870  if (!$this->prtf_embed) {
871  parent::executeCommand();
872  return;
873  }
874 
875  $this->setTabs();
876 
877  if (!$cmd) {
878  $cmd = "render";
879  }
880  $this->rendered_content = (string) $this->$cmd();
881  }
882  }
ilNavigationHistory $nav_history
setLocator()
set Locator
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
filterInactivePostings()
Filter inactive items from items list.
preview()
Render fullscreen presentation.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
GUI class for the workflow of copying objects.
addHeaderActionForCommand(string $a_cmd)
Class ilBlogPosting GUI class.
static exists(int $a_blog_id, int $a_posting_id)
Checks whether a posting exists.
setContentStyleSheet(ilGlobalTemplateInterface $a_tpl=null)
prepareOutput(bool $show_sub_objects=true)
ILIAS Blog InternalGUIService $gui
renderFullScreen(string $a_content, string $a_navigation)
Build fullscreen context.
Export User Interface Class.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
setContent(string $a_html)
Sets content for standard template.
static isCommentsExportPossible(int $blog_id)
ilGlobalTemplateInterface $tpl
loadStandardTemplate()
This loads the standard template "tpl.adm_content.html" and "tpl.statusline.html" the CONTENT and STA...
setSettingsSubTabs(string $a_active)
renderNavigation(string $a_list_cmd="render", string $a_posting_cmd="preview", string $a_link_template=null, bool $a_show_inactive=false, int $a_blpg=0)
Build navigation blocks.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRightContent(string $a_html)
Sets content of right column.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
renderToolbarNavigation(array $a_items, bool $single_posting=false)
Toolbar navigation.
buildEmbedded(string $a_content, string $a_nav)
Combine content (list/posting) and navigation to html chunk.
addHeaderAction()
Add header action menu.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ export()

ilObjBlogGUI::export ( bool  $a_with_comments = false)

Build and deliver export file.

Definition at line 1178 of file class.ilObjBlogGUI.php.

References buildExportFile(), ilFileDelivery\deliverFileLegacy(), and ILIAS\Repository\object().

Referenced by exportWithComments().

1180  : void {
1181  $zip = $this->buildExportFile($a_with_comments);
1182  ilFileDelivery::deliverFileLegacy($zip, $this->object->getTitle() . ".zip", '', false, true);
1183  }
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
buildExportFile(bool $a_include_comments=false, bool $print_version=false)
Build export file.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportWithComments()

ilObjBlogGUI::exportWithComments ( )
protected

Handle export choice.

Definition at line 2731 of file class.ilObjBlogGUI.php.

References ilObjectGUI\$object, $provider, ILIAS\Repository\ctrl(), export(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

2731  : void
2732  {
2733  $this->export(true);
2734  }
export(bool $a_with_comments=false)
Build and deliver export file.
+ Here is the call graph for this function:

◆ filterInactivePostings()

ilObjBlogGUI::filterInactivePostings ( )
protected

Filter inactive items from items list.

Definition at line 2386 of file class.ilObjBlogGUI.php.

References ilObjectGUI\$id, ilPageObject\_lookupActive(), and ILIAS\Repository\object().

Referenced by executeCommand(), getHTML(), and preview().

2386  : void
2387  {
2388  foreach ($this->items as $month => $postings) {
2389  foreach ($postings as $id => $item) {
2390  if (!ilBlogPosting::_lookupActive($id, "blp")) {
2391  unset($this->items[$month][$id]);
2392  } elseif ($this->object->hasApproval() && !$item["approved"]) {
2393  unset($this->items[$month][$id]);
2394  }
2395  }
2396  if (!count($this->items[$month])) {
2397  unset($this->items[$month]);
2398  }
2399  }
2400 
2401  if ($this->items && !isset($this->items[$this->month])) {
2402  $keys = array_keys($this->items);
2403  $this->month = array_shift($keys);
2404  }
2405  }
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filterItemsByKeyword()

ilObjBlogGUI::filterItemsByKeyword ( array  $a_items,
string  $a_keyword 
)

Definition at line 2407 of file class.ilObjBlogGUI.php.

References $res, and ilBlogPosting\getKeywords().

Referenced by getListItems().

2410  : array {
2411  $res = [];
2412  foreach ($a_items as $month => $items) {
2413  foreach ($items as $item) {
2414  if (in_array(
2415  $a_keyword,
2416  ilBlogPosting::getKeywords($this->obj_id, $item["id"])
2417  )) {
2418  $res[] = $item;
2419  }
2420  }
2421  }
2422  return $res;
2423  }
$res
Definition: ltiservices.php:69
static getKeywords(int $a_obj_id, int $a_posting_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forwardExport()

ilObjBlogGUI::forwardExport ( )
protected

Definition at line 2776 of file class.ilObjBlogGUI.php.

References ILIAS\Repository\ctrl().

2776  : void
2777  {
2778  $this->ctrl->redirectByClass(ilExportGUI::class);
2779  }
+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjBlogGUI::getEditFormCustomValues ( array &  $a_values)
protected

Definition at line 426 of file class.ilObjBlogGUI.php.

References ilObjBlog\ABSTRACT_DEFAULT_IMAGE_HEIGHT, ilObjBlog\ABSTRACT_DEFAULT_IMAGE_WIDTH, and ilObjBlog\ABSTRACT_DEFAULT_SHORTEN_LENGTH.

426  : void
427  {
428  if ($this->id_type === self::REPOSITORY_NODE_ID) {
429  $a_values["approval"] = $this->object->hasApproval();
430  $a_values["nav_authors"] = $this->object->hasAuthors();
431  }
432  $a_values["keywords"] = $this->object->hasKeywords();
433  $a_values["notes"] = $this->object->getNotesStatus();
434  $a_values["ppic"] = $this->object->hasProfilePicture();
435  /*
436  $a_values["bg_color"] = $this->object->getBackgroundColor();
437  $a_values["font_color"] = $this->object->getFontColor();
438  */
439  $a_values["banner"] = $this->object->getImage();
440  $a_values["rss"] = $this->object->hasRSS();
441  $a_values["abss"] = $this->object->hasAbstractShorten();
442  $a_values["absi"] = $this->object->hasAbstractImage();
443  $a_values["nav"] = $this->object->getNavMode();
444  $a_values["nav_list_mon_with_post"] = $this->object->getNavModeListMonthsWithPostings();
445  $a_values["nav_list_mon"] = $this->object->getNavModeListMonths();
446  $a_values["ov_list_post_num"] = $this->object->getOverviewPostings();
447 
448  // #13420
449  $a_values["abssl"] = $this->object->getAbstractShortenLength() ?: ilObjBlog::ABSTRACT_DEFAULT_SHORTEN_LENGTH;
450  $a_values["absiw"] = $this->object->getAbstractImageWidth() ?: ilObjBlog::ABSTRACT_DEFAULT_IMAGE_WIDTH;
451  $a_values["absih"] = $this->object->getAbstractImageHeight() ?: ilObjBlog::ABSTRACT_DEFAULT_IMAGE_HEIGHT;
452  $a_values = $this->reading_time_gui->addValueToArray($a_values);
453  }
const ABSTRACT_DEFAULT_IMAGE_WIDTH
const ABSTRACT_DEFAULT_SHORTEN_LENGTH
const ABSTRACT_DEFAULT_IMAGE_HEIGHT

◆ getHTML()

ilObjBlogGUI::getHTML ( )

Return embeddable HTML chunk.

Definition at line 1066 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilObject2GUI\$user, ilObject\_lookupOwner(), buildEmbedded(), filterInactivePostings(), getListItems(), ILIAS\Repository\lng(), renderList(), renderNavigation(), ILIAS\Repository\toolbar(), and ILIAS\Repository\ui().

1066  : string
1067  {
1068  $ilUser = $this->user;
1069  $ilCtrl = $this->ctrl;
1070  $lng = $this->lng;
1071 
1072  // getHTML() is called by ilRepositoryGUI::show()
1073  if ($this->id_type === self::REPOSITORY_NODE_ID) {
1074  return "";
1075  }
1076 
1077  // there is no way to do a permissions check here, we have no wsp
1078 
1079  $this->filterInactivePostings();
1080 
1081  $list_items = $this->getListItems();
1082  $list = $nav = "";
1083  if ($list_items) {
1084  $list = $this->renderList($list_items, "previewEmbedded");
1085  $nav = $this->renderNavigation("gethtml", "previewEmbedded");
1086  }
1087  // quick editing in portfolio
1088  elseif ($this->prt_id) {
1089  // see renderList()
1090  if (ilObject::_lookupOwner($this->prt_id) === $ilUser->getId()) {
1091  // see ilPortfolioPageTableGUI::fillRow()
1092  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", $this->user_page);
1093  $link = $ilCtrl->getLinkTargetByClass(array("ilportfoliopagegui", "ilobjbloggui"), "render");
1094  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", "");
1095 
1096  $this->toolbar->addComponent($this->ui->factory()->button()->standard(
1097  $this->lng->txt("blog_edit"),
1098  $link
1099  ));
1100  }
1101  }
1102 
1103  return $this->buildEmbedded($list, $nav);
1104  }
filterInactivePostings()
Filter inactive items from items list.
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
getListItems(bool $a_show_inactive=false)
Filter blog postings by month, keyword or author.
renderNavigation(string $a_list_cmd="render", string $a_posting_cmd="preview", string $a_link_template=null, bool $a_show_inactive=false, int $a_blpg=0)
Build navigation blocks.
buildEmbedded(string $a_content, string $a_nav)
Combine content (list/posting) and navigation to html chunk.
renderList(array $items, string $a_cmd="preview", string $a_link_template="", bool $a_show_inactive=false, string $a_export_directory="")
Build posting month list.
+ Here is the call graph for this function:

◆ getItems()

ilObjBlogGUI::getItems ( )

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

References $items.

186  : array
187  {
188  return $this->items;
189  }

◆ getKeywords()

ilObjBlogGUI::getKeywords ( bool  $a_show_inactive,
?int  $a_posting_id = null 
)

Get keywords for single posting or complete blog.

Definition at line 2161 of file class.ilObjBlogGUI.php.

References $keyword, ilPageObject\_lookupActive(), ilBlogPosting\getKeywords(), and ilArrayUtil\sortArray().

Referenced by buildExportLink(), and renderNavigationByKeywords().

2164  : array {
2165  $keywords = array();
2166  if ($a_posting_id) {
2167  foreach (ilBlogPosting::getKeywords($this->obj_id, $a_posting_id) as $keyword) {
2168  if (isset($keywords[$keyword])) {
2169  $keywords[$keyword]++;
2170  } else {
2171  $keywords[$keyword] = 1;
2172  }
2173  }
2174  } else {
2175  foreach ($this->items as $month => $items) {
2176  foreach ($items as $item) {
2177  if ($a_show_inactive || ilBlogPosting::_lookupActive($item["id"], "blp")) {
2178  foreach (ilBlogPosting::getKeywords($this->obj_id, $item["id"]) as $keyword) {
2179  if (isset($keywords[$keyword])) {
2180  $keywords[$keyword]++;
2181  } else {
2182  $keywords[$keyword] = 1;
2183  }
2184  }
2185  }
2186  }
2187  }
2188  }
2189 
2190  // #15881
2191  $tmp = array();
2192  foreach ($keywords as $keyword => $counter) {
2193  $tmp[] = array("keyword" => $keyword, "counter" => $counter);
2194  }
2195  $tmp = ilArrayUtil::sortArray($tmp, "keyword", "ASC");
2196 
2197  $keywords = array();
2198  foreach ($tmp as $item) {
2199  $keywords[(string) $item["keyword"]] = $item["counter"];
2200  }
2201  return $keywords;
2202  }
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static getKeywords(int $a_obj_id, int $a_posting_id)
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getListItems()

ilObjBlogGUI::getListItems ( bool  $a_show_inactive = false)
protected

Filter blog postings by month, keyword or author.

Definition at line 1109 of file class.ilObjBlogGUI.php.

References ilObjectGUI\$id, $month, ilPageObject\_lookupActive(), and filterItemsByKeyword().

Referenced by getHTML(), preview(), and render().

1111  : array {
1112  if ($this->author) {
1113  $list_items = array();
1114  foreach ($this->items as $month => $items) {
1115  foreach ($items as $id => $item) {
1116  if ($item["author"] == $this->author ||
1117  (isset($item["editors"]) && in_array($this->author, $item["editors"]))) {
1118  $list_items[$id] = $item;
1119  }
1120  }
1121  }
1122  } elseif ($this->keyword) {
1123  $list_items = $this->filterItemsByKeyword($this->items, $this->keyword);
1124  } else {
1125  $max = $this->object->getOverviewPostings();
1126  if ($this->month_default && $max) {
1127  $list_items = array();
1128  foreach ($this->items as $month => $postings) {
1129  foreach ($postings as $id => $item) {
1130  if (!$a_show_inactive &&
1131  !ilBlogPosting::_lookupActive($id, "blp")) {
1132  continue;
1133  }
1134  $list_items[$id] = $item;
1135 
1136  if (count($list_items) >= $max) {
1137  break(2);
1138  }
1139  }
1140  }
1141  } else {
1142  $list_items = $this->items[$this->month] ?? [];
1143  }
1144  }
1145  return $list_items;
1146  }
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
filterItemsByKeyword(array $a_items, string $a_keyword)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNotesSubId()

ilObjBlogGUI::getNotesSubId ( )

Definition at line 2233 of file class.ilObjBlogGUI.php.

References $blpg.

2233  : int
2234  {
2235  return $this->blpg;
2236  }

◆ getRenderedContent()

ilObjBlogGUI::getRenderedContent ( )

Definition at line 884 of file class.ilObjBlogGUI.php.

References $rendered_content.

884  : string
885  {
887  }

◆ getType()

ilObjBlogGUI::getType ( )

Definition at line 181 of file class.ilObjBlogGUI.php.

181  : string
182  {
183  return "blog";
184  }

◆ infoScreen()

ilObjBlogGUI::infoScreen ( )

this one is called from the info button in the repository

Definition at line 910 of file class.ilObjBlogGUI.php.

References ILIAS\Repository\ctrl(), and infoScreenForward().

910  : void
911  {
912  $this->ctrl->setCmd("showSummary");
913  $this->ctrl->setCmdClass("ilinfoscreengui");
914  $this->infoScreenForward();
915  }
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjBlogGUI::infoScreenForward ( )

Definition at line 917 of file class.ilObjBlogGUI.php.

References $tabs, ilTabsGUI\activateTab(), ilObject2GUI\checkPermission(), ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

Referenced by executeCommand(), and infoScreen().

917  : void
918  {
919  $ilTabs = $this->tabs;
920 
921  $ilTabs->activateTab("id_info");
922 
923  $this->checkPermission("visible");
924 
925  $info = new ilInfoScreenGUI($this);
926 
927  if ($this->id_type !== self::WORKSPACE_NODE_ID) {
928  $info->enablePrivateNotes();
929  }
930 
931  if ($this->checkPermissionBool("read")) {
932  $info->enableNews();
933  }
934 
935  // no news editing for files, just notifications
936  $info->enableNewsEditing(false);
937  if ($this->checkPermissionBool("write")) {
938  $news_set = new ilSetting("news");
939  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
940 
941  if ($enable_internal_rss) {
942  $info->setBlockProperty("news", "settings", "1");
943  $info->setBlockProperty("news", "public_notifications_option", "1");
944  }
945  }
946 
947  // standard meta data
948  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
949 
950  $this->ctrl->forwardCommand($info);
951  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
Class ilInfoScreenGUI.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
activateTab(string $a_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreationForms()

ilObjBlogGUI::initCreationForms ( string  $new_type)
protected

Definition at line 192 of file class.ilObjBlogGUI.php.

192  : array
193  {
194  $forms = parent::initCreationForms($new_type);
195 
196  if ($this->id_type === self::WORKSPACE_NODE_ID) {
197  unset($forms[self::CFORM_IMPORT], $forms[self::CFORM_CLONE]);
198  }
199 
200  return $forms;
201  }

◆ initEditCustomForm()

ilObjBlogGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

Definition at line 248 of file class.ilObjBlogGUI.php.

References $ilSetting, ilObject2GUI\$lng, ilObjectGUI\$settings, ilPropertyFormGUI\addItem(), ilObjectGUI\getObjectService(), ilObjBlog\NAV_MODE_LIST, ilObjBlog\NAV_MODE_MONTH, ILIAS\Repository\object(), ilFormPropertyGUI\setRequired(), setSettingsSubTabs(), ilWACSignedPath\signFile(), and ilLanguage\txt().

250  : void {
251  $lng = $this->lng;
253  $obj_service = $this->getObjectService();
254 
255  $this->setSettingsSubTabs("properties");
256 
257  if ($this->id_type === self::REPOSITORY_NODE_ID) {
258  $appr = new ilCheckboxInputGUI($lng->txt("blog_enable_approval"), "approval");
259  $appr->setInfo($lng->txt("blog_enable_approval_info"));
260  $a_form->addItem($appr);
261  }
262 
263  $notes = new ilCheckboxInputGUI($lng->txt("blog_enable_notes"), "notes");
264  $a_form->addItem($notes);
265 
266  if ($ilSetting->get('enable_global_profiles')) {
267  $rss = new ilCheckboxInputGUI($lng->txt("blog_enable_rss"), "rss");
268  $rss->setInfo($lng->txt("blog_enable_rss_info"));
269  $a_form->addItem($rss);
270  }
271 
272 
273  // navigation
274 
275  $nav = new ilFormSectionHeaderGUI();
276  $nav->setTitle($lng->txt("blog_settings_navigation"));
277  $a_form->addItem($nav);
278 
279  $nav_mode = new ilRadioGroupInputGUI($lng->txt("blog_nav_mode"), "nav");
280  $nav_mode->setRequired(true);
281  $a_form->addItem($nav_mode);
282 
283  $opt = new ilRadioOption($lng->txt("blog_nav_mode_month_list"), (string) ilObjBlog::NAV_MODE_LIST);
284  $opt->setInfo($lng->txt("blog_nav_mode_month_list_info"));
285  $nav_mode->addOption($opt);
286 
287 
288  $mon_num = new ilNumberInputGUI($lng->txt("blog_nav_mode_month_list_num_month"), "nav_list_mon");
289  $mon_num->setInfo($lng->txt("blog_nav_mode_month_list_num_month_info"));
290  $mon_num->setSize(3);
291  $mon_num->setMinValue(1);
292  $opt->addSubItem($mon_num);
293 
294  $detail_num = new ilNumberInputGUI($lng->txt("blog_nav_mode_month_list_num_month_with_post"), "nav_list_mon_with_post");
295  $detail_num->setInfo($lng->txt("blog_nav_mode_month_list_num_month_with_post_info"));
296  //$detail_num->setRequired(true);
297  $detail_num->setSize(3);
298  //$detail_num->setMinValue(0);
299  $opt->addSubItem($detail_num);
300 
301  $opt = new ilRadioOption($lng->txt("blog_nav_mode_month_single"), (string) ilObjBlog::NAV_MODE_MONTH);
302  $opt->setInfo($lng->txt("blog_nav_mode_month_single_info"));
303  $nav_mode->addOption($opt);
304 
305  $order_options = array();
306  if ($this->object->getOrder()) {
307  foreach ($this->object->getOrder() as $item) {
308  $order_options[] = $lng->txt("blog_" . $item);
309  }
310  }
311 
312  if (!in_array($lng->txt("blog_navigation"), $order_options)) {
313  $order_options[] = $lng->txt("blog_navigation");
314  }
315 
316  if ($this->id_type === self::REPOSITORY_NODE_ID) {
317  if (!in_array($lng->txt("blog_authors"), $order_options)) {
318  $order_options[] = $lng->txt("blog_authors");
319  }
320 
321  $auth = new ilCheckboxInputGUI($lng->txt("blog_enable_nav_authors"), "nav_authors");
322  $auth->setInfo($lng->txt("blog_enable_nav_authors_info"));
323  $a_form->addItem($auth);
324  }
325 
326  $keyw = new ilCheckboxInputGUI($lng->txt("blog_enable_keywords"), "keywords");
327  $keyw->setInfo($lng->txt("blog_enable_keywords_info"));
328  $a_form->addItem($keyw);
329 
330  if (!in_array($lng->txt("blog_keywords"), $order_options)) {
331  $order_options[] = $lng->txt("blog_keywords");
332  }
333 
334  $order = new ilNonEditableValueGUI($lng->txt("blog_nav_sortorder"), "order");
335  $order->setMultiValues($order_options);
336  $order->setValue(array_shift($order_options));
337  $order->setMulti(true, true, false);
338  $a_form->addItem($order);
339 
340 
341  // presentation (frame)
342 
343  $pres = new ilFormSectionHeaderGUI();
344  $pres->setTitle($lng->txt("blog_presentation_frame"));
345  $a_form->addItem($pres);
346 
347  if ($this->id_type === self::REPOSITORY_NODE_ID) {
348  $obj_service->commonSettings()->legacyForm($a_form, $this->object)->addTileImage();
349  }
350 
351  $ppic = new ilCheckboxInputGUI($lng->txt("blog_profile_picture"), "ppic");
352  $a_form->addItem($ppic);
353 
354  if ($this->id_type === self::REPOSITORY_NODE_ID) {
355  $ppic->setInfo($lng->txt("blog_profile_picture_repository_info"));
356  }
357 
358  $blga_set = new ilSetting("blga");
359  if ($blga_set->get("banner")) {
360  $dimensions = " (" . $blga_set->get("banner_width") . "x" .
361  $blga_set->get("banner_height") . ")";
362 
363  $img = new ilImageFileInputGUI($lng->txt("blog_banner") . $dimensions, "banner");
364  $a_form->addItem($img);
365 
366  // show existing file
367  $file = $this->object->getImageFullPath(true);
368  if ($file) {
369  $img->setImage(ilWACSignedPath::signFile($file));
370  }
371  }
372 
373  $this->reading_time_gui->addSettingToForm($a_form);
374 
375  /* #15000
376  $bg_color = new ilColorPickerInputGUI($lng->txt("blog_background_color"), "bg_color");
377  $a_form->addItem($bg_color);
378 
379  $font_color = new ilColorPickerInputGUI($lng->txt("blog_font_color"), "font_color");
380  $a_form->addItem($font_color);
381  */
382 
383  // presentation (overview)
384 
385  $list = new ilFormSectionHeaderGUI();
386  $list->setTitle($lng->txt("blog_presentation_overview"));
387  $a_form->addItem($list);
388 
389 
390  $post_num = new ilNumberInputGUI($lng->txt("blog_list_num_postings"), "ov_list_post_num");
391  $post_num->setInfo($lng->txt("blog_list_num_postings_info"));
392  $post_num->setSize(3);
393  $post_num->setMinValue(1);
394  $post_num->setRequired(true);
395  $a_form->addItem($post_num);
396 
397  $abs_shorten = new ilCheckboxInputGUI($lng->txt("blog_abstract_shorten"), "abss");
398  $a_form->addItem($abs_shorten);
399 
400  $abs_shorten_len = new ilNumberInputGUI($lng->txt("blog_abstract_shorten_length"), "abssl");
401  $abs_shorten_len->setSize(5);
402  $abs_shorten_len->setRequired(true);
403  $abs_shorten_len->setSuffix($lng->txt("blog_abstract_shorten_characters"));
404  $abs_shorten_len->setMinValue(50, true);
405  $abs_shorten->addSubItem($abs_shorten_len);
406 
407  $abs_img = new ilCheckboxInputGUI($lng->txt("blog_abstract_image"), "absi");
408  $abs_img->setInfo($lng->txt("blog_abstract_image_info"));
409  $a_form->addItem($abs_img);
410 
411  $abs_img_width = new ilNumberInputGUI($lng->txt("blog_abstract_image_width"), "absiw");
412  $abs_img_width->setSize(5);
413  $abs_img_width->setRequired(true);
414  $abs_img_width->setSuffix($lng->txt("blog_abstract_image_pixels"));
415  $abs_img_width->setMinValue(32, true);
416  $abs_img->addSubItem($abs_img_width);
417 
418  $abs_img_height = new ilNumberInputGUI($lng->txt("blog_abstract_image_height"), "absih");
419  $abs_img_height->setSize(5);
420  $abs_img_height->setRequired(true);
421  $abs_img_height->setSuffix($lng->txt("blog_abstract_image_pixels"));
422  $abs_img_height->setMinValue(32, true);
423  $abs_img->addSubItem($abs_img_height);
424  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
const NAV_MODE_LIST
This class represents a property in a property form.
setSettingsSubTabs(string $a_active)
setRequired(bool $a_required)
This class represents an image file property in a property form.
global $ilSetting
Definition: privfeed.php:18
static signFile(string $path_to_file)
const NAV_MODE_MONTH
ilSetting $settings
ILIAS Notes Service $notes
+ Here is the call graph for this function:

◆ initHeaderAction()

ilObjBlogGUI::initHeaderAction ( ?string  $sub_type = null,
?int  $sub_id = null,
bool  $is_preview = false 
)
protected

Definition at line 2265 of file class.ilObjBlogGUI.php.

References $blpg, ilObject2GUI\$ctrl, $disable_notes, ilObjectGUI\$obj_id, ilObject2GUI\$user, ilUtil\getImagePath(), ilNotification\hasNotification(), ilNotification\hasOptOut(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilNotification\TYPE_BLOG.

Referenced by addHeaderActionForCommand().

2269  : ?ilObjectListGUI {
2270  $ilUser = $this->user;
2271  $ilCtrl = $this->ctrl;
2272  if (!$this->obj_id) {
2273  return null;
2274  }
2275  $sub_type = $sub_id = null;
2276  if ($this->blpg > 0) {
2277  $sub_type = "blp";
2278  $sub_id = $this->blpg;
2279  }
2280 
2281  $lg = parent::initHeaderAction($sub_type, $sub_id);
2282  if (!$lg) {
2283  return null;
2284  }
2285  $lg->enableComments(false);
2286  $lg->enableNotes(false);
2287 
2288  if ($is_preview) {
2289  if ($this->blpg > 0) {
2290  if (($this->object->getNotesStatus() && !$this->disable_notes)) {
2291  $lg->enableComments(true);
2292  }
2293  $lg->enableNotes(true);
2294  }
2295  $lg->enableTags(false);
2296 
2297  if (!$this->prtf_embed) {
2299  $ilCtrl->setParameter($this, "ntf", 1);
2300  $link = $ilCtrl->getLinkTarget($this, "setNotification");
2301  $ilCtrl->setParameter($this, "ntf", "");
2302  if (ilNotification::hasOptOut($this->obj_id)) {
2303  $lg->addCustomCommand($link, "blog_notification_toggle_off");
2304  }
2305 
2306  $lg->addHeaderIcon(
2307  "not_icon",
2308  ilUtil::getImagePath("object/notification_on.svg"),
2309  $this->lng->txt("blog_notification_activated")
2310  );
2311  } else {
2312  $ilCtrl->setParameter($this, "ntf", 2);
2313  $link = $ilCtrl->getLinkTarget($this, "setNotification");
2314  $ilCtrl->setParameter($this, "ntf", "");
2315  $lg->addCustomCommand($link, "blog_notification_toggle_on");
2316 
2317  $lg->addHeaderIcon(
2318  "not_icon",
2319  ilUtil::getImagePath("object/notification_off.svg"),
2320  $this->lng->txt("blog_notification_deactivated")
2321  );
2322  }
2323  }
2324 
2325  // #11758
2326  if ($this->blog_access->mayContribute()) {
2327  $ilCtrl->setParameter($this, "prvm", "");
2328 
2329  $ilCtrl->setParameter($this, "bmn", "");
2330  $ilCtrl->setParameter($this, "blpg", "");
2331  $link = $ilCtrl->getLinkTarget($this, "");
2332  $ilCtrl->setParameter($this, "blpg", $sub_id);
2333  $ilCtrl->setParameter($this, "bmn", $this->month);
2334  $lg->addCustomCommand($link, "blog_edit"); // #11868
2335 
2336  if ($sub_id && $this->blog_access->mayEditPosting($sub_id)) {
2337  $link = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit");
2338  $lg->addCustomCommand($link, "blog_edit_posting");
2339  }
2340 
2341  $ilCtrl->setParameter($this, "prvm", "fsc");
2342  }
2343 
2344  $ilCtrl->setParameter($this, "ntf", "");
2345  }
2346 
2347  return $lg;
2348  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static hasNotification(int $type, int $user_id, int $id)
Check notification status for object and user.
static hasOptOut(int $obj_id)
Is opt out (disable notification) allowed?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAdmin()

ilObjBlogGUI::isAdmin ( )
protected

Check if user has admin access (approve, may edit & deactivate all postings)

Definition at line 2428 of file class.ilObjBlogGUI.php.

References ilObject2GUI\checkPermissionBool().

Referenced by approve(), and renderList().

2428  : bool
2429  {
2430  return ($this->checkPermissionBool("redact") ||
2431  $this->checkPermissionBool("write"));
2432  }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupSubObjectTitle()

static ilObjBlogGUI::lookupSubObjectTitle ( int  $a_blog_id,
int  $a_posting_id 
)
static

Get title for blog posting (used in ilNotesGUI)

Definition at line 2371 of file class.ilObjBlogGUI.php.

References $post.

2374  : string {
2375  // page might be deleted, so setting halt on errors to false
2376  $post = new ilBlogPosting($a_posting_id);
2377  if ($post->getBlogId() === $a_blog_id) {
2378  return $post->getTitle();
2379  }
2380  return "";
2381  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$post
Definition: ltitoken.php:49

◆ preview()

ilObjBlogGUI::preview ( )

Render fullscreen presentation.

Definition at line 1151 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$lng, ilObject2GUI\$toolbar, ilObject2GUI\checkPermissionBool(), filterInactivePostings(), getListItems(), renderFullScreen(), renderList(), renderNavigation(), renderToolbarNavigation(), and ilLanguage\txt().

Referenced by executeCommand().

1151  : void
1152  {
1153  $lng = $this->lng;
1155 
1156  if (!$this->checkPermissionBool("read")) {
1157  $this->tpl->setOnScreenMessage('info', $lng->txt("no_permission"));
1158  return;
1159  }
1160 
1161  $this->filterInactivePostings();
1162 
1163  $list_items = $this->getListItems();
1164 
1165  $list = $nav = "";
1166  if ($list_items) {
1167  $list = $this->renderList($list_items, "previewFullscreen");
1168  $nav = $this->renderNavigation("preview", "previewFullscreen");
1169  $this->renderToolbarNavigation($this->items);
1170  }
1171 
1172  $this->renderFullScreen($list, $nav);
1173  }
filterInactivePostings()
Filter inactive items from items list.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
renderFullScreen(string $a_content, string $a_navigation)
Build fullscreen context.
ilToolbarGUI $toolbar
getListItems(bool $a_show_inactive=false)
Filter blog postings by month, keyword or author.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
renderNavigation(string $a_list_cmd="render", string $a_posting_cmd="preview", string $a_link_template=null, bool $a_show_inactive=false, int $a_blpg=0)
Build navigation blocks.
renderToolbarNavigation(array $a_items, bool $single_posting=false)
Toolbar navigation.
renderList(array $items, string $a_cmd="preview", string $a_link_template="", bool $a_show_inactive=false, string $a_export_directory="")
Build posting month list.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printPostings()

ilObjBlogGUI::printPostings ( )

Definition at line 2770 of file class.ilObjBlogGUI.php.

2770  : void
2771  {
2772  $print_view = $this->getPrintView();
2773  $print_view->sendPrintView();
2774  }

◆ printViewSelection()

ilObjBlogGUI::printViewSelection ( )

Definition at line 2764 of file class.ilObjBlogGUI.php.

2764  : void
2765  {
2766  $view = $this->getPrintView();
2767  $view->sendForm();
2768  }

◆ removeContributor()

ilObjBlogGUI::removeContributor ( )

Definition at line 2611 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, $rbacadmin, contributors(), ILIAS\Repository\ctrl(), ilRbacAdmin\deassignUser(), ILIAS\Repository\object(), and ilLanguage\txt().

2611  : void
2612  {
2613  $ilCtrl = $this->ctrl;
2614  $lng = $this->lng;
2616 
2617  $ids = $this->blog_request->getIds();
2618 
2619  if (count($ids) === 0) {
2620  $this->tpl->setOnScreenMessage('failure', $lng->txt("select_one"), true);
2621  $ilCtrl->redirect($this, "contributors");
2622  }
2623 
2624  // get contributor role
2625  $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
2626  if (!$local_roles) {
2627  $this->tpl->setOnScreenMessage('failure', $lng->txt("missing_perm"));
2628  $this->contributors();
2629  return;
2630  }
2631 
2632  foreach ($ids as $user_id) {
2633  foreach ($local_roles as $role_id) {
2634  $rbacadmin->deassignUser($role_id, $user_id);
2635  }
2636  }
2637 
2638  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
2639  $this->ctrl->redirect($this, "contributors");
2640  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilRbacAdmin $rbacadmin
deassignUser(int $a_rol_id, int $a_usr_id)
Deassigns a user from a role.
+ Here is the call graph for this function:

◆ render()

ilObjBlogGUI::render ( )

Render object context.

Definition at line 985 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, $tabs, ilObject2GUI\$tpl, $url, ilGlobalTemplateInterface\addOnLoadCode(), ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), getListItems(), renderList(), renderNavigation(), ilGlobalTemplateInterface\setContent(), setContentStyleSheet(), ilGlobalTemplateInterface\setRightContent(), and ilLanguage\txt().

985  : void
986  {
987  $tpl = $this->tpl;
988  $ilTabs = $this->tabs;
989  $ilCtrl = $this->ctrl;
990  $lng = $this->lng;
991  $ilToolbar = new ilToolbarGUI();
992 
993  if (!$this->checkPermissionBool("read")) {
994  $this->tpl->setOnScreenMessage('info', $lng->txt("no_permission"));
995  return;
996  }
997 
998  $ilTabs->activateTab("content");
999 
1000  // toolbar
1001  if ($this->blog_access->mayContribute()) {
1002  $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "createPosting"));
1003 
1004  $title = new ilTextInputGUI($lng->txt("title"), "title");
1005  $title->setSize(30);
1006  $ilToolbar->addStickyItem($title, true);
1007  $tpl->addOnLoadCode("
1008  document.getElementById('title').setAttribute('data-blog-input', 'posting-title');
1009  document.getElementById('title').setAttribute('placeholder', ' ');
1010  ");
1011 
1012  $this->gui->button(
1013  $lng->txt("blog_add_posting"),
1014  "createPosting"
1015  )->submit()->toToolbar(true, $ilToolbar);
1016 
1017  // #18763
1018  $keys = array_keys($this->items);
1019  $first = array_shift($keys);
1020  if ($first != $this->month) {
1021  $ilToolbar->addSeparator();
1022 
1023  $ilCtrl->setParameter($this, "bmn", $first);
1024  $url = $ilCtrl->getLinkTarget($this, "");
1025  $ilCtrl->setParameter($this, "bmn", $this->month);
1026 
1027  $this->gui->link(
1028  $lng->txt("blog_show_latest"),
1029  $url
1030  )->emphasised()->toToolbar(true, $ilToolbar);
1031  }
1032 
1033  // print/pdf
1034  $print_view = $this->getPrintView();
1035  $modal_elements = $print_view->getModalElements(
1036  $this->ctrl->getLinkTarget(
1037  $this,
1038  "printViewSelection"
1039  )
1040  );
1041  $ilToolbar->addSeparator();
1042  $ilToolbar->addComponent($modal_elements->button);
1043  $ilToolbar->addComponent($modal_elements->modal);
1044  }
1045 
1046  // $is_owner = ($this->object->getOwner() == $ilUser->getId());
1047  $is_owner = $this->blog_access->mayContribute();
1048 
1049  $list_items = $this->getListItems($is_owner);
1050 
1051  $list = $nav = "";
1052  if ($list_items) {
1053  $list = $this->renderList($list_items, "preview", "", $is_owner);
1054  $nav = $this->renderNavigation("render", "edit", "", $is_owner);
1055  }
1056 
1057  $this->setContentStyleSheet();
1058 
1059  $tpl->setContent($ilToolbar->getHTML() . $list);
1060  $tpl->setRightContent($nav);
1061  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContentStyleSheet(ilGlobalTemplateInterface $a_tpl=null)
getListItems(bool $a_show_inactive=false)
Filter blog postings by month, keyword or author.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
$url
Definition: ltiregstart.php:35
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
renderNavigation(string $a_list_cmd="render", string $a_posting_cmd="preview", string $a_link_template=null, bool $a_show_inactive=false, int $a_blpg=0)
Build navigation blocks.
setRightContent(string $a_html)
Sets content of right column.
renderList(array $items, string $a_cmd="preview", string $a_link_template="", bool $a_show_inactive=false, string $a_export_directory="")
Build posting month list.
+ Here is the call graph for this function:

◆ renderFullScreen()

ilObjBlogGUI::renderFullScreen ( string  $a_content,
string  $a_navigation 
)

Build fullscreen context.

Definition at line 1204 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$locator, ilObject2GUI\$node_id, ilObject2GUI\$parent_id, $tabs, ilObject2GUI\$tpl, ilObjectGUI\$tree, ilObject2GUI\$user, ilLink\_getStaticLink(), ANONYMOUS_USER_ID, ILIAS\Repository\ctrl(), ilTree\getParentId(), ILIAS\Repository\lng(), renderFullscreenHeader(), ilGlobalTemplateInterface\setContent(), setContentStyleSheet(), ilGlobalTemplateInterface\setLocator(), and ilGlobalTemplateInterface\setRightContent().

Referenced by executeCommand(), and preview().

1207  : void {
1208  $tpl = $this->tpl;
1209  $ilUser = $this->user;
1210  $ilTabs = $this->tabs;
1211  $ilLocator = $this->locator;
1212 
1213  $owner = $this->object->getOwner();
1214 
1215  $ilTabs->clearTargets();
1216  $tpl->setLocator();
1217 
1218  $back_caption = "";
1219  $back = "";
1220 
1221  // back (edit)
1222  if ($owner === $ilUser->getId()) {
1223  // from shared/deeplink
1224  if ($this->id_type === self::WORKSPACE_NODE_ID) {
1225  $back = "ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace&wsp_id=" . $this->node_id;
1226  }
1227  // from editor (#10073)
1228  elseif ($this->blog_access->mayContribute()) {
1229  $this->ctrl->setParameter($this, "prvm", "");
1230  if ($this->blpg === 0) {
1231  $back = $this->ctrl->getLinkTarget($this, "");
1232  } else {
1233  $this->ctrl->setParameterByClass("ilblogpostinggui", "bmn", $this->month);
1234  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $this->blpg);
1235  $back = $this->ctrl->getLinkTargetByClass("ilblogpostinggui", "preview");
1236  }
1237  $this->ctrl->setParameter($this, "prvm", $this->prvm);
1238  }
1239 
1240  $back_caption = $this->lng->txt("blog_back_to_blog_owner");
1241  }
1242  // back
1243  elseif ($ilUser->getId() && $ilUser->getId() !== ANONYMOUS_USER_ID) {
1244  // workspace (always shared)
1245  if ($this->id_type === self::WORKSPACE_NODE_ID) {
1246  $back = "ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace&dsh=" . $owner;
1247  }
1248  // contributor
1249  elseif ($this->blog_access->mayContribute()) {
1250  $back = $this->ctrl->getLinkTarget($this, "");
1251  $back_caption = $this->lng->txt("blog_back_to_blog_owner");
1252  }
1253  // listgui / parent container
1254  else {
1255  $tree = $this->tree;
1256  $parent_id = $tree->getParentId($this->node_id);
1258  }
1259  }
1260 
1261  $this->renderFullscreenHeader($tpl, $owner);
1262 
1263  // #13564
1264  $this->ctrl->setParameter($this, "bmn", "");
1265  //$tpl->setTitleUrl($this->ctrl->getLinkTarget($this, "preview"));
1266  $this->ctrl->setParameter($this, "bmn", $this->month);
1267 
1268  $this->setContentStyleSheet();
1269 
1270  // content
1271  $tpl->setContent($a_content);
1272  $tpl->setRightContent($a_navigation);
1273  }
setLocator()
Insert locator.
const ANONYMOUS_USER_ID
Definition: constants.php:27
setContentStyleSheet(ilGlobalTemplateInterface $a_tpl=null)
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
getParentId(int $a_node_id)
get parent id of given node
renderFullscreenHeader(ilGlobalTemplateInterface $a_tpl, int $a_user_id, bool $a_export=false)
Render banner, user name.
ilLocatorGUI $locator
setRightContent(string $a_html)
Sets content of right column.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderFullscreenHeader()

ilObjBlogGUI::renderFullscreenHeader ( ilGlobalTemplateInterface  $a_tpl,
int  $a_user_id,
bool  $a_export = false 
)

Render banner, user name.

Definition at line 1278 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$node_id, $post, ilObject2GUI\$user, ilObjUser\_getPersonalPicturePath(), ilObjUser\_lookupName(), ilChangeEvent\_recordReadEvent(), ILIAS\Repository\object(), ilGlobalTemplateInterface\resetHeaderBlock(), ilGlobalTemplateInterface\setDescription(), ilGlobalTemplateInterface\setTitle(), ilGlobalTemplateInterface\setTitleIcon(), and ilWACSignedPath\signFile().

Referenced by renderFullScreen().

1282  : void {
1283  $ilUser = $this->user;
1284 
1285  if (!$a_export) {
1287  $this->object->getType(),
1289  $this->object->getId(),
1290  $ilUser->getId()
1291  );
1292  }
1293 
1294  // repository blogs are multi-author
1295  $name = "";
1296  if ($this->id_type !== self::REPOSITORY_NODE_ID) {
1297  $name = ilObjUser::_lookupName($a_user_id);
1298  $name = $name["lastname"] . ", " . $name["firstname"];
1299  }
1300 
1301  // show banner?
1302  $banner = "";
1303  $blga_set = new ilSetting("blga");
1304  $banner_width = "";
1305  $banner_height = "";
1306  if ($blga_set->get("banner")) {
1307  $banner = ilWACSignedPath::signFile($this->object->getImageFullPath());
1308  $banner_width = $blga_set->get("banner_width");
1309  $banner_height = $blga_set->get("banner_height");
1310  if ($a_export) {
1311  $banner = basename($banner);
1312  }
1313  }
1314 
1315  $ppic = "";
1316  if ($this->object->hasProfilePicture()) {
1317  // repository (multi-user)
1318  if ($this->id_type === self::REPOSITORY_NODE_ID) {
1319  // #15030
1320  if ($this->blpg > 0 && !$a_export) {
1321  $post = new ilBlogPosting($this->blpg);
1322  $author_id = $post->getAuthor();
1323  if ($author_id) {
1324  $ppic = $this->profile_gui->getPicturePath($author_id);
1325  $name = $this->profile_gui->getNamePresentation($author_id);
1326  //$name = $name["lastname"] . ", " . $name["firstname"];
1327  }
1328  }
1329  }
1330  // workspace (author == owner)
1331  else {
1332  $ppic = ilObjUser::_getPersonalPicturePath($a_user_id, "xsmall", true, true);
1333  if ($a_export) {
1334  $ppic = basename($ppic);
1335  }
1336  }
1337  }
1338  $a_tpl->resetHeaderBlock(false);
1339  $a_tpl->setBanner($banner);
1340  $a_tpl->setTitleIcon($ppic);
1341  $a_tpl->setTitle($this->object->getTitle());
1342  if ($this->id_type === self::REPOSITORY_NODE_ID) {
1343  $a_tpl->setDescription($this->object->getDescription());
1344  } else {
1345  $a_tpl->setDescription($name);
1346  }
1347  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
resetHeaderBlock(bool $a_reset_header_action=true)
Reset all header properties: title, icon, description, alerts, action menu.
static _lookupName(int $a_user_id)
lookup user name
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
static _getPersonalPicturePath(int $a_usr_id, string $a_size="small", bool $a_force_pic=false, bool $a_prevent_no_photo_image=false, bool $html_export=false)
setDescription(string $a_descr)
Sets description below title in standard template.
static signFile(string $path_to_file)
$post
Definition: ltitoken.php:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderList()

ilObjBlogGUI::renderList ( array  $items,
string  $a_cmd = "preview",
string  $a_link_template = "",
bool  $a_show_inactive = false,
string  $a_export_directory = "" 
)

Build posting month list.

Definition at line 1379 of file class.ilObjBlogGUI.php.

References Vendor\Package\$b, ilObject2GUI\$ctrl, $disable_notes, $keyword, ilObject2GUI\$lng, $month, ilObjectGUI\$ref_id, ilObjectGUI\$ui_factory, ilObjectGUI\$ui_renderer, ilObject2GUI\$user, ilPageObject\_lookupActive(), ilObject\_lookupOwner(), buildExportLink(), ilDatePresentation\formatDate(), ilBlogPosting\getKeywords(), ilBlogPostingGUI\getSnippet(), IL_CAL_DATE, isAdmin(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\Repository\toolbar(), ilLanguage\txt(), and ILIAS\Repository\ui().

Referenced by getHTML(), preview(), and render().

1385  : string {
1386  $lng = $this->lng;
1387  $ilCtrl = $this->ctrl;
1388  $ilUser = $this->user;
1389  $ui_factory = $this->ui->factory();
1390  $ui_renderer = $this->ui->renderer();
1391 
1392  $wtpl = new ilTemplate("tpl.blog_list.html", true, true, "Modules/Blog");
1393 
1394  // quick editing in portfolio
1395  if ($this->prt_id > 0 &&
1396  stripos($a_cmd, "embedded") !== false && ilObject::_lookupOwner($this->prt_id) === $ilUser->getId()) {
1397  // see ilPortfolioPageTableGUI::fillRow()
1398  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", $this->user_page);
1399  $link = $ilCtrl->getLinkTargetByClass(array("ilportfoliopagegui", "ilobjbloggui"), "render");
1400  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", "");
1401  $b = $this->ui->factory()->button()->standard(
1402  $this->lng->txt("blog_edit"),
1403  $link
1404  );
1405  $this->toolbar->addComponent($b);
1406  }
1407 
1408  $is_admin = $this->isAdmin();
1409 
1410  $last_month = null;
1411  $is_empty = true;
1412  foreach ($items as $item) {
1413  // only published items
1414  $is_active = ilBlogPosting::_lookupActive($item["id"], "blp");
1415  if (!$is_active && !$a_show_inactive) {
1416  continue;
1417  }
1418 
1419  $is_empty = false;
1420 
1421  $month = "";
1422  if (!$this->keyword && !$this->author) {
1423  $month = substr($item["created"]->get(IL_CAL_DATE), 0, 7);
1424  }
1425 
1426  if (!$last_month || $last_month != $month) {
1427  if ($last_month) {
1428  $wtpl->setCurrentBlock("month_bl");
1429  $wtpl->parseCurrentBlock();
1430  }
1431 
1432  // title according to current "filter"/navigation
1433  if ($this->keyword) {
1434  $title = $lng->txt("blog_keyword") . ": " . $this->keyword;
1435  } elseif ($this->author) {
1436  $title = $lng->txt("blog_author") . ": " . $this->profile_gui->getNamePresentation($this->author);
1437  } else {
1438  $title = $this->gui->presentation()->util()->getMonthPresentation($month);
1439  $last_month = $month;
1440  }
1441 
1442  $wtpl->setVariable("TXT_CURRENT_MONTH", $title);
1443  }
1444 
1445  if (!$a_link_template) {
1446  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", $this->month);
1447  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $item["id"]);
1448  $preview = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", $a_cmd);
1449  } else {
1450  $preview = $this->buildExportLink($a_link_template, "posting", (string) $item["id"]);
1451  }
1452  $more_link = $preview;
1453 
1454  // actions
1455  $posting_edit = $this->blog_access->mayEditPosting($item["id"], $item["author"]);
1456  if (($posting_edit || $is_admin) && !$a_link_template && $a_cmd === "preview") {
1457  $actions = [];
1458 
1459  if ($is_active && $this->object->hasApproval() && !$item["approved"]) {
1460  if ($is_admin) {
1461  $ilCtrl->setParameter($this, "apid", $item["id"]);
1462  $actions[] = $ui_factory->link()->standard(
1463  $lng->txt("blog_approve"),
1464  $ilCtrl->getLinkTarget($this, "approve")
1465  );
1466  $ilCtrl->setParameter($this, "apid", "");
1467  }
1468 
1469  $wtpl->setVariable("APPROVAL", $lng->txt("blog_needs_approval"));
1470  }
1471 
1472  if ($posting_edit) {
1473  $actions[] = $ui_factory->link()->standard(
1474  $lng->txt("edit_content"),
1475  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit")
1476  );
1477  $more_link = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit");
1478 
1479  // #11858
1480  if ($is_active) {
1481  $actions[] = $ui_factory->link()->standard(
1482  $lng->txt("blog_toggle_draft"),
1483  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deactivatePageToList")
1484  );
1485  } else {
1486  $actions[] = $ui_factory->link()->standard(
1487  $lng->txt("blog_toggle_final"),
1488  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "activatePageToList")
1489  );
1490  }
1491 
1492  $actions[] = $ui_factory->link()->standard(
1493  $lng->txt("rename"),
1494  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edittitle")
1495  );
1496 
1497  if ($this->object->hasKeywords()) { // #13616
1498  $actions[] = $ui_factory->link()->standard(
1499  $lng->txt("blog_edit_keywords"),
1500  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editKeywords")
1501  );
1502  }
1503 
1504  $actions[] = $ui_factory->link()->standard(
1505  $lng->txt("blog_edit_date"),
1506  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editdate")
1507  );
1508 
1509  $actions[] = $ui_factory->link()->standard(
1510  $lng->txt("delete"),
1511  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deleteBlogPostingConfirmationScreen")
1512  );
1513  } elseif ($is_admin) {
1514  // #10513
1515  if ($is_active) {
1516  $ilCtrl->setParameter($this, "apid", $item["id"]);
1517  $actions[] = $ui_factory->link()->standard(
1518  $lng->txt("blog_toggle_draft_admin"),
1519  $ilCtrl->getLinkTarget($this, "deactivateAdmin")
1520  );
1521  $ilCtrl->setParameter($this, "apid", "");
1522  }
1523 
1524  $actions[] = $ui_factory->link()->standard(
1525  $lng->txt("delete"),
1526  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deleteBlogPostingConfirmationScreen")
1527  );
1528  }
1529 
1530  $dd = $ui_factory->dropdown()->standard($actions)->withLabel($this->lng->txt("actions"));
1531 
1532  $wtpl->setCurrentBlock("actions");
1533  $wtpl->setVariable("ACTION_SELECTOR", $ui_renderer->render($dd));
1534  $wtpl->parseCurrentBlock();
1535  }
1536 
1537  // comments
1538  if ($this->object->getNotesStatus() && !$a_link_template && !$this->disable_notes) {
1539  // count (public) notes
1540  $notes_context = $this->notes
1541  ->data()
1542  ->context(
1543  $this->obj_id,
1544  (int) $item["id"],
1545  "blp"
1546  );
1547  $count = $this->notes
1548  ->domain()
1549  ->getNrOfCommentsForContext($notes_context);
1550 
1551  if ($a_cmd !== "preview") {
1552  $wtpl->setCurrentBlock("comments");
1553  $wtpl->setVariable("TEXT_COMMENTS", $lng->txt("blog_comments"));
1554  $wtpl->setVariable("URL_COMMENTS", $preview);
1555  $wtpl->setVariable("COUNT_COMMENTS", $count);
1556  $wtpl->parseCurrentBlock();
1557  }
1558  }
1559 
1560  // permanent link
1561  if ($this->node_id !== null &&
1562  $a_cmd !== "preview" &&
1563  $a_cmd !== "previewEmbedded") {
1564  if ($this->id_type === self::WORKSPACE_NODE_ID) {
1565  $goto = $this->gui->permanentLink(0, (int) $this->node_id)->getPermanentLink((int) $item["id"]);
1566  } else {
1567  $goto = $this->gui->permanentLink((int) $this->node_id)->getPermanentLink((int) $item["id"]);
1568  }
1569  $wtpl->setCurrentBlock("permalink");
1570  $wtpl->setVariable("URL_PERMALINK", $goto);
1571  $wtpl->setVariable("TEXT_PERMALINK", $lng->txt("blog_link"));
1572  $wtpl->parseCurrentBlock();
1573  }
1574 
1575  $snippet = ilBlogPostingGUI::getSnippet(
1576  $item["id"],
1577  $this->object->hasAbstractShorten(),
1578  $this->object->getAbstractShortenLength(),
1579  "&hellip;",
1580  $this->object->hasAbstractImage(),
1581  $this->object->getAbstractImageWidth(),
1582  $this->object->getAbstractImageHeight(),
1583  $a_export_directory
1584  );
1585 
1586  if ($snippet) {
1587  $wtpl->setCurrentBlock("more");
1588  $wtpl->setVariable("URL_MORE", $more_link);
1589  $wtpl->setVariable("TEXT_MORE", $lng->txt("blog_list_more"));
1590  $wtpl->parseCurrentBlock();
1591  }
1592 
1593 
1594 
1595  if (!$is_active) {
1596  $wtpl->setCurrentBlock("draft_text");
1597  $wtpl->setVariable("DRAFT_TEXT", $lng->txt("blog_draft_text"));
1598  $wtpl->parseCurrentBlock();
1599  $wtpl->setVariable("DRAFT_CLASS", " ilBlogListItemDraft");
1600  }
1601 
1602  // reading time
1603  $reading_time = $this->reading_time_manager->getReadingTime(
1604  $this->object->getId(),
1605  $item["id"]
1606  );
1607  if (!is_null($reading_time)) {
1608  $this->lng->loadLanguageModule("copg");
1609  $wtpl->setCurrentBlock("reading_time");
1610  $wtpl->setVariable(
1611  "READING_TIME",
1612  $this->lng->txt("copg_est_reading_time") . ": " .
1613  sprintf($this->lng->txt("copg_x_minutes"), $reading_time)
1614  );
1615  $wtpl->parseCurrentBlock();
1616  }
1617 
1618  $wtpl->setCurrentBlock("posting");
1619 
1620  $author = "";
1621  if ($this->id_type === self::REPOSITORY_NODE_ID) {
1622  $authors = array();
1623 
1624  $author_id = $item["author"];
1625  if ($author_id) {
1626  $authors[] = $this->profile_gui->getNamePresentation($author_id);
1627  }
1628 
1629  if (isset($item["editors"])) {
1630  foreach ($item["editors"] as $editor_id) {
1631  $authors[] = $this->profile_gui->getNamePresentation($editor_id);
1632  }
1633  }
1634 
1635  if ($authors) {
1636  $author = implode(", ", $authors) . " - ";
1637  }
1638  }
1639 
1640  // title
1641  $wtpl->setVariable("URL_TITLE", $preview);
1642  $wtpl->setVariable("TITLE", $item["title"]);
1643 
1644  $kw = ilBlogPosting::getKeywords($this->obj_id, $item["id"]);
1645  natcasesort($kw);
1646  $keywords = (count($kw) > 0)
1647  ? "<br>" . $this->lng->txt("keywords") . ": " . implode(", ", $kw)
1648  : "";
1649 
1650  $wtpl->setVariable("DATETIME", $author .
1651  ilDatePresentation::formatDate($item["created"]) . $keywords);
1652 
1653  // content
1654  $wtpl->setVariable("CONTENT", $snippet);
1655 
1656  $wtpl->parseCurrentBlock();
1657  }
1658 
1659  // permalink
1660  if ($a_cmd === "previewFullscreen") {
1661  $ref_id = ($this->id_type === self::WORKSPACE_NODE_ID)
1662  ? 0
1663  : $this->node_id;
1664  $wsp_id = ($this->id_type === self::WORKSPACE_NODE_ID)
1665  ? $this->node_id
1666  : 0;
1667  $this->gui->permanentLink($ref_id, $wsp_id)->setPermanentLink();
1668  }
1669 
1670  if (!$is_empty || $a_show_inactive) {
1671  return $wtpl->get();
1672  }
1673  return "";
1674  }
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
UIFactory $ui_factory
const IL_CAL_DATE
isAdmin()
Check if user has admin access (approve, may edit & deactivate all postings)
static getSnippet(int $a_id, bool $a_truncate=false, int $a_truncate_length=500, string $a_truncate_sign="...", bool $a_include_picture=false, int $a_picture_width=144, int $a_picture_height=144, string $a_export_directory=null)
Get first text paragraph of page.
static getKeywords(int $a_obj_id, int $a_posting_id)
UIRenderer $ui_renderer
buildExportLink(string $a_template, string $a_type, string $a_id)
Build export link.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderNavigation()

ilObjBlogGUI::renderNavigation ( string  $a_list_cmd = "render",
string  $a_posting_cmd = "preview",
string  $a_link_template = null,
bool  $a_show_inactive = false,
int  $a_blpg = 0 
)

Build navigation blocks.

Definition at line 2045 of file class.ilObjBlogGUI.php.

References $DIC, $ilSetting, $items, ilObject2GUI\$node_id, ilObjectGUI\$settings, ilObjectGUI\$ui_factory, ilObjectGUI\$ui_renderer, $url, CLIENT_ID, ilRSSButtonGUI\get(), ilRSSButtonGUI\ICON_RSS, ILIAS\Repository\lng(), ILIAS\Repository\object(), renderNavigationByAuthors(), renderNavigationByDate(), and renderNavigationByKeywords().

Referenced by executeCommand(), getHTML(), preview(), and render().

2051  : string {
2053  $a_items = $this->items;
2054  $blpg = ($a_blpg > 0)
2055  ? $a_blpg
2056  : $this->blpg;
2057 
2058  if ($this->object->getOrder()) {
2059  $order = array_flip($this->object->getOrder());
2060  } else {
2061  $order = array(
2062  "navigation" => 0
2063  ,"keywords" => 2
2064  ,"authors" => 1
2065  );
2066  }
2067 
2068  $wtpl = new ilTemplate("tpl.blog_list_navigation.html", true, true, "Modules/Blog");
2069 
2070  $blocks = array();
2071 
2072  // by date
2073  if (count($a_items)) {
2074  $blocks[$order["navigation"]] = array(
2075  $this->lng->txt("blog_navigation"),
2076  $this->renderNavigationByDate($a_items, $a_list_cmd, $a_posting_cmd, $a_link_template, $a_show_inactive, $a_blpg)
2077  );
2078  }
2079 
2080  if ($this->object->hasKeywords()) {
2081  // keywords
2082  $may_edit_keywords = ($blpg > 0 &&
2083  $this->blog_access->mayEditPosting($blpg) &&
2084  $a_list_cmd !== "preview" &&
2085  $a_list_cmd !== "gethtml" &&
2086  !$a_link_template);
2087  $keywords = $this->renderNavigationByKeywords($a_list_cmd, $a_show_inactive, (string) $a_link_template, $a_blpg);
2088  if ($keywords || $may_edit_keywords) {
2089  if (!$keywords) {
2090  $keywords = $this->lng->txt("blog_no_keywords");
2091  }
2092  $cmd = null;
2093  $blocks[$order["keywords"]] = array(
2094  $this->lng->txt("blog_keywords"),
2095  $keywords,
2096  $cmd
2097  ? array($cmd, $this->lng->txt("blog_edit_keywords"))
2098  : null
2099  );
2100  }
2101  }
2102 
2103  // is not part of (html) export
2104  if (!$a_link_template) {
2105  // authors
2106  if ($this->id_type === self::REPOSITORY_NODE_ID &&
2107  $this->object->hasAuthors()) {
2108  $authors = $this->renderNavigationByAuthors($a_items, $a_list_cmd, $a_show_inactive);
2109  if ($authors) {
2110  $blocks[$order["authors"]] = array($this->lng->txt("blog_authors"), $authors);
2111  }
2112  }
2113 
2114  // rss
2115  if ($this->object->hasRSS() &&
2116  $ilSetting->get('enable_global_profiles') &&
2117  $a_list_cmd === "preview") {
2118  // #10827
2119  $blog_id = $this->node_id;
2120  if ($this->id_type !== self::WORKSPACE_NODE_ID) {
2121  $blog_id .= "_cll";
2122  }
2123  $url = ILIAS_HTTP_PATH . "/feed.php?blog_id=" . $blog_id .
2124  "&client_id=" . rawurlencode(CLIENT_ID);
2125 
2126  $wtpl->setVariable("RSS_BUTTON", ilRSSButtonGUI::get(ilRSSButtonGUI::ICON_RSS, $url));
2127  }
2128  }
2129 
2130  if (count($blocks)) {
2131  global $DIC;
2132 
2133  $ui_factory = $DIC->ui()->factory();
2134  $ui_renderer = $DIC->ui()->renderer();
2135 
2136  ksort($blocks);
2137  foreach ($blocks as $block) {
2138  $title = $block[0];
2139 
2140  $content = $block[1];
2141 
2142  $secondary_panel = $ui_factory->panel()->secondary()->legacy($title, $ui_factory->legacy($content));
2143 
2144  if (isset($block[2]) && is_array($block[2])) {
2145  $link = $ui_factory->button()->shy($block[2][1], $block[2][0]);
2146  $secondary_panel = $secondary_panel->withFooter($link);
2147  }
2148 
2149  $wtpl->setCurrentBlock("block_bl");
2150  $wtpl->setVariable("BLOCK", $ui_renderer->render($secondary_panel));
2151  $wtpl->parseCurrentBlock();
2152  }
2153  }
2154 
2155  return $wtpl->get();
2156  }
renderNavigationByKeywords(string $a_list_cmd="render", bool $a_show_inactive=false, string $a_link_template="", int $a_blpg=0)
Build navigation by keywords block.
renderNavigationByDate(array $a_items, string $a_list_cmd="render", string $a_posting_cmd="preview", ?string $a_link_template=null, bool $a_show_inactive=false, int $a_blpg=0)
Build navigation by date block.
renderNavigationByAuthors(array $a_items, string $a_list_cmd="render", bool $a_show_inactive=false)
global $DIC
Definition: feed.php:28
UIFactory $ui_factory
const CLIENT_ID
Definition: constants.php:41
$url
Definition: ltiregstart.php:35
static get(string $a_type, string $a_href="")
Get icon html.
global $ilSetting
Definition: privfeed.php:18
UIRenderer $ui_renderer
ilSetting $settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderNavigationByAuthors()

ilObjBlogGUI::renderNavigationByAuthors ( array  $a_items,
string  $a_list_cmd = "render",
bool  $a_show_inactive = false 
)
protected

Definition at line 1944 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$ctrl, ilObjectGUI\$id, $url, ilPageObject\_lookupActive(), ilObjUser\_lookupName(), ilObject\_lookupType(), and ilUserUtil\getNamePresentation().

Referenced by renderNavigation().

1948  : string {
1949  $ilCtrl = $this->ctrl;
1950 
1951  $authors = array();
1952  foreach ($a_items as $month => $items) {
1953  foreach ($items as $item) {
1954  if (($a_show_inactive || ilBlogPosting::_lookupActive($item["id"], "blp"))) {
1955  if ($item["author"]) {
1956  $authors[] = $item["author"];
1957  }
1958 
1959  if (isset($item["editors"])) {
1960  foreach ($item["editors"] as $editor_id) {
1961  if ($editor_id != $item["author"]) {
1962  $authors[] = $editor_id;
1963  }
1964  }
1965  }
1966  }
1967  }
1968  }
1969 
1970  $authors = array_unique($authors);
1971 
1972  // filter out deleted users
1973  $authors = array_filter($authors, function ($id) {
1974  return ilObject::_lookupType($id) == "usr";
1975  });
1976 
1977  if (count($authors) > 1) {
1978  $list = array();
1979  foreach ($authors as $user_id) {
1980  if ($user_id) {
1981  $ilCtrl->setParameter($this, "ath", $user_id);
1982  $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1983  $ilCtrl->setParameter($this, "ath", "");
1984 
1985  $base_name = ilUserUtil::getNamePresentation($user_id);
1986  if (substr($base_name, 0, 1) == "[") {
1987  $name = ilUserUtil::getNamePresentation($user_id, true);
1988  $sort = $name;
1989  } else {
1991  $user_id,
1992  true,
1993  false,
1994  "",
1995  false,
1996  true,
1997  false
1998  );
1999  $name_arr = ilObjUser::_lookupName($user_id);
2000  $sort = $name_arr["lastname"] . " " . $name_arr["firstname"];
2001  }
2002 
2003  $idx = trim(strip_tags($sort)) . "///" . $user_id; // #10934
2004  $list[$idx] = array($name, $url);
2005  }
2006  }
2007  ksort($list);
2008 
2009  $wtpl = new ilTemplate("tpl.blog_list_navigation_authors.html", true, true, "Modules/Blog");
2010 
2011  $wtpl->setCurrentBlock("author");
2012  foreach ($list as $author) {
2013  $wtpl->setVariable("TXT_AUTHOR", $author[0]);
2014  $wtpl->setVariable("URL_AUTHOR", $author[1]);
2015  $wtpl->parseCurrentBlock();
2016  }
2017 
2018  return $wtpl->get();
2019  }
2020  return "";
2021  }
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static _lookupName(int $a_user_id)
lookup user name
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path='ilpublicuserprofilegui')
Default behaviour is:
$url
Definition: ltiregstart.php:35
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderNavigationByDate()

ilObjBlogGUI::renderNavigationByDate ( array  $a_items,
string  $a_list_cmd = "render",
string  $a_posting_cmd = "preview",
?string  $a_link_template = null,
bool  $a_show_inactive = false,
int  $a_blpg = 0 
)
protected

Build navigation by date block.

Definition at line 1691 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$ctrl, ilObjectGUI\$id, $month, $url, ilPageObject\_lookupActive(), ilCalendarUtil\_numericMonthToString(), buildExportLink(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilObjBlog\NAV_MODE_LIST, ILIAS\Repository\object(), and ILIAS\Repository\ui().

Referenced by renderNavigation().

1698  : string {
1699  $ilCtrl = $this->ctrl;
1700 
1701  $blpg = ($a_blpg > 0)
1702  ? $a_blpg
1703  : $this->blpg;
1704 
1705 
1706  // gather page active status
1707  foreach ($a_items as $month => $postings) {
1708  foreach (array_keys($postings) as $id) {
1709  $active = ilBlogPosting::_lookupActive($id, "blp");
1710  if (!$a_show_inactive && !$active) {
1711  unset($a_items[$month][$id]);
1712  } else {
1713  $a_items[$month][$id]["active"] = $active;
1714  }
1715  }
1716  if (!count($a_items[$month])) {
1717  unset($a_items[$month]);
1718  }
1719  }
1720 
1721  // list month (incl. postings)
1722  if ($this->object->getNavMode() === ilObjBlog::NAV_MODE_LIST || $a_link_template) {
1723  //$max_detail_postings = $this->object->getNavModeListPostings();
1724  $max_months = $this->object->getNavModeListMonths();
1725 
1726  $wtpl = new ilTemplate("tpl.blog_list_navigation_by_date.html", true, true, "Modules/Blog");
1727 
1728  $ilCtrl->setParameter($this, "blpg", "");
1729 
1730  $counter = $mon_counter = $last_year = 0;
1731  foreach ($a_items as $month => $postings) {
1732  if (!$a_link_template && $max_months && $mon_counter >= $max_months) {
1733  break;
1734  }
1735 
1736  $add_year = false;
1737  $year = substr($month, 0, 4);
1738  if (!$last_year || $year != $last_year) {
1739  // #13562
1740  $add_year = true;
1741  $last_year = $year;
1742  }
1743 
1744  $mon_counter++;
1745 
1746  $month_name = ilCalendarUtil::_numericMonthToString((int) substr($month, 5));
1747  if (!$a_link_template) {
1748  $ilCtrl->setParameter($this, "bmn", $month);
1749  $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1750  } else {
1751  $month_url = $this->buildExportLink($a_link_template, "list", (string) $month);
1752  }
1753 
1754  // list postings for month
1755  //if($counter < $max_detail_postings)
1756  if ($mon_counter <= $this->object->getNavModeListMonthsWithPostings()) {
1757  if ($add_year) {
1758  $wtpl->setCurrentBlock("navigation_year_details");
1759  $wtpl->setVariable("YEAR", $year);
1760  $wtpl->parseCurrentBlock();
1761  }
1762 
1763  foreach ($postings as $id => $posting) {
1764  //if($max_detail_postings && $counter >= $max_detail_postings)
1765  //{
1766  // break;
1767  //}
1768 
1769  $counter++;
1770 
1771  $caption = /* ilDatePresentation::formatDate($posting["created"], IL_CAL_DATETIME).
1772  ", ".*/ $posting["title"];
1773 
1774  if (!$a_link_template) {
1775  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", $month);
1776  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $id);
1777  $url = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", $a_posting_cmd);
1778  } else {
1779  $url = $this->buildExportLink($a_link_template, "posting", (string) $id);
1780  }
1781 
1782  if (!$posting["active"]) {
1783  $wtpl->setVariable("NAV_ITEM_DRAFT", $this->lng->txt("blog_draft"));
1784  } elseif ($this->object->hasApproval() && !$posting["approved"]) {
1785  $wtpl->setVariable("NAV_ITEM_APPROVAL", $this->lng->txt("blog_needs_approval"));
1786  }
1787 
1788  $wtpl->setCurrentBlock("navigation_item");
1789  $wtpl->setVariable("NAV_ITEM_URL", $url);
1790  $wtpl->setVariable("NAV_ITEM_CAPTION", $caption);
1791  $wtpl->parseCurrentBlock();
1792  }
1793 
1794  $wtpl->setCurrentBlock("navigation_month_details");
1795  $wtpl->setVariable("NAV_MONTH", $month_name);
1796  $wtpl->setVariable("URL_MONTH", $month_url);
1797  }
1798  // summarized month
1799  else {
1800  if ($add_year) {
1801  $wtpl->setCurrentBlock("navigation_year");
1802  $wtpl->setVariable("YEAR", $year);
1803  $wtpl->parseCurrentBlock();
1804  }
1805 
1806  $wtpl->setCurrentBlock("navigation_month");
1807  $wtpl->setVariable("MONTH_NAME", $month_name);
1808  $wtpl->setVariable("URL_MONTH", $month_url);
1809  $wtpl->setVariable("MONTH_COUNT", count($postings));
1810  }
1811  $wtpl->parseCurrentBlock();
1812  }
1813  if (!$a_link_template) {
1814  $this->ctrl->setParameterByClass(self::class, "bmn", null);
1815  $url = $this->ctrl->getLinkTargetByClass(self::class, $a_list_cmd);
1816  } else {
1817  $url = "index.html";
1818  }
1819 
1820  $wtpl->setVariable(
1821  "STARTING_PAGE",
1822  $this->ui->renderer()->render(
1823  $this->ui->factory()->link()->standard(
1824  $this->lng->txt("blog_starting_page"),
1825  $url
1826  )
1827  )
1828  );
1829  }
1830  // single month
1831  else {
1832  $wtpl = new ilTemplate("tpl.blog_list_navigation_month.html", true, true, "Modules/Blog");
1833 
1834  $ilCtrl->setParameter($this, "blpg", "");
1835 
1836  $month_options = array();
1837  foreach ($a_items as $month => $postings) {
1838  $month_name = $this->gui->presentation()->util()->getMonthPresentation($month);
1839 
1840  $month_options[$month] = $month_name;
1841 
1842  if ($month == $this->month) {
1843  if (!$a_link_template) {
1844  $ilCtrl->setParameter($this, "bmn", $month);
1845  $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1846  } else {
1847  $month_url = $this->buildExportLink($a_link_template, "list", (string) $month);
1848  }
1849 
1850  foreach ($postings as $id => $posting) {
1851  $caption = /* ilDatePresentation::formatDate($posting["created"], IL_CAL_DATETIME).
1852  ", ".*/ $posting["title"];
1853 
1854  if (!$a_link_template) {
1855  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", $month);
1856  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $id);
1857  $url = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", $a_posting_cmd);
1858  } else {
1859  $url = $this->buildExportLink($a_link_template, "posting", (string) $id);
1860  }
1861 
1862  if (!$posting["active"]) {
1863  $wtpl->setVariable("NAV_ITEM_DRAFT", $this->lng->txt("blog_draft"));
1864  } elseif ($this->object->hasApproval() && !$posting["approved"]) {
1865  $wtpl->setVariable("NAV_ITEM_APPROVAL", $this->lng->txt("blog_needs_approval"));
1866  }
1867 
1868  $wtpl->setCurrentBlock("navigation_item");
1869  $wtpl->setVariable("NAV_ITEM_URL", $url);
1870  $wtpl->setVariable("NAV_ITEM_CAPTION", $caption);
1871  $wtpl->parseCurrentBlock();
1872  }
1873 
1874  $wtpl->setCurrentBlock("navigation_month_details");
1875  if ($blpg > 0) {
1876  $wtpl->setVariable("NAV_MONTH", $month_name);
1877  $wtpl->setVariable("URL_MONTH", $month_url);
1878  }
1879  $wtpl->parseCurrentBlock();
1880  }
1881  }
1882 
1883  if ($blpg === 0) {
1884  $wtpl->setCurrentBlock("option_bl");
1885  foreach ($month_options as $value => $caption) {
1886  $wtpl->setVariable("OPTION_VALUE", $value);
1887  $wtpl->setVariable("OPTION_CAPTION", $caption);
1888  if ($value == $this->month) {
1889  $wtpl->setVariable("OPTION_SEL", ' selected="selected"');
1890  }
1891  $wtpl->parseCurrentBlock();
1892  }
1893 
1894  $wtpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this, $a_list_cmd));
1895  }
1896  }
1897  $ilCtrl->setParameter($this, "bmn", $this->month);
1898  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", "");
1899  return $wtpl->get();
1900  }
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static _numericMonthToString(int $a_month, bool $a_long=true)
numeric month to string
const NAV_MODE_LIST
$url
Definition: ltiregstart.php:35
buildExportLink(string $a_template, string $a_type, string $a_id)
Build export link.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderNavigationByKeywords()

ilObjBlogGUI::renderNavigationByKeywords ( string  $a_list_cmd = "render",
bool  $a_show_inactive = false,
string  $a_link_template = "",
int  $a_blpg = 0 
)
protected

Build navigation by keywords block.

Definition at line 1905 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$ctrl, $url, buildExportLink(), getKeywords(), and ilTagging\getRelevanceClass().

Referenced by renderNavigation().

1910  : string {
1911  $ilCtrl = $this->ctrl;
1912 
1913  $blpg = ($a_blpg > 0)
1914  ? $a_blpg
1915  : $this->blpg;
1916 
1917  $keywords = $this->getKeywords($a_show_inactive, $blpg);
1918  if ($keywords) {
1919  $wtpl = new ilTemplate("tpl.blog_list_navigation_keywords.html", true, true, "Modules/Blog");
1920 
1921  $max = max($keywords);
1922 
1923  $wtpl->setCurrentBlock("keyword");
1924  foreach ($keywords as $keyword => $counter) {
1925  if (!$a_link_template) {
1926  $ilCtrl->setParameter($this, "kwd", urlencode((string) $keyword)); // #15885
1927  $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1928  $ilCtrl->setParameter($this, "kwd", "");
1929  } else {
1930  $url = $this->buildExportLink($a_link_template, "keyword", (string) $keyword);
1931  }
1932 
1933  $wtpl->setVariable("TXT_KEYWORD", $keyword);
1934  $wtpl->setVariable("CLASS_KEYWORD", ilTagging::getRelevanceClass($counter, $max));
1935  $wtpl->setVariable("URL_KEYWORD", $url);
1936  $wtpl->parseCurrentBlock();
1937  }
1938 
1939  return $wtpl->get();
1940  }
1941  return "";
1942  }
static getRelevanceClass(int $cnt, int $max)
$url
Definition: ltiregstart.php:35
getKeywords(bool $a_show_inactive, ?int $a_posting_id=null)
Get keywords for single posting or complete blog.
buildExportLink(string $a_template, string $a_type, string $a_id)
Build export link.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderToolbarNavigation()

ilObjBlogGUI::renderToolbarNavigation ( array  $a_items,
bool  $single_posting = false 
)

Toolbar navigation.

Definition at line 2026 of file class.ilObjBlogGUI.php.

Referenced by executeCommand(), and preview().

2029  : void {
2030  $nav_renderer = $this->gui->navigation()->toolbarNavigationRenderer();
2031  $nav_renderer->renderToolbarNavigation(
2032  $this->blog_access,
2033  $a_items,
2034  $this->blpg,
2035  $single_posting,
2036  $this->prtf_embed,
2037  $this->month,
2038  $this->user_page
2039  );
2040  }
+ Here is the caller graph for this function:

◆ setContentStyleSheet()

ilObjBlogGUI::setContentStyleSheet ( ilGlobalTemplateInterface  $a_tpl = null)

Definition at line 2662 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$tpl, ilGlobalTemplateInterface\addCss(), and ILIAS\Repository\object().

Referenced by executeCommand(), render(), and renderFullScreen().

2664  : void {
2665  $tpl = $this->tpl;
2666 
2667  if ($a_tpl) {
2668  $ctpl = $a_tpl;
2669  } else {
2670  $ctpl = $tpl;
2671  }
2672 
2673  $this->content_style_gui->addCss(
2674  $ctpl,
2675  $this->object->getRefId(),
2676  $this->object->getId()
2677  );
2678  }
ilGlobalTemplateInterface $tpl
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setNotification()

ilObjBlogGUI::setNotification ( )
protected

Definition at line 2350 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$ctrl, ilObjectGUI\$obj_id, ilObject2GUI\$user, ilNotification\setNotification(), and ilNotification\TYPE_BLOG.

2350  : void
2351  {
2352  $ilUser = $this->user;
2353  $ilCtrl = $this->ctrl;
2354 
2355  switch ($this->ntf) {
2356  case 1:
2358  break;
2359 
2360  case 2:
2362  break;
2363  }
2364 
2365  $ilCtrl->redirect($this, "preview");
2366  }
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
+ Here is the call graph for this function:

◆ setSettingsSubTabs()

ilObjBlogGUI::setSettingsSubTabs ( string  $a_active)
protected

Definition at line 211 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$access, ilObjectGUI\$tree, ilRBACAccessHandler\checkAccess(), ilTree\checkForParentType(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by executeCommand(), and initEditCustomForm().

211  : void
212  {
213  $tree = $this->tree;
215 
216  // general properties
217  $this->tabs_gui->addSubTab(
218  "properties",
219  $this->lng->txt("blog_properties"),
220  $this->ctrl->getLinkTarget($this, 'edit')
221  );
222 
223  $this->tabs_gui->addSubTab(
224  "style",
225  $this->lng->txt("obj_sty"),
226  $this->ctrl->getLinkTargetByClass("ilobjectcontentstylesettingsgui", "")
227  );
228 
229  // notification settings for blogs in courses and groups
230  if ($this->id_type === self::REPOSITORY_NODE_ID) {
231  $grp_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
232  $crs_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
233 
234  if ($grp_ref_id > 0 || $crs_ref_id > 0) {
235  if ($access->checkAccess('write', '', $this->ref_id)) {
236  $this->tabs_gui->addSubTab(
237  'notifications',
238  $this->lng->txt("notifications"),
239  $this->ctrl->getLinkTargetByClass("ilobjnotificationsettingsgui", '')
240  );
241  }
242  }
243  }
244 
245  $this->tabs_gui->activateSubTab($a_active);
246  }
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance) ...
checkForParentType(int $a_ref_id, string $a_type, bool $a_exclude_source_check=false)
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentTyp...
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilObjBlogGUI::setTabs ( )
protected

Definition at line 503 of file class.ilObjBlogGUI.php.

References $help, ilObject2GUI\$lng, $prtf_embed, ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), and ilLanguage\txt().

Referenced by executeCommand().

503  : void
504  {
505  $lng = $this->lng;
506  $ilHelp = $this->help;
507 
508  if ($this->id_type === self::WORKSPACE_NODE_ID) {
509  $this->ctrl->setParameter($this, "wsp_id", $this->node_id);
510  }
511 
512  $ilHelp->setScreenIdComponent("blog");
513 
514  if ($this->checkPermissionBool("read")) {
515  $this->ctrl->setParameterByClass(self::class, "bmn", null);
516  $this->tabs_gui->addTab(
517  "content",
518  $lng->txt("content"),
519  $this->ctrl->getLinkTarget($this, "")
520  );
521  }
522  if ($this->checkPermissionBool("read") && !$this->prtf_embed) {
523  $this->tabs_gui->addTab(
524  "id_info",
525  $lng->txt("info_short"),
526  $this->ctrl->getLinkTargetByClass(array("ilobjbloggui", "ilinfoscreengui"), "showSummary")
527  );
528  }
529 
530  if ($this->checkPermissionBool("write")) {
531  $this->tabs_gui->addTab(
532  "settings",
533  $lng->txt("settings"),
534  $this->ctrl->getLinkTarget($this, "edit")
535  );
536 
537  if (!$this->prtf_embed) {
538  if ($this->id_type === self::REPOSITORY_NODE_ID) {
539  $this->tabs_gui->addTab(
540  "contributors",
541  $lng->txt("blog_contributors"),
542  $this->ctrl->getLinkTarget($this, "contributors")
543  );
544  }
545 
546  if ($this->id_type === self::REPOSITORY_NODE_ID) {
547  $this->tabs_gui->addTab(
548  "export",
549  $lng->txt("export"),
550  $this->ctrl->getLinkTargetByClass("ilexportgui", "")
551  );
552  }
553  }
554  }
555 
556  if (!$this->prtf_embed) {
557  if ($this->blog_access->mayContribute()) {
558  $this->tabs_gui->addNonTabbedLink(
559  "preview",
560  $lng->txt("blog_preview"),
561  $this->ctrl->getLinkTarget($this, "preview")
562  );
563  }
564  parent::setTabs();
565  }
566  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ triggerAssignmentTool()

ilObjBlogGUI::triggerAssignmentTool ( )
protected

Definition at line 889 of file class.ilObjBlogGUI.php.

References ilExerciseGSToolProvider\EXC_ASS_BUTTONS, ilExerciseGSToolProvider\EXC_ASS_IDS, and ilExerciseGSToolProvider\SHOW_EXC_ASSIGNMENT_INFO.

Referenced by executeCommand().

889  : void
890  {
891  $be = $this->domain->exercise($this->node_id);
892  $be_gui = $this->gui->exercise()->ilBlogExerciseGUI($this->node_id);
893  $assignments = $be->getAssignmentsOfBlog();
894  if (count($assignments) > 0) {
895  $ass_ids = array_map(static function ($i) {
896  return $i["ass_id"];
897  }, $assignments);
898  $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::SHOW_EXC_ASSIGNMENT_INFO, true);
899  $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::EXC_ASS_IDS, $ass_ids);
900  $this->tool_context->current()->addAdditionalData(
902  $be_gui->getActionButtons()
903  );
904  }
905  }
+ Here is the caller graph for this function:

◆ updateCustom()

ilObjBlogGUI::updateCustom ( ilPropertyFormGUI  $form)
protected

Definition at line 455 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$lng, ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), ilObjectGUI\getObjectService(), and ilLanguage\txt().

455  : void
456  {
457  $lng = $this->lng;
458  $obj_service = $this->getObjectService();
459 
460  if ($this->id_type === self::REPOSITORY_NODE_ID) {
461  $this->object->setApproval((bool) $form->getInput("approval"));
462  $this->object->setAuthors((bool) $form->getInput("nav_authors"));
463  $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTileImage();
464  }
465  $this->object->setKeywords((bool) $form->getInput("keywords"));
466  $this->object->setNotesStatus((bool) $form->getInput("notes"));
467  $this->object->setProfilePicture((bool) $form->getInput("ppic"));
468  $this->object->setRSS((bool) $form->getInput("rss"));
469  $this->object->setAbstractShorten((bool) $form->getInput("abss"));
470  $this->object->setAbstractShortenLength((int) $form->getInput("abssl"));
471  $this->object->setAbstractImage((bool) $form->getInput("absi"));
472  $this->object->setAbstractImageWidth((int) $form->getInput("absiw"));
473  $this->object->setAbstractImageHeight((int) $form->getInput("absih"));
474  $this->object->setNavMode((int) $form->getInput("nav"));
475  $this->object->setNavModeListMonthsWithPostings((int) $form->getInput("nav_list_mon_with_post"));
476  $this->object->setNavModeListMonths((int) $form->getInput("nav_list_mon"));
477  $this->object->setOverviewPostings((int) $form->getInput("ov_list_post_num"));
478  $this->reading_time_gui->saveSettingFromForm($form);
479 
480  $order = (array) $form->getInput("order");
481 
482  foreach ($order as $idx => $value) {
483  if ($value == $lng->txt("blog_navigation")) {
484  $order[$idx] = "navigation";
485  } elseif ($value == $lng->txt("blog_keywords")) {
486  $order[$idx] = "keywords";
487  } else {
488  $order[$idx] = "authors";
489  }
490  }
491  $this->object->setOrder($order);
492  // banner field is optional
493  $banner = $form->getItemByPostVar("banner");
494  if ($banner) {
495  if ($_FILES["banner"]["tmp_name"]) {
496  $this->object->uploadImage($_FILES["banner"]);
497  } elseif ($banner->getDeletionFlag()) {
498  $this->object->deleteImage();
499  }
500  }
501  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getItemByPostVar(string $a_post_var)
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
+ Here is the call graph for this function:

Field Documentation

◆ $apid

int ilObjBlogGUI::$apid = 0
protected

Definition at line 64 of file class.ilObjBlogGUI.php.

◆ $author

int ilObjBlogGUI::$author = null
protected

Definition at line 53 of file class.ilObjBlogGUI.php.

◆ $blog_access

ILIAS Blog Access BlogAccess ilObjBlogGUI::$blog_access
protected

Definition at line 36 of file class.ilObjBlogGUI.php.

◆ $blog_request

StandardGUIRequest ilObjBlogGUI::$blog_request
protected

Definition at line 44 of file class.ilObjBlogGUI.php.

Referenced by __construct().

◆ $blpg

int ilObjBlogGUI::$blpg = 0
protected

Definition at line 57 of file class.ilObjBlogGUI.php.

Referenced by getNotesSubId(), and initHeaderAction().

◆ $content_style_domain

ILIAS Style Content Object ObjectFacade ilObjBlogGUI::$content_style_domain
protected

Definition at line 72 of file class.ilObjBlogGUI.php.

◆ $content_style_gui

ILIAS Style Content GUIService ilObjBlogGUI::$content_style_gui
protected

Definition at line 71 of file class.ilObjBlogGUI.php.

◆ $disable_notes

bool ilObjBlogGUI::$disable_notes = false
protected

Definition at line 67 of file class.ilObjBlogGUI.php.

Referenced by executeCommand(), initHeaderAction(), and renderList().

◆ $domain

ILIAS Blog InternalDomainService ilObjBlogGUI::$domain
protected

Definition at line 37 of file class.ilObjBlogGUI.php.

◆ $edt

string ilObjBlogGUI::$edt
protected

Definition at line 56 of file class.ilObjBlogGUI.php.

◆ $gtp

int ilObjBlogGUI::$gtp = 0
protected

Definition at line 55 of file class.ilObjBlogGUI.php.

Referenced by executeCommand().

◆ $gui

ILIAS Blog InternalGUIService ilObjBlogGUI::$gui
protected

Definition at line 38 of file class.ilObjBlogGUI.php.

Referenced by __construct().

◆ $help

ilHelpGUI ilObjBlogGUI::$help
protected

Definition at line 45 of file class.ilObjBlogGUI.php.

Referenced by setTabs().

◆ $http

ILIAS HTTP Services ilObjBlogGUI::$http
protected

Definition at line 69 of file class.ilObjBlogGUI.php.

◆ $items

array ilObjBlogGUI::$items = []
protected

Definition at line 51 of file class.ilObjBlogGUI.php.

Referenced by buildPostingList(), getItems(), and renderNavigation().

◆ $keyword

string ilObjBlogGUI::$keyword = ""
protected

Definition at line 52 of file class.ilObjBlogGUI.php.

Referenced by getKeywords(), and renderList().

◆ $month

string ilObjBlogGUI::$month = ""
protected

◆ $month_default

bool ilObjBlogGUI::$month_default = false
protected

Definition at line 54 of file class.ilObjBlogGUI.php.

◆ $nav_history

ilNavigationHistory ilObjBlogGUI::$nav_history
protected

Definition at line 47 of file class.ilObjBlogGUI.php.

Referenced by executeCommand().

◆ $new_type

string ilObjBlogGUI::$new_type = ""
protected

Definition at line 65 of file class.ilObjBlogGUI.php.

◆ $notes

ILIAS Notes Service ilObjBlogGUI::$notes
protected

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

◆ $ntf

int ilObjBlogGUI::$ntf = 0
protected

Definition at line 63 of file class.ilObjBlogGUI.php.

◆ $old_nr

int ilObjBlogGUI::$old_nr = 0
protected

Definition at line 58 of file class.ilObjBlogGUI.php.

◆ $ppage

int ilObjBlogGUI::$ppage = 0
protected

Definition at line 59 of file class.ilObjBlogGUI.php.

◆ $profile

ILIAS Repository Profile ProfileAdapter ilObjBlogGUI::$profile
protected

Definition at line 35 of file class.ilObjBlogGUI.php.

◆ $profile_gui

ILIAS Repository Profile ProfileGUI ilObjBlogGUI::$profile_gui
protected

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

◆ $prt_id

int ilObjBlogGUI::$prt_id = 0
protected

Definition at line 66 of file class.ilObjBlogGUI.php.

◆ $prtf_embed

bool ilObjBlogGUI::$prtf_embed = false

Definition at line 61 of file class.ilObjBlogGUI.php.

Referenced by setTabs().

◆ $prvm

string ilObjBlogGUI::$prvm
protected

Definition at line 62 of file class.ilObjBlogGUI.php.

◆ $rbacadmin

ilRbacAdmin ilObjBlogGUI::$rbacadmin
protected

Definition at line 48 of file class.ilObjBlogGUI.php.

Referenced by addContributor(), and removeContributor().

◆ $reading_time_gui

ILIAS Blog ReadingTime BlogSettingsGUI ilObjBlogGUI::$reading_time_gui
protected

Definition at line 41 of file class.ilObjBlogGUI.php.

◆ $reading_time_manager

ILIAS Blog ReadingTime ReadingTimeManager ilObjBlogGUI::$reading_time_manager
protected

Definition at line 42 of file class.ilObjBlogGUI.php.

◆ $rendered_content

string ilObjBlogGUI::$rendered_content = ""
protected

Definition at line 39 of file class.ilObjBlogGUI.php.

Referenced by getRenderedContent().

◆ $tabs

ilTabsGUI ilObjBlogGUI::$tabs
protected

◆ $tool_context

ContextServices ilObjBlogGUI::$tool_context
protected

Definition at line 68 of file class.ilObjBlogGUI.php.

◆ $ui

ILIAS DI UIServices ilObjBlogGUI::$ui
protected

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

◆ $user_page

int ilObjBlogGUI::$user_page = 0
protected

Definition at line 60 of file class.ilObjBlogGUI.php.


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