ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjBlogGUI Class Reference

Class ilObjBlogGUI. More...

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

Public Member Functions

 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 
 getType ()
 
 getItems ()
 Get items. More...
 
 setTabs ()
 
 executeCommand ()
 
 infoScreen ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 infoScreenForward ()
 show information screen More...
 
 createPosting ()
 Create new posting. More...
 
 render ()
 Render object context. More...
 
 getHTML ()
 Return embeddable HTML chunk. More...
 
 preview ()
 Render fullscreen presentation. More...
 
 export ()
 Build and deliver export file. More...
 
 renderFullScreen ($a_content, $a_navigation)
 Build fullscreen context. More...
 
 renderFullscreenHeader ($a_tpl, $a_user_id, $a_export=false)
 Render banner, user name. More...
 
 renderList (array $items, $a_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_export_directory=null)
 Build posting month list. More...
 
 renderToolbarNavigation ($a_items, $single_posting=false)
 Toolbar navigation. More...
 
 getNextMonth ($a_items)
 Get next month. More...
 
 getPreviousMonth ($a_items)
 Get next month. More...
 
 getLatestMonth ($a_items)
 Get next month. More...
 
 getNextPosting ($a_items)
 Get next posting. More...
 
 getPreviousPosting ($a_items)
 Get previous posting. More...
 
 getLatestPosting ($a_items)
 Get previous posting. More...
 
 renderNavigation ($a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
 Build navigation blocks. More...
 
 getKeywords ($a_show_inactive, $a_posting_id=null)
 Get keywords for single posting or complete blog. More...
 
 buildExportFile ()
 Build export file. More...
 
 getNotesSubId ()
 
 disableNotes ($a_value=false)
 
 filterItemsByKeyWord (array $a_items, $a_keyword)
 
 addLocatorItems ()
 
 approve ()
 
 contributors ()
 
 addUserFromAutoComplete ()
 Autocomplete submit. More...
 
 addContributor ($a_user_ids=array(), $a_user_type=null)
 Centralized method to add contributors. More...
 
 confirmRemoveContributor ()
 Used in ilContributorTableGUI. More...
 
 removeContributor ()
 Used in ilContributorTableGUI. More...
 
 deactivateAdmin ()
 
 setContentStyleSheet ($a_tpl=null)
 
 editStyleProperties ()
 
 initStylePropertiesForm ()
 
 createStyle ()
 
 editStyle ()
 
 deleteStyle ()
 
 saveStyleSettings ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 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 ($a_mode=true)
 
 getCreationMode ()
 
 prepareOutput ($a_show_subobjects=true)
 
 isVisible ($a_ref_id, $a_type)
 
 trash ()
 
 undelete ()
 
 cancelDelete ()
 
 removeFromSystem ()
 
 cloneAll ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 Deleted in ilObject. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 Import. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ilDesktopItemHandling
 addToDeskObject ()
 Add desktop item public. More...
 
 removeFromDeskObject ()
 Remove from desktop public. More...
 

Static Public Member Functions

static lookupSubObjectTitle ($a_blog_id, $a_posting_id)
 Get title for blog posting (used in ilNotesGUI) More...
 
static _goto ($a_target)
 Deep link. More...
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $a_obj, $a_callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Data Fields

 $prtf_embed = false
 
- Data Fields inherited from ilObject2GUI
 $tree
 
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 COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 initCreationForms ($a_new_type)
 
 afterSave (ilObject $a_new_object)
 
 setSettingsSubTabs ($a_active)
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 
 getEditFormCustomValues (array &$a_values)
 
 updateCustom (ilPropertyFormGUI $a_form)
 
 triggerAssignmentTool ()
 Trigger assignment tool. More...
 
 getListItems ($a_show_inactive=false)
 Filter blog postings by month, keyword or author. More...
 
 buildEmbedded ($a_content, $a_nav)
 Combine content (list/posting) and navigation to html chunk. More...
 
 buildPostingList ($a_obj_id)
 Gather all blog postings. More...
 
 buildExportLink ($a_template, $a_type, $a_id)
 Build export link. More...
 
 renderNavigationByDate (array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
 Build navigation by date block. More...
 
 renderNavigationByKeywords ( $a_list_cmd="render", $a_show_inactive=false, $a_link_template=false, $a_blpg=0)
 Build navigation by keywords block. More...
 
 renderNavigationByAuthors (array $a_items, $a_list_cmd="render", $a_show_inactive=false)
 
 addHeaderActionForCommand ($a_cmd)
 
 initHeaderAction ($sub_type=null, $sub_id=null, $a_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...
 
 mayEditPosting ($a_posting_id, $a_author_id=null)
 Check if user may edit posting. More...
 
 mayContribute ()
 Check if user may contribute at all. More...
 
- 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 ()
 Get access handler. More...
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 setTitleAndDescription ()
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 
 setTargetFrame ($a_cmd, $a_target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 
 showActions ()
 
 getTabs ()
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget ($a_append=null, $a_center=false)
 
 handleAutoRating (ilObject $a_new_obj)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 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 public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $help
 
 $tabs
 
 $nav_history
 
 $main_menu
 
 $rbacadmin
 
 $month
 
 $items
 
 $keyword
 
 $author
 
 $month_default
 
 $gtp
 
 $edt
 
 $blpg
 
 $old_nr
 
 $ppage
 
 $user_page
 
 $prvm
 
 $ntf
 
 $apid
 
 $new_type
 
 $prt_id
 
 $tool_context
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References $_GET, $DIC, $ilCtrl, ilObjectGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), buildPostingList(), help(), ilBlogPosting\lookupBlogId(), settings(), ilUtil\stripSlashes(), and user().

122  {
123  global $DIC;
124 
125  $this->settings = $DIC->settings();
126  $this->help = $DIC["ilHelp"];
127  $this->tabs = $DIC->tabs();
128  $this->nav_history = $DIC["ilNavigationHistory"];
129  $this->user = $DIC->user();
130  $this->toolbar = $DIC->toolbar();
131  $this->tree = $DIC->repositoryTree();
132  $this->locator = $DIC["ilLocator"];
133  $this->main_menu = $DIC["ilMainMenu"];
134  $this->rbacreview = $DIC->rbac()->review();
135  $this->rbacadmin = $DIC->rbac()->admin();
136 
137  $lng = $DIC->language();
138  $ilCtrl = $DIC->ctrl();
139 
140  $this->gtp = (int) $_GET["gtp"];
141  $this->edt = $_GET["edt"];
142  $this->blpg = (int) $_REQUEST["blpg"];
143  $this->old_nr = (int) $_GET["old_nr"];
144  $this->ppage = (int) $_GET["ppage"];
145  $this->user_page = (int) $_REQUEST["user_page"];
146  $this->new_type = ilUtil::stripSlashes($_REQUEST["new_type"]);
147  $this->prvm = ilUtil::stripSlashes($_REQUEST["prvm"]);
148  $this->ntf = (int) $_GET["ntf"];
149  $this->apid = (int) $_GET["apid"];
150  $this->month = ilUtil::stripSlashes($_REQUEST["bmn"]);
151  $this->keyword = ilUtil::stripSlashes($_REQUEST["kwd"]);
152  $this->author = (int) $_REQUEST["ath"];
153  $this->prt_id = (int) $_REQUEST["prt_id"];
154 
155  $this->tool_context = $DIC->globalScreen()->tool()->context();
156 
157  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
158 
159  if ($_REQUEST["blpg"] > 0 && ilBlogPosting::lookupBlogId($_REQUEST["blpg"]) != $this->object->getId()) {
160  throw new ilException("Posting ID does not match blog.");
161  }
162 
163  if ($this->object) {
164  // gather postings by month
165  $this->items = $this->buildPostingList($this->object->getId());
166  if ($this->items) {
167  // current month (if none given or empty)
168  if (!$this->month || !$this->items[$this->month]) {
169  $this->month = array_keys($this->items);
170  $this->month = array_shift($this->month);
171  $this->month_default = true;
172  }
173  }
174 
175  $ilCtrl->setParameter($this, "bmn", $this->month);
176  }
177 
178  $lng->loadLanguageModule("blog");
179  $ilCtrl->saveParameter($this, "prvm");
180  }
settings()
Definition: settings.php:2
static lookupBlogId($a_posting_id)
Lookup blog id.
$_GET["client_id"]
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
help()
Definition: help.php:2
buildPostingList($a_obj_id)
Gather all blog postings.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjBlogGUI::_goto (   $a_target)
static

Deep link.

Parameters
string$a_target

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

References ilObjectGUI\$access, $DIC, and $ilCtrl.

2990  {
2991  global $DIC;
2992 
2993  $ilCtrl = $DIC->ctrl();
2994  $access = $DIC->access();
2995 
2996  if (substr($a_target, -3) == "wsp") {
2997  $id = explode("_", $a_target);
2998 
2999  $ilCtrl->setTargetScript("ilias.php");
3000  $ilCtrl->initBaseClass("ilSharedResourceGUI");
3001  $ilCtrl->setParameterByClass("ilSharedResourceGUI", "wsp_id", $id[0]);
3002 
3003  if (sizeof($id) >= 2) {
3004  if (is_numeric($id[1])) {
3005  $ilCtrl->setParameterByClass("ilSharedResourceGUI", "gtp", $id[1]);
3006  } else {
3007  $ilCtrl->setParameterByClass("ilSharedResourceGUI", "kwd", $id[1]);
3008  }
3009  if ($id[2] == "edit") {
3010  $ilCtrl->setParameterByClass("ilSharedResourceGUI", "edt", $id[2]);
3011  }
3012  }
3013  $ilCtrl->redirectByClass("ilSharedResourceGUI", "");
3014  } else {
3015  $id = explode("_", $a_target);
3016 
3017  $ilCtrl->setTargetScript("ilias.php");
3018  $ilCtrl->initBaseClass("ilRepositoryGUI");
3019  $ilCtrl->setParameterByClass("ilRepositoryGUI", "ref_id", $id[0]);
3020 
3021  if (sizeof($id) >= 2) {
3022  if (is_numeric($id[1])) {
3023  $ilCtrl->setParameterByClass("ilRepositoryGUI", "gtp", $id[1]);
3024  } else {
3025  $ilCtrl->setParameterByClass("ilRepositoryGUI", "kwd", $id[1]);
3026  }
3027 
3028  if ($id[2] == "edit") {
3029  $ilCtrl->setParameterByClass("ilRepositoryGUI", "edt", $id[2]);
3030  }
3031  }
3032  if ($access->checkAccess("read", "", $id[0])) {
3033  $ilCtrl->redirectByClass("ilRepositoryGUI", "preview");
3034  }
3035  if ($access->checkAccess("visible", "", $id[0])) {
3036  $ilCtrl->redirectByClass("ilRepositoryGUI", "infoScreen");
3037  }
3038  }
3039  }
global $ilCtrl
Definition: ilias.php:18
$DIC
Definition: xapitoken.php:46

◆ addContributor()

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

Centralized method to add contributors.

Parameters
array$a_user_ids

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

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $rbacadmin, ilObjectGUI\$rbacreview, ilObject2GUI\checkPermissionBool(), contributors(), and ilUtil\sendFailure().

Referenced by addUserFromAutoComplete().

2752  {
2753  $ilCtrl = $this->ctrl;
2754  $lng = $this->lng;
2757 
2758  if (!$this->checkPermissionBool("write")) {
2759  return;
2760  }
2761 
2762  if (!count($a_user_ids) || !$a_user_type) {
2763  ilUtil::sendFailure($lng->txt("no_checkbox"));
2764  return $this->contributors();
2765  }
2766 
2767  // get contributor role
2768  $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
2769  if (!in_array($a_user_type, $local_roles)) {
2770  ilUtil::sendFailure($lng->txt("missing_perm"));
2771  return $this->contributors();
2772  }
2773 
2774  foreach ($a_user_ids as $user_id) {
2775  if (!$rbacreview->isAssigned($user_id, $a_user_type)) {
2776  $rbacadmin->assignUser($a_user_type, $user_id);
2777  }
2778  }
2779 
2780  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
2781  $ilCtrl->redirect($this, "contributors");
2782  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addHeaderActionForCommand()

ilObjBlogGUI::addHeaderActionForCommand (   $a_cmd)
protected

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

References ilObjectGUI\$ctrl, $ilCtrl, $ilUser, ilObjectGUI\$user, initHeaderAction(), and ilObjectGUI\insertHeaderAction().

Referenced by executeCommand().

2410  {
2411  $ilUser = $this->user;
2412  $ilCtrl = $this->ctrl;
2413 
2414  // preview?
2415  if ($a_cmd == "preview" || $a_cmd == "previewFullscreen" || $this->prvm) {
2416  // notification
2417  if ($ilUser->getId() != ANONYMOUS_USER_ID) {
2418  if (!$this->prvm) {
2419  $ilCtrl->setParameter($this, "prvm", "fsc");
2420  }
2421  $this->insertHeaderAction($this->initHeaderAction(null, null, true));
2422  if (!$this->prvm) {
2423  $ilCtrl->setParameter($this, "prvm", "");
2424  }
2425  }
2426  } else {
2427  return parent::addHeaderAction();
2428  }
2429  }
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
insertHeaderAction($a_list_gui)
Insert header action into main template.
initHeaderAction($sub_type=null, $sub_id=null, $a_is_preview=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLocatorItems()

ilObjBlogGUI::addLocatorItems ( )

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

References ilObjectGUI\$locator, and ilObject2GUI\$node_id.

2648  {
2649  $ilLocator = $this->locator;
2650 
2651  if (is_object($this->object)) {
2652  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "preview"), "", $this->node_id);
2653  }
2654  }

◆ addUserFromAutoComplete()

ilObjBlogGUI::addUserFromAutoComplete ( )

Autocomplete submit.

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

References $_POST, ilObjectGUI\$lng, ilObjectGUI\$user, ilObjUser\_lookupId(), addContributor(), contributors(), ilUtil\sendFailure(), and ilUtil\stripSlashes().

2719  {
2720  $lng = $this->lng;
2721 
2722  $user_login = ilUtil::stripSlashes($_POST['user_login']);
2723  $user_type = ilUtil::stripSlashes($_POST["user_type"]);
2724 
2725  if (!strlen(trim($user_login))) {
2726  ilUtil::sendFailure($lng->txt('msg_no_search_string'));
2727  return $this->contributors();
2728  }
2729  $users = explode(',', $user_login);
2730 
2731  $user_ids = array();
2732  foreach ($users as $user) {
2733  $user_id = ilObjUser::_lookupId($user);
2734 
2735  if (!$user_id) {
2736  ilUtil::sendFailure($lng->txt('user_not_known'));
2737  return $this->contributors();
2738  }
2739 
2740  $user_ids[] = $user_id;
2741  }
2742 
2743  return $this->addContributor($user_ids, $user_type);
2744  }
static _lookupId($a_user_str)
Lookup id by login.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
addContributor($a_user_ids=array(), $a_user_type=null)
Centralized method to add contributors.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ afterSave()

ilObjBlogGUI::afterSave ( ilObject  $a_new_object)
protected

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

References ilObjectGUI\$ctrl, and $ilCtrl.

211  {
213 
214  ilUtil::sendSuccess($this->lng->txt("object_added"), true);
215  $ilCtrl->redirect($this, "");
216  }
global $ilCtrl
Definition: ilias.php:18

◆ approve()

ilObjBlogGUI::approve ( )

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

References isAdmin().

2657  {
2658  if ($this->isAdmin() && $this->apid > 0) {
2659  $post = new ilBlogPosting($this->apid);
2660  $post->setApproved(true);
2661  $post->setBlogNodeId($this->node_id, ($this->id_type == self::WORKSPACE_NODE_ID));
2662  $post->update(true, false, true, "new"); // #13434
2663 
2664  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
2665  }
2666 
2667  $this->ctrl->redirect($this, "render");
2668  }
Class ilBlogPosting.
isAdmin()
Check if user has admin access (approve, may edit & deactivate all postings)
+ Here is the call graph for this function:

◆ buildEmbedded()

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

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

Parameters
string$a_content
string$a_nav
Returns
string

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

References $a_content.

Referenced by executeCommand(), and getHTML().

1197  {
1198  $wtpl = new ilTemplate("tpl.blog_embedded.html", true, true, "Modules/Blog");
1199  $wtpl->setVariable("VAL_LIST", $a_content);
1200  $wtpl->setVariable("VAL_NAVIGATION", $a_nav);
1201  return $wtpl->get();
1202  }
$a_content
Definition: workflow.php:93
+ Here is the caller graph for this function:

◆ buildExportFile()

ilObjBlogGUI::buildExportFile ( )

Build export file.

Returns
string

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

References ilExport\_createExportDirectory(), and ilExport\_getExportDirectory().

Referenced by export().

2388  {
2389  // create export file
2390  ilExport::_createExportDirectory($this->object->getId(), "html", "blog");
2391  $exp_dir = ilExport::_getExportDirectory($this->object->getId(), "html", "blog");
2392 
2393  $subdir = $this->object->getType() . "_" . $this->object->getId();
2394 
2395  $blog_export = new \ILIAS\Blog\Export\BlogHtmlExport($this, $exp_dir, $subdir);
2396  return $blog_export->exportHTML();
2397  }
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildExportLink()

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

Build export link.

Parameters

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

References $a_type, and getKeywords().

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

1691  {
1692  return \ILIAS\Blog\Export\BlogHtmlExport::buildExportLink($a_template, $a_type, $a_id, $this->getKeywords(false));
1693  }
$a_type
Definition: workflow.php:92
getKeywords($a_show_inactive, $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 (   $a_obj_id)
protected

Gather all blog postings.

Parameters
int$a_obj_id
Returns
array

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

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

Referenced by __construct().

1360  {
1361  $author_found = false;
1362 
1363  $items = array();
1364  foreach (ilBlogPosting::getAllPostings($a_obj_id) as $posting) {
1365  if ($this->author &&
1366  ($posting["author"] == $this->author ||
1367  (is_array($posting["editors"]) && in_array($this->author, $posting["editors"])))) {
1368  $author_found = true;
1369  }
1370 
1371  $month = substr($posting["created"]->get(IL_CAL_DATE), 0, 7);
1372  $items[$month][$posting["id"]] = $posting;
1373  }
1374 
1375  if ($this->author && !$author_found) {
1376  $this->author = null;
1377  }
1378 
1379  return $items;
1380  }
static getAllPostings($a_blog_id, $a_limit=1000, $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 2787 of file class.ilObjBlogGUI.php.

References $_POST, ilUserUtil\getNamePresentation(), ilUtil\sendFailure(), and ilUtil\stripSlashesRecursive().

2788  {
2789  $ids = ilUtil::stripSlashesRecursive($_POST["id"]);
2790 
2791  if (!is_array($ids)) {
2792  ilUtil::sendFailure($this->lng->txt("select_one"), true);
2793  $this->ctrl->redirect($this, "contributors");
2794  }
2795 
2796  $confirm = new ilConfirmationGUI();
2797  $confirm->setHeaderText($this->lng->txt('blog_confirm_delete_contributors'));
2798  $confirm->setFormAction($this->ctrl->getFormAction($this, 'removeContributor'));
2799  $confirm->setConfirm($this->lng->txt('delete'), 'removeContributor');
2800  $confirm->setCancel($this->lng->txt('cancel'), 'contributors');
2801 
2802  foreach ($ids as $user_id) {
2803  $confirm->addItem(
2804  'id[]',
2805  $user_id,
2806  ilUserUtil::getNamePresentation($user_id, false, false, "", true)
2807  );
2808  }
2809 
2810  $this->tpl->setContent($confirm->getHTML());
2811  }
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ contributors()

ilObjBlogGUI::contributors ( )

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

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, ilObject2GUI\$node_id, $tabs, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, ilObject2GUI\checkPermissionBool(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), and ilUtil\sendInfo().

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

2676  {
2677  $ilTabs = $this->tabs;
2678  $ilToolbar = $this->toolbar;
2679  $ilCtrl = $this->ctrl;
2680  $lng = $this->lng;
2681  $tpl = $this->tpl;
2682 
2683  if (!$this->checkPermissionBool("write")) {
2684  return;
2685  }
2686 
2687  $ilTabs->activateTab("contributors");
2688 
2689  $local_roles = $this->object->getAllLocalRoles($this->node_id);
2690 
2691  // add member
2693  $this,
2694  $ilToolbar,
2695  array(
2696  'auto_complete_name' => $lng->txt('user'),
2697  'submit_name' => $lng->txt('add'),
2698  'add_search' => true,
2699  'add_from_container' => $this->node_id,
2700  'user_type' => $local_roles
2701  ),
2702  true
2703  );
2704 
2705  $other_roles = $this->object->getRolesWithContributeOrRedact($this->node_id);
2706  if ($other_roles) {
2707  ilUtil::sendInfo(sprintf($lng->txt("blog_contribute_other_roles"), implode(", ", $other_roles)));
2708  }
2709 
2710  $tbl = new ilContributorTableGUI($this, "contributors", $this->object->getAllLocalRoles($this->node_id));
2711 
2712  $tpl->setContent($tbl->getHTML());
2713  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
List all contributors members of a blog.
+ 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 960 of file class.ilObjBlogGUI.php.

References $_POST, ilObjectGUI\$ctrl, $ilCtrl, $ilUser, ilObjectGUI\$user, ilUtil\sendFailure(), and ilUtil\stripSlashes().

961  {
964 
965  $title = trim(ilUtil::stripSlashes($_POST["title"]));
966  if ($title) {
967  // create new posting
968  $posting = new ilBlogPosting();
969  $posting->setTitle($title);
970  $posting->setBlogId($this->object->getId());
971  $posting->setActive(false);
972  $posting->setAuthor($ilUser->getId());
973  $posting->create();
974 
975  // switch month list to current month (will include new posting)
976  $ilCtrl->setParameter($this, "bmn", date("Y-m"));
977 
978  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $posting->getId());
979  $ilCtrl->redirectByClass("ilblogpostinggui", "edit");
980  } else {
981  ilUtil::sendFailure($this->lng->txt("msg_no_title"), true);
982  $ilCtrl->redirect($this, "render");
983  }
984  }
Class ilBlogPosting.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ createStyle()

ilObjBlogGUI::createStyle ( )

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

2955  {
2956  $this->ctrl->redirectByClass("ilobjstylesheetgui", "create");
2957  }

◆ deactivateAdmin()

ilObjBlogGUI::deactivateAdmin ( )

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

References ilObject2GUI\checkPermissionBool().

2847  {
2848  if ($this->checkPermissionBool("write") && $this->apid > 0) {
2849  // ilBlogPostingGUI::deactivatePage()
2850  $post = new ilBlogPosting($this->apid);
2851  $post->setApproved(false);
2852  $post->setActive(false);
2853  $post->update(true, false, false);
2854 
2855  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
2856  }
2857 
2858  $this->ctrl->redirect($this, "render");
2859  }
Class ilBlogPosting.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
+ Here is the call graph for this function:

◆ deleteStyle()

ilObjBlogGUI::deleteStyle ( )

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

2965  {
2966  $this->ctrl->redirectByClass("ilobjstylesheetgui", "delete");
2967  }

◆ disableNotes()

ilObjBlogGUI::disableNotes (   $a_value = false)

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

2405  {
2406  $this->disable_notes = (bool) $a_value;
2407  }

◆ editStyle()

ilObjBlogGUI::editStyle ( )

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

2960  {
2961  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
2962  }

◆ editStyleProperties()

ilObjBlogGUI::editStyleProperties ( )

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

References ilObject2GUI\checkPermission(), initStylePropertiesForm(), and setSettingsSubTabs().

2885  {
2886  $this->checkPermission("write");
2887 
2888  $this->tabs_gui->activateTab("settings");
2889  $this->setSettingsSubTabs("style");
2890 
2891  $form = $this->initStylePropertiesForm();
2892  $this->tpl->setContent($form->getHTML());
2893  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
setSettingsSubTabs($a_active)
+ Here is the call graph for this function:

◆ executeCommand()

ilObjBlogGUI::executeCommand ( )

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

References ilObjectGUI\$ctrl, $gtp, $ilCtrl, ilObjectGUI\$lng, $nav_history, $ret, $tabs, ilObjectGUI\$tpl, addHeaderActionForCommand(), buildEmbedded(), ilObject2GUI\checkPermissionBool(), ilBlogPosting\exists(), filterInactivePostings(), ilObject2GUI\getAccessHandler(), ilObject2GUI\getCreationMode(), ilObjStyleSheet\getEffectiveContentStyleId(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), infoScreenForward(), mayContribute(), mayEditPosting(), ilObjectGUI\omitLocator(), ilObject2GUI\prepareOutput(), preview(), renderFullScreen(), renderNavigation(), renderToolbarNavigation(), ilUtil\sendFailure(), ilUtil\sendInfo(), setContentStyleSheet(), ilObject2GUI\setLocator(), ilFileInputGUI\setPersonalWorkspaceQuotaCheck(), setSettingsSubTabs(), setTabs(), and triggerAssignmentTool().

577  {
579  $tpl = $this->tpl;
580  $ilTabs = $this->tabs;
581  $lng = $this->lng;
582  $ilNavigationHistory = $this->nav_history;
583 
584  $this->triggerAssignmentTool();
585 
586  // goto link to blog posting
587  if ($this->gtp > 0) {
588  $page_id = $this->gtp;
589  if (ilBlogPosting::exists($this->object_id, $page_id)) {
590  // #12312
591  $ilCtrl->setCmdClass("ilblogpostinggui");
592  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $page_id);
593  if ($this->edt == "edit") {
594  $ilCtrl->redirectByClass("ilblogpostinggui", "edit");
595  } else {
596  $ilCtrl->redirectByClass("ilblogpostinggui", "previewFullscreen");
597  }
598  } else {
599  ilUtil::sendFailure($lng->txt("blog_posting_not_found"));
600  }
601  }
602 
603  $next_class = $ilCtrl->getNextClass($this);
604  $cmd = $ilCtrl->getCmd();
605 
606  if ($this->id_type == self::REPOSITORY_NODE_ID) {
607  // add entry to navigation history
608  if (!$this->getCreationMode() &&
609  $this->getAccessHandler()->checkAccess("read", "", $this->node_id)) {
610  // see #22067
611  $link = $ilCtrl->getLinkTargetByClass(["ilrepositorygui", "ilObjBlogGUI"], "preview");
612  $ilNavigationHistory->addItem($this->node_id, $link, "blog");
613  }
614  }
615 
616  switch ($next_class) {
617  case 'ilblogpostinggui':
618  if (!$this->prtf_embed) {
619  $tpl->loadStandardTemplate();
620  }
621 
622  if (!$this->checkPermissionBool("read") && !$this->prtf_embed) {
623  ilUtil::sendInfo($lng->txt("no_permission"));
624  return;
625  }
626 
627  // #9680
628  if ($this->id_type == self::REPOSITORY_NODE_ID) {
629  $this->setLocator();
630  } else {
632  }
633  $ilTabs->setBackTarget(
634  $lng->txt("back"),
635  $ilCtrl->getLinkTarget($this, "")
636  );
637 
639  $this->object->getStyleSheetId(),
640  "blog"
641  );
642 
643  $bpost_gui = new ilBlogPostingGUI(
644  $this->node_id,
645  $this->getAccessHandler(),
646  $this->blpg,
647  $this->old_nr,
648  ($this->object->getNotesStatus() && !$this->disable_notes),
649  $this->mayEditPosting($this->blpg),
650  $style_sheet_id
651  );
652 
653  // keep preview mode through notes gui (has its own commands)
654  switch ($cmd) {
655  // blog preview
656  case "previewFullscreen":
657  $ilCtrl->setParameter($this, "prvm", "fsc");
658  break;
659 
660  // blog in portfolio
661  case "previewEmbedded":
662  $ilCtrl->setParameter($this, "prvm", "emb");
663  break;
664 
665  // edit
666  default:
667  $this->setContentStyleSheet();
668 
669 
670  if (!$this->prtf_embed) {
671  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $this->blpg);
672  $this->tabs_gui->addNonTabbedLink(
673  "preview",
674  $lng->txt("blog_preview"),
675  $this->ctrl->getLinkTargetByClass("ilblogpostinggui", "previewFullscreen")
676  );
677  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", "");
678  } else {
679  $this->ctrl->setParameterByClass("ilobjportfoliogui", "user_page", $this->ppage);
680  $this->tabs_gui->addNonTabbedLink(
681  "preview",
682  $lng->txt("blog_preview"),
683  $this->ctrl->getLinkTargetByClass("ilobjportfoliogui", "preview")
684  );
685  $this->ctrl->setParameterByClass("ilobjportfoliogui", "user_page", "");
686  }
687  break;
688  }
689 
690  // keep preview mode through notes gui
691  if ($this->prvm) {
692  $cmd = "preview" . (($this->prvm == "fsc") ? "Fullscreen" : "Embedded");
693  }
694  $ret = $ilCtrl->forwardCommand($bpost_gui); // needs prvm setParameter call
695  if (in_array($cmd, array("previewFullscreen", "previewEmbedded"))) {
696  // resets prvm parameter
697  $this->renderToolbarNavigation($this->items, true);
698  }
699  if ($ret != "") {
700 
701  // $is_owner = $this->object->getOwner() == $ilUser->getId();
702  $is_owner = $this->mayContribute();
703  $is_active = $bpost_gui->getBlogPosting()->getActive();
704 
705  // do not show inactive postings
706  if (($cmd == "previewFullscreen" || $cmd == "previewEmbedded")
707  && !$is_owner && !$is_active) {
708  $this->ctrl->redirect($this, "preview");
709  }
710 
711  switch ($cmd) {
712  // blog preview
713  case "previewFullscreen":
714  $this->addHeaderActionForCommand($cmd);
715  $this->filterInactivePostings();
716  $nav = $this->renderNavigation("preview", $cmd);
717  $this->renderFullScreen($ret, $nav);
718  break;
719 
720  // blog in portfolio
721  case "previewEmbedded":
722  $this->filterInactivePostings();
723  $nav = $this->renderNavigation("gethtml", $cmd);
724  return $this->buildEmbedded($ret, $nav);
725 
726  // ilias/editor
727  default:
728  // infos about draft status / snippet
729  $info = array();
730  if (!$is_active) {
731  // single author blog (owner) in personal workspace
732  if ($this->id_type == self::WORKSPACE_NODE_ID) {
733  $info[] = $lng->txt("blog_draft_info");
734  } else {
735  $info[] = $lng->txt("blog_draft_info_contributors");
736  }
737  }
738  if ($cmd != "history" && $is_active && empty($info)) {
739  $info[] = $lng->txt("blog_new_posting_info");
740  $public_action = true;
741  }
742  if ($this->object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved()) {
743  // #9737
744  $info[] = $lng->txt("blog_posting_edit_approval_info");
745  }
746  //TODO can we get rid of this conditional? hasMessage belongs to the old ilBlogGlobalTemplate class
747  //if(sizeof($info) && !$tpl->hasMessage("info")) // #15121
748  //{
749  if ($public_action) {
750  ilUtil::sendSuccess(implode("<br />", $info));
751  } else {
752  ilUtil::sendInfo(implode("<br />", $info));
753  }
754  //}
755  // revert to edit cmd to avoid confusion
756  $this->addHeaderActionForCommand("render");
757  $tpl->setContent($ret);
758  $nav = $this->renderNavigation("render", $cmd, null, $is_owner);
759  $tpl->setRightContent($nav);
760  break;
761  }
762  }
763  break;
764 
765  case "ilinfoscreengui":
766  $this->prepareOutput();
767  $this->addHeaderActionForCommand("render");
768  $this->infoScreenForward();
769  break;
770 
771  case "ilnotegui":
772  $this->preview();
773  break;
774 
775  case "ilcommonactiondispatchergui":
777  $this->ctrl->forwardCommand($gui);
778  break;
779 
780  case "ilpermissiongui":
781  $this->prepareOutput();
782  $ilTabs->activateTab("id_permissions");
783  $perm_gui = new ilPermissionGUI($this);
784  $this->ctrl->forwardCommand($perm_gui);
785  break;
786 
787  case "ilobjectcopygui":
788  $this->prepareOutput();
789  $cp = new ilObjectCopyGUI($this);
790  $cp->setType("blog");
791  $this->ctrl->forwardCommand($cp);
792  break;
793 
794  case 'ilrepositorysearchgui':
795  $this->prepareOutput();
796  $ilTabs->activateTab("contributors");
797  $rep_search = new ilRepositorySearchGUI();
798  $rep_search->setTitle($this->lng->txt("blog_add_contributor"));
799  $rep_search->setCallback($this, 'addContributor', $this->object->getAllLocalRoles($this->node_id));
800  $this->ctrl->setReturn($this, 'contributors');
801  $ret = &$this->ctrl->forwardCommand($rep_search);
802  break;
803 
804  case 'ilexportgui':
805  $this->prepareOutput();
806  $ilTabs->activateTab("export");
807  $exp_gui = new ilExportGUI($this);
808  $exp_gui->addFormat("xml");
809  $exp_gui->addFormat("html", null, $this, "buildExportFile"); // #13419
810  $ret = $ilCtrl->forwardCommand($exp_gui);
811  break;
812 
813  case "ilobjstylesheetgui":
814  $this->ctrl->setReturn($this, "editStyleProperties");
815  $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
816  $style_gui->omitLocator();
817  if ($cmd == "create" || $this->new_type == "sty") {
818  $style_gui->setCreationMode(true);
819  }
820 
821  if ($cmd == "confirmedDelete") {
822  $this->object->setStyleSheetId(0);
823  $this->object->update();
824  }
825 
826  $ret = $this->ctrl->forwardCommand($style_gui);
827 
828  if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
829  $style_id = $ret;
830  $this->object->setStyleSheetId($style_id);
831  $this->object->update();
832  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
833  }
834  break;
835 
836  case "ilblogexercisegui":
837  $this->ctrl->setReturn($this, "render");
838  $gui = new ilBlogExerciseGUI($this->node_id);
839  $this->ctrl->forwardCommand($gui);
840  break;
841 
842  case 'ilobjnotificationsettingsgui':
843  $this->prepareOutput();
844  $ilTabs->activateTab("settings");
845  $this->setSettingsSubTabs("notifications");
846  $gui = new ilObjNotificationSettingsGUI($this->object->getRefId());
847  $this->ctrl->forwardCommand($gui);
848  break;
849 
850  default:
851  if ($cmd != "gethtml") {
852  // desktop item handling, must be toggled before header action
853  if ($cmd == "addToDesk" || $cmd == "removeFromDesk") {
854  $this->{$cmd . "Object"}();
855  if ($this->prvm) {
856  $cmd = "preview";
857  } else {
858  $cmd = "render";
859  }
860  $ilCtrl->setCmd($cmd);
861  }
862  $this->addHeaderActionForCommand($cmd);
863  }
864  if (!$this->prtf_embed) {
865  return parent::executeCommand();
866  } else {
867  $this->setTabs();
868 
869  if (!$cmd) {
870  $cmd = "render";
871  }
872  return $this->$cmd();
873  }
874  }
875 
876  return true;
877  }
setLocator()
set Locator
filterInactivePostings()
Filter inactive items from items list.
mayContribute()
Check if user may contribute at all.
preview()
Render fullscreen presentation.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
GUI class for the workflow of copying objects.
Class ilBlogPosting GUI class.
getAccessHandler()
Get access handler.
Class ilBlogExerciseGUI.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Export User Interface Class.
buildEmbedded($a_content, $a_nav)
Combine content (list/posting) and navigation to html chunk.
static exists($a_blog_id, $a_posting_id)
Checks whether a posting exists.
triggerAssignmentTool()
Trigger assignment tool.
renderFullScreen($a_content, $a_navigation)
Build fullscreen context.
static setPersonalWorkspaceQuotaCheck($a_value)
omitLocator($a_omit=true)
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
infoScreenForward()
show information screen
setContentStyleSheet($a_tpl=null)
Class ilObjStyleSheetGUI.
setSettingsSubTabs($a_active)
Handles general notification settings, see e.g.
$ret
Definition: parser.php:6
prepareOutput($a_show_subobjects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
addHeaderActionForCommand($a_cmd)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
renderToolbarNavigation($a_items, $single_posting=false)
Toolbar navigation.
renderNavigation($a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
Build navigation blocks.
mayEditPosting($a_posting_id, $a_author_id=null)
Check if user may edit posting.
+ Here is the call graph for this function:

◆ export()

ilObjBlogGUI::export ( )

Build and deliver export file.

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

References buildExportFile(), and ilUtil\deliverFile().

1180  {
1181  $zip = $this->buildExportFile();
1182 
1183  ilUtil::deliverFile($zip, $this->object->getTitle() . ".zip", '', false, true);
1184  }
buildExportFile()
Build export file.
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ filterInactivePostings()

ilObjBlogGUI::filterInactivePostings ( )
protected

Filter inactive items from items list.

Returns
array

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

References $month, and ilPageObject\_lookupActive().

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

2544  {
2545  foreach ($this->items as $month => $postings) {
2546  foreach ($postings as $id => $item) {
2547  if (!ilBlogPosting::_lookupActive($id, "blp")) {
2548  unset($this->items[$month][$id]);
2549  } elseif ($this->object->hasApproval() && !$item["approved"]) {
2550  unset($this->items[$month][$id]);
2551  }
2552  }
2553  if (!sizeof($this->items[$month])) {
2554  unset($this->items[$month]);
2555  }
2556  }
2557 
2558  if ($this->items && !isset($this->items[$this->month])) {
2559  $this->month = array_shift(array_keys($this->items));
2560  }
2561  }
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $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,
  $a_keyword 
)

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

References $items, $month, $res, and ilBlogPosting\getKeywords().

2564  {
2565  $res = array();
2566  foreach ($a_items as $month => $items) {
2567  foreach ($items as $item) {
2568  if (in_array(
2569  $a_keyword,
2570  ilBlogPosting::getKeywords($this->obj_id, $item["id"])
2571  )) {
2572  $res[] = $item;
2573  }
2574  }
2575  }
2576  return $res;
2577  }
static getKeywords($a_obj_id, $a_posting_id)
foreach($_POST as $key=> $value) $res
+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjBlogGUI::getEditFormCustomValues ( array &  $a_values)
protected

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

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

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

◆ getHTML()

ilObjBlogGUI::getHTML ( )

Return embeddable HTML chunk.

Returns
string

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

References ilObjectGUI\$ctrl, $ilCtrl, $ilUser, ilObjectGUI\$lng, ilObjectGUI\$user, ilObject\_lookupOwner(), buildEmbedded(), filterInactivePostings(), ilLinkButton\getInstance(), getListItems(), renderList(), and renderNavigation().

1060  {
1061  $ilUser = $this->user;
1062  $ilCtrl = $this->ctrl;
1063  $lng = $this->lng;
1064 
1065  // getHTML() is called by ilRepositoryGUI::show()
1066  if ($this->id_type == self::REPOSITORY_NODE_ID) {
1067  return;
1068  }
1069 
1070  // there is no way to do a permissions check here, we have no wsp
1071 
1072  $this->filterInactivePostings();
1073 
1074  $list_items = $this->getListItems();
1075 
1076  $list = $nav = "";
1077  if ($list_items) {
1078  $list = $this->renderList($list_items, "previewEmbedded");
1079  $nav = $this->renderNavigation("gethtml", "previewEmbedded");
1080  }
1081  // quick editing in portfolio
1082  elseif ($this->prt_id) {
1083  // see renderList()
1084  if (ilObject::_lookupOwner($this->prt_id) == $ilUser->getId()) {
1085  // see ilPortfolioPageTableGUI::fillRow()
1086  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", $this->user_page);
1087  $link = $ilCtrl->getLinkTargetByClass(array("ilportfoliopagegui", "ilobjbloggui"), "render");
1088  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", "");
1089 
1090  $btn = ilLinkButton::getInstance();
1091  $btn->setCaption(sprintf($lng->txt("prtf_edit_embedded_blog"), $this->object->getTitle()), false);
1092  $btn->setUrl($link);
1093  $btn->setPrimary(true);
1094 
1095  $list = $btn->render();
1096  }
1097  }
1098 
1099  return $this->buildEmbedded($list, $nav);
1100  }
filterInactivePostings()
Filter inactive items from items list.
global $ilCtrl
Definition: ilias.php:18
getListItems($a_show_inactive=false)
Filter blog postings by month, keyword or author.
buildEmbedded($a_content, $a_nav)
Combine content (list/posting) and navigation to html chunk.
renderList(array $items, $a_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_export_directory=null)
Build posting month list.
$ilUser
Definition: imgupload.php:18
static _lookupOwner($a_id)
lookup object owner
renderNavigation($a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
Build navigation blocks.
+ Here is the call graph for this function:

◆ getItems()

ilObjBlogGUI::getItems ( )

Get items.

Returns
array

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

References $items.

193  {
194  return $this->items;
195  }

◆ getKeywords()

ilObjBlogGUI::getKeywords (   $a_show_inactive,
  $a_posting_id = null 
)

Get keywords for single posting or complete blog.

Parameters
bool$a_show_inactive
int$a_posting_id
Returns
array

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

References $items, $keyword, $month, ilPageObject\_lookupActive(), ilBlogPosting\getKeywords(), and ilUtil\sortArray().

Referenced by buildExportLink(), and renderNavigationByKeywords().

2350  {
2351  $keywords = array();
2352  if ($a_posting_id) {
2353  foreach (ilBlogPosting::getKeywords($this->obj_id, $a_posting_id) as $keyword) {
2354  $keywords[$keyword]++;
2355  }
2356  } else {
2357  foreach ($this->items as $month => $items) {
2358  foreach ($items as $item) {
2359  if ($a_show_inactive || ilBlogPosting::_lookupActive($item["id"], "blp")) {
2360  foreach (ilBlogPosting::getKeywords($this->obj_id, $item["id"]) as $keyword) {
2361  $keywords[$keyword]++;
2362  }
2363  }
2364  }
2365  }
2366  }
2367 
2368  // #15881
2369  $tmp = array();
2370  foreach ($keywords as $keyword => $counter) {
2371  $tmp[] = array("keyword" => $keyword, "counter" => $counter);
2372  }
2373  $tmp = ilUtil::sortArray($tmp, "keyword", "ASC");
2374 
2375  $keywords = array();
2376  foreach ($tmp as $item) {
2377  $keywords[$item["keyword"]] = $item["counter"];
2378  }
2379  return $keywords;
2380  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static getKeywords($a_obj_id, $a_posting_id)
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLatestMonth()

ilObjBlogGUI::getLatestMonth (   $a_items)

Get next month.

Parameters
array$a_itemsitem array
Returns
string

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

Referenced by renderToolbarNavigation().

2153  {
2154  reset($a_items);
2155  return key($a_items);
2156  }
+ Here is the caller graph for this function:

◆ getLatestPosting()

ilObjBlogGUI::getLatestPosting (   $a_items)

Get previous posting.

Parameters
array$a_itemsitem array
Returns
int page id

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

References $month.

Referenced by renderToolbarNavigation().

2213  {
2214  reset($a_items);
2215  $month = current($a_items);
2216  if (is_array($month)) {
2217  return current($month)["id"];
2218  }
2219  return false;
2220  }
+ Here is the caller graph for this function:

◆ getListItems()

ilObjBlogGUI::getListItems (   $a_show_inactive = false)
protected

Filter blog postings by month, keyword or author.

Parameters
bool$a_show_inactive
Returns
array

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

References $items, $month, and ilPageObject\_lookupActive().

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

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

◆ getNextMonth()

ilObjBlogGUI::getNextMonth (   $a_items)

Get next month.

Parameters
array$a_itemsitem array
Returns
string

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

References $items, and $month.

Referenced by renderToolbarNavigation().

2117  {
2118  reset($a_items);
2119  $found = "";
2120  foreach ($a_items as $month => $items) {
2121  if ($month > $this->month) {
2122  $found = $month;
2123  }
2124  }
2125  return $found;
2126  }
+ Here is the caller graph for this function:

◆ getNextPosting()

ilObjBlogGUI::getNextPosting (   $a_items)

Get next posting.

Parameters
array$a_itemsitem array
Returns
int page id

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

References $items, and $month.

Referenced by renderToolbarNavigation().

2165  {
2166  reset($a_items);
2167  $found = "";
2168  $next_blpg = 0;
2169  foreach ($a_items as $month => $items) {
2170  foreach ($items as $item) {
2171  if ($item["id"] == $this->blpg) {
2172  $found = true;
2173  }
2174  if (!$found) {
2175  $next_blpg = $item["id"];
2176  }
2177  }
2178  }
2179  return $next_blpg;
2180  }
+ Here is the caller graph for this function:

◆ getNotesSubId()

ilObjBlogGUI::getNotesSubId ( )

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

References $blpg.

2400  {
2401  return $this->blpg;
2402  }

◆ getPreviousMonth()

ilObjBlogGUI::getPreviousMonth (   $a_items)

Get next month.

Parameters
array$a_itemsitem array
Returns
string

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

References $items, and $month.

Referenced by renderToolbarNavigation().

2135  {
2136  reset($a_items);
2137  $found = "";
2138  foreach ($a_items as $month => $items) {
2139  if ($month < $this->month && $found == "") {
2140  $found = $month;
2141  }
2142  }
2143  return $found;
2144  }
+ Here is the caller graph for this function:

◆ getPreviousPosting()

ilObjBlogGUI::getPreviousPosting (   $a_items)

Get previous posting.

Parameters
array$a_itemsitem array
Returns
int page id

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

References $items, and $month.

Referenced by renderToolbarNavigation().

2189  {
2190  reset($a_items);
2191  $found = "";
2192  $prev_blpg = 0;
2193  foreach ($a_items as $month => $items) {
2194  foreach ($items as $item) {
2195  if ($found && $prev_blpg == "") {
2196  $prev_blpg = $item["id"];
2197  }
2198  if ($item["id"] == $this->blpg) {
2199  $found = true;
2200  }
2201  }
2202  }
2203  return $prev_blpg;
2204  }
+ Here is the caller graph for this function:

◆ getType()

ilObjBlogGUI::getType ( )

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

Referenced by renderList().

183  {
184  return "blog";
185  }
+ Here is the caller graph for this function:

◆ infoScreen()

ilObjBlogGUI::infoScreen ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

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

References infoScreenForward().

908  {
909  $this->ctrl->setCmd("showSummary");
910  $this->ctrl->setCmdClass("ilinfoscreengui");
911  $this->infoScreenForward();
912  }
infoScreenForward()
show information screen
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjBlogGUI::infoScreenForward ( )

show information screen

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

References $tabs, ilObject2GUI\checkPermission(), ilObject2GUI\checkPermissionBool(), and ilObject2GUI\getPermanentLinkWidget().

Referenced by executeCommand(), and infoScreen().

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", true);
943  $info->setBlockProperty("news", "public_notifications_option", true);
944  }
945  }
946 
947  // standard meta data
948  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
949 
950  if ($this->id_type == self::WORKSPACE_NODE_ID) {
951  $info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget());
952  }
953 
954  $this->ctrl->forwardCommand($info);
955  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Class ilInfoScreenGUI.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getPermanentLinkWidget($a_append=null, $a_center=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreationForms()

ilObjBlogGUI::initCreationForms (   $a_new_type)
protected

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

199  {
200  $forms = parent::initCreationForms($a_new_type);
201 
202  if ($this->id_type == self::WORKSPACE_NODE_ID) {
203  unset($forms[self::CFORM_IMPORT]);
204  unset($forms[self::CFORM_CLONE]);
205  }
206 
207  return $forms;
208  }

◆ initEditCustomForm()

ilObjBlogGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

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

References $auth, $ilSetting, $img, ilObjectGUI\$lng, ilObjectGUI\$settings, ilPropertyFormGUI\addItem(), ilObjectGUI\getObjectService(), ilObjBlog\NAV_MODE_LIST, ilObjBlog\NAV_MODE_MONTH, ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setMultiValues(), ilFileInputGUI\setPersonalWorkspaceQuotaCheck(), ilFormPropertyGUI\setRequired(), setSettingsSubTabs(), and ilNumberInputGUI\setSize().

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

◆ initHeaderAction()

ilObjBlogGUI::initHeaderAction (   $sub_type = null,
  $sub_id = null,
  $a_is_preview = false 
)
protected

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

References $blpg, ilObjectGUI\$ctrl, $ilCtrl, $ilUser, ilObjectGUI\$obj_id, ilObjectGUI\$user, ilUtil\getImagePath(), ilNotification\hasNotification(), ilNotification\hasOptOut(), mayContribute(), mayEditPosting(), and ilNotification\TYPE_BLOG.

Referenced by addHeaderActionForCommand().

2432  {
2433  $ilUser = $this->user;
2434  $ilCtrl = $this->ctrl;
2435 
2436  if (!$this->obj_id) {
2437  return false;
2438  }
2439 
2440  $sub_type = $sub_id = null;
2441  if ($this->blpg > 0) {
2442  $sub_type = "blp";
2443  $sub_id = $this->blpg;
2444  }
2445 
2446  $lg = parent::initHeaderAction($sub_type, $sub_id);
2447 
2448  if ($a_is_preview) {
2449  $lg->enableComments(false);
2450  $lg->enableNotes(false);
2451  $lg->enableTags(false);
2452 
2454  $ilCtrl->setParameter($this, "ntf", 1);
2455  $link = $ilCtrl->getLinkTarget($this, "setNotification");
2456  $ilCtrl->setParameter($this, "ntf", "");
2457  if (ilNotification::hasOptOut($this->obj_id)) {
2458  $lg->addCustomCommand($link, "blog_notification_toggle_off");
2459  }
2460 
2461  $lg->addHeaderIcon(
2462  "not_icon",
2463  ilUtil::getImagePath("notification_on.svg"),
2464  $this->lng->txt("blog_notification_activated")
2465  );
2466  } else {
2467  $ilCtrl->setParameter($this, "ntf", 2);
2468  $link = $ilCtrl->getLinkTarget($this, "setNotification");
2469  $ilCtrl->setParameter($this, "ntf", "");
2470  $lg->addCustomCommand($link, "blog_notification_toggle_on");
2471 
2472  $lg->addHeaderIcon(
2473  "not_icon",
2474  ilUtil::getImagePath("notification_off.svg"),
2475  $this->lng->txt("blog_notification_deactivated")
2476  );
2477  }
2478 
2479  // #11758
2480  if ($this->mayContribute()) {
2481  $ilCtrl->setParameter($this, "prvm", "");
2482 
2483  $ilCtrl->setParameter($this, "bmn", "");
2484  $ilCtrl->setParameter($this, "blpg", "");
2485  $link = $ilCtrl->getLinkTarget($this, "");
2486  $ilCtrl->setParameter($this, "blpg", $sub_id);
2487  $ilCtrl->setParameter($this, "bmn", $this->month);
2488  $lg->addCustomCommand($link, "blog_edit"); // #11868
2489 
2490  if ($sub_id && $this->mayEditPosting($sub_id)) {
2491  $link = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit");
2492  $lg->addCustomCommand($link, "blog_edit_posting");
2493  }
2494 
2495  $ilCtrl->setParameter($this, "prvm", "fsc");
2496  }
2497 
2498  $ilCtrl->setParameter($this, "ntf", "");
2499  }
2500 
2501  return $lg;
2502  }
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
mayContribute()
Check if user may contribute at all.
static hasOptOut($obj_id)
Is opt out (disable notification) allowed?
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
mayEditPosting($a_posting_id, $a_author_id=null)
Check if user may edit posting.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initStylePropertiesForm()

ilObjBlogGUI::initStylePropertiesForm ( )

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

References $ilSetting, ilObjectGUI\$settings, ilObjStyleSheet\_getStandardStyles(), ilObjStyleSheet\_lookupStandard(), ilObject\_lookupTitle(), and ilNonEditableValueGUI\setValue().

Referenced by editStyleProperties().

2896  {
2898 
2899  $this->lng->loadLanguageModule("style");
2900 
2901  $form = new ilPropertyFormGUI();
2902 
2903  $fixed_style = $ilSetting->get("fixed_content_style_id");
2904  $style_id = $this->object->getStyleSheetId();
2905 
2906  if ($fixed_style > 0) {
2907  $st = new ilNonEditableValueGUI($this->lng->txt("style_current_style"));
2908  $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" .
2909  $this->lng->txt("global_fixed") . ")");
2910  $form->addItem($st);
2911  } else {
2913  true,
2914  false,
2915  $this->ref_id
2916  );
2917 
2918  $st_styles[0] = $this->lng->txt("default");
2919  ksort($st_styles);
2920 
2921  if ($style_id > 0) {
2922  // individual style
2923  if (!ilObjStyleSheet::_lookupStandard($style_id)) {
2924  $st = new ilNonEditableValueGUI($this->lng->txt("style_current_style"));
2925  $st->setValue(ilObject::_lookupTitle($style_id));
2926  $form->addItem($st);
2927 
2928  // delete command
2929  $form->addCommandButton("editStyle", $this->lng->txt("style_edit_style"));
2930  $form->addCommandButton("deleteStyle", $this->lng->txt("style_delete_style"));
2931  }
2932  }
2933 
2934  if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id)) {
2935  $style_sel = new ilSelectInputGUI(
2936  $this->lng->txt("style_current_style"),
2937  "style_id"
2938  );
2939  $style_sel->setOptions($st_styles);
2940  $style_sel->setValue($style_id);
2941  $form->addItem($style_sel);
2942 
2943  $form->addCommandButton("saveStyleSettings", $this->lng->txt("save"));
2944  $form->addCommandButton("createStyle", $this->lng->txt("sty_create_ind_style"));
2945  }
2946  }
2947 
2948  $form->setTitle($this->lng->txt("blog_style"));
2949  $form->setFormAction($this->ctrl->getFormAction($this));
2950 
2951  return $form;
2952  }
This class represents a property form user interface.
static _lookupTitle($a_id)
lookup object title
static _getStandardStyles( $a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
static _lookupStandard($a_id)
Lookup standard flag.
This class represents a non editable value in a property form.
global $ilSetting
Definition: privfeed.php:17
+ 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)

