ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ()
 
 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...
 
 renderList (array $items, $a_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_export_directory=null)
 Build posting month list. More...
 
 renderNavigation (array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
 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...
 
 exportHTMLPages ($a_target_directory, $a_link_template=null, $a_tpl_callback=null, $a_co_page_html_export=null, $a_index_name="index.html")
 Export all pages. More...
 
 getNotesSubId ()
 
 disableNotes ($a_value=false)
 
 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...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
 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...
 
- 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...
 
 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 ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. 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...
 

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)
 
 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...
 
 renderFullscreenHeader ($a_tpl, $a_user_id, $a_export=false)
 Render banner, user name. More...
 
 buildPostingList ($a_obj_id)
 Gather all blog postings. More...
 
 renderNavigationByDate (array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
 Build navigation by date block. More...
 
 renderNavigationByKeywords ($a_list_cmd="render", $a_show_inactive=false, $a_link_template=false)
 Build navigation by keywords block. More...
 
 renderNavigationByAuthors (array $a_items, $a_list_cmd="render", $a_show_inactive=false)
 
 buildExportLink ($a_template, $a_type, $a_id)
 Build static export link. More...
 
 buildExportTemplate ($a_back_url="")
 Build export "frame". More...
 
 writeExportFile ($a_target_directory, $a_file, $a_tpl, $a_content, $a_right_content=null, $a_back=null)
 Write HTML to file. More...
 
 addHeaderActionForCommand ($a_cmd)
 
 initHeaderAction ($sub_type=null, $sub_id=null, $a_is_preview=false)
 
 setNotification ()
 
 filterInactivePostings ()
 Filter inactive items from items list. More...
 
 filterItemsByKeyWord (array $a_items, $a_keyword)
 
 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...
 
 deleteConfirmation ()
 Display delete confirmation form (workspace specific) 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...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. 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
 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...
 
 showMountWebfolderIcon ()
 
 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...
 
 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...
 
 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

 $month
 
 $items
 
 $keyword
 
 $author
 
 $month_default
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Static Protected Attributes

static $keyword_export_map
 

Additional Inherited Members

- 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
 
 $ilias
 
 $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
 

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 32 of file class.ilObjBlogGUI.php.

References $ilCtrl, ilObjectGUI\$lng, buildPostingList(), ilBlogPosting\lookupBlogId(), object, and string.

33  {
34  global $lng, $ilCtrl;
35 
36  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
37 
38 
39  if ($_REQUEST["blpg"] > 0 && ilBlogPosting::lookupBlogId($_REQUEST["blpg"]) != $this->object->getId())
40  {
41  throw new ilException("Posting ID does not match blog.");
42  }
43 
44 
45  if($this->object)
46  {
47  $this->month = (string)$_REQUEST["bmn"];
48  $this->keyword = (string)$_REQUEST["kwd"];
49  $this->author = (int)$_REQUEST["ath"];
50 
51  // gather postings by month
52  $this->items = $this->buildPostingList($this->object->getId());
53  if($this->items)
54  {
55  // current month (if none given or empty)
56  if(!$this->month || !$this->items[$this->month])
57  {
58  $this->month = array_keys($this->items);
59  $this->month = array_shift($this->month);
60  $this->month_default = true;
61  }
62  }
63 
64  $ilCtrl->setParameter($this, "bmn", $this->month);
65  }
66 
67  $lng->loadLanguageModule("blog");
68  $ilCtrl->saveParameter($this, "prvm");
69  }
Base class for ILIAS Exception handling.
static lookupBlogId($a_posting_id)
Lookup blog id.
Add rich text string
The name of the decorator.
global $ilCtrl
Definition: ilias.php:18
buildPostingList($a_obj_id)
Gather all blog postings.
Create new PHPExcel object
obj_idprivate
+ 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 3104 of file class.ilObjBlogGUI.php.

References $_GET, and exit.

3105  {
3106  if(substr($a_target, -3) == "wsp")
3107  {
3108  $id = explode("_", $a_target);
3109 
3110  $_GET["baseClass"] = "ilSharedResourceGUI";
3111  $_GET["wsp_id"] = $id[0];
3112  if(sizeof($id) == 3)
3113  {
3114  $_GET["gtp"] = $id[1];
3115  }
3116  }
3117  else
3118  {
3119  $id = explode("_", $a_target);
3120 
3121  $_GET["baseClass"] = "ilRepositoryGUI";
3122  $_GET["ref_id"] = $id[0];
3123  $_GET["cmd"] = "preview";
3124  if(sizeof($id) == 2)
3125  {
3126  if(is_numeric($id[1]))
3127  {
3128  $_GET["gtp"] = $id[1];
3129  }
3130  else
3131  {
3132  $_REQUEST["kwd"] = $id[1];
3133  }
3134  }
3135  }
3136 
3137  include("ilias.php");
3138  exit;
3139  }
$_GET["client_id"]

◆ addContributor()

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

Centralized method to add contributors.

Parameters
array$a_user_ids

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

References $ilCtrl, ilObjectGUI\$lng, ilObject2GUI\checkPermissionBool(), contributors(), object, ilUtil\sendFailure(), and ilUtil\sendSuccess().

Referenced by addUserFromAutoComplete().

2829  {
2830  global $ilCtrl, $lng, $rbacreview, $rbacadmin;
2831 
2832  if(!$this->checkPermissionBool("write"))
2833  {
2834  return;
2835  }
2836 
2837  if(!count($a_user_ids) || !$a_user_type)
2838  {
2839  ilUtil::sendFailure($lng->txt("no_checkbox"));
2840  return $this->contributors();
2841  }
2842 
2843  // get contributor role
2844  $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
2845  if(!in_array($a_user_type, $local_roles))
2846  {
2847  ilUtil::sendFailure($lng->txt("missing_perm"));
2848  return $this->contributors();
2849  }
2850 
2851  foreach($a_user_ids as $user_id)
2852  {
2853  if(!$rbacreview->isAssigned($user_id, $a_user_type))
2854  {
2855  $rbacadmin->assignUser($a_user_type, $user_id);
2856  }
2857  }
2858 
2859  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
2860  $ilCtrl->redirect($this, "contributors");
2861  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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.
Create new PHPExcel object
obj_idprivate
+ 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 2455 of file class.ilObjBlogGUI.php.

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

Referenced by executeCommand().

2456  {
2457  global $ilUser, $ilCtrl;
2458 
2459  // preview?
2460  if($a_cmd == "preview" || $a_cmd == "previewFullscreen" || $_GET["prvm"])
2461  {
2462  // notification
2463  if($ilUser->getId() != ANONYMOUS_USER_ID)
2464  {
2465  if(!$_GET["prvm"])
2466  {
2467  $ilCtrl->setParameter($this, "prvm", "fsc");
2468  }
2469  $this->insertHeaderAction($this->initHeaderAction(null, null, true));
2470  if(!$_GET["prvm"])
2471  {
2472  $ilCtrl->setParameter($this, "prvm", "");
2473  }
2474  }
2475  }
2476  else
2477  {
2478  return parent::addHeaderAction();
2479  }
2480  }
$_GET["client_id"]
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 2721 of file class.ilObjBlogGUI.php.

References ilObject2GUI\$node_id, and object.

2722  {
2723  global $ilLocator;
2724 
2725  if (is_object($this->object))
2726  {
2727  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->node_id);
2728  }
2729  }
Create new PHPExcel object
obj_idprivate

◆ addToDeskObject()

ilObjBlogGUI::addToDeskObject ( )
See also
ilDesktopItemHandling::addToDesk()

Implements ilDesktopItemHandling.

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

References ilObjectGUI\$lng, ilDesktopItemGUI\addToDesktop(), and ilUtil\sendSuccess().

2933  {
2934  global $lng;
2935 
2936  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
2938  ilUtil::sendSuccess($lng->txt("added_to_desktop"));
2939  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static addToDesktop()
Add desktop item public.
+ Here is the call graph for this function:

◆ addUserFromAutoComplete()

ilObjBlogGUI::addUserFromAutoComplete ( )

Autocomplete submit.

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

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

2796  {
2797  global $lng;
2798 
2799  if(!strlen(trim($_POST['user_login'])))
2800  {
2801  ilUtil::sendFailure($lng->txt('msg_no_search_string'));
2802  return $this->contributors();
2803  }
2804  $users = explode(',', $_POST['user_login']);
2805 
2806  $user_ids = array();
2807  foreach($users as $user)
2808  {
2809  $user_id = ilObjUser::_lookupId($user);
2810 
2811  if(!$user_id)
2812  {
2813  ilUtil::sendFailure($lng->txt('user_not_known'));
2814  return $this->contributors();
2815  }
2816 
2817  $user_ids[] = $user_id;
2818  }
2819 
2820  return $this->addContributor($user_ids, $_POST["user_type"]);
2821  }
static _lookupId($a_user_str)
Lookup id by login.
addContributor($a_user_ids=array(), $a_user_type=null)
Centralized method to add contributors.
Create styles array
The data for the language used.
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 89 of file class.ilObjBlogGUI.php.

References $ilCtrl, and ilUtil\sendSuccess().

90  {
91  global $ilCtrl;
92 
93  ilUtil::sendSuccess($this->lng->txt("object_added"), true);
94  $ilCtrl->redirect($this, "");
95  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ approve()

ilObjBlogGUI::approve ( )

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

References $_GET, isAdmin(), and ilUtil\sendSuccess().

2732  {
2733  if($this->isAdmin() && (int)$_GET["apid"])
2734  {
2735  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
2736  $post = new ilBlogPosting((int)$_GET["apid"]);
2737  $post->setApproved(true);
2738  $post->setBlogNodeId($this->node_id, ($this->id_type == self::WORKSPACE_NODE_ID));
2739  $post->update(true, false, true, "new"); // #13434
2740 
2741  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
2742  }
2743 
2744  $this->ctrl->redirect($this, "render");
2745  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilBlogPosting.
$_GET["client_id"]
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 1061 of file class.ilObjBlogGUI.php.

References $a_content.

Referenced by executeCommand(), and getHTML().

1062  {
1063  $wtpl = new ilTemplate("tpl.blog_embedded.html", true, true, "Modules/Blog");
1064  $wtpl->setVariable("VAL_LIST", $a_content);
1065  $wtpl->setVariable("VAL_NAVIGATION", $a_nav);
1066  return $wtpl->get();
1067  }
$a_content
Definition: workflow.php:94
special template class to simplify handling of ITX/PEAR
+ Here is the caller graph for this function:

◆ buildExportFile()

ilObjBlogGUI::buildExportFile ( )

Build export file.

Returns
string

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

References ilExport\_createExportDirectory(), ilExport\_getExportDirectory(), ilObjUser\_getPersonalPicturePath(), ilUtil\delDir(), exportHTMLPages(), ilUtil\makeDir(), object, time, and ilUtil\zip().

Referenced by export().

2130  {
2131  // create export file
2132  include_once("./Services/Export/classes/class.ilExport.php");
2133  ilExport::_createExportDirectory($this->object->getId(), "html", "blog");
2134  $exp_dir = ilExport::_getExportDirectory($this->object->getId(), "html", "blog");
2135 
2136  $subdir = $this->object->getType()."_".$this->object->getId();
2137  $export_dir = $exp_dir."/".$subdir;
2138 
2139  // initialize temporary target directory
2140  ilUtil::delDir($export_dir);
2141  ilUtil::makeDir($export_dir);
2142 
2143  // system style html exporter
2144  include_once("./Services/Style/System/classes/class.ilSystemStyleHTMLExport.php");
2145  $this->sys_style_html_export = new ilSystemStyleHTMLExport($export_dir);
2146  $this->sys_style_html_export->addImage("icon_blog.svg");
2147  $this->sys_style_html_export->export();
2148 
2149  // init co page html exporter
2150  include_once("./Services/COPage/classes/class.ilCOPageHTMLExport.php");
2151  $this->co_page_html_export = new ilCOPageHTMLExport($export_dir);
2152  $this->co_page_html_export->setContentStyleId($this->object->getStyleSheetId());
2153  $this->co_page_html_export->createDirectories();
2154  $this->co_page_html_export->exportStyles();
2155  $this->co_page_html_export->exportSupportScripts();
2156 
2157  // banner / profile picture
2158  $blga_set = new ilSetting("blga");
2159  if($blga_set->get("banner"))
2160  {
2161  $banner = $this->object->getImageFullPath();
2162  if($banner)
2163  {
2164  copy($banner, $export_dir."/".basename($banner));
2165  }
2166  }
2167  $ppic = ilObjUser::_getPersonalPicturePath($this->object->getOwner(), "xsmall", true, true);
2168  if($ppic)
2169  {
2170  $ppic = array_shift(explode("?", $ppic));
2171  copy($ppic, $export_dir."/".basename($ppic));
2172  }
2173 
2174  // export pages
2175  $this->exportHTMLPages($export_dir);
2176 
2177  // zip everything
2178  if (true)
2179  {
2180  // zip it all
2181  $date = time();
2182  $zip_file = ilExport::_getExportDirectory($this->object->getId(), "html", "blog").
2183  "/".$date."__".IL_INST_ID."__".
2184  $this->object->getType()."_".$this->object->getId().".zip";
2185  ilUtil::zip($export_dir, $zip_file);
2186  ilUtil::delDir($export_dir);
2187  }
2188 
2189  return $zip_file;
2190  }
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
ILIAS Setting Class.
HTML export class for pages.
HTML export class for system styles.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
Create new PHPExcel object
obj_idprivate
static _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
exportHTMLPages($a_target_directory, $a_link_template=null, $a_tpl_callback=null, $a_co_page_html_export=null, $a_index_name="index.html")
Export all pages.
+ 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 static export link.

Parameters
string$a_template
string$a_type
mixed$a_id
Returns
string

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

References $a_type, and getKeywords().

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

2333  {
2334  switch($a_type)
2335  {
2336  case "list":
2337  $a_type = "m";
2338  break;
2339  break;
2340 
2341  case "keyword":
2342  if(!self::$keyword_export_map)
2343  {
2344  self::$keyword_export_map = array_flip(array_keys($this->getKeywords(false)));
2345  }
2346  $a_id = self::$keyword_export_map[$a_id];
2347  $a_type = "k";
2348  break;
2349 
2350  default:
2351  $a_type = "p";
2352  break;
2353  }
2354 
2355  $link = str_replace("{TYPE}", $a_type, $a_template);
2356  return str_replace("{ID}", $a_id, $link);
2357  }
$a_type
Definition: workflow.php:93
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:

◆ buildExportTemplate()

ilObjBlogGUI::buildExportTemplate (   $a_back_url = "")
protected

Build export "frame".

Parameters
type$a_back_url
Returns
ilTemplate

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

References ilObjectGUI\$lng, ilObjectGUI\$tpl, object, and renderFullscreenHeader().

Referenced by exportHTMLPages().

2366  {
2367  global $ilTabs, $lng;
2368 
2369  $tpl = $this->co_page_html_export->getPreparedMainTemplate();
2370 
2371  $tpl->getStandardTemplate();
2372 
2373  $ilTabs->clearTargets();
2374  if($a_back_url)
2375  {
2376  $ilTabs->setBackTarget($lng->txt("back"), $a_back_url);
2377  }
2378 
2379  $this->renderFullscreenHeader($tpl, $this->object->getOwner(), true);
2380 
2381  return $tpl;
2382  }
renderFullscreenHeader($a_tpl, $a_user_id, $a_export=false)
Render banner, user name.
Create new PHPExcel object
obj_idprivate
+ 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 1255 of file class.ilObjBlogGUI.php.

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

Referenced by __construct().

1256  {
1257  $author_found = false;
1258 
1259  $items = array();
1260  foreach(ilBlogPosting::getAllPostings($a_obj_id) as $posting)
1261  {
1262  if($this->author &&
1263  ($posting["author"] == $this->author ||
1264  (is_array($posting["editors"]) && in_array($this->author, $posting["editors"]))))
1265  {
1266  $author_found = true;
1267  }
1268 
1269  $month = substr($posting["created"]->get(IL_CAL_DATE), 0, 7);
1270  $items[$month][$posting["id"]] = $posting;
1271  }
1272 
1273  if($this->author && !$author_found)
1274  {
1275  $this->author = null;
1276  }
1277 
1278  return $items;
1279  }
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
Create styles array
The data for the language used.
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 2866 of file class.ilObjBlogGUI.php.

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

2867  {
2868  $ids = $_POST["id"];
2869 
2870  if(!sizeof($ids))
2871  {
2872  ilUtil::sendFailure($this->lng->txt("select_one"), true);
2873  $this->ctrl->redirect($this, "contributors");
2874  }
2875 
2876  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
2877  $confirm = new ilConfirmationGUI();
2878  $confirm->setHeaderText($this->lng->txt('blog_confirm_delete_contributors'));
2879  $confirm->setFormAction($this->ctrl->getFormAction($this, 'removeContributor'));
2880  $confirm->setConfirm($this->lng->txt('delete'), 'removeContributor');
2881  $confirm->setCancel($this->lng->txt('cancel'), 'contributors');
2882 
2883  include_once 'Services/User/classes/class.ilUserUtil.php';
2884 
2885  foreach($ids as $user_id)
2886  {
2887  $confirm->addItem('id[]', $user_id,
2888  ilUserUtil::getNamePresentation($user_id, false, false, "", true));
2889  }
2890 
2891  $this->tpl->setContent($confirm->getHTML());
2892  }
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)
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 2752 of file class.ilObjBlogGUI.php.

References $ilCtrl, ilObjectGUI\$lng, ilObject2GUI\$node_id, $tbl, ilObjectGUI\$tpl, array, ilObject2GUI\checkPermissionBool(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), object, and ilUtil\sendInfo().

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

2753  {
2754  global $ilTabs, $ilToolbar, $ilCtrl, $lng, $tpl;
2755 
2756  if(!$this->checkPermissionBool("write"))
2757  {
2758  return;
2759  }
2760 
2761  $ilTabs->activateTab("contributors");
2762 
2763  $local_roles = $this->object->getAllLocalRoles($this->node_id);
2764 
2765  // add member
2766  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
2768  $this,
2769  $ilToolbar,
2770  array(
2771  'auto_complete_name' => $lng->txt('user'),
2772  'submit_name' => $lng->txt('add'),
2773  'add_search' => true,
2774  'add_from_container' => $this->node_id,
2775  'user_type' => $local_roles
2776  ),
2777  true
2778  );
2779 
2780  $other_roles = $this->object->getRolesWithContributeOrRedact($this->node_id);
2781  if($other_roles)
2782  {
2783  ilUtil::sendInfo(sprintf($lng->txt("blog_contribute_other_roles"), implode(", ", $other_roles)));
2784  }
2785 
2786  include_once "Modules/Blog/classes/class.ilContributorTableGUI.php";
2787  $tbl = new ilContributorTableGUI($this, "contributors", $this->object->getAllLocalRoles($this->node_id));
2788 
2789  $tpl->setContent($tbl->getHTML());
2790  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
$tbl
Definition: example_048.php:81
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
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 798 of file class.ilObjBlogGUI.php.

References $_POST, $ilCtrl, $ilUser, $title, date, object, ilUtil\sendFailure(), and ilUtil\stripSlashes().

799  {
800  global $ilCtrl, $ilUser;
801 
802  $title = trim(ilUtil::stripSlashes($_POST["title"]));
803  if($title)
804  {
805  // create new posting
806  include_once("./Modules/Blog/classes/class.ilBlogPosting.php");
807  $posting = new ilBlogPosting();
808  $posting->setTitle($title);
809  $posting->setBlogId($this->object->getId());
810  $posting->setActive(false);
811  $posting->setAuthor($ilUser->getId());
812  $posting->create();
813 
814  // switch month list to current month (will include new posting)
815  $ilCtrl->setParameter($this, "bmn", date("Y-m"));
816 
817  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $posting->getId());
818  $ilCtrl->redirectByClass("ilblogpostinggui", "edit");
819  }
820  else
821  {
822  ilUtil::sendFailure($this->lng->txt("msg_no_title"), true);
823  $ilCtrl->redirect($this, "render");
824  }
825  }
Class ilBlogPosting.
global $ilCtrl
Definition: ilias.php:18
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
$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.
Create new PHPExcel object
obj_idprivate
$_POST["username"]
+ Here is the call graph for this function:

◆ createStyle()

ilObjBlogGUI::createStyle ( )

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

3068  {
3069  $this->ctrl->redirectByClass("ilobjstylesheetgui", "create");
3070  }

◆ deactivateAdmin()

ilObjBlogGUI::deactivateAdmin ( )

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

References $_GET, ilObject2GUI\checkPermissionBool(), and ilUtil\sendSuccess().

2954  {
2955  if($this->checkPermissionBool("write") && (int)$_GET["apid"])
2956  {
2957  // ilBlogPostingGUI::deactivatePage()
2958  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
2959  $post = new ilBlogPosting((int)$_GET["apid"]);
2960  $post->setApproved(false);
2961  $post->setActive(false);
2962  $post->update(true, false, false);
2963 
2964  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
2965  }
2966 
2967  $this->ctrl->redirect($this, "render");
2968  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilBlogPosting.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
$_GET["client_id"]
+ Here is the call graph for this function:

◆ deleteStyle()

ilObjBlogGUI::deleteStyle ( )

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

3078  {
3079  $this->ctrl->redirectByClass("ilobjstylesheetgui", "delete");
3080  }

◆ disableNotes()

ilObjBlogGUI::disableNotes (   $a_value = false)

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

2451  {
2452  $this->disable_notes = (bool)$a_value;
2453  }

◆ editStyle()

ilObjBlogGUI::editStyle ( )

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

3073  {
3074  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
3075  }

◆ editStyleProperties()

ilObjBlogGUI::editStyleProperties ( )

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

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

2995  {
2996  $this->checkPermission("write");
2997 
2998  $this->tabs_gui->activateTab("settings");
2999  $this->setSettingsSubTabs("style");
3000 
3001  $form = $this->initStylePropertiesForm();
3002  $this->tpl->setContent($form->getHTML());
3003  }
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 437 of file class.ilObjBlogGUI.php.

References $_GET, $cmd, $ilCtrl, $info, ilObjectGUI\$lng, $ret, ilObjectGUI\$tpl, addHeaderActionForCommand(), array, buildEmbedded(), ilObject2GUI\checkPermissionBool(), ilBlogPosting\exists(), filterInactivePostings(), ilObject2GUI\getAccessHandler(), ilObject2GUI\getCreationMode(), ilObjStyleSheet\getEffectiveContentStyleId(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), infoScreenForward(), mayContribute(), mayEditPosting(), object, ilObjectGUI\omitLocator(), ilObject2GUI\prepareOutput(), preview(), renderFullScreen(), renderNavigation(), ilUtil\sendFailure(), ilUtil\sendInfo(), setContentStyleSheet(), ilObject2GUI\setLocator(), and ilFileInputGUI\setPersonalWorkspaceQuotaCheck().

438  {
439  global $ilCtrl, $tpl, $ilTabs, $lng, $ilNavigationHistory;
440 
441  // goto link to blog posting
442  if($_GET["gtp"])
443  {
444  $page_id = (int)$_GET["gtp"];
445  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
446  if(ilBlogPosting::exists($this->object_id, $page_id))
447  {
448  // #12312
449  $ilCtrl->setCmdClass("ilblogpostinggui");
450  $_GET["blpg"] = $page_id;
451  $ilCtrl->setCmd("previewFullscreen");
452  }
453  else
454  {
455  ilUtil::sendFailure($lng->txt("blog_posting_not_found"));
456  }
457  }
458 
459  $next_class = $ilCtrl->getNextClass($this);
460  $cmd = $ilCtrl->getCmd();
461 
462  if($this->id_type == self::REPOSITORY_NODE_ID)
463  {
464  // add entry to navigation history
465  if(!$this->getCreationMode() &&
466  $this->getAccessHandler()->checkAccess("read", "", $this->node_id))
467  {
468  $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset");
469  $ilNavigationHistory->addItem($this->node_id, $link, "blog");
470  }
471  }
472 
473  switch($next_class)
474  {
475  case 'ilblogpostinggui':
476  if(!$this->prtf_embed)
477  {
478  $tpl->getStandardTemplate();
479  }
480 
481  if(!$this->checkPermissionBool("read"))
482  {
483  ilUtil::sendInfo($lng->txt("no_permission"));
484  return;
485  }
486 
487  // #9680
488  if($this->id_type == self::REPOSITORY_NODE_ID)
489  {
490  $this->setLocator();
491  }
492  else
493  {
494  include_once "Services/Form/classes/class.ilFileInputGUI.php";
496  }
497  $ilTabs->setBackTarget($lng->txt("back"),
498  $ilCtrl->getLinkTarget($this, ""));
499 
501  $this->object->getStyleSheetId(), "blog");
502 
503  include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
504  $bpost_gui = new ilBlogPostingGUI($this->node_id,
505  $this->getAccessHandler(),
506  $_GET["blpg"],
507  $_GET["old_nr"],
508  ($this->object->getNotesStatus() && !$this->disable_notes),
509  $this->mayEditPosting($_GET["blpg"]),
510  $style_sheet_id);
511 
512  // keep preview mode through notes gui (has its own commands)
513  switch($cmd)
514  {
515  // blog preview
516  case "previewFullscreen":
517  $ilCtrl->setParameter($this, "prvm", "fsc");
518  break;
519 
520  // blog in portfolio
521  case "previewEmbedded":
522  $ilCtrl->setParameter($this, "prvm", "emb");
523  break;
524 
525  // edit
526  default:
527  $this->setContentStyleSheet();
528 
529  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $_GET["blpg"]);
530  $this->tabs_gui->addNonTabbedLink("preview", $lng->txt("blog_preview"),
531  $this->ctrl->getLinkTargetByClass("ilblogpostinggui", "previewFullscreen"));
532  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", "");
533  break;
534  }
535 
536  $ret = $ilCtrl->forwardCommand($bpost_gui);
537  if ($ret != "")
538  {
539  // keep preview mode through notes gui
540  if($_REQUEST["prvm"])
541  {
542  $cmd = "preview".(($_REQUEST["prvm"] == "fsc") ? "Fullscreen" : "Embedded");
543  }
544 
545  // $is_owner = $this->object->getOwner() == $ilUser->getId();
546  $is_owner = $this->mayContribute();
547  $is_active = $bpost_gui->getBlogPosting()->getActive();
548 
549  // do not show inactive postings
550  if(($cmd == "previewFullscreen" || $cmd == "previewEmbedded")
551  && !$is_owner && !$is_active)
552  {
553  $this->ctrl->redirect($this, "preview");
554  }
555 
556  switch($cmd)
557  {
558  // blog preview
559  case "previewFullscreen":
561  $this->filterInactivePostings();
562  $nav = $this->renderNavigation($this->items, "preview", $cmd);
563  $this->renderFullScreen($ret, $nav);
564  break;
565 
566  // blog in portfolio
567  case "previewEmbedded":
568  $this->filterInactivePostings();
569  $nav = $this->renderNavigation($this->items, "gethtml", $cmd);
570  return $this->buildEmbedded($ret, $nav);
571 
572  // ilias/editor
573  default:
574  // infos about draft status / snippet
575  $info = array();
576  if(!$is_active)
577  {
578  // single author blog (owner) in personal workspace
579  if($this->id_type == self::WORKSPACE_NODE_ID)
580  {
581  $info[] = $lng->txt("blog_draft_info");
582  }
583  else
584  {
585  $info[] = $lng->txt("blog_draft_info_contributors");
586  }
587  }
588  if($cmd != "history" && !$bpost_gui->getBlogPosting()->getFirstParagraphText())
589  {
590  $info[] = $lng->txt("blog_new_posting_info");
591  }
592  if($this->object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved())
593  {
594  // #9737
595  $info[] = $lng->txt("blog_posting_edit_approval_info");
596  }
597  if(sizeof($info) && !$tpl->hasMessage("info")) // #15121
598  {
599  ilUtil::sendInfo(implode("<br />", $info));
600  }
601  // revert to edit cmd to avoid confusion
602  $this->addHeaderActionForCommand("render");
603  $tpl->setContent($ret);
604  $nav = $this->renderNavigation($this->items, "render", $cmd, null, $is_owner);
605  $tpl->setRightContent($nav);
606  break;
607  }
608  }
609  break;
610 
611  case "ilinfoscreengui":
612  $this->prepareOutput();
613  $this->addHeaderActionForCommand("render");
614  $this->infoScreenForward();
615  break;
616 
617  case "ilnotegui":
618  $this->preview();
619  break;
620 
621  case "ilcommonactiondispatchergui":
622  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
624  $this->ctrl->forwardCommand($gui);
625  break;
626 
627  case "ilpermissiongui":
628  $this->prepareOutput();
629  $ilTabs->activateTab("id_permissions");
630  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
631  $perm_gui = new ilPermissionGUI($this);
632  $this->ctrl->forwardCommand($perm_gui);
633  break;
634 
635  case "ilobjectcopygui":
636  $this->prepareOutput();
637  include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
638  $cp = new ilObjectCopyGUI($this);
639  $cp->setType("blog");
640  $this->ctrl->forwardCommand($cp);
641  break;
642 
643  case 'ilrepositorysearchgui':
644  $this->prepareOutput();
645  $ilTabs->activateTab("contributors");
646  include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
647  $rep_search = new ilRepositorySearchGUI();
648  $rep_search->setTitle($this->lng->txt("blog_add_contributor"));
649  $rep_search->setCallback($this,'addContributor',$this->object->getAllLocalRoles($this->node_id));
650  $this->ctrl->setReturn($this,'contributors');
651  $ret =& $this->ctrl->forwardCommand($rep_search);
652  break;
653 
654  case 'ilexportgui':
655  $this->prepareOutput();
656  $ilTabs->activateTab("export");
657  include_once("./Services/Export/classes/class.ilExportGUI.php");
658  $exp_gui = new ilExportGUI($this);
659  $exp_gui->addFormat("xml");
660  $exp_gui->addFormat("html", null, $this, "buildExportFile"); // #13419
661  $ret = $ilCtrl->forwardCommand($exp_gui);
662  break;
663 
664  case "ilobjstylesheetgui":
665  include_once ("./Services/Style/Content/classes/class.ilObjStyleSheetGUI.php");
666  $this->ctrl->setReturn($this, "editStyleProperties");
667  $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
668  $style_gui->omitLocator();
669  if ($cmd == "create" || $_GET["new_type"]=="sty")
670  {
671  $style_gui->setCreationMode(true);
672  }
673 
674  if ($cmd == "confirmedDelete")
675  {
676  $this->object->setStyleSheetId(0);
677  $this->object->update();
678  }
679 
680  $ret = $this->ctrl->forwardCommand($style_gui);
681 
682  if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
683  {
684  $style_id = $ret;
685  $this->object->setStyleSheetId($style_id);
686  $this->object->update();
687  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
688  }
689  break;
690 
691  case "ilblogexercisegui":
692  $this->ctrl->setReturn($this, "render");
693  include_once "Modules/Blog/classes/class.ilBlogExerciseGUI.php";
694  $gui = new ilBlogExerciseGUI($this->node_id);
695  $this->ctrl->forwardCommand($gui);
696  break;
697 
698  default:
699  if($cmd != "gethtml")
700  {
701  // desktop item handling, must be toggled before header action
702  if($cmd == "addToDesk" || $cmd == "removeFromDesk")
703  {
704  $this->{$cmd."Object"}();
705  if($_GET["prvm"])
706  {
707  $cmd = "preview";
708  }
709  else
710  {
711  $cmd = "render";
712  }
713  $ilCtrl->setCmd($cmd);
714  }
716  }
717  if(!$this->prtf_embed)
718  {
719  return parent::executeCommand();
720  }
721  else
722  {
723  if(!$cmd)
724  {
725  $cmd = "render";
726  }
727  return $this->$cmd();
728  }
729  }
730 
731  return true;
732  }
renderNavigation(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build navigation blocks.
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.
$_GET["client_id"]
Class ilBlogPosting GUI class.
getAccessHandler()
Get access handler.
$cmd
Definition: sahs_server.php:35
Class ilBlogExerciseGUI.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Export User Interface Class.
$info
Definition: example_052.php:80
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.
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.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
infoScreenForward()
show information screen
setContentStyleSheet($a_tpl=null)
Create new PHPExcel object
obj_idprivate
Class ilObjStyleSheetGUI.
$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
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 1044 of file class.ilObjBlogGUI.php.

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

1045  {
1046  $zip = $this->buildExportFile();
1047 
1048  ilUtil::deliverFile($zip, $this->object->getTitle().".zip", '', false, true);
1049  }
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.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ exportHTMLPages()

ilObjBlogGUI::exportHTMLPages (   $a_target_directory,
  $a_link_template = null,
  $a_tpl_callback = null,
  $a_co_page_html_export = null,
  $a_index_name = "index.html" 
)

Export all pages.

Parameters
string$a_target_directory
string$a_link_template(embedded)
array$a_tpl_callback(embedded)
object$a_co_page_html_export(embedded)
string$a_index_name(embedded)

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

References $_GET, $file, $keyword, $month, ilObjectGUI\$tpl, ilPageObject\_exists(), buildExportLink(), buildExportTemplate(), ilBlogPosting\getAllPostings(), ilMathJax\getInstance(), getKeywords(), IL_CAL_DATE, object, ilMathJax\PURPOSE_EXPORT, renderList(), renderNavigation(), and writeExportFile().

Referenced by buildExportFile().

2202  {
2203  require_once('Services/MathJax/classes/class.ilMathJax.php');
2205 
2206  if(!$a_link_template)
2207  {
2208  $a_link_template = "bl{TYPE}_{ID}.html";
2209  }
2210 
2211  if($a_co_page_html_export)
2212  {
2213  $this->co_page_html_export = $a_co_page_html_export;
2214  }
2215 
2216 
2217  // lists
2218 
2219  // global nav
2220  $nav = $this->renderNavigation($this->items, "", "", $a_link_template);
2221 
2222  // month list
2223  $has_index = false;
2224  foreach(array_keys($this->items) as $month)
2225  {
2226  $list = $this->renderList($this->items[$month], "render", $a_link_template, false, $a_target_directory);
2227 
2228  if(!$list)
2229  {
2230  continue;
2231  }
2232 
2233  if(!$a_tpl_callback)
2234  {
2235  $tpl = $this->buildExportTemplate();
2236  }
2237  else
2238  {
2239  $tpl = call_user_func($a_tpl_callback);
2240  }
2241 
2242  $file = $this->buildExportLink($a_link_template, "list", $month);
2243  $file = $this->writeExportFile($a_target_directory, $file,
2244  $tpl, $list, $nav);
2245 
2246  if(!$has_index)
2247  {
2248  copy($file, $a_target_directory."/".$a_index_name);
2249  $has_index = true;
2250  }
2251  }
2252 
2253  // keywords
2254  foreach(array_keys($this->getKeywords(false)) as $keyword)
2255  {
2256  $this->keyword = $keyword;
2257  $list_items = $this->filterItemsByKeyword($this->items, $keyword);
2258  $list = $this->renderList($list_items, "render", $a_link_template, false, $a_target_directory);
2259 
2260  if(!$list)
2261  {
2262  continue;
2263  }
2264 
2265  if(!$a_tpl_callback)
2266  {
2267  $tpl = $this->buildExportTemplate();
2268  }
2269  else
2270  {
2271  $tpl = call_user_func($a_tpl_callback);
2272  }
2273 
2274  $file = $this->buildExportLink($a_link_template, "keyword", $keyword);
2275  $file = $this->writeExportFile($a_target_directory, $file,
2276  $tpl, $list, $nav);
2277  }
2278 
2279 
2280  // single postings
2281 
2282  include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
2283  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2284  $pages = ilBlogPosting::getAllPostings($this->object->getId(), 0);
2285  foreach ($pages as $page)
2286  {
2287  if (ilBlogPosting::_exists("blp", $page["id"]))
2288  {
2289  include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
2290  $blp_gui = new ilBlogPostingGUI(0, null, $page["id"]);
2291  $blp_gui->setOutputMode("offline");
2292  $blp_gui->setFullscreenLink("fullscreen.html"); // #12930 - see page.xsl
2293  $blp_gui->add_date = true;
2294  $page_content = $blp_gui->showPage();
2295 
2296  $back = $this->buildExportLink($a_link_template, "list",
2297  substr($page["created"]->get(IL_CAL_DATE), 0, 7));
2298 
2299  $file = $this->buildExportLink($a_link_template, "posting", $page["id"]);
2300 
2301  if(!$a_tpl_callback)
2302  {
2303  $tpl = $this->buildExportTemplate();
2304  }
2305  else
2306  {
2307  $tpl = call_user_func($a_tpl_callback);
2308  }
2309 
2310  // posting nav
2311  $_GET["blpg"] = $page["id"];
2312  $nav = $this->renderNavigation($this->items, "", "", $a_link_template);
2313  $_GET["blpg"] = null;
2314 
2315  $this->writeExportFile($a_target_directory, $file, $tpl,
2316  $page_content, $nav, $back);
2317 
2318  $this->co_page_html_export->collectPageElements("blp:pg", $page["id"]);
2319  }
2320  }
2321  $this->co_page_html_export->exportPageElements();
2322  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
renderNavigation(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build navigation blocks.
$_GET["client_id"]
Class ilBlogPosting GUI class.
buildExportTemplate($a_back_url="")
Build export "frame".
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
renderList(array $items, $a_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_export_directory=null)
Build posting month list.
const PURPOSE_EXPORT
buildExportLink($a_template, $a_type, $a_id)
Build static export link.
getKeywords($a_show_inactive, $a_posting_id=null)
Get keywords for single posting or complete blog.
const IL_CAL_DATE
static getInstance()
Singleton: get instance.
Create new PHPExcel object
obj_idprivate
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
writeExportFile($a_target_directory, $a_file, $a_tpl, $a_content, $a_right_content=null, $a_back=null)
Write HTML to file.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filterInactivePostings()

ilObjBlogGUI::filterInactivePostings ( )
protected

Filter inactive items from items list.

Returns
array

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

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

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

2600  {
2601  foreach($this->items as $month => $postings)
2602  {
2603  foreach($postings as $id => $item)
2604  {
2605  if(!ilBlogPosting::_lookupActive($id, "blp"))
2606  {
2607  unset($this->items[$month][$id]);
2608  }
2609  else if($this->object->hasApproval() && !$item["approved"])
2610  {
2611  unset($this->items[$month][$id]);
2612  }
2613  }
2614  if(!sizeof($this->items[$month]))
2615  {
2616  unset($this->items[$month]);
2617  }
2618  }
2619 
2620  if($this->items && !isset($this->items[$this->month]))
2621  {
2622  $this->month = array_shift(array_keys($this->items));
2623  }
2624  }
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filterItemsByKeyWord()

ilObjBlogGUI::filterItemsByKeyWord ( array  $a_items,
  $a_keyword 
)
protected

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

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

2627  {
2628  $res = array();
2629  include_once("./Modules/Blog/classes/class.ilBlogPosting.php");
2630  foreach($a_items as $month => $items)
2631  {
2632  foreach($items as $item)
2633  {
2634  if(in_array($a_keyword,
2635  ilBlogPosting::getKeywords($this->obj_id, $item["id"])))
2636  {
2637  $res[] = $item;
2638  }
2639  }
2640  }
2641  return $res;
2642  }
static getKeywords($a_obj_id, $a_posting_id)
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjBlogGUI::getEditFormCustomValues ( array $a_values)
protected

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

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

293  {
294  if($this->id_type == self::REPOSITORY_NODE_ID)
295  {
296  $a_values["approval"] = $this->object->hasApproval();
297  $a_values["nav_authors"] = $this->object->hasAuthors();
298  }
299  $a_values["keywords"] = $this->object->hasKeywords();
300  $a_values["notes"] = $this->object->getNotesStatus();
301  $a_values["ppic"] = $this->object->hasProfilePicture();
302  /*
303  $a_values["bg_color"] = $this->object->getBackgroundColor();
304  $a_values["font_color"] = $this->object->getFontColor();
305  */
306  $a_values["banner"] = $this->object->getImage();
307  $a_values["rss"] = $this->object->hasRSS();
308  $a_values["abss"] = $this->object->hasAbstractShorten();
309  $a_values["absi"] = $this->object->hasAbstractImage();
310  $a_values["nav"] = $this->object->getNavMode();
311  $a_values["nav_list_detail"] = $this->object->getNavModeListPostings();
312  $a_values["nav_list_mon"] = $this->object->getNavModeListMonths();
313  $a_values["ov_list_post_num"] = $this->object->getOverviewPostings();
314 
315  // #13420
316  $a_values["abssl"] = $this->object->getAbstractShortenLength() ? $this->object->getAbstractShortenLength() : ilObjBlog::ABSTRACT_DEFAULT_SHORTEN_LENGTH;
317  $a_values["absiw"] = $this->object->getAbstractImageWidth() ? $this->object->getAbstractImageWidth() : ilObjBlog::ABSTRACT_DEFAULT_IMAGE_WIDTH;
318  $a_values["absih"] = $this->object->getAbstractImageHeight() ? $this->object->getAbstractImageHeight() : ilObjBlog::ABSTRACT_DEFAULT_IMAGE_HEIGHT;
319  }
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 909 of file class.ilObjBlogGUI.php.

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

910  {
911  // getHTML() is called by ilRepositoryGUI::show()
912  if($this->id_type == self::REPOSITORY_NODE_ID)
913  {
914  return;
915  }
916 
917  // there is no way to do a permissions check here, we have no wsp
918 
919  $this->filterInactivePostings();
920 
921  $list_items = $this->getListItems();
922 
923  $list = $nav = "";
924  if($list_items)
925  {
926  $list = $this->renderList($list_items, "previewEmbedded");
927  $nav = $this->renderNavigation($this->items, "gethtml", "previewEmbedded");
928  }
929  // quick editing in portfolio
930  else if($_REQUEST["prt_id"])
931  {
932  global $ilUser, $ilCtrl, $lng;
933 
934  // see renderList()
935  if(ilObject::_lookupOwner($_REQUEST["prt_id"]) == $ilUser->getId())
936  {
937  // see ilPortfolioPageTableGUI::fillRow()
938  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", (int)$_REQUEST["user_page"]);
939  $link = $ilCtrl->getLinkTargetByClass(array("ilportfoliopagegui", "ilobjbloggui"), "render");
940  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", "");
941 
942  include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
943  $btn = ilLinkButton::getInstance();
944  $btn->setCaption(sprintf($lng->txt("prtf_edit_embedded_blog"), $this->object->getTitle()), false);
945  $btn->setUrl($link);
946  $btn->setPrimary(true);
947 
948  $list = $btn->render();
949  }
950  }
951 
952  return $this->buildEmbedded($list, $nav);
953  }
renderNavigation(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build navigation blocks.
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
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ 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 2080 of file class.ilObjBlogGUI.php.

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

Referenced by buildExportLink(), exportHTMLPages(), and renderNavigationByKeywords().

2081  {
2082  $keywords = array();
2083  include_once("./Modules/Blog/classes/class.ilBlogPosting.php");
2084  if($a_posting_id)
2085  {
2086  foreach(ilBlogPosting::getKeywords($this->obj_id, $a_posting_id) as $keyword)
2087  {
2088  $keywords[$keyword]++;
2089  }
2090  }
2091  else
2092  {
2093  foreach($this->items as $month => $items)
2094  {
2095  foreach($items as $item)
2096  {
2097  if($a_show_inactive || ilBlogPosting::_lookupActive($item["id"], "blp"))
2098  {
2099  foreach(ilBlogPosting::getKeywords($this->obj_id, $item["id"]) as $keyword)
2100  {
2101  $keywords[$keyword]++;
2102  }
2103  }
2104  }
2105  }
2106  }
2107 
2108  // #15881
2109  $tmp = array();
2110  foreach($keywords as $keyword => $counter)
2111  {
2112  $tmp[] = array("keyword"=>$keyword, "counter"=>$counter);
2113  }
2114  $tmp = ilUtil::sortArray($tmp, "keyword", "ASC");
2115 
2116  $keywords = array();
2117  foreach($tmp as $item)
2118  {
2119  $keywords[$item["keyword"]] = $item["counter"];
2120  }
2121  return $keywords;
2122  }
static getKeywords($a_obj_id, $a_posting_id)
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
$counter
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ 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 961 of file class.ilObjBlogGUI.php.

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

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

962  {
963  if($this->author)
964  {
965  $list_items = array();
966  foreach($this->items as $month => $items)
967  {
968  foreach($items as $id => $item)
969  {
970  if($item["author"] == $this->author ||
971  (is_array($item["editors"]) && in_array($this->author, $item["editors"])))
972  {
973  $list_items[$id] = $item;
974  }
975  }
976  }
977  }
978  else if($this->keyword)
979  {
980  $list_items = $this->filterItemsByKeyword($this->items, $this->keyword);
981  }
982  else
983  {
984  $max = $this->object->getOverviewPostings();
985  if($this->month_default && $max)
986  {
987  $list_items = array();
988  foreach($this->items as $month => $postings)
989  {
990  foreach($postings as $id => $item)
991  {
992  if(!$a_show_inactive &&
993  !ilBlogPosting::_lookupActive($id, "blp"))
994  {
995  continue;
996  }
997  $list_items[$id] = $item;
998 
999  if(sizeof($list_items) >= $max)
1000  {
1001  break(2);
1002  }
1003  }
1004  }
1005  }
1006  else
1007  {
1008  $list_items = $this->items[$this->month];
1009  }
1010  }
1011  return $list_items;
1012  }
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNotesSubId()

ilObjBlogGUI::getNotesSubId ( )

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

2442  {
2443  if($_REQUEST["blpg"])
2444  {
2445  return $_REQUEST["blpg"];
2446  }
2447  return 0;
2448  }

◆ getType()

ilObjBlogGUI::getType ( )

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

Referenced by renderList().

72  {
73  return "blog";
74  }
+ 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 739 of file class.ilObjBlogGUI.php.

References infoScreenForward().

740  {
741  $this->ctrl->setCmd("showSummary");
742  $this->ctrl->setCmdClass("ilinfoscreengui");
743  $this->infoScreenForward();
744  }
infoScreenForward()
show information screen
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjBlogGUI::infoScreenForward ( )

show information screen

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

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

Referenced by executeCommand(), and infoScreen().

750  {
751  global $ilTabs;
752 
753  $ilTabs->activateTab("id_info");
754 
755  $this->checkPermission("visible");
756 
757  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
758  $info = new ilInfoScreenGUI($this);
759 
760  if($this->id_type != self::WORKSPACE_NODE_ID)
761  {
762  $info->enablePrivateNotes();
763  }
764 
765  if ($this->checkPermissionBool("read"))
766  {
767  $info->enableNews();
768  }
769 
770  // no news editing for files, just notifications
771  $info->enableNewsEditing(false);
772  if ($this->checkPermissionBool("write"))
773  {
774  $news_set = new ilSetting("news");
775  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
776 
777  if ($enable_internal_rss)
778  {
779  $info->setBlockProperty("news", "settings", true);
780  $info->setBlockProperty("news", "public_notifications_option", true);
781  }
782  }
783 
784  // standard meta data
785  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
786 
787  if($this->id_type == self::WORKSPACE_NODE_ID)
788  {
789  $info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget());
790  }
791 
792  $this->ctrl->forwardCommand($info);
793  }
ILIAS Setting Class.
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)
$info
Definition: example_052.php:80
Create new PHPExcel object
obj_idprivate
+ 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 76 of file class.ilObjBlogGUI.php.

77  {
78  $forms = parent::initCreationForms($a_new_type);
79 
80  if($this->id_type == self::WORKSPACE_NODE_ID)
81  {
82  unset($forms[self::CFORM_IMPORT]);
83  unset($forms[self::CFORM_CLONE]);
84  }
85 
86  return $forms;
87  }

◆ initEditCustomForm()

ilObjBlogGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

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

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

112  {
113  global $lng, $ilSetting;
114 
115  $this->setSettingsSubTabs("properties");
116 
117  if($this->id_type == self::REPOSITORY_NODE_ID)
118  {
119  $appr = new ilCheckboxInputGUI($lng->txt("blog_enable_approval"), "approval");
120  $appr->setInfo($lng->txt("blog_enable_approval_info"));
121  $a_form->addItem($appr);
122  }
123 
124  $notes = new ilCheckboxInputGUI($lng->txt("blog_enable_notes"), "notes");
125  $a_form->addItem($notes);
126 
127  if($ilSetting->get('enable_global_profiles'))
128  {
129  $rss = new ilCheckboxInputGUI($lng->txt("blog_enable_rss"), "rss");
130  $rss->setInfo($lng->txt("blog_enable_rss_info"));
131  $a_form->addItem($rss);
132  }
133 
134 
135  // navigation
136 
137  $nav = new ilFormSectionHeaderGUI();
138  $nav->setTitle($lng->txt("blog_settings_navigation"));
139  $a_form->addItem($nav);
140 
141  $nav_mode = new ilRadioGroupInputGUI($lng->txt("blog_nav_mode"), "nav");
142  $nav_mode->setRequired(true);
143  $a_form->addItem($nav_mode);
144 
145  $opt = new ilRadioOption($lng->txt("blog_nav_mode_month_list"), ilObjBlog::NAV_MODE_LIST);
146  $opt->setInfo($lng->txt("blog_nav_mode_month_list_info"));
147  $nav_mode->addOption($opt);
148 
149  $detail_num = new ilNumberInputGUI($lng->txt("blog_nav_mode_month_list_num_detail"), "nav_list_detail");
150  $detail_num->setInfo($lng->txt("blog_nav_mode_month_list_num_detail_info"));
151  $detail_num->setRequired(true);
152  $detail_num->setSize(3);
153  $detail_num->setMinValue(0);
154  $opt->addSubItem($detail_num);
155 
156  $mon_num = new ilNumberInputGUI($lng->txt("blog_nav_mode_month_list_num_month"), "nav_list_mon");
157  $mon_num->setInfo($lng->txt("blog_nav_mode_month_list_num_month_info"));
158  $mon_num->setSize(3);
159  $mon_num->setMinValue(1);
160  $opt->addSubItem($mon_num);
161 
162  $opt = new ilRadioOption($lng->txt("blog_nav_mode_month_single"), ilObjBlog::NAV_MODE_MONTH);
163  $opt->setInfo($lng->txt("blog_nav_mode_month_single_info"));
164  $nav_mode->addOption($opt);
165 
166  $order_options = array();
167  if($this->object->getOrder())
168  {
169  foreach($this->object->getOrder() as $item)
170  {
171  $order_options[] = $lng->txt("blog_".$item);
172  }
173  }
174 
175  if(!in_array($lng->txt("blog_navigation"), $order_options))
176  {
177  $order_options[] = $lng->txt("blog_navigation");
178  }
179 
180  if($this->id_type == self::REPOSITORY_NODE_ID)
181  {
182  if(!in_array($lng->txt("blog_authors"), $order_options))
183  {
184  $order_options[] = $lng->txt("blog_authors");
185  }
186 
187  $auth = new ilCheckboxInputGUI($lng->txt("blog_enable_nav_authors"), "nav_authors");
188  $auth->setInfo($lng->txt("blog_enable_nav_authors_info"));
189  $a_form->addItem($auth);
190  }
191 
192  $keyw = new ilCheckboxInputGUI($lng->txt("blog_enable_keywords"), "keywords");
193  $keyw->setInfo($lng->txt("blog_enable_keywords_info"));
194  $a_form->addItem($keyw);
195 
196  if(!in_array($lng->txt("blog_keywords"), $order_options))
197  {
198  $order_options[] = $lng->txt("blog_keywords");
199  }
200 
201  $order = new ilNonEditableValueGUI($lng->txt("blog_nav_sortorder"), "order");
202  $order->setMultiValues($order_options);
203  $order->setValue(array_shift($order_options));
204  $order->setMulti(true, true, false);
205  $a_form->addItem($order);
206 
207 
208  // presentation (frame)
209 
210  $pres = new ilFormSectionHeaderGUI();
211  $pres->setTitle($lng->txt("blog_presentation_frame"));
212  $a_form->addItem($pres);
213 
214  $ppic = new ilCheckboxInputGUI($lng->txt("blog_profile_picture"), "ppic");
215  $a_form->addItem($ppic);
216 
217  if($this->id_type == self::REPOSITORY_NODE_ID)
218  {
219  $ppic->setInfo($lng->txt("blog_profile_picture_repository_info"));
220  }
221 
222  $blga_set = new ilSetting("blga");
223  if($blga_set->get("banner"))
224  {
225  include_once "Services/Form/classes/class.ilFileInputGUI.php";
227 
228  $dimensions = " (".$blga_set->get("banner_width")."x".
229  $blga_set->get("banner_height").")";
230 
231  $img = new ilImageFileInputGUI($lng->txt("blog_banner").$dimensions, "banner");
232  $a_form->addItem($img);
233 
234  // show existing file
235  $file = $this->object->getImageFullPath(true);
236  if($file)
237  {
238  $img->setImage($file);
239  }
240  }
241 
242  /* #15000
243  $bg_color = new ilColorPickerInputGUI($lng->txt("blog_background_color"), "bg_color");
244  $a_form->addItem($bg_color);
245 
246  $font_color = new ilColorPickerInputGUI($lng->txt("blog_font_color"), "font_color");
247  $a_form->addItem($font_color);
248  */
249 
250  // presentation (overview)
251 
252  $list = new ilFormSectionHeaderGUI();
253  $list->setTitle($lng->txt("blog_presentation_overview"));
254  $a_form->addItem($list);
255 
256  $post_num = new ilNumberInputGUI($lng->txt("blog_list_num_postings"), "ov_list_post_num");
257  $post_num->setInfo($lng->txt("blog_list_num_postings_info"));
258  $post_num->setSize(3);
259  $post_num->setMinValue(1);
260  $post_num->setRequired(true);
261  $a_form->addItem($post_num);
262 
263  $abs_shorten = new ilCheckboxInputGUI($lng->txt("blog_abstract_shorten"), "abss");
264  $a_form->addItem($abs_shorten);
265 
266  $abs_shorten_len = new ilNumberInputGUI($lng->txt("blog_abstract_shorten_length"), "abssl");
267  $abs_shorten_len->setSize(5);
268  $abs_shorten_len->setRequired(true);
269  $abs_shorten_len->setSuffix($lng->txt("blog_abstract_shorten_characters"));
270  $abs_shorten_len->setMinValue(50, true);
271  $abs_shorten->addSubItem($abs_shorten_len);
272 
273  $abs_img = new ilCheckboxInputGUI($lng->txt("blog_abstract_image"), "absi");
274  $abs_img->setInfo($lng->txt("blog_abstract_image_info"));
275  $a_form->addItem($abs_img);
276 
277  $abs_img_width = new ilNumberInputGUI($lng->txt("blog_abstract_image_width"), "absiw");
278  $abs_img_width->setSize(5);
279  $abs_img_width->setRequired(true);
280  $abs_img_width->setSuffix($lng->txt("blog_abstract_image_pixels"));
281  $abs_img_width->setMinValue(32, true);
282  $abs_img->addSubItem($abs_img_width);
283 
284  $abs_img_height = new ilNumberInputGUI($lng->txt("blog_abstract_image_height"), "absih");
285  $abs_img_height->setSize(5);
286  $abs_img_height->setRequired(true);
287  $abs_img_height->setSuffix($lng->txt("blog_abstract_image_pixels"));
288  $abs_img_height->setMinValue(32, true);
289  $abs_img->addSubItem($abs_img_height);
290  }
This class represents an option in a radio group.
ILIAS Setting Class.
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.
This class represents a property in a property form.
static setPersonalWorkspaceQuotaCheck($a_value)
This class represents a number property in a property form.
Create styles array
The data for the language used.
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.
Create new PHPExcel object
obj_idprivate
global $ilSetting
Definition: privfeed.php:17
setSettingsSubTabs($a_active)
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
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 2482 of file class.ilObjBlogGUI.php.

References $_GET, $ilCtrl, $ilUser, $lg, ilObjectGUI\$obj_id, ilUtil\getImagePath(), ilNotification\hasNotification(), mayContribute(), mayEditPosting(), and ilNotification\TYPE_BLOG.

Referenced by addHeaderActionForCommand().

2483  {
2484  global $ilUser, $ilCtrl;
2485 
2486  if(!$this->obj_id)
2487  {
2488  return false;
2489  }
2490 
2491  $sub_type = $sub_id = null;
2492  if($_GET["blpg"])
2493  {
2494  $sub_type = "blp";
2495  $sub_id = $_GET["blpg"];
2496  }
2497 
2498  $lg = parent::initHeaderAction($sub_type, $sub_id);
2499 
2500  if($a_is_preview)
2501  {
2502  $lg->enableComments(false);
2503  $lg->enableNotes(false);
2504  $lg->enableTags(false);
2505 
2506  include_once "./Services/Notification/classes/class.ilNotification.php";
2508  {
2509  $ilCtrl->setParameter($this, "ntf", 1);
2510  $link = $ilCtrl->getLinkTarget($this, "setNotification");
2511  $ilCtrl->setParameter($this, "ntf", "");
2512  $lg->addCustomCommand($link, "blog_notification_toggle_off");
2513 
2514  $lg->addHeaderIcon("not_icon",
2515  ilUtil::getImagePath("notification_on.svg"),
2516  $this->lng->txt("blog_notification_activated"));
2517  }
2518  else
2519  {
2520  $ilCtrl->setParameter($this, "ntf", 2);
2521  $link = $ilCtrl->getLinkTarget($this, "setNotification");
2522  $ilCtrl->setParameter($this, "ntf", "");
2523  $lg->addCustomCommand($link, "blog_notification_toggle_on");
2524 
2525  $lg->addHeaderIcon("not_icon",
2526  ilUtil::getImagePath("notification_off.svg"),
2527  $this->lng->txt("blog_notification_deactivated"));
2528  }
2529 
2530  // #11758
2531  if($this->mayContribute())
2532  {
2533  $ilCtrl->setParameter($this, "prvm", "");
2534 
2535  $ilCtrl->setParameter($this, "bmn", "");
2536  $ilCtrl->setParameter($this, "blpg", "");
2537  $link = $ilCtrl->getLinkTarget($this, "");
2538  $ilCtrl->setParameter($this, "blpg", $sub_id);
2539  $ilCtrl->setParameter($this, "bmn", $this->month);
2540  $lg->addCustomCommand($link, "blog_edit"); // #11868
2541 
2542  if($sub_id && $this->mayEditPosting($sub_id))
2543  {
2544  $link = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit");
2545  $lg->addCustomCommand($link, "blog_edit_posting");
2546  }
2547 
2548  $ilCtrl->setParameter($this, "prvm", "fsc");
2549  }
2550 
2551  $ilCtrl->setParameter($this, "ntf", "");
2552  }
2553 
2554  return $lg;
2555  }
$lg
Definition: example_018.php:62
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
mayContribute()
Check if user may contribute at all.
$_GET["client_id"]
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 3005 of file class.ilObjBlogGUI.php.

References $_GET, $ilSetting, ilObjStyleSheet\_getStandardStyles(), ilObjStyleSheet\_lookupStandard(), ilObject\_lookupTitle(), ilSelectInputGUI\setOptions(), and ilNonEditableValueGUI\setValue().

Referenced by editStyleProperties().

3006  {
3007  global $ilSetting;
3008 
3009  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3010  $this->lng->loadLanguageModule("style");
3011 
3012  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
3013  $form = new ilPropertyFormGUI();
3014 
3015  $fixed_style = $ilSetting->get("fixed_content_style_id");
3016  $style_id = $this->object->getStyleSheetId();
3017 
3018  if ($fixed_style > 0)
3019  {
3020  $st = new ilNonEditableValueGUI($this->lng->txt("style_current_style"));
3021  $st->setValue(ilObject::_lookupTitle($fixed_style)." (".
3022  $this->lng->txt("global_fixed").")");
3023  $form->addItem($st);
3024  }
3025  else
3026  {
3027  $st_styles = ilObjStyleSheet::_getStandardStyles(true, false,
3028  $_GET["ref_id"]);
3029 
3030  $st_styles[0] = $this->lng->txt("default");
3031  ksort($st_styles);
3032 
3033  if ($style_id > 0)
3034  {
3035  // individual style
3036  if (!ilObjStyleSheet::_lookupStandard($style_id))
3037  {
3038  $st = new ilNonEditableValueGUI($this->lng->txt("style_current_style"));
3039  $st->setValue(ilObject::_lookupTitle($style_id));
3040  $form->addItem($st);
3041 
3042  // delete command
3043  $form->addCommandButton("editStyle", $this->lng->txt("style_edit_style"));
3044  $form->addCommandButton("deleteStyle", $this->lng->txt("style_delete_style"));
3045  }
3046  }
3047 
3048  if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id))
3049  {
3050  $style_sel = new ilSelectInputGUI($this->lng->txt("style_current_style"),
3051  "style_id");
3052  $style_sel->setOptions($st_styles);
3053  $style_sel->setValue($style_id);
3054  $form->addItem($style_sel);
3055 
3056  $form->addCommandButton("saveStyleSettings", $this->lng->txt("save"));
3057  $form->addCommandButton("createStyle", $this->lng->txt("sty_create_ind_style"));
3058  }
3059  }
3060 
3061  $form->setTitle($this->lng->txt("blog_style"));
3062  $form->setFormAction($this->ctrl->getFormAction($this));
3063 
3064  return $form;
3065  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
$_GET["client_id"]
static _getStandardStyles($a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
static _lookupTitle($a_id)
lookup object title
static _lookupStandard($a_id)
Lookup standard flag.
setOptions($a_options)
Set Options.
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 2649 of file class.ilObjBlogGUI.php.

References ilObject2GUI\checkPermissionBool().

Referenced by approve(), and renderList().

2650  {
2651  return ($this->checkPermissionBool("redact") ||
2652  $this->checkPermissionBool("write"));
2653  }
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 2583 of file class.ilObjBlogGUI.php.

2584  {
2585  // page might be deleted, so setting halt on errors to false
2586  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
2587  $post = new ilBlogPosting($a_posting_id);
2588  if($post->getBlogId() == $a_blog_id)
2589  {
2590  return $post->getTitle();
2591  }
2592  }
Class ilBlogPosting.

◆ mayContribute()

ilObjBlogGUI::mayContribute ( )
protected

Check if user may contribute at all.

Returns
boolean

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

References ilObject2GUI\checkPermissionBool().

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

2710  {
2711  // single author blog (owner) in personal workspace
2712  if($this->id_type == self::WORKSPACE_NODE_ID)
2713  {
2714  return $this->checkPermissionBool("write");
2715  }
2716 
2717  return ($this->checkPermissionBool("redact") ||
2718  $this->checkPermissionBool("contribute"));
2719  }
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 2662 of file class.ilObjBlogGUI.php.

References $ilUser, and ilObject2GUI\checkPermissionBool().

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

2663  {
2664  global $ilUser;
2665 
2666  // single author blog (owner) in personal workspace
2667  if($this->id_type == self::WORKSPACE_NODE_ID)
2668  {
2669  return $this->checkPermissionBool("write");
2670  }
2671 
2672  // repository blogs
2673 
2674  // redact allows to edit all postings
2675  if($this->checkPermissionBool("redact"))
2676  {
2677  return true;
2678  }
2679 
2680  // contribute gives access to own postings
2681  if($this->checkPermissionBool("contribute"))
2682  {
2683  // check owner of posting
2684  if(!$a_author_id)
2685  {
2686  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
2687  $post = new ilBlogPosting($a_posting_id);
2688  $a_author_id = $post->getAuthor();
2689  }
2690  if($ilUser->getId() == $a_author_id)
2691  {
2692  return true;
2693  }
2694  else
2695  {
2696  return false;
2697  }
2698 
2699  return true;
2700  }
2701  return false;
2702  }
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 1017 of file class.ilObjBlogGUI.php.

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

Referenced by executeCommand().

1018  {
1019  global $lng;
1020 
1021  if(!$this->checkPermissionBool("read"))
1022  {
1023  ilUtil::sendInfo($lng->txt("no_permission"));
1024  return;
1025  }
1026 
1027  $this->filterInactivePostings();
1028 
1029  $list_items = $this->getListItems();
1030 
1031  $list = $nav = "";
1032  if($list_items)
1033  {
1034  $list = $this->renderList($list_items, "previewFullscreen");
1035  $nav = $this->renderNavigation($this->items, "preview", "previewFullscreen");
1036  }
1037 
1038  $this->renderFullScreen($list, $nav);
1039  }
renderNavigation(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build navigation blocks.
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.
+ 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 2897 of file class.ilObjBlogGUI.php.

References $_POST, $ilCtrl, ilObjectGUI\$lng, contributors(), object, ilUtil\sendFailure(), and ilUtil\sendSuccess().

2898  {
2899  global $ilCtrl, $lng, $rbacadmin;
2900 
2901  $ids = $_POST["id"];
2902 
2903  if(!sizeof($ids))
2904  {
2905  ilUtil::sendFailure($lng->txt("select_one"), true);
2906  $ilCtrl->redirect($this, "contributors");
2907  }
2908 
2909  // get contributor role
2910  $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
2911  if(!$local_roles)
2912  {
2913  ilUtil::sendFailure($lng->txt("missing_perm"));
2914  return $this->contributors();
2915  }
2916 
2917  foreach($ids as $user_id)
2918  {
2919  foreach($local_roles as $role_id)
2920  {
2921  $rbacadmin->deassignUser($role_id, $user_id);
2922  }
2923  }
2924 
2925  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
2926  $this->ctrl->redirect($this, "contributors");
2927  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
$_POST["username"]
+ Here is the call graph for this function:

◆ removeFromDeskObject()

ilObjBlogGUI::removeFromDeskObject ( )
See also
ilDesktopItemHandling::removeFromDesk()

Implements ilDesktopItemHandling.

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

References ilObjectGUI\$lng, ilDesktopItemGUI\removeFromDesktop(), and ilUtil\sendSuccess().

2945  {
2946  global $lng;
2947 
2948  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
2950  ilUtil::sendSuccess($lng->txt("removed_from_desktop"));
2951  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static removeFromDesktop()
Remove item from personal desktop public.
+ Here is the call graph for this function:

◆ render()

ilObjBlogGUI::render ( )

Render object context.

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

References $ilCtrl, $ilUser, ilObjectGUI\$lng, $title, ilObjectGUI\$tpl, ilObject2GUI\$tree, $url, ilBlogExerciseGUI\checkExercise(), ilObject2GUI\checkPermissionBool(), ilSubmitButton\getInstance(), ilLinkButton\getInstance(), getListItems(), mayContribute(), renderList(), renderNavigation(), ilUtil\sendInfo(), and setContentStyleSheet().

834  {
835  global $tpl, $ilTabs, $ilCtrl, $lng, $ilToolbar, $ilUser, $tree;
836 
837  if(!$this->checkPermissionBool("read"))
838  {
839  ilUtil::sendInfo($lng->txt("no_permission"));
840  return;
841  }
842 
843  $ilTabs->activateTab("content");
844 
845  // toolbar
846  if($this->mayContribute())
847  {
848  $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "createPosting"));
849 
850  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
851  $title = new ilTextInputGUI($lng->txt("title"), "title");
852  $ilToolbar->addStickyItem($title, $lng->txt("title"));
853 
854  include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
855  $button = ilSubmitButton::getInstance();
856  $button->setCaption("blog_add_posting");
857  $button->setCommand("createPosting");
858  $ilToolbar->addStickyItem($button);
859 
860  // #18763
861  $first = array_shift((array_keys($this->items)));
862  if($first != $this->month)
863  {
864  $ilToolbar->addSeparator();
865 
866  $ilCtrl->setParameter($this, "bmn", $first);
867  $url = $ilCtrl->getLinkTarget($this, "");
868  $ilCtrl->setParameter($this, "bmn", $this->month);
869 
870  include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
871  $button = ilLinkButton::getInstance();
872  $button->setCaption("blog_show_latest");
873  $button->setUrl($url);
874  $ilToolbar->addButtonInstance($button);
875  }
876 
877  // exercise blog?
878  include_once "Modules/Blog/classes/class.ilBlogExerciseGUI.php";
879  $exercises = ilBlogExerciseGUI::checkExercise($this->node_id);
880  if($exercises)
881  {
882  ilUtil::sendInfo($exercises);
883  }
884  }
885 
886  // $is_owner = ($this->object->getOwner() == $ilUser->getId());
887  $is_owner = $this->mayContribute();
888 
889  $list_items = $this->getListItems($is_owner);
890 
891  $list = $nav = "";
892  if($list_items)
893  {
894  $list = $this->renderList($list_items, "preview", null, $is_owner);
895  $nav = $this->renderNavigation($this->items, "render", "preview", null, $is_owner);
896  }
897 
898  $this->setContentStyleSheet();
899 
900  $tpl->setContent($list);
901  $tpl->setRightContent($nav);
902  }
renderNavigation(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build navigation blocks.
mayContribute()
Check if user may contribute at all.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
$url
Definition: shib_logout.php:72
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.
This class represents a text property in a property form.
$ilUser
Definition: imgupload.php:18
setContentStyleSheet($a_tpl=null)
static checkExercise($a_node_id)
+ 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 1075 of file class.ilObjBlogGUI.php.

References $_GET, $a_content, $ilUser, ilObject2GUI\$parent_id, ilObjectGUI\$tpl, ilObject2GUI\$tree, ilLink\_getStaticLink(), mayContribute(), ilMainMenuGUI\MODE_TOPBAR_ONLY, renderFullscreenHeader(), and setContentStyleSheet().

Referenced by executeCommand(), and preview().

1076  {
1077  global $tpl, $ilUser, $ilTabs, $ilLocator;
1078 
1079  $owner = $this->object->getOwner();
1080 
1081  $ilTabs->clearTargets();
1082  $ilLocator->clearItems();
1083  $tpl->setLocator();
1084 
1085  $back_caption = "";
1086 
1087  // back (edit)
1088  if($owner == $ilUser->getId())
1089  {
1090  // from shared/deeplink
1091  if($this->id_type == self::WORKSPACE_NODE_ID)
1092  {
1093  $back = "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&wsp_id=".$this->node_id;
1094  }
1095  // from editor (#10073)
1096  else if($this->mayContribute())
1097  {
1098  $prvm = $_GET["prvm"];
1099  $this->ctrl->setParameter($this, "prvm", "");
1100  if(!$_GET["blpg"])
1101  {
1102  $back = $this->ctrl->getLinkTarget($this, "");
1103  }
1104  else
1105  {
1106  $this->ctrl->setParameterByClass("ilblogpostinggui", "bmn", $this->month);
1107  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $_GET["blpg"]);
1108  $back = $this->ctrl->getLinkTargetByClass("ilblogpostinggui", "preview");
1109  }
1110  $this->ctrl->setParameter($this, "prvm", $prvm);
1111  }
1112 
1113  $back_caption = $this->lng->txt("blog_back_to_blog_owner");
1114  }
1115  // back
1116  else if($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
1117  {
1118  // workspace (always shared)
1119  if($this->id_type == self::WORKSPACE_NODE_ID)
1120  {
1121  $back = "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=".$owner;
1122  }
1123  // contributor
1124  else if($this->mayContribute())
1125  {
1126  $back = $this->ctrl->getLinkTarget($this, "");
1127  $back_caption = $this->lng->txt("blog_back_to_blog_owner");
1128  }
1129  // listgui / parent container
1130  else
1131  {
1132  global $tree;
1133  $parent_id = $tree->getParentId($this->node_id);
1134  include_once "Services/Link/classes/class.ilLink.php";
1136  }
1137  }
1138 
1139  global $ilMainMenu;
1140  $ilMainMenu->setMode(ilMainMenuGUI::MODE_TOPBAR_ONLY);
1141  $ilMainMenu->setTopBarBack($back, $back_caption);
1142 
1143  $this->renderFullscreenHeader($tpl, $owner);
1144 
1145  // #13564
1146  $this->ctrl->setParameter($this, "bmn", "");
1147  $tpl->setTitleUrl($this->ctrl->getLinkTarget($this, "preview"));
1148  $this->ctrl->setParameter($this, "bmn", $this->month);
1149 
1150  $this->setContentStyleSheet();
1151 
1152  // content
1153  $tpl->setContent($a_content);
1154  $tpl->setRightContent($a_navigation);
1155  }
mayContribute()
Check if user may contribute at all.
renderFullscreenHeader($a_tpl, $a_user_id, $a_export=false)
Render banner, user name.
$_GET["client_id"]
$a_content
Definition: workflow.php:94
$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 
)
protected

Render banner, user name.

Parameters
object$a_tpl
int$a_user_id
bool$a_export_path

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

References $_GET, $ilUser, ilObject2GUI\$node_id, $t, ilObjUser\_getPersonalPicturePath(), ilObjUser\_lookupName(), ilChangeEvent\_recordReadEvent(), object, and ilWACSignedPath\signFile().

Referenced by buildExportTemplate(), and renderFullScreen().

1165  {
1166  global $ilUser;
1167 
1168  if(!$a_export)
1169  {
1170  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
1172  $this->object->getType(),
1173  $this->node_id,
1174  $this->object->getId(),
1175  $ilUser->getId()
1176  );
1177  }
1178 
1179  // repository blogs are multi-author
1180  $name = null;
1181  if($this->id_type != self::REPOSITORY_NODE_ID)
1182  {
1183  $name = ilObjUser::_lookupName($a_user_id);
1184  $name = $name["lastname"].", ".($t = $name["title"] ? $t . " " : "").$name["firstname"];
1185  }
1186 
1187  // show banner?
1188  $banner = false;
1189  $blga_set = new ilSetting("blga");
1190  if($blga_set->get("banner"))
1191  {
1192  require_once('./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
1193  $banner = ilWACSignedPath::signFile($this->object->getImageFullPath());
1194  $banner_width = $blga_set->get("banner_width");
1195  $banner_height = $blga_set->get("banner_height");
1196  if($a_export)
1197  {
1198  $banner = basename($banner);
1199  }
1200  }
1201 
1202  $ppic = null;
1203  if($this->object->hasProfilePicture())
1204  {
1205  // repository (multi-user)
1206  if($this->id_type == self::REPOSITORY_NODE_ID)
1207  {
1208  // #15030
1209  if($_GET["blpg"] && !$a_export)
1210  {
1211  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
1212  $post = new ilBlogPosting($_GET["blpg"]);
1213  $author_id = $post->getAuthor();
1214  if($author_id)
1215  {
1216  $ppic = ilObjUser::_getPersonalPicturePath($author_id, "xsmall", true, true);
1217 
1218  $name = ilObjUser::_lookupName($author_id);
1219  $name = $name["lastname"].", ".($t = $name["title"] ? $t . " " : "").$name["firstname"];
1220  }
1221  }
1222  }
1223  // workspace (author == owner)
1224  else
1225  {
1226  $ppic = ilObjUser::_getPersonalPicturePath($a_user_id, "xsmall", true, true);
1227  if($a_export)
1228  {
1229  $ppic = basename($ppic);
1230  }
1231  }
1232  }
1233 
1234  $a_tpl->resetHeaderBlock(false);
1235  // $a_tpl->setBackgroundColor($this->object->getBackgroundColor());
1236  $a_tpl->setBanner($banner, $banner_width, $banner_height, $a_export);
1237  $a_tpl->setTitleIcon($ppic);
1238  $a_tpl->setTitle($this->object->getTitle());
1239  // $a_tpl->setTitleColor($this->object->getFontColor());
1240  $a_tpl->setDescription($name);
1241 
1242  // to get rid of locator in repository preview
1243  $a_tpl->setVariable("LOCATOR", "");
1244 
1245  // :TODO: obsolete?
1246  // $a_tpl->setBodyClass("std ilExternal ilBlog");
1247  }
static _lookupName($a_user_id)
lookup user name
ILIAS Setting Class.
Class ilBlogPosting.
$_GET["client_id"]
$ilUser
Definition: imgupload.php:18
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.
static signFile($path_to_file)
Create new PHPExcel object
obj_idprivate
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 1291 of file class.ilObjBlogGUI.php.

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

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

1292  {
1293  global $lng, $ilCtrl;
1294 
1295  include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
1296  $wtpl = new ilTemplate("tpl.blog_list.html", true, true, "Modules/Blog");
1297 
1298  // quick editing in portfolio
1299  if($_REQUEST["prt_id"] &&
1300  stristr($a_cmd, "embedded"))
1301  {
1302  global $ilUser;
1303  if(ilObject::_lookupOwner($_REQUEST["prt_id"]) == $ilUser->getId())
1304  {
1305  // see ilPortfolioPageTableGUI::fillRow()
1306  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", (int)$_REQUEST["user_page"]);
1307  $link = $ilCtrl->getLinkTargetByClass(array("ilportfoliopagegui", "ilobjbloggui"), "render");
1308  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", "");
1309 
1310  include_once "Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
1311  $list = new ilAdvancedSelectionListGUI();
1312  $list->setListTitle($lng->txt("action"));
1313  $list->addItem(
1314  sprintf($lng->txt("prtf_edit_embedded_blog"), $this->object->getTitle()),
1315  "",
1316  $link);
1317 
1318  /*
1319  include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
1320  $btn = ilLinkButton::getInstance();
1321  $btn->setCaption(sprintf($lng->txt("prtf_edit_embedded_blog"), $this->object->getTitle()), false);
1322  $btn->setUrl($link);
1323  */
1324 
1325  $wtpl->setCurrentBlock("prtf_edit_bl");
1326  $wtpl->setVariable("PRTF_BLOG_EDIT", $list->getHTML());
1327  $wtpl->parseCurrentBlock();
1328  }
1329  }
1330 
1331  $is_admin = $this->isAdmin();
1332 
1333  include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
1334  $last_month = null;
1335  $is_empty = true;
1336  foreach($items as $item)
1337  {
1338  // only published items
1339  $is_active = ilBlogPosting::_lookupActive($item["id"], "blp");
1340  if(!$is_active && !$a_show_inactive)
1341  {
1342  continue;
1343  }
1344 
1345  $is_empty = false;
1346 
1347  if(!$this->keyword && !$this->author)
1348  {
1349  $month = substr($item["created"]->get(IL_CAL_DATE), 0, 7);
1350  }
1351 
1352  if(!$last_month || $last_month != $month)
1353  {
1354  if($last_month)
1355  {
1356  $wtpl->setCurrentBlock("month_bl");
1357  $wtpl->parseCurrentBlock();
1358  }
1359 
1360  // title according to current "filter"/navigation
1361  if($this->keyword)
1362  {
1363  $title = $lng->txt("blog_keyword").": ".$this->keyword;
1364  }
1365  else if($this->author)
1366  {
1367  include_once "Services/User/classes/class.ilUserUtil.php";
1368  $title = $lng->txt("blog_author").": ".ilUserUtil::getNamePresentation($this->author);
1369  }
1370  else
1371  {
1372  include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
1374  " ".substr($month, 0, 4);
1375 
1376  $last_month = $month;
1377  }
1378 
1379  $wtpl->setVariable("TXT_CURRENT_MONTH", $title);
1380  }
1381 
1382  if(!$a_link_template)
1383  {
1384  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", $this->month);
1385  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $item["id"]);
1386  $preview = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", $a_cmd);
1387  }
1388  else
1389  {
1390  $preview = $this->buildExportLink($a_link_template, "posting", $item["id"]);
1391  }
1392 
1393  // actions
1394  $posting_edit = $this->mayEditPosting($item["id"], $item["author"]);
1395  if(($posting_edit || $is_admin) && !$a_link_template && $a_cmd == "preview")
1396  {
1397  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
1398  $alist = new ilAdvancedSelectionListGUI();
1399  $alist->setId($item["id"]);
1400  $alist->setListTitle($lng->txt("actions"));
1401 
1402  if($is_active && $this->object->hasApproval() && !$item["approved"])
1403  {
1404  if($is_admin)
1405  {
1406  $ilCtrl->setParameter($this, "apid", $item["id"]);
1407  $alist->addItem($lng->txt("blog_approve"), "approve",
1408  $ilCtrl->getLinkTarget($this, "approve"));
1409  $ilCtrl->setParameter($this, "apid", "");
1410  }
1411 
1412  $wtpl->setVariable("APPROVAL", $lng->txt("blog_needs_approval"));
1413  }
1414 
1415  if($posting_edit)
1416  {
1417  $alist->addItem($lng->txt("edit_content"), "edit",
1418  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit"));
1419 
1420  // #11858
1421  if($is_active)
1422  {
1423  $alist->addItem($lng->txt("blog_toggle_draft"), "deactivate",
1424  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deactivatePageToList"));
1425  }
1426  else
1427  {
1428  $alist->addItem($lng->txt("blog_toggle_final"), "activate",
1429  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "activatePageToList"));
1430  }
1431 
1432  $alist->addItem($lng->txt("rename"), "rename",
1433  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edittitle"));
1434 
1435  if($this->object->hasKeywords()) // #13616
1436  {
1437  $alist->addItem($lng->txt("blog_edit_keywords"), "keywords",
1438  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editKeywords"));
1439  }
1440 
1441  $alist->addItem($lng->txt("blog_edit_date"), "editdate",
1442  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editdate"));
1443  $alist->addItem($lng->txt("delete"), "delete",
1444  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deleteBlogPostingConfirmationScreen"));
1445  }
1446  else if($is_admin)
1447  {
1448  // #10513
1449  if($is_active)
1450  {
1451  $ilCtrl->setParameter($this, "apid", $item["id"]);
1452  $alist->addItem($lng->txt("blog_toggle_draft_admin"), "deactivate",
1453  $ilCtrl->getLinkTarget($this, "deactivateAdmin"));
1454  $ilCtrl->setParameter($this, "apid", "");
1455  }
1456 
1457  $alist->addItem($lng->txt("delete"), "delete",
1458  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deleteBlogPostingConfirmationScreen"));
1459  }
1460 
1461  $wtpl->setCurrentBlock("actions");
1462  $wtpl->setVariable("ACTION_SELECTOR", $alist->getHTML());
1463  $wtpl->parseCurrentBlock();
1464  }
1465 
1466  // comments
1467  if($this->object->getNotesStatus() && !$a_link_template && !$this->disable_notes)
1468  {
1469  // count (public) notes
1470  include_once("Services/Notes/classes/class.ilNote.php");
1471  $count = sizeof(ilNote::_getNotesOfObject($this->obj_id,
1472  $item["id"], "blp", IL_NOTE_PUBLIC));
1473 
1474  if($a_cmd != "preview")
1475  {
1476  $wtpl->setCurrentBlock("comments");
1477  $wtpl->setVariable("TEXT_COMMENTS", $lng->txt("blog_comments"));
1478  $wtpl->setVariable("URL_COMMENTS", $preview);
1479  $wtpl->setVariable("COUNT_COMMENTS", $count);
1480  $wtpl->parseCurrentBlock();
1481  }
1482  /* we disabled comments in edit mode (should always be done via pagegui)
1483  else
1484  {
1485  $hash = ilCommonActionDispatcherGUI::buildAjaxHash(ilCommonActionDispatcherGUI::TYPE_WORKSPACE,
1486  $this->node_id, "blog", $this->obj_id, "blp", $item["id"]);
1487  $notes_link = "#\" onclick=\"".ilNoteGUI::getListCommentsJSCall($hash);
1488  }
1489  */
1490  }
1491 
1492  // permanent link
1493  if($a_cmd != "preview" && $a_cmd != "previewEmbedded")
1494  {
1495  if($this->id_type == self::WORKSPACE_NODE_ID)
1496  {
1497  $goto = $this->getAccessHandler()->getGotoLink($this->node_id, $this->obj_id, "_".$item["id"]);
1498  }
1499  else
1500  {
1501  include_once "Services/Link/classes/class.ilLink.php";
1502  $goto = ilLink::_getStaticLink($this->node_id, $this->getType(), true, "_".$item["id"]);
1503  }
1504  $wtpl->setCurrentBlock("permalink");
1505  $wtpl->setVariable("URL_PERMALINK", $goto);
1506  $wtpl->setVariable("TEXT_PERMALINK", $lng->txt("blog_permanent_link"));
1507  $wtpl->parseCurrentBlock();
1508  }
1509 
1510  $snippet = ilBlogPostingGUI::getSnippet($item["id"],
1511  $this->object->hasAbstractShorten(),
1512  $this->object->getAbstractShortenLength(),
1513  "&hellip;",
1514  $this->object->hasAbstractImage(),
1515  $this->object->getAbstractImageWidth(),
1516  $this->object->getAbstractImageHeight(),
1517  $a_export_directory);
1518 
1519  if($snippet)
1520  {
1521  $wtpl->setCurrentBlock("more");
1522  $wtpl->setVariable("URL_MORE", $preview);
1523  $wtpl->setVariable("TEXT_MORE", $lng->txt("blog_list_more"));
1524  $wtpl->parseCurrentBlock();
1525  }
1526 
1527  $wtpl->setCurrentBlock("posting");
1528 
1529  if(!$is_active)
1530  {
1531  $wtpl->setVariable("DRAFT_CLASS", " ilBlogListItemDraft");
1532  }
1533 
1534  $author = "";
1535  if($this->id_type == self::REPOSITORY_NODE_ID)
1536  {
1537  $authors = array();
1538 
1539  $author_id = $item["author"];
1540  if($author_id)
1541  {
1542  include_once "Services/User/classes/class.ilUserUtil.php";
1543  $authors[] = ilUserUtil::getNamePresentation($author_id);
1544  }
1545 
1546  if(is_array($item["editors"]))
1547  {
1548  foreach($item["editors"] as $editor_id)
1549  {
1550  $authors[] = ilUserUtil::getNamePresentation($editor_id);
1551  }
1552  }
1553 
1554  if($authors)
1555  {
1556  $author = implode(", ", $authors)." - ";
1557  }
1558  }
1559 
1560  // title
1561  $wtpl->setVariable("URL_TITLE", $preview);
1562  $wtpl->setVariable("TITLE", $item["title"]);
1563  $wtpl->setVariable("DATETIME", $author.
1564  ilDatePresentation::formatDate($item["created"], IL_CAL_DATE));
1565 
1566  // content
1567  $wtpl->setVariable("CONTENT", $snippet);
1568 
1569  $wtpl->parseCurrentBlock();
1570  }
1571 
1572  // permalink
1573  if($a_cmd == "previewFullscreen")
1574  {
1575  $this->tpl->setPermanentLink("blog", $this->node_id,
1576  ($this->id_type == self::WORKSPACE_NODE_ID)
1577  ? "_wsp"
1578  : "");
1579  }
1580 
1581  if(!$is_empty || $a_show_inactive)
1582  {
1583  return $wtpl->get();
1584  }
1585  }
getAccessHandler()
Get access handler.
$preview
static _numericMonthToString($a_month, $a_long=true)
numeric month to string
global $ilCtrl
Definition: ilias.php:18
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)
Default behaviour is:
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:5
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.
special template class to simplify handling of ITX/PEAR
static formatDate(ilDateTime $date)
Format a date public.
$ilUser
Definition: imgupload.php:18
static _lookupOwner($a_id)
lookup object owner
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)
get all notes related to a specific object
Create styles array
The data for the language used.
User interface class for advanced drop-down selection lists.
buildExportLink($a_template, $a_type, $a_id)
Build static export link.
const IL_CAL_DATE
isAdmin()
Check if user has admin access (approve, may edit & deactivate all postings)
Create new PHPExcel object
obj_idprivate
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 ( array  $a_items,
  $a_list_cmd = "render",
  $a_posting_cmd = "preview",
  $a_link_template = null,
  $a_show_inactive = false 
)

Build navigation blocks.

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 1951 of file class.ilObjBlogGUI.php.

References $_GET, $cmd, $ilCtrl, $ilSetting, ilObject2GUI\$node_id, $url, array, ilRSSButtonGUI\get(), ilPanelGUI\getInstance(), ilPanelGUI\HEADING_STYLE_BLOCK, ilRSSButtonGUI\ICON_RSS, mayEditPosting(), object, ilPanelGUI\PANEL_STYLE_SECONDARY, renderNavigationByAuthors(), renderNavigationByDate(), and renderNavigationByKeywords().

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

1952  {
1953  global $ilCtrl, $ilSetting;
1954 
1955  if($this->object->getOrder())
1956  {
1957  $order = array_flip($this->object->getOrder());
1958  }
1959  else
1960  {
1961  $order = array(
1962  "navigation" => 0
1963  ,"keywords" => 2
1964  ,"authors" => 1
1965  );
1966  }
1967 
1968  $wtpl = new ilTemplate("tpl.blog_list_navigation.html", true, true, "Modules/Blog");
1969 
1970  $blocks = array();
1971 
1972  // by date
1973  if(sizeof($a_items))
1974  {
1975  $blocks[$order["navigation"]] = array(
1976  $this->lng->txt("blog_navigation"),
1977  $this->renderNavigationByDate($a_items, $a_list_cmd, $a_posting_cmd, $a_link_template, $a_show_inactive)
1978  );
1979  }
1980 
1981  if($this->object->hasKeywords())
1982  {
1983  // keywords
1984  $may_edit_keywords = ($_GET["blpg"] &&
1985  $this->mayEditPosting($_GET["blpg"]) &&
1986  $a_list_cmd != "preview" &&
1987  $a_list_cmd != "gethtml" &&
1988  !$a_link_template);
1989  $keywords = $this->renderNavigationByKeywords($a_list_cmd, $a_show_inactive, $a_link_template);
1990  if($keywords || $may_edit_keywords)
1991  {
1992  if(!$keywords)
1993  {
1994  $keywords = $this->lng->txt("blog_no_keywords");
1995  }
1996  $cmd = null;
1997  if($may_edit_keywords)
1998  {
1999  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $_GET["blpg"]);
2000  $cmd = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editKeywords");
2001  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", "");
2002  }
2003  $blocks[$order["keywords"]] = array(
2004  $this->lng->txt("blog_keywords"),
2005  $keywords,
2006  $cmd
2007  ? array($cmd, $this->lng->txt("blog_edit_keywords"))
2008  : null
2009  );
2010  }
2011  }
2012 
2013  // is not part of (html) export
2014  if(!$a_link_template)
2015  {
2016  // authors
2017  if($this->id_type == self::REPOSITORY_NODE_ID &&
2018  $this->object->hasAuthors())
2019  {
2020  $authors = $this->renderNavigationByAuthors($a_items, $a_list_cmd, $a_show_inactive);
2021  if($authors)
2022  {
2023  $blocks[$order["authors"]] = array($this->lng->txt("blog_authors"), $authors);
2024  }
2025  }
2026 
2027  // rss
2028  if($this->object->hasRSS() &&
2029  $ilSetting->get('enable_global_profiles') &&
2030  $a_list_cmd == "preview")
2031  {
2032  // #10827
2033  $blog_id = $this->node_id;
2034  if($this->id_type != self::WORKSPACE_NODE_ID)
2035  {
2036  $blog_id .= "_cll";
2037  }
2038  $url = ILIAS_HTTP_PATH."/feed.php?blog_id=".$blog_id.
2039  "&client_id=".rawurlencode(CLIENT_ID);
2040 
2041  include_once("./Services/News/classes/class.ilRSSButtonGUI.php");
2042  $wtpl->setVariable("RSS_BUTTON", ilRSSButtonGUI::get(ilRSSButtonGUI::ICON_RSS, $url));
2043  }
2044  }
2045 
2046  if(sizeof($blocks))
2047  {
2048  include_once "Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
2049 
2050  ksort($blocks);
2051  foreach($blocks as $block)
2052  {
2053  $panel = ilPanelGUI::getInstance();
2054  $panel->setPanelStyle(ilPanelGUI::PANEL_STYLE_SECONDARY);
2055  $panel->setHeadingStyle(ilPanelGUI::HEADING_STYLE_BLOCK);
2056  $panel->setHeading($block[0]);
2057  $panel->setBody($block[1]);
2058 
2059  if(isset($block[2]) && is_array($block[2]))
2060  {
2061  $panel->setFooter('<a href="'.$block[2][0].'">'.$block[2][1].'</a>');
2062  }
2063 
2064  $wtpl->setCurrentBlock("block_bl");
2065  $wtpl->setVariable("BLOCK", $panel->getHTML());
2066  $wtpl->parseCurrentBlock();
2067  }
2068  }
2069 
2070  return $wtpl->get();
2071  }
static get($a_type, $a_href="")
Get icon html.
renderNavigationByDate(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build navigation by date block.
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
$url
Definition: shib_logout.php:72
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
renderNavigationByAuthors(array $a_items, $a_list_cmd="render", $a_show_inactive=false)
static getInstance()
Get instance.
renderNavigationByKeywords($a_list_cmd="render", $a_show_inactive=false, $a_link_template=false)
Build navigation by keywords block.
Create new PHPExcel object
obj_idprivate
global $ilSetting
Definition: privfeed.php:17
const PANEL_STYLE_SECONDARY
const HEADING_STYLE_BLOCK
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 1876 of file class.ilObjBlogGUI.php.

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

Referenced by renderNavigation().

1877  {
1878  global $ilCtrl;
1879 
1880  $authors = array();
1881  foreach($a_items as $month => $items)
1882  {
1883  foreach($items as $item)
1884  {
1885  if(($a_show_inactive || ilBlogPosting::_lookupActive($item["id"], "blp")))
1886  {
1887  if($item["author"])
1888  {
1889  $authors[] = $item["author"];
1890  }
1891 
1892  if(is_array($item["editors"]))
1893  {
1894  foreach($item["editors"] as $editor_id)
1895  {
1896  if($editor_id != $item["author"])
1897  {
1898  $authors[] = $editor_id;
1899  }
1900  }
1901  }
1902  }
1903  }
1904  }
1905 
1906  $authors = array_unique($authors);
1907  if(sizeof($authors) > 1)
1908  {
1909  include_once "Services/User/classes/class.ilUserUtil.php";
1910 
1911  $list = array();
1912  foreach($authors as $user_id)
1913  {
1914  if($user_id)
1915  {
1916  $ilCtrl->setParameter($this, "ath", $user_id);
1917  $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1918  $ilCtrl->setParameter($this, "ath", "");
1919 
1920  $name = ilUserUtil::getNamePresentation($user_id, true);
1921  $idx = trim(strip_tags($name))."///".$user_id; // #10934
1922  $list[$idx] = array($name, $url);
1923  }
1924  }
1925  ksort($list);
1926 
1927  $wtpl = new ilTemplate("tpl.blog_list_navigation_authors.html", true, true, "Modules/Blog");
1928 
1929  $wtpl->setCurrentBlock("author");
1930  foreach($list as $author)
1931  {
1932  $wtpl->setVariable("TXT_AUTHOR", $author[0]);
1933  $wtpl->setVariable("URL_AUTHOR", $author[1]);
1934  $wtpl->parseCurrentBlock();
1935  }
1936 
1937  return $wtpl->get();
1938  }
1939  }
$url
Definition: shib_logout.php:72
global $ilCtrl
Definition: ilias.php:18
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)
Default behaviour is:
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
+ 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 
)
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 1597 of file class.ilObjBlogGUI.php.

References $_GET, $counter, $ilCtrl, $month, $url, ilPageObject\_lookupActive(), ilCalendarUtil\_numericMonthToString(), array, buildExportLink(), ilObjBlog\NAV_MODE_LIST, and object.

Referenced by renderNavigation().

1598  {
1599  global $ilCtrl;
1600 
1601  // gather page active status
1602  foreach($a_items as $month => $postings)
1603  {
1604  foreach(array_keys($postings) as $id)
1605  {
1606  $active = ilBlogPosting::_lookupActive($id, "blp");
1607  if(!$a_show_inactive && !$active)
1608  {
1609  unset($a_items[$month][$id]);
1610  }
1611  else
1612  {
1613  $a_items[$month][$id]["active"] = $active;
1614  }
1615  }
1616  if(!sizeof($a_items[$month]))
1617  {
1618  unset($a_items[$month]);
1619  }
1620  }
1621 
1622  // list month (incl. postings)
1623  if($this->object->getNavMode() == ilObjBlog::NAV_MODE_LIST || $a_link_template)
1624  {
1625  $max_detail_postings = $this->object->getNavModeListPostings();
1626  $max_months = $this->object->getNavModeListMonths();
1627 
1628  $wtpl = new ilTemplate("tpl.blog_list_navigation_by_date.html", true, true, "Modules/Blog");
1629 
1630  $ilCtrl->setParameter($this, "blpg", "");
1631 
1632  include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
1633  $counter = $mon_counter = $last_year = 0;
1634  foreach($a_items as $month => $postings)
1635  {
1636  if(!$a_link_template && $max_months && $mon_counter >= $max_months)
1637  {
1638  break;
1639  }
1640 
1641  $add_year = false;
1642  $year = substr($month, 0, 4);
1643  if(!$last_year || $year != $last_year)
1644  {
1645  // #13562
1646  $add_year = true;
1647  $last_year = $year;
1648  }
1649 
1650  $mon_counter++;
1651 
1652  $month_name = ilCalendarUtil::_numericMonthToString((int)substr($month, 5));
1653 
1654  if(!$a_link_template)
1655  {
1656  $ilCtrl->setParameter($this, "bmn", $month);
1657  $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1658  }
1659  else
1660  {
1661  $month_url = $this->buildExportLink($a_link_template, "list", $month);
1662  }
1663 
1664  // list postings for month
1665  if($counter < $max_detail_postings)
1666  {
1667  if($add_year)
1668  {
1669  $wtpl->setCurrentBlock("navigation_year_details");
1670  $wtpl->setVariable("YEAR", $year);
1671  $wtpl->parseCurrentBlock();
1672  }
1673 
1674  foreach($postings as $id => $posting)
1675  {
1676  if($max_detail_postings && $counter >= $max_detail_postings)
1677  {
1678  break;
1679  }
1680 
1681  $counter++;
1682 
1683  $caption = /* ilDatePresentation::formatDate($posting["created"], IL_CAL_DATETIME).
1684  ", ".*/ $posting["title"];
1685 
1686  if(!$a_link_template)
1687  {
1688  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", $month);
1689  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $id);
1690  $url = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", $a_posting_cmd);
1691  }
1692  else
1693  {
1694  $url = $this->buildExportLink($a_link_template, "posting", $id);
1695  }
1696 
1697  if(!$posting["active"])
1698  {
1699  $wtpl->setVariable("NAV_ITEM_DRAFT", $this->lng->txt("blog_draft"));
1700  }
1701  else if($this->object->hasApproval() && !$posting["approved"])
1702  {
1703  $wtpl->setVariable("NAV_ITEM_APPROVAL", $this->lng->txt("blog_needs_approval"));
1704  }
1705 
1706  $wtpl->setCurrentBlock("navigation_item");
1707  $wtpl->setVariable("NAV_ITEM_URL", $url);
1708  $wtpl->setVariable("NAV_ITEM_CAPTION", $caption);
1709  $wtpl->parseCurrentBlock();
1710  }
1711 
1712  $wtpl->setCurrentBlock("navigation_month_details");
1713  $wtpl->setVariable("NAV_MONTH", $month_name);
1714  $wtpl->setVariable("URL_MONTH", $month_url);
1715  $wtpl->parseCurrentBlock();
1716  }
1717  // summarized month
1718  else
1719  {
1720  if($add_year)
1721  {
1722  $wtpl->setCurrentBlock("navigation_year");
1723  $wtpl->setVariable("YEAR", $year);
1724  $wtpl->parseCurrentBlock();
1725  }
1726 
1727  $wtpl->setCurrentBlock("navigation_month");
1728  $wtpl->setVariable("MONTH_NAME", $month_name);
1729  $wtpl->setVariable("URL_MONTH", $month_url);
1730  $wtpl->setVariable("MONTH_COUNT", sizeof($postings));
1731  $wtpl->parseCurrentBlock();
1732  }
1733  }
1734 
1735  $ilCtrl->setParameter($this, "bmn", $this->month);
1736  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", "");
1737 
1738  return $wtpl->get();
1739  }
1740  // single month
1741  else
1742  {
1743  $wtpl = new ilTemplate("tpl.blog_list_navigation_month.html", true, true, "Modules/Blog");
1744 
1745  $ilCtrl->setParameter($this, "blpg", "");
1746 
1747  include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
1748  $month_options = array();
1749  foreach($a_items as $month => $postings)
1750  {
1751  $month_name = ilCalendarUtil::_numericMonthToString((int)substr($month, 5)).
1752  " ".substr($month, 0, 4);
1753 
1754  $month_options[$month] = $month_name;
1755 
1756  if($month == $this->month)
1757  {
1758  if(!$a_link_template)
1759  {
1760  $ilCtrl->setParameter($this, "bmn", $month);
1761  $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1762  }
1763  else
1764  {
1765  $month_url = $this->buildExportLink($a_link_template, "list", $month);
1766  }
1767 
1768  foreach($postings as $id => $posting)
1769  {
1770  $caption = /* ilDatePresentation::formatDate($posting["created"], IL_CAL_DATETIME).
1771  ", ".*/ $posting["title"];
1772 
1773  if(!$a_link_template)
1774  {
1775  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", $month);
1776  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $id);
1777  $url = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", $a_posting_cmd);
1778  }
1779  else
1780  {
1781  $url = $this->buildExportLink($a_link_template, "posting", $id);
1782  }
1783 
1784  if(!$posting["active"])
1785  {
1786  $wtpl->setVariable("NAV_ITEM_DRAFT", $this->lng->txt("blog_draft"));
1787  }
1788  else if($this->object->hasApproval() && !$posting["approved"])
1789  {
1790  $wtpl->setVariable("NAV_ITEM_APPROVAL", $this->lng->txt("blog_needs_approval"));
1791  }
1792 
1793  $wtpl->setCurrentBlock("navigation_item");
1794  $wtpl->setVariable("NAV_ITEM_URL", $url);
1795  $wtpl->setVariable("NAV_ITEM_CAPTION", $caption);
1796  $wtpl->parseCurrentBlock();
1797  }
1798 
1799  $wtpl->setCurrentBlock("navigation_month_details");
1800  if($_GET["blpg"])
1801  {
1802  $wtpl->setVariable("NAV_MONTH", $month_name);
1803  $wtpl->setVariable("URL_MONTH", $month_url);
1804  }
1805  $wtpl->parseCurrentBlock();
1806  }
1807  }
1808 
1809  if(!$_GET["blpg"])
1810  {
1811  $wtpl->setCurrentBlock("option_bl");
1812  foreach($month_options as $value => $caption)
1813  {
1814  $wtpl->setVariable("OPTION_VALUE", $value);
1815  $wtpl->setVariable("OPTION_CAPTION", $caption);
1816  if($value == $this->month)
1817  {
1818  $wtpl->setVariable("OPTION_SEL", ' selected="selected"');
1819  }
1820  $wtpl->parseCurrentBlock();
1821  }
1822 
1823  $wtpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this, $a_list_cmd));
1824  }
1825 
1826  $ilCtrl->setParameter($this, "bmn", $this->month);
1827  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", "");
1828 
1829  return $wtpl->get();
1830  }
1831  }
$_GET["client_id"]
const NAV_MODE_LIST
$url
Definition: shib_logout.php:72
static _numericMonthToString($a_month, $a_long=true)
numeric month to string
global $ilCtrl
Definition: ilias.php:18
$counter
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
buildExportLink($a_template, $a_type, $a_id)
Build static export link.
Create new PHPExcel object
obj_idprivate
+ 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 
)
protected

Build navigation by keywords block.

Parameters
string$a_list_cmd
bool$a_show_inactive
Returns
string

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

References $_GET, $counter, $ilCtrl, $keyword, $url, buildExportLink(), getKeywords(), and ilTagging\getRelevanceClass().

Referenced by renderNavigation().

1841  {
1842  global $ilCtrl;
1843 
1844  $keywords = $this->getKeywords($a_show_inactive, $_GET["blpg"]);
1845  if($keywords)
1846  {
1847  $wtpl = new ilTemplate("tpl.blog_list_navigation_keywords.html", true, true, "Modules/Blog");
1848 
1849  $max = max($keywords);
1850  include_once "Services/Tagging/classes/class.ilTagging.php";
1851 
1852  $wtpl->setCurrentBlock("keyword");
1853  foreach($keywords as $keyword => $counter)
1854  {
1855  if(!$a_link_template)
1856  {
1857  $ilCtrl->setParameter($this, "kwd", urlencode($keyword)); // #15885
1858  $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1859  $ilCtrl->setParameter($this, "kwd", "");
1860  }
1861  else
1862  {
1863  $url = $this->buildExportLink($a_link_template, "keyword", $keyword);
1864  }
1865 
1866  $wtpl->setVariable("TXT_KEYWORD", $keyword);
1867  $wtpl->setVariable("CLASS_KEYWORD", ilTagging::getRelevanceClass($counter, $max));
1868  $wtpl->setVariable("URL_KEYWORD", $url);
1869  $wtpl->parseCurrentBlock();
1870  }
1871 
1872  return $wtpl->get();
1873  }
1874  }
$_GET["client_id"]
$url
Definition: shib_logout.php:72
global $ilCtrl
Definition: ilias.php:18
$counter
special template class to simplify handling of ITX/PEAR
static getRelevanceClass($cnt, $max)
Get style class for tag relevance.
buildExportLink($a_template, $a_type, $a_id)
Build static export link.
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:

◆ saveStyleSettings()

ilObjBlogGUI::saveStyleSettings ( )

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

References $_POST, $ilSetting, ilObjStyleSheet\_lookupStandard(), object, ilUtil\sendSuccess(), and ilUtil\stripSlashes().

3083  {
3084  global $ilSetting;
3085 
3086  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3087  if ($ilSetting->get("fixed_content_style_id") <= 0 &&
3088  (ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId())
3089  || $this->object->getStyleSheetId() == 0))
3090  {
3091  $this->object->setStyleSheetId(ilUtil::stripSlashes($_POST["style_id"]));
3092  $this->object->update();
3093 
3094  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
3095  }
3096  $this->ctrl->redirect($this, "editStyleProperties");
3097  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupStandard($a_id)
Lookup standard flag.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create new PHPExcel object
obj_idprivate
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 2975 of file class.ilObjBlogGUI.php.

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

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

2976  {
2977  global $tpl;
2978 
2979  if ($a_tpl != null)
2980  {
2981  $ctpl = $a_tpl;
2982  }
2983  else
2984  {
2985  $ctpl = $tpl;
2986  }
2987 
2988  $ctpl->setCurrentBlock("ContentStyle");
2989  $ctpl->setVariable("LOCATION_CONTENT_STYLESHEET",
2990  ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
2991  $ctpl->parseCurrentBlock();
2992  }
static getContentStylePath($a_style_id)
get content style path
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setNotification()

ilObjBlogGUI::setNotification ( )
protected

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

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

2558  {
2559  global $ilUser, $ilCtrl;
2560 
2561  include_once "./Services/Notification/classes/class.ilNotification.php";
2562  switch($_GET["ntf"])
2563  {
2564  case 1:
2566  break;
2567 
2568  case 2:
2570  break;
2571  }
2572 
2573  $ilCtrl->redirect($this, "preview");
2574  }
$_GET["client_id"]
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 97 of file class.ilObjBlogGUI.php.

Referenced by editStyleProperties(), and initEditCustomForm().

98  {
99  // general properties
100  $this->tabs_gui->addSubTab("properties",
101  $this->lng->txt("blog_properties"),
102  $this->ctrl->getLinkTarget($this, 'edit'));
103 
104  $this->tabs_gui->addSubTab("style",
105  $this->lng->txt("obj_sty"),
106  $this->ctrl->getLinkTarget($this, 'editStyleProperties'));
107 
108  $this->tabs_gui->activateSubTab($a_active);
109  }
+ Here is the caller graph for this function:

◆ setTabs()

ilObjBlogGUI::setTabs ( )

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

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

382  {
383  global $lng, $ilHelp;
384 
385  if($this->id_type == self::WORKSPACE_NODE_ID)
386  {
387  $this->ctrl->setParameter($this,"wsp_id",$this->node_id);
388  }
389 
390  $ilHelp->setScreenIdComponent("blog");
391 
392  if ($this->checkPermissionBool("read"))
393  {
394  $this->tabs_gui->addTab("content",
395  $lng->txt("content"),
396  $this->ctrl->getLinkTarget($this, ""));
397  }
398 
399  if ($this->checkPermissionBool("read"))
400  {
401  $this->tabs_gui->addTab("id_info",
402  $lng->txt("info_short"),
403  $this->ctrl->getLinkTargetByClass(array("ilobjbloggui", "ilinfoscreengui"), "showSummary"));
404  }
405 
406  if ($this->checkPermissionBool("write"))
407  {
408  $this->tabs_gui->addTab("settings",
409  $lng->txt("settings"),
410  $this->ctrl->getLinkTarget($this, "edit"));
411 
412  if($this->id_type == self::REPOSITORY_NODE_ID)
413  {
414  $this->tabs_gui->addTab("contributors",
415  $lng->txt("blog_contributors"),
416  $this->ctrl->getLinkTarget($this, "contributors"));
417  }
418 
419  if($this->id_type == self::REPOSITORY_NODE_ID)
420  {
421  $this->tabs_gui->addTab("export",
422  $lng->txt("export"),
423  $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
424  }
425  }
426 
427  if($this->mayContribute())
428  {
429  $this->tabs_gui->addNonTabbedLink("preview", $lng->txt("blog_preview"),
430  $this->ctrl->getLinkTarget($this, "preview"));
431  }
432 
433  // will add permissions if needed
434  parent::setTabs();
435  }
mayContribute()
Check if user may contribute at all.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ updateCustom()

ilObjBlogGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

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

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

322  {
323  global $lng;
324 
325  if($this->id_type == self::REPOSITORY_NODE_ID)
326  {
327  $this->object->setApproval($a_form->getInput("approval"));
328  $this->object->setAuthors($a_form->getInput("nav_authors"));
329  }
330  $this->object->setKeywords($a_form->getInput("keywords"));
331  $this->object->setNotesStatus($a_form->getInput("notes"));
332  $this->object->setProfilePicture($a_form->getInput("ppic"));
333  /*
334  $this->object->setBackgroundColor($a_form->getInput("bg_color"));
335  $this->object->setFontColor($a_form->getInput("font_color"));
336  */
337  $this->object->setRSS($a_form->getInput("rss"));
338  $this->object->setAbstractShorten($a_form->getInput("abss"));
339  $this->object->setAbstractShortenLength($a_form->getInput("abssl"));
340  $this->object->setAbstractImage($a_form->getInput("absi"));
341  $this->object->setAbstractImageWidth($a_form->getInput("absiw"));
342  $this->object->setAbstractImageHeight($a_form->getInput("absih"));
343  $this->object->setNavMode($a_form->getInput("nav"));
344  $this->object->setNavModeListPostings($a_form->getInput("nav_list_detail"));
345  $this->object->setNavModeListMonths($a_form->getInput("nav_list_mon"));
346  $this->object->setOverviewPostings($a_form->getInput("ov_list_post_num"));
347 
348  $order = $a_form->getInput("order");
349  foreach($order as $idx => $value)
350  {
351  if($value == $lng->txt("blog_navigation"))
352  {
353  $order[$idx] = "navigation";
354  }
355  else if($value == $lng->txt("blog_keywords"))
356  {
357  $order[$idx] = "keywords";
358  }
359  else
360  {
361  $order[$idx]= "authors";
362  }
363  }
364  $this->object->setOrder($order);
365 
366  // banner field is optional
367  $banner = $a_form->getItemByPostVar("banner");
368  if($banner)
369  {
370  if($_FILES["banner"]["tmp_name"])
371  {
372  $this->object->uploadImage($_FILES["banner"]);
373  }
374  else if($banner->getDeletionFlag())
375  {
376  $this->object->deleteImage();
377  }
378  }
379  }
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.
+ Here is the call graph for this function:

◆ writeExportFile()

ilObjBlogGUI::writeExportFile (   $a_target_directory,
  $a_file,
  $a_tpl,
  $a_content,
  $a_right_content = null,
  $a_back = null 
)
protected

Write HTML to file.

Parameters
type$a_target_directory
type$a_file
type$a_tpl
type$a_content
type$a_right_content
Returns
string

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

References $a_content, and $file.

Referenced by exportHTMLPages().

2395  {
2396  $file = $a_target_directory."/".$a_file;
2397  // return if file is already existing
2398  if (@is_file($file))
2399  {
2400  return;
2401  }
2402 
2403  // export template: page content
2404  $ep_tpl = new ilTemplate("tpl.export_page.html", true, true,
2405  "Modules/Blog");
2406  if($a_back)
2407  {
2408  $ep_tpl->setVariable("PAGE_CONTENT", $a_content);
2409  }
2410  else
2411  {
2412  $ep_tpl->setVariable("LIST", $a_content);
2413  }
2414  unset($a_content);
2415  $a_tpl->setContent($ep_tpl->get());
2416  unset($ep_tpl);
2417 
2418  // template: right content
2419  if($a_right_content)
2420  {
2421  $a_tpl->setRightContent($a_right_content);
2422  unset($a_right_content);
2423  }
2424 
2425  $content = $a_tpl->get("DEFAULT", false, false, false,
2426  true, true, true);
2427 
2428  // open file
2429  if (!file_put_contents($file, $content))
2430  {
2431  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
2432  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
2433  }
2434 
2435  // set file permissions
2436  chmod($file, 0770);
2437 
2438  return $file;
2439  }
$a_content
Definition: workflow.php:94
special template class to simplify handling of ITX/PEAR
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the caller graph for this function:

Field Documentation

◆ $author

ilObjBlogGUI::$author
protected

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

Referenced by renderList(), and renderNavigationByAuthors().

◆ $items

ilObjBlogGUI::$items
protected

◆ $keyword

ilObjBlogGUI::$keyword
protected

◆ $keyword_export_map

ilObjBlogGUI::$keyword_export_map
staticprotected

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

◆ $month

◆ $month_default

ilObjBlogGUI::$month_default
protected

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


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