Returns
bool

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

References ilObject2GUI\checkPermissionBool().

Referenced by approve(), and renderList().

2585  {
2586  return ($this->checkPermissionBool("redact") ||
2587  $this->checkPermissionBool("write"));
2588  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupSubObjectTitle()

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

Get title for blog posting (used in ilNotesGUI)

Parameters
int$a_blog_id
int$a_posting_id
Returns
string

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

2530  {
2531  // page might be deleted, so setting halt on errors to false
2532  $post = new ilBlogPosting($a_posting_id);
2533  if ($post->getBlogId() == $a_blog_id) {
2534  return $post->getTitle();
2535  }
2536  }
Class ilBlogPosting.

◆ mayContribute()

ilObjBlogGUI::mayContribute ( )
protected

Check if user may contribute at all.

Returns
boolean

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

References ilObject2GUI\checkPermissionBool().

Referenced by executeCommand(), initHeaderAction(), render(), renderFullScreen(), renderToolbarNavigation(), and setTabs().

2637  {
2638  // single author blog (owner) in personal workspace
2639  if ($this->id_type == self::WORKSPACE_NODE_ID) {
2640  return $this->checkPermissionBool("write");
2641  }
2642 
2643  return ($this->checkPermissionBool("redact") ||
2644  $this->checkPermissionBool("contribute"));
2645  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mayEditPosting()

ilObjBlogGUI::mayEditPosting (   $a_posting_id,
  $a_author_id = null 
)
protected

Check if user may edit posting.

Parameters
int$a_posting_id
int$a_author_id
Returns
boolean

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

References $ilUser, ilObjectGUI\$user, and ilObject2GUI\checkPermissionBool().

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

2598  {
2599  $ilUser = $this->user;
2600 
2601  // single author blog (owner) in personal workspace
2602  if ($this->id_type == self::WORKSPACE_NODE_ID) {
2603  return $this->checkPermissionBool("write");
2604  }
2605 
2606  // repository blogs
2607 
2608  // redact allows to edit all postings
2609  if ($this->checkPermissionBool("redact")) {
2610  return true;
2611  }
2612 
2613  // contribute gives access to own postings
2614  if ($this->checkPermissionBool("contribute")) {
2615  // check owner of posting
2616  if (!$a_author_id) {
2617  $post = new ilBlogPosting($a_posting_id);
2618  $a_author_id = $post->getAuthor();
2619  }
2620  if ($ilUser->getId() == $a_author_id) {
2621  return true;
2622  } else {
2623  return false;
2624  }
2625 
2626  return true;
2627  }
2628  return false;
2629  }
Class ilBlogPosting.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ preview()

ilObjBlogGUI::preview ( )

Render fullscreen presentation.

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

References $DIC, ilObjectGUI\$lng, ilObjectGUI\$toolbar, ilObject2GUI\checkPermissionBool(), filterInactivePostings(), getListItems(), renderFullScreen(), renderList(), renderNavigation(), renderToolbarNavigation(), and ilUtil\sendInfo().

Referenced by executeCommand().

1150  {
1151  global $DIC;
1152 
1153  $lng = $DIC->language();
1154  $toolbar = $DIC->toolbar();
1155 
1156  if (!$this->checkPermissionBool("read")) {
1157  ilUtil::sendInfo($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  $list .= $toolbar->getHTML();
1171  }
1172 
1173  $this->renderFullScreen($list, $nav);
1174  }
filterInactivePostings()
Filter inactive items from items list.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getListItems($a_show_inactive=false)
Filter blog postings by month, keyword or author.
renderList(array $items, $a_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_export_directory=null)
Build posting month list.
renderFullScreen($a_content, $a_navigation)
Build fullscreen context.
$DIC
Definition: xapitoken.php:46
renderToolbarNavigation($a_items, $single_posting=false)
Toolbar navigation.
renderNavigation($a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
Build navigation blocks.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeContributor()

ilObjBlogGUI::removeContributor ( )

Used in ilContributorTableGUI.

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

References $_POST, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $rbacadmin, contributors(), ilUtil\sendFailure(), and ilUtil\stripSlashesRecursive().

2817  {
2818  $ilCtrl = $this->ctrl;
2819  $lng = $this->lng;
2821 
2822  $ids = ilUtil::stripSlashesRecursive($_POST["id"]);
2823 
2824  if (!is_array($ids)) {
2825  ilUtil::sendFailure($lng->txt("select_one"), true);
2826  $ilCtrl->redirect($this, "contributors");
2827  }
2828 
2829  // get contributor role
2830  $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
2831  if (!$local_roles) {
2832  ilUtil::sendFailure($lng->txt("missing_perm"));
2833  return $this->contributors();
2834  }
2835 
2836  foreach ($ids as $user_id) {
2837  foreach ($local_roles as $role_id) {
2838  $rbacadmin->deassignUser($role_id, $user_id);
2839  }
2840  }
2841 
2842  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
2843  $this->ctrl->redirect($this, "contributors");
2844  }
global $ilCtrl
Definition: ilias.php:18
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ render()

ilObjBlogGUI::render ( )

Render object context.

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

References ilObjectGUI\$ctrl, $ilCtrl, $ilUser, ilObjectGUI\$lng, $message, $tabs, ilObjectGUI\$tpl, ilObject2GUI\$tree, $url, ilObjectGUI\$user, ilObject2GUI\checkPermissionBool(), ilSubmitButton\getInstance(), ilLinkButton\getInstance(), getListItems(), mayContribute(), renderList(), renderNavigation(), ilUtil\sendInfo(), and setContentStyleSheet().

993  {
994  $tpl = $this->tpl;
995  $ilTabs = $this->tabs;
997  $lng = $this->lng;
998  $ilToolbar = new ilToolbarGUI();
1000  $tree = $this->tree;
1001 
1002  if (!$this->checkPermissionBool("read")) {
1003  ilUtil::sendInfo($lng->txt("no_permission"));
1004  return;
1005  }
1006 
1007  $ilTabs->activateTab("content");
1008 
1009  // toolbar
1010  if ($this->mayContribute()) {
1011  $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "createPosting"));
1012 
1013  $title = new ilTextInputGUI($lng->txt("title"), "title");
1014  $ilToolbar->addStickyItem($title, $lng->txt("title"));
1015 
1016  $button = ilSubmitButton::getInstance();
1017  $button->setCaption("blog_add_posting");
1018  $button->setCommand("createPosting");
1019  $ilToolbar->addStickyItem($button);
1020 
1021  // #18763
1022  $first = array_shift((array_keys($this->items)));
1023  if ($first != $this->month) {
1024  $ilToolbar->addSeparator();
1025 
1026  $ilCtrl->setParameter($this, "bmn", $first);
1027  $url = $ilCtrl->getLinkTarget($this, "");
1028  $ilCtrl->setParameter($this, "bmn", $this->month);
1029 
1030  $button = ilLinkButton::getInstance();
1031  $button->setCaption("blog_show_latest");
1032  $button->setUrl($url);
1033  $ilToolbar->addButtonInstance($button);
1034  }
1035  }
1036 
1037  // $is_owner = ($this->object->getOwner() == $ilUser->getId());
1038  $is_owner = $this->mayContribute();
1039 
1040  $list_items = $this->getListItems($is_owner);
1041 
1042  $list = $nav = "";
1043  if ($list_items) {
1044  $list = $this->renderList($list_items, "preview", null, $is_owner);
1045  $nav = $this->renderNavigation("render", "preview", null, $is_owner);
1046  }
1047 
1048  $this->setContentStyleSheet();
1049 
1050  $tpl->setContent($message . $ilToolbar->getHTML() . $list);
1051  $tpl->setRightContent($nav);
1052  }
mayContribute()
Check if user may contribute at all.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getListItems($a_show_inactive=false)
Filter blog postings by month, keyword or author.
renderList(array $items, $a_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_export_directory=null)
Build posting month list.
$ilUser
Definition: imgupload.php:18
setContentStyleSheet($a_tpl=null)
$message
Definition: xapiexit.php:14
$url
renderNavigation($a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
Build navigation blocks.
+ Here is the call graph for this function:

◆ renderFullScreen()

ilObjBlogGUI::renderFullScreen (   $a_content,
  $a_navigation 
)

Build fullscreen context.

Parameters
string$a_content
string$a_navigation

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

References $a_content, $ilUser, ilObjectGUI\$locator, $main_menu, ilObject2GUI\$node_id, ilObject2GUI\$parent_id, $tabs, ilObjectGUI\$tpl, ilObject2GUI\$tree, ilObjectGUI\$user, ilLink\_getStaticLink(), mayContribute(), ilMainMenuGUI\MODE_TOPBAR_ONLY, renderFullscreenHeader(), and setContentStyleSheet().

Referenced by executeCommand(), and preview().

1211  {
1212  $tpl = $this->tpl;
1213  $ilUser = $this->user;
1214  $ilTabs = $this->tabs;
1215  $ilLocator = $this->locator;
1216 
1217  $owner = $this->object->getOwner();
1218 
1219  $ilTabs->clearTargets();
1220  $tpl->setLocator();
1221 
1222  $back_caption = "";
1223 
1224  // back (edit)
1225  if ($owner == $ilUser->getId()) {
1226  // from shared/deeplink
1227  if ($this->id_type == self::WORKSPACE_NODE_ID) {
1228  $back = "ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace&wsp_id=" . $this->node_id;
1229  }
1230  // from editor (#10073)
1231  elseif ($this->mayContribute()) {
1232  $this->ctrl->setParameter($this, "prvm", "");
1233  if ($this->blpg == 0) {
1234  $back = $this->ctrl->getLinkTarget($this, "");
1235  } else {
1236  $this->ctrl->setParameterByClass("ilblogpostinggui", "bmn", $this->month);
1237  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $this->blpg);
1238  $back = $this->ctrl->getLinkTargetByClass("ilblogpostinggui", "preview");
1239  }
1240  $this->ctrl->setParameter($this, "prvm", $this->prvm);
1241  }
1242 
1243  $back_caption = $this->lng->txt("blog_back_to_blog_owner");
1244  }
1245  // back
1246  elseif ($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID) {
1247  // workspace (always shared)
1248  if ($this->id_type == self::WORKSPACE_NODE_ID) {
1249  $back = "ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace&dsh=" . $owner;
1250  }
1251  // contributor
1252  elseif ($this->mayContribute()) {
1253  $back = $this->ctrl->getLinkTarget($this, "");
1254  $back_caption = $this->lng->txt("blog_back_to_blog_owner");
1255  }
1256  // listgui / parent container
1257  else {
1258  $tree = $this->tree;
1259  $parent_id = $tree->getParentId($this->node_id);
1261  }
1262  }
1263 
1264  $ilMainMenu = $this->main_menu;
1265  $ilMainMenu->setMode(ilMainMenuGUI::MODE_TOPBAR_ONLY);
1266  $ilMainMenu->setTopBarBack($back, $back_caption);
1267 
1268  $this->renderFullscreenHeader($tpl, $owner);
1269 
1270  // #13564
1271  $this->ctrl->setParameter($this, "bmn", "");
1272  //$tpl->setTitleUrl($this->ctrl->getLinkTarget($this, "preview"));
1273  $this->ctrl->setParameter($this, "bmn", $this->month);
1274 
1275  $this->setContentStyleSheet();
1276 
1277  // content
1278  $tpl->setContent($a_content);
1279  $tpl->setRightContent($a_navigation);
1280  }
mayContribute()
Check if user may contribute at all.
renderFullscreenHeader($a_tpl, $a_user_id, $a_export=false)
Render banner, user name.
$a_content
Definition: workflow.php:93
$ilUser
Definition: imgupload.php:18
setContentStyleSheet($a_tpl=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderFullscreenHeader()

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

Render banner, user name.

Parameters
object$a_tpl
int$a_user_id
bool$a_export_path

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

References $ilUser, $name, ilObject2GUI\$node_id, ilObjectGUI\$user, ilObjUser\_getPersonalPicturePath(), ilObjUser\_lookupName(), ilChangeEvent\_recordReadEvent(), and ilWACSignedPath\signFile().

Referenced by renderFullScreen().

1290  {
1291  $ilUser = $this->user;
1292 
1293  if (!$a_export) {
1295  $this->object->getType(),
1297  $this->object->getId(),
1298  $ilUser->getId()
1299  );
1300  }
1301 
1302  // repository blogs are multi-author
1303  $name = null;
1304  if ($this->id_type != self::REPOSITORY_NODE_ID) {
1305  $name = ilObjUser::_lookupName($a_user_id);
1306  $name = $name["lastname"] . ", " . ($t = $name["title"] ? $t . " " : "") . $name["firstname"];
1307  }
1308 
1309  // show banner?
1310  $banner = false;
1311  $blga_set = new ilSetting("blga");
1312  if ($blga_set->get("banner")) {
1313  $banner = ilWACSignedPath::signFile($this->object->getImageFullPath());
1314  $banner_width = $blga_set->get("banner_width");
1315  $banner_height = $blga_set->get("banner_height");
1316  if ($a_export) {
1317  $banner = basename($banner);
1318  }
1319  }
1320 
1321  $ppic = null;
1322  if ($this->object->hasProfilePicture()) {
1323  // repository (multi-user)
1324  if ($this->id_type == self::REPOSITORY_NODE_ID) {
1325  // #15030
1326  if ($this->blpg > 0 && !$a_export) {
1327  $post = new ilBlogPosting($this->blpg);
1328  $author_id = $post->getAuthor();
1329  if ($author_id) {
1330  $ppic = ilObjUser::_getPersonalPicturePath($author_id, "xsmall", true, true);
1331 
1332  $name = ilObjUser::_lookupName($author_id);
1333  $name = $name["lastname"] . ", " . ($t = $name["title"] ? $t . " " : "") . $name["firstname"];
1334  }
1335  }
1336  }
1337  // workspace (author == owner)
1338  else {
1339  $ppic = ilObjUser::_getPersonalPicturePath($a_user_id, "xsmall", true, true);
1340  if ($a_export) {
1341  $ppic = basename($ppic);
1342  }
1343  }
1344  }
1345 
1346  $a_tpl->resetHeaderBlock(false);
1347  $a_tpl->setBanner($banner, $banner_width, $banner_height, $a_export);
1348  $a_tpl->setTitleIcon($ppic);
1349  $a_tpl->setTitle($this->object->getTitle());
1350  $a_tpl->setDescription($name);
1351  }
static _lookupName($a_user_id)
lookup user name
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
Class ilBlogPosting.
if($format !==null) $name
Definition: metadata.php:230
$ilUser
Definition: imgupload.php:18
static signFile($path_to_file)
static _getPersonalPicturePath( $a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderList()

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

Build posting month list.

Parameters
array$items
string$a_cmd
bool$a_link_template
bool$a_show_inactive
string$a_export_directory
Returns
string

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

References $author, ilObjectGUI\$ctrl, $ilCtrl, $ilUser, $keyword, ilObjectGUI\$lng, $month, $preview, ilObjectGUI\$user, ilNote\_getNotesOfObject(), ilLink\_getStaticLink(), ilPageObject\_lookupActive(), ilObject\_lookupOwner(), ilCalendarUtil\_numericMonthToString(), buildExportLink(), ilDatePresentation\formatDate(), ilObject2GUI\getAccessHandler(), ilBlogPosting\getKeywords(), ilUserUtil\getNamePresentation(), ilBlogPostingGUI\getSnippet(), getType(), IL_CAL_DATE, IL_NOTE_PUBLIC, isAdmin(), and mayEditPosting().

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

1393  {
1394  $lng = $this->lng;
1395  $ilCtrl = $this->ctrl;
1396  $ilUser = $this->user;
1397 
1398  $wtpl = new ilTemplate("tpl.blog_list.html", true, true, "Modules/Blog");
1399 
1400  // quick editing in portfolio
1401  if ($this->prt_id > 0 &&
1402  stristr($a_cmd, "embedded")) {
1403  if (ilObject::_lookupOwner($this->prt_id) == $ilUser->getId()) {
1404  // see ilPortfolioPageTableGUI::fillRow()
1405  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", $this->user_page);
1406  $link = $ilCtrl->getLinkTargetByClass(array("ilportfoliopagegui", "ilobjbloggui"), "render");
1407  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", "");
1408 
1409  $list = new ilAdvancedSelectionListGUI();
1410  $list->setListTitle($lng->txt("action"));
1411  $list->addItem(
1412  sprintf($lng->txt("prtf_edit_embedded_blog"), $this->object->getTitle()),
1413  "",
1414  $link
1415  );
1416 
1417  $wtpl->setCurrentBlock("prtf_edit_bl");
1418  $wtpl->setVariable("PRTF_BLOG_EDIT", $list->getHTML());
1419  $wtpl->parseCurrentBlock();
1420  }
1421  }
1422 
1423  $is_admin = $this->isAdmin();
1424 
1425  $last_month = null;
1426  $is_empty = true;
1427  foreach ($items as $item) {
1428  // only published items
1429  $is_active = ilBlogPosting::_lookupActive($item["id"], "blp");
1430  if (!$is_active && !$a_show_inactive) {
1431  continue;
1432  }
1433 
1434  $is_empty = false;
1435 
1436  if (!$this->keyword && !$this->author) {
1437  $month = substr($item["created"]->get(IL_CAL_DATE), 0, 7);
1438  }
1439 
1440  if (!$last_month || $last_month != $month) {
1441  if ($last_month) {
1442  $wtpl->setCurrentBlock("month_bl");
1443  $wtpl->parseCurrentBlock();
1444  }
1445 
1446  // title according to current "filter"/navigation
1447  if ($this->keyword) {
1448  $title = $lng->txt("blog_keyword") . ": " . $this->keyword;
1449  } elseif ($this->author) {
1450  $title = $lng->txt("blog_author") . ": " . ilUserUtil::getNamePresentation($this->author);
1451  } else {
1452  $title = ilCalendarUtil::_numericMonthToString((int) substr($month, 5)) .
1453  " " . substr($month, 0, 4);
1454 
1455  $last_month = $month;
1456  }
1457 
1458  $wtpl->setVariable("TXT_CURRENT_MONTH", $title);
1459  }
1460 
1461  if (!$a_link_template) {
1462  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", $this->month);
1463  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $item["id"]);
1464  $preview = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", $a_cmd);
1465  } else {
1466  $preview = $this->buildExportLink($a_link_template, "posting", $item["id"]);
1467  }
1468 
1469  // actions
1470  $posting_edit = $this->mayEditPosting($item["id"], $item["author"]);
1471  if (($posting_edit || $is_admin) && !$a_link_template && $a_cmd == "preview") {
1472  $alist = new ilAdvancedSelectionListGUI();
1473  $alist->setId($item["id"]);
1474  $alist->setListTitle($lng->txt("actions"));
1475 
1476  if ($is_active && $this->object->hasApproval() && !$item["approved"]) {
1477  if ($is_admin) {
1478  $ilCtrl->setParameter($this, "apid", $item["id"]);
1479  $alist->addItem(
1480  $lng->txt("blog_approve"),
1481  "approve",
1482  $ilCtrl->getLinkTarget($this, "approve")
1483  );
1484  $ilCtrl->setParameter($this, "apid", "");
1485  }
1486 
1487  $wtpl->setVariable("APPROVAL", $lng->txt("blog_needs_approval"));
1488  }
1489 
1490  if ($posting_edit) {
1491  $alist->addItem(
1492  $lng->txt("edit_content"),
1493  "edit",
1494  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit")
1495  );
1496 
1497  // #11858
1498  if ($is_active) {
1499  $alist->addItem(
1500  $lng->txt("blog_toggle_draft"),
1501  "deactivate",
1502  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deactivatePageToList")
1503  );
1504  } else {
1505  $alist->addItem(
1506  $lng->txt("blog_toggle_final"),
1507  "activate",
1508  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "activatePageToList")
1509  );
1510  }
1511 
1512  $alist->addItem(
1513  $lng->txt("rename"),
1514  "rename",
1515  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edittitle")
1516  );
1517 
1518  if ($this->object->hasKeywords()) { // #13616
1519  $alist->addItem(
1520  $lng->txt("blog_edit_keywords"),
1521  "keywords",
1522  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editKeywords")
1523  );
1524  }
1525 
1526  $alist->addItem(
1527  $lng->txt("blog_edit_date"),
1528  "editdate",
1529  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editdate")
1530  );
1531  $alist->addItem(
1532  $lng->txt("delete"),
1533  "delete",
1534  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deleteBlogPostingConfirmationScreen")
1535  );
1536  } elseif ($is_admin) {
1537  // #10513
1538  if ($is_active) {
1539  $ilCtrl->setParameter($this, "apid", $item["id"]);
1540  $alist->addItem(
1541  $lng->txt("blog_toggle_draft_admin"),
1542  "deactivate",
1543  $ilCtrl->getLinkTarget($this, "deactivateAdmin")
1544  );
1545  $ilCtrl->setParameter($this, "apid", "");
1546  }
1547 
1548  $alist->addItem(
1549  $lng->txt("delete"),
1550  "delete",
1551  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deleteBlogPostingConfirmationScreen")
1552  );
1553  }
1554 
1555  $wtpl->setCurrentBlock("actions");
1556  $wtpl->setVariable("ACTION_SELECTOR", $alist->getHTML());
1557  $wtpl->parseCurrentBlock();
1558  }
1559 
1560  // comments
1561  if ($this->object->getNotesStatus() && !$a_link_template && !$this->disable_notes) {
1562  // count (public) notes
1563  $count = sizeof(ilNote::_getNotesOfObject(
1564  $this->obj_id,
1565  $item["id"],
1566  "blp",
1568  ));
1569 
1570  if ($a_cmd != "preview") {
1571  $wtpl->setCurrentBlock("comments");
1572  $wtpl->setVariable("TEXT_COMMENTS", $lng->txt("blog_comments"));
1573  $wtpl->setVariable("URL_COMMENTS", $preview);
1574  $wtpl->setVariable("COUNT_COMMENTS", $count);
1575  $wtpl->parseCurrentBlock();
1576  }
1577  /* we disabled comments in edit mode (should always be done via pagegui)
1578  else
1579  {
1580  $hash = ilCommonActionDispatcherGUI::buildAjaxHash(ilCommonActionDispatcherGUI::TYPE_WORKSPACE,
1581  $this->node_id, "blog", $this->obj_id, "blp", $item["id"]);
1582  $notes_link = "#\" onclick=\"".ilNoteGUI::getListCommentsJSCall($hash);
1583  }
1584  */
1585  }
1586 
1587  // permanent link
1588  if ($a_cmd != "preview" && $a_cmd != "previewEmbedded") {
1589  if ($this->id_type == self::WORKSPACE_NODE_ID) {
1590  $goto = $this->getAccessHandler()->getGotoLink($this->node_id, $this->obj_id, "_" . $item["id"]);
1591  } else {
1592  $goto = ilLink::_getStaticLink($this->node_id, $this->getType(), true, "_" . $item["id"]);
1593  }
1594  $wtpl->setCurrentBlock("permalink");
1595  $wtpl->setVariable("URL_PERMALINK", $goto);
1596  $wtpl->setVariable("TEXT_PERMALINK", $lng->txt("blog_permanent_link"));
1597  $wtpl->parseCurrentBlock();
1598  }
1599 
1600  $snippet = ilBlogPostingGUI::getSnippet(
1601  $item["id"],
1602  $this->object->hasAbstractShorten(),
1603  $this->object->getAbstractShortenLength(),
1604  "&hellip;",
1605  $this->object->hasAbstractImage(),
1606  $this->object->getAbstractImageWidth(),
1607  $this->object->getAbstractImageHeight(),
1608  $a_export_directory
1609  );
1610 
1611  if ($snippet) {
1612  $wtpl->setCurrentBlock("more");
1613  $wtpl->setVariable("URL_MORE", $preview);
1614  $wtpl->setVariable("TEXT_MORE", $lng->txt("blog_list_more"));
1615  $wtpl->parseCurrentBlock();
1616  }
1617 
1618 
1619 
1620  if (!$is_active) {
1621  $wtpl->setCurrentBlock("draft_text");
1622  $wtpl->setVariable("DRAFT_TEXT", $lng->txt("blog_draft_text"));
1623  $wtpl->parseCurrentBlock();
1624  $wtpl->setVariable("DRAFT_CLASS", " ilBlogListItemDraft");
1625  }
1626 
1627  $wtpl->setCurrentBlock("posting");
1628 
1629  $author = "";
1630  if ($this->id_type == self::REPOSITORY_NODE_ID) {
1631  $authors = array();
1632 
1633  $author_id = $item["author"];
1634  if ($author_id) {
1635  $authors[] = ilUserUtil::getNamePresentation($author_id);
1636  }
1637 
1638  if (is_array($item["editors"])) {
1639  foreach ($item["editors"] as $editor_id) {
1640  $authors[] = ilUserUtil::getNamePresentation($editor_id);
1641  }
1642  }
1643 
1644  if ($authors) {
1645  $author = implode(", ", $authors) . " - ";
1646  }
1647  }
1648 
1649  // title
1650  $wtpl->setVariable("URL_TITLE", $preview);
1651  $wtpl->setVariable("TITLE", $item["title"]);
1652 
1653  $kw = ilBlogPosting::getKeywords($this->obj_id, $item["id"]);
1654  natcasesort($kw);
1655  $keywords = (count($kw) > 0)
1656  ? "<br>" . $this->lng->txt("keywords") . ": " . implode(", ", $kw)
1657  : "";
1658 
1659  $wtpl->setVariable("DATETIME", $author .
1660  ilDatePresentation::formatDate($item["created"]) . $keywords);
1661 
1662  // content
1663  $wtpl->setVariable("CONTENT", $snippet);
1664 
1665  $wtpl->parseCurrentBlock();
1666  }
1667 
1668  // permalink
1669  if ($a_cmd == "previewFullscreen") {
1670  $this->tpl->setPermanentLink(
1671  "blog",
1672  $this->node_id,
1673  ($this->id_type == self::WORKSPACE_NODE_ID)
1674  ? "_wsp"
1675  : ""
1676  );
1677  }
1678 
1679  if (!$is_empty || $a_show_inactive) {
1680  return $wtpl->get();
1681  }
1682  }
getAccessHandler()
Get access handler.
$preview
static _getNotesOfObject( $a_rep_obj_id, $a_obj_id, $a_obj_type, $a_type=IL_NOTE_PRIVATE, $a_incl_sub=false, $a_filter="", $a_all_public="y", $a_repository_mode=true, $a_sort_ascending=false, $a_news_id=0)
get all notes related to a specific object
static getKeywords($a_obj_id, $a_posting_id)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static _numericMonthToString($a_month, $a_long=true)
numeric month to string
global $ilCtrl
Definition: ilias.php:18
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
const IL_NOTE_PUBLIC
Definition: class.ilNote.php:6
static getSnippet($a_id, $a_truncate=false, $a_truncate_length=500, $a_truncate_sign="...", $a_include_picture=false, $a_picture_width=144, $a_picture_height=144, $a_export_directory=null)
Get first text paragraph of page.
$ilUser
Definition: imgupload.php:18
static _lookupOwner($a_id)
lookup object owner
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
buildExportLink($a_template, $a_type, $a_id)
Build export link.
const IL_CAL_DATE
isAdmin()
Check if user has admin access (approve, may edit & deactivate all postings)
mayEditPosting($a_posting_id, $a_author_id=null)
Check if user may edit posting.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderNavigation()

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

Build navigation blocks.

Parameters
string$a_list_cmd
string$a_posting_cmd
bool$a_link_template
bool$a_show_inactive
int$a_blpgblog page id
Returns
string

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

References $blpg, ilObjectGUI\$ctrl, $DIC, $ilCtrl, $ilSetting, $items, ilObject2GUI\$node_id, ilObjectGUI\$settings, $url, ilRSSButtonGUI\get(), ilRSSButtonGUI\ICON_RSS, ILIAS_HTTP_PATH, mayEditPosting(), renderNavigationByAuthors(), renderNavigationByDate(), and renderNavigationByKeywords().

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

2233  {
2234  $ilCtrl = $this->ctrl;
2236  $a_items = $this->items;
2237 
2238  $blpg = ($a_blpg > 0)
2239  ? $a_blpg
2240  : $this->blpg;
2241 
2242  if ($this->object->getOrder()) {
2243  $order = array_flip($this->object->getOrder());
2244  } else {
2245  $order = array(
2246  "navigation" => 0
2247  ,"keywords" => 2
2248  ,"authors" => 1
2249  );
2250  }
2251 
2252  $wtpl = new ilTemplate("tpl.blog_list_navigation.html", true, true, "Modules/Blog");
2253 
2254  $blocks = array();
2255 
2256  // by date
2257  if (sizeof($a_items)) {
2258  $blocks[$order["navigation"]] = array(
2259  $this->lng->txt("blog_navigation"),
2260  $this->renderNavigationByDate($a_items, $a_list_cmd, $a_posting_cmd, $a_link_template, $a_show_inactive, $a_blpg)
2261  );
2262  }
2263 
2264  if ($this->object->hasKeywords()) {
2265  // keywords
2266  $may_edit_keywords = ($blpg > 0 &&
2267  $this->mayEditPosting($blpg) &&
2268  $a_list_cmd != "preview" &&
2269  $a_list_cmd != "gethtml" &&
2270  !$a_link_template);
2271  $keywords = $this->renderNavigationByKeywords($a_list_cmd, $a_show_inactive, $a_link_template, $a_blpg);
2272  if ($keywords || $may_edit_keywords) {
2273  if (!$keywords) {
2274  $keywords = $this->lng->txt("blog_no_keywords");
2275  }
2276  $cmd = null;
2277  $blocks[$order["keywords"]] = array(
2278  $this->lng->txt("blog_keywords"),
2279  $keywords,
2280  $cmd
2281  ? array($cmd, $this->lng->txt("blog_edit_keywords"))
2282  : null
2283  );
2284  }
2285  }
2286 
2287  // is not part of (html) export
2288  if (!$a_link_template) {
2289  // authors
2290  if ($this->id_type == self::REPOSITORY_NODE_ID &&
2291  $this->object->hasAuthors()) {
2292  $authors = $this->renderNavigationByAuthors($a_items, $a_list_cmd, $a_show_inactive);
2293  if ($authors) {
2294  $blocks[$order["authors"]] = array($this->lng->txt("blog_authors"), $authors);
2295  }
2296  }
2297 
2298  // rss
2299  if ($this->object->hasRSS() &&
2300  $ilSetting->get('enable_global_profiles') &&
2301  $a_list_cmd == "preview") {
2302  // #10827
2303  $blog_id = $this->node_id;
2304  if ($this->id_type != self::WORKSPACE_NODE_ID) {
2305  $blog_id .= "_cll";
2306  }
2307  $url = ILIAS_HTTP_PATH . "/feed.php?blog_id=" . $blog_id .
2308  "&client_id=" . rawurlencode(CLIENT_ID);
2309 
2310  $wtpl->setVariable("RSS_BUTTON", ilRSSButtonGUI::get(ilRSSButtonGUI::ICON_RSS, $url));
2311  }
2312  }
2313 
2314  if (sizeof($blocks)) {
2315  global $DIC;
2316 
2317  $ui_factory = $DIC->ui()->factory();
2318  $ui_renderer = $DIC->ui()->renderer();
2319 
2320  ksort($blocks);
2321  foreach ($blocks as $block) {
2322  $title = $block[0];
2323 
2324  $content = $block[1];
2325 
2326  $secondary_panel = $ui_factory->panel()->secondary()->legacy($title, $ui_factory->legacy($content));
2327 
2328  if (isset($block[2]) && is_array($block[2])) {
2329  $link = $ui_factory->button()->shy($block[2][1], $block[2][0]);
2330  $secondary_panel = $secondary_panel->withFooter($link);
2331  }
2332 
2333  $wtpl->setCurrentBlock("block_bl");
2334  $wtpl->setVariable("BLOCK", $ui_renderer->render($secondary_panel));
2335  $wtpl->parseCurrentBlock();
2336  }
2337  }
2338 
2339  return $wtpl->get();
2340  }
static get($a_type, $a_href="")
Get icon html.
global $ilCtrl
Definition: ilias.php:18
renderNavigationByKeywords( $a_list_cmd="render", $a_show_inactive=false, $a_link_template=false, $a_blpg=0)
Build navigation by keywords block.
renderNavigationByDate(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
Build navigation by date block.
renderNavigationByAuthors(array $a_items, $a_list_cmd="render", $a_show_inactive=false)
global $ilSetting
Definition: privfeed.php:17
$DIC
Definition: xapitoken.php:46
$url
mayEditPosting($a_posting_id, $a_author_id=null)
Check if user may edit posting.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderNavigationByAuthors()

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

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

References $author, ilObjectGUI\$ctrl, $ilCtrl, $items, $month, $name, $url, ilPageObject\_lookupActive(), and ilUserUtil\getNamePresentation().

Referenced by renderNavigation().

1951  {
1952  $ilCtrl = $this->ctrl;
1953 
1954  $authors = array();
1955  foreach ($a_items as $month => $items) {
1956  foreach ($items as $item) {
1957  if (($a_show_inactive || ilBlogPosting::_lookupActive($item["id"], "blp"))) {
1958  if ($item["author"]) {
1959  $authors[] = $item["author"];
1960  }
1961 
1962  if (is_array($item["editors"])) {
1963  foreach ($item["editors"] as $editor_id) {
1964  if ($editor_id != $item["author"]) {
1965  $authors[] = $editor_id;
1966  }
1967  }
1968  }
1969  }
1970  }
1971  }
1972 
1973  $authors = array_unique($authors);
1974  if (sizeof($authors) > 1) {
1975  $list = array();
1976  foreach ($authors as $user_id) {
1977  if ($user_id) {
1978  $ilCtrl->setParameter($this, "ath", $user_id);
1979  $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1980  $ilCtrl->setParameter($this, "ath", "");
1981 
1982  $name = ilUserUtil::getNamePresentation($user_id, true);
1983  $idx = trim(strip_tags($name)) . "///" . $user_id; // #10934
1984  $list[$idx] = array($name, $url);
1985  }
1986  }
1987  ksort($list);
1988 
1989  $wtpl = new ilTemplate("tpl.blog_list_navigation_authors.html", true, true, "Modules/Blog");
1990 
1991  $wtpl->setCurrentBlock("author");
1992  foreach ($list as $author) {
1993  $wtpl->setVariable("TXT_AUTHOR", $author[0]);
1994  $wtpl->setVariable("URL_AUTHOR", $author[1]);
1995  $wtpl->parseCurrentBlock();
1996  }
1997 
1998  return $wtpl->get();
1999  }
2000  }
global $ilCtrl
Definition: ilias.php:18
if($format !==null) $name
Definition: metadata.php:230
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
$url
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderNavigationByDate()

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

Build navigation by date block.

Parameters
array$a_items
string$a_list_cmd
string$a_posting_cmd
bool$a_link_template
bool$a_show_inactive
Returns
string

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

References $blpg, ilObjectGUI\$ctrl, $ilCtrl, $month, $url, ilPageObject\_lookupActive(), ilCalendarUtil\_numericMonthToString(), buildExportLink(), and ilObjBlog\NAV_MODE_LIST.

Referenced by renderNavigation().

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

◆ renderNavigationByKeywords()

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

Build navigation by keywords block.

Parameters
string$a_list_cmd
bool$a_show_inactive
Returns
string

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

References $blpg, ilObjectGUI\$ctrl, $ilCtrl, $keyword, $url, buildExportLink(), getKeywords(), and ilTagging\getRelevanceClass().

Referenced by renderNavigation().

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

◆ renderToolbarNavigation()

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

Toolbar navigation.

Parameters

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

References ilObjectGUI\$ctrl, $DIC, Vendor\Package\$f, ilObjectGUI\$lng, $prtf_embed, ilObjectGUI\$toolbar, getLatestMonth(), getLatestPosting(), getNextMonth(), getNextPosting(), getPreviousMonth(), getPreviousPosting(), mayContribute(), and mayEditPosting().

Referenced by executeCommand(), and preview().

2009  {
2010  global $DIC;
2011 
2012  $toolbar = $DIC->toolbar();
2013  $lng = $DIC->language();
2014  $ctrl = $DIC->ctrl();
2015 
2016  $f = $DIC->ui()->factory();
2017 
2018  $cmd = ($this->prtf_embed)
2019  ? "previewEmbedded"
2020  : "previewFullscreen";
2021 
2022  if ($single_posting) { // single posting view
2023  $latest_posting = $this->getLatestPosting($a_items);
2024  if ($latest_posting != "" && $this->blpg != $latest_posting) {
2025  $ctrl->setParameterByClass("ilblogpostinggui", "blpg", $latest_posting);
2026  $mb = $f->button()->standard(
2027  $lng->txt("blog_latest_posting"),
2028  $ctrl->getLinkTargetByClass("ilblogpostinggui", $cmd)
2029  );
2030  } else {
2031  $mb = $f->button()->standard($lng->txt("blog_latest_posting"), "#")->withUnavailableAction();
2032  }
2033 
2034  $prev_posting = $this->getPreviousPosting($a_items);
2035  if ($prev_posting != "") {
2036  $ctrl->setParameterByClass("ilblogpostinggui", "blpg", $prev_posting);
2037  $pb = $f->button()->standard(
2038  $lng->txt("previous"),
2039  $ctrl->getLinkTargetByClass("ilblogpostinggui", $cmd)
2040  );
2041  } else {
2042  $pb = $f->button()->standard($lng->txt("previous"), "#")->withUnavailableAction();
2043  }
2044 
2045  $next_posting = $this->getNextPosting($a_items);
2046  if ($next_posting != "") {
2047  $ctrl->setParameterByClass("ilblogpostinggui", "blpg", $next_posting);
2048  $nb = $f->button()->standard(
2049  $lng->txt("next"),
2050  $ctrl->getLinkTargetByClass("ilblogpostinggui", $cmd)
2051  );
2052  } else {
2053  $nb = $f->button()->standard($lng->txt("next"), "#")->withUnavailableAction();
2054  }
2055  $ctrl->setParameter($this, "blpg", $this->blpg);
2056  $vc = $f->viewControl()->section($pb, $mb, $nb);
2057  $toolbar->addComponent($vc);
2058  if ($this->mayContribute() && $this->mayEditPosting($this->blpg)) {
2059  $ctrl->setParameter($this, "prvm", "");
2060  $ctrl->setParameterByClass("ilblogpostinggui", "blpg", $this->blpg);
2061  $link = $link = $ctrl->getLinkTargetByClass("ilblogpostinggui", "edit");
2062  $toolbar->addSeparator();
2063  $toolbar->addComponent($f->button()->standard($lng->txt("blog_edit_posting"), $link));
2064  }
2065  } else { // month view
2066  $latest_month = $this->getLatestMonth($a_items);
2067  if ($latest_month != "" && $this->month != $latest_month) {
2068  $ctrl->setParameter($this, "bmn", $latest_month);
2069  $mb = $f->button()->standard(
2070  $lng->txt("blog_latest_posting"),
2071  $ctrl->getLinkTarget($this, "preview")
2072  );
2073  } else {
2074  $mb = $f->button()->standard($lng->txt("blog_latest_posting"), "#")->withUnavailableAction();
2075  }
2076 
2077  $prev_month = $this->getPreviousMonth($a_items);
2078  if ($prev_month != "") {
2079  $ctrl->setParameter($this, "bmn", $prev_month);
2080  $pb = $f->button()->standard($lng->txt("previous"), $ctrl->getLinkTarget($this, "preview"));
2081  } else {
2082  $pb = $f->button()->standard($lng->txt("previous"), "#")->withUnavailableAction();
2083  }
2084 
2085  $next_month = $this->getNextMonth($a_items);
2086  if ($next_month != "") {
2087  $ctrl->setParameter($this, "bmn", $next_month);
2088  $nb = $f->button()->standard($lng->txt("next"), $ctrl->getLinkTarget($this, "preview"));
2089  } else {
2090  $nb = $f->button()->standard($lng->txt("next"), "#")->withUnavailableAction();
2091  }
2092  $ctrl->setParameter($this, "bmn", $this->month);
2093  $vc = $f->viewControl()->section($pb, $mb, $nb);
2094  $toolbar->addComponent($vc);
2095 
2096  if ($this->mayContribute()) {
2097  $ctrl->setParameter($this, "prvm", "");
2098 
2099  $ctrl->setParameter($this, "bmn", "");
2100  $ctrl->setParameter($this, "blpg", "");
2101  $link = $ctrl->getLinkTarget($this, "");
2102  $ctrl->setParameter($this, "blpg", $this->blpg);
2103  $ctrl->setParameter($this, "bmn", $this->month);
2104  $toolbar->addSeparator();
2105  $toolbar->addComponent($f->button()->standard($lng->txt("edit"), $link));
2106  }
2107  }
2108  }
getLatestPosting($a_items)
Get previous posting.
mayContribute()
Check if user may contribute at all.
getNextPosting($a_items)
Get next posting.
getPreviousMonth($a_items)
Get next month.
getNextMonth($a_items)
Get next month.
$DIC
Definition: xapitoken.php:46
getPreviousPosting($a_items)
Get previous posting.
getLatestMonth($a_items)
Get next month.
mayEditPosting($a_posting_id, $a_author_id=null)
Check if user may edit posting.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveStyleSettings()

ilObjBlogGUI::saveStyleSettings ( )

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

References $_POST, $ilSetting, ilObjectGUI\$settings, and ilObjStyleSheet\_lookupStandard().

2970  {
2972 
2973  if ($ilSetting->get("fixed_content_style_id") <= 0 &&
2974  (ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId())
2975  || $this->object->getStyleSheetId() == 0)) {
2976  $this->object->setStyleSheetId((int) $_POST["style_id"]);
2977  $this->object->update();
2978 
2979  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
2980  }
2981  $this->ctrl->redirect($this, "editStyleProperties");
2982  }
static _lookupStandard($a_id)
Lookup standard flag.
global $ilSetting
Definition: privfeed.php:17
$_POST["username"]
+ Here is the call graph for this function:

◆ setContentStyleSheet()

ilObjBlogGUI::setContentStyleSheet (   $a_tpl = null)

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

References ilObjectGUI\$tpl, and ilObjStyleSheet\getContentStylePath().

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

2867  {
2868  $tpl = $this->tpl;
2869 
2870  if ($a_tpl != null) {
2871  $ctpl = $a_tpl;
2872  } else {
2873  $ctpl = $tpl;
2874  }
2875 
2876  $ctpl->setCurrentBlock("ContentStyle");
2877  $ctpl->setVariable(
2878  "LOCATION_CONTENT_STYLESHEET",
2879  ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())
2880  );
2881  $ctpl->parseCurrentBlock();
2882  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setNotification()

ilObjBlogGUI::setNotification ( )
protected

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

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

2505  {
2506  $ilUser = $this->user;
2507  $ilCtrl = $this->ctrl;
2508 
2509  switch ($this->ntf) {
2510  case 1:
2512  break;
2513 
2514  case 2:
2516  break;
2517  }
2518 
2519  $ilCtrl->redirect($this, "preview");
2520  }
global $ilCtrl
Definition: ilias.php:18
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ setSettingsSubTabs()

ilObjBlogGUI::setSettingsSubTabs (   $a_active)
protected

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

References ilObjectGUI\$access, $DIC, and ilObject2GUI\$tree.

Referenced by editStyleProperties(), executeCommand(), and initEditCustomForm().

219  {
220  global $DIC;
221 
222  $tree = $DIC->repositoryTree();
223  $access = $DIC->access();
224 
225  // general properties
226  $this->tabs_gui->addSubTab(
227  "properties",
228  $this->lng->txt("blog_properties"),
229  $this->ctrl->getLinkTarget($this, 'edit')
230  );
231 
232  $this->tabs_gui->addSubTab(
233  "style",
234  $this->lng->txt("obj_sty"),
235  $this->ctrl->getLinkTarget($this, 'editStyleProperties')
236  );
237 
238  // notification settings for blogs in courses and groups
239  if ($this->id_type == self::REPOSITORY_NODE_ID) {
240  $grp_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
241  $crs_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
242 
243  if ((int) $grp_ref_id > 0 || (int) $crs_ref_id > 0) {
244  if ($access->checkAccess('write', '', $this->ref_id)) {
245  $this->tabs_gui->addSubTab(
246  'notifications',
247  $this->lng->txt("notifications"),
248  $this->ctrl->getLinkTargetByClass("ilobjnotificationsettingsgui", '')
249  );
250  }
251  }
252  }
253 
254  $this->tabs_gui->activateSubTab($a_active);
255  }
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ setTabs()

ilObjBlogGUI::setTabs ( )

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

References $help, ilObjectGUI\$lng, $prtf_embed, ilObject2GUI\checkPermissionBool(), and mayContribute().

Referenced by executeCommand().

513  {
514  $lng = $this->lng;
515  $ilHelp = $this->help;
516 
517  if ($this->id_type == self::WORKSPACE_NODE_ID) {
518  $this->ctrl->setParameter($this, "wsp_id", $this->node_id);
519  }
520 
521  $ilHelp->setScreenIdComponent("blog");
522 
523  if ($this->checkPermissionBool("read")) {
524  $this->tabs_gui->addTab(
525  "content",
526  $lng->txt("content"),
527  $this->ctrl->getLinkTarget($this, "")
528  );
529  }
530  if ($this->checkPermissionBool("read") && !$this->prtf_embed) {
531  $this->tabs_gui->addTab(
532  "id_info",
533  $lng->txt("info_short"),
534  $this->ctrl->getLinkTargetByClass(array("ilobjbloggui", "ilinfoscreengui"), "showSummary")
535  );
536  }
537 
538  if ($this->checkPermissionBool("write")) {
539  $this->tabs_gui->addTab(
540  "settings",
541  $lng->txt("settings"),
542  $this->ctrl->getLinkTarget($this, "edit")
543  );
544 
545  if (!$this->prtf_embed) {
546  if ($this->id_type == self::REPOSITORY_NODE_ID) {
547  $this->tabs_gui->addTab(
548  "contributors",
549  $lng->txt("blog_contributors"),
550  $this->ctrl->getLinkTarget($this, "contributors")
551  );
552  }
553 
554  if ($this->id_type == self::REPOSITORY_NODE_ID) {
555  $this->tabs_gui->addTab(
556  "export",
557  $lng->txt("export"),
558  $this->ctrl->getLinkTargetByClass("ilexportgui", "")
559  );
560  }
561  }
562  }
563 
564  if (!$this->prtf_embed) {
565  if ($this->mayContribute()) {
566  $this->tabs_gui->addNonTabbedLink(
567  "preview",
568  $lng->txt("blog_preview"),
569  $this->ctrl->getLinkTarget($this, "preview")
570  );
571  }
572  parent::setTabs();
573  }
574  }
mayContribute()
Check if user may contribute at all.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ triggerAssignmentTool()

ilObjBlogGUI::triggerAssignmentTool ( )
protected

Trigger assignment tool.

Parameters

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

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

Referenced by executeCommand().

885  {
886  $be = new ilBlogExercise($this->node_id);
887  $be_gui = new ilBlogExerciseGUI($this->node_id);
888  $assignments = $be->getAssignmentsOfBlog();
889  if (count($assignments) > 0) {
890  $ass_ids = array_map(function ($i) {
891  return $i["ass_id"];
892  }, $assignments);
893  $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::SHOW_EXC_ASSIGNMENT_INFO, true);
894  $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::EXC_ASS_IDS, $ass_ids);
895  $this->tool_context->current()->addAdditionalData(
897  $be_gui->getActionButtons()
898  );
899  }
900  }
Class ilBlogExerciseGUI.
$i
Definition: metadata.php:24
+ Here is the caller graph for this function:

◆ updateCustom()

ilObjBlogGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

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

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

463  {
464  $lng = $this->lng;
465  $obj_service = $this->getObjectService();
466 
467  if ($this->id_type == self::REPOSITORY_NODE_ID) {
468  $this->object->setApproval($a_form->getInput("approval"));
469  $this->object->setAuthors($a_form->getInput("nav_authors"));
470  $obj_service->commonSettings()->legacyForm($a_form, $this->object)->saveTileImage();
471  }
472  $this->object->setKeywords($a_form->getInput("keywords"));
473  $this->object->setNotesStatus($a_form->getInput("notes"));
474  $this->object->setProfilePicture($a_form->getInput("ppic"));
475  /*
476  $this->object->setBackgroundColor($a_form->getInput("bg_color"));
477  $this->object->setFontColor($a_form->getInput("font_color"));
478  */
479  $this->object->setRSS($a_form->getInput("rss"));
480  $this->object->setAbstractShorten($a_form->getInput("abss"));
481  $this->object->setAbstractShortenLength($a_form->getInput("abssl"));
482  $this->object->setAbstractImage($a_form->getInput("absi"));
483  $this->object->setAbstractImageWidth($a_form->getInput("absiw"));
484  $this->object->setAbstractImageHeight($a_form->getInput("absih"));
485  $this->object->setNavMode($a_form->getInput("nav"));
486  $this->object->setNavModeListMonthsWithPostings($a_form->getInput("nav_list_mon_with_post"));
487  $this->object->setNavModeListMonths($a_form->getInput("nav_list_mon"));
488  $this->object->setOverviewPostings($a_form->getInput("ov_list_post_num"));
489 
490  $order = $a_form->getInput("order");
491  foreach ($order as $idx => $value) {
492  if ($value == $lng->txt("blog_navigation")) {
493  $order[$idx] = "navigation";
494  } elseif ($value == $lng->txt("blog_keywords")) {
495  $order[$idx] = "keywords";
496  } else {
497  $order[$idx] = "authors";
498  }
499  }
500  $this->object->setOrder($order);
501  // banner field is optional
502  $banner = $a_form->getItemByPostVar("banner");
503  if ($banner) {
504  if ($_FILES["banner"]["tmp_name"]) {
505  $this->object->uploadImage($_FILES["banner"]);
506  } elseif ($banner->getDeletionFlag()) {
507  $this->object->deleteImage();
508  }
509  }
510  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
getObjectService()
Get object service.
+ Here is the call graph for this function:

Field Documentation

◆ $apid

ilObjBlogGUI::$apid
protected

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

◆ $author

ilObjBlogGUI::$author
protected

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

Referenced by renderList(), and renderNavigationByAuthors().

◆ $blpg

ilObjBlogGUI::$blpg
protected

◆ $edt

ilObjBlogGUI::$edt
protected

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

◆ $gtp

ilObjBlogGUI::$gtp
protected

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

Referenced by executeCommand().

◆ $help

ilObjBlogGUI::$help
protected

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

Referenced by setTabs().

◆ $items

◆ $keyword

ilObjBlogGUI::$keyword
protected

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

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

◆ $main_menu

ilObjBlogGUI::$main_menu
protected

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

Referenced by renderFullScreen().

◆ $month

◆ $month_default

ilObjBlogGUI::$month_default
protected

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

◆ $nav_history

ilObjBlogGUI::$nav_history
protected

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

Referenced by executeCommand().

◆ $new_type

ilObjBlogGUI::$new_type
protected

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

◆ $ntf

ilObjBlogGUI::$ntf
protected

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

◆ $old_nr

ilObjBlogGUI::$old_nr
protected

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

◆ $ppage

ilObjBlogGUI::$ppage
protected

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

◆ $prt_id

ilObjBlogGUI::$prt_id
protected

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

◆ $prtf_embed

ilObjBlogGUI::$prtf_embed = false

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

Referenced by renderToolbarNavigation(), and setTabs().

◆ $prvm

ilObjBlogGUI::$prvm
protected

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

◆ $rbacadmin

ilObjBlogGUI::$rbacadmin
protected

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

Referenced by addContributor(), and removeContributor().

◆ $tabs

ilObjBlogGUI::$tabs
protected

◆ $tool_context

ilObjBlogGUI::$tool_context
protected

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

◆ $user_page

ilObjBlogGUI::$user_page
protected

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


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