ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 renderToolbarNavigation ($a_items, $single_posting=false)
 Toolbar navigation. More...
 
 getNextMonth ($a_items)
 Get next month. More...
 
 getPreviousMonth ($a_items)
 Get next month. More...
 
 getLatestMonth ($a_items)
 Get next month. More...
 
 getNextPosting ($a_items)
 Get next posting. More...
 
 getPreviousPosting ($a_items)
 Get previous posting. More...
 
 getLatestPosting ($a_items)
 Get previous posting. More...
 
 renderNavigation (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...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 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...
 

Data Fields

 $prtf_embed = false
 
- Data Fields inherited from ilObject2GUI
 $tree
 
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 initCreationForms ($a_new_type)
 
 afterSave (ilObject $a_new_object)
 
 setSettingsSubTabs ($a_active)
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 
 getEditFormCustomValues (array &$a_values)
 
 updateCustom (ilPropertyFormGUI $a_form)
 
 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...
 
 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...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $help
 
 $tabs
 
 $nav_history
 
 $main_menu
 
 $rbacadmin
 
 $month
 
 $items
 
 $keyword
 
 $author
 
 $month_default
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Static Protected Attributes

static $keyword_export_map
 

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

References $DIC, $ilCtrl, ilObjectGUI\$lng, buildPostingList(), ilBlogPosting\lookupBlogId(), object, settings(), string, ilUtil\stripSlashes(), and user().

63  {
64  global $DIC;
65 
66  $this->settings = $DIC->settings();
67  $this->help = $DIC["ilHelp"];
68  $this->tabs = $DIC->tabs();
69  $this->nav_history = $DIC["ilNavigationHistory"];
70  $this->user = $DIC->user();
71  $this->toolbar = $DIC->toolbar();
72  $this->tree = $DIC->repositoryTree();
73  $this->locator = $DIC["ilLocator"];
74  $this->main_menu = $DIC["ilMainMenu"];
75  $this->rbacreview = $DIC->rbac()->review();
76  $this->rbacadmin = $DIC->rbac()->admin();
77 
78  $lng = $DIC->language();
79  $ilCtrl = $DIC->ctrl();
80 
81  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
82 
83 
84  if ($_REQUEST["blpg"] > 0 && ilBlogPosting::lookupBlogId($_REQUEST["blpg"]) != $this->object->getId()) {
85  throw new ilException("Posting ID does not match blog.");
86  }
87 
88 
89  if ($this->object) {
90  $this->month = (string) ilUtil::stripSlashes($_REQUEST["bmn"]);
91  $this->keyword = (string) ilUtil::stripSlashes($_REQUEST["kwd"]);
92  $this->author = (int) $_REQUEST["ath"];
93 
94  // gather postings by month
95  $this->items = $this->buildPostingList($this->object->getId());
96  if ($this->items) {
97  // current month (if none given or empty)
98  if (!$this->month || !$this->items[$this->month]) {
99  $this->month = array_keys($this->items);
100  $this->month = array_shift($this->month);
101  $this->month_default = true;
102  }
103  }
104 
105  $ilCtrl->setParameter($this, "bmn", $this->month);
106  }
107 
108  $lng->loadLanguageModule("blog");
109  $ilCtrl->saveParameter($this, "prvm");
110  }
Add rich text string
static lookupBlogId($a_posting_id)
Lookup blog id.
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
buildPostingList($a_obj_id)
Gather all blog postings.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
settings()
Definition: settings.php:2
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 3221 of file class.ilObjBlogGUI.php.

References $_GET, $id, and exit.

3222  {
3223  if (substr($a_target, -3) == "wsp") {
3224  $id = explode("_", $a_target);
3225 
3226  $_GET["baseClass"] = "ilSharedResourceGUI";
3227  $_GET["wsp_id"] = $id[0];
3228  if (sizeof($id) == 3) {
3229  $_GET["gtp"] = $id[1];
3230  }
3231  } else {
3232  $id = explode("_", $a_target);
3233 
3234  $_GET["baseClass"] = "ilRepositoryGUI";
3235  $_GET["ref_id"] = $id[0];
3236  $_GET["cmd"] = "preview";
3237  if (sizeof($id) == 2) {
3238  if (is_numeric($id[1])) {
3239  $_GET["gtp"] = $id[1];
3240  } else {
3241  $_REQUEST["kwd"] = $id[1];
3242  }
3243  }
3244  }
3245 
3246  include("ilias.php");
3247  exit;
3248  }
$_GET["client_id"]
if(!array_key_exists('StateId', $_REQUEST)) $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 2952 of file class.ilObjBlogGUI.php.

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

Referenced by addUserFromAutoComplete().

2953  {
2954  $ilCtrl = $this->ctrl;
2955  $lng = $this->lng;
2958 
2959  if (!$this->checkPermissionBool("write")) {
2960  return;
2961  }
2962 
2963  if (!count($a_user_ids) || !$a_user_type) {
2964  ilUtil::sendFailure($lng->txt("no_checkbox"));
2965  return $this->contributors();
2966  }
2967 
2968  // get contributor role
2969  $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
2970  if (!in_array($a_user_type, $local_roles)) {
2971  ilUtil::sendFailure($lng->txt("missing_perm"));
2972  return $this->contributors();
2973  }
2974 
2975  foreach ($a_user_ids as $user_id) {
2976  if (!$rbacreview->isAssigned($user_id, $a_user_type)) {
2977  $rbacadmin->assignUser($a_user_type, $user_id);
2978  }
2979  }
2980 
2981  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
2982  $ilCtrl->redirect($this, "contributors");
2983  }
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 2605 of file class.ilObjBlogGUI.php.

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

Referenced by executeCommand().

2606  {
2607  $ilUser = $this->user;
2608  $ilCtrl = $this->ctrl;
2609 
2610  // preview?
2611  if ($a_cmd == "preview" || $a_cmd == "previewFullscreen" || $_GET["prvm"]) {
2612  // notification
2613  if ($ilUser->getId() != ANONYMOUS_USER_ID) {
2614  if (!$_GET["prvm"]) {
2615  $ilCtrl->setParameter($this, "prvm", "fsc");
2616  }
2617  $this->insertHeaderAction($this->initHeaderAction(null, null, true));
2618  if (!$_GET["prvm"]) {
2619  $ilCtrl->setParameter($this, "prvm", "");
2620  }
2621  }
2622  } else {
2623  return parent::addHeaderAction();
2624  }
2625  }
$_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 2848 of file class.ilObjBlogGUI.php.

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

2849  {
2850  $ilLocator = $this->locator;
2851 
2852  if (is_object($this->object)) {
2853  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->node_id);
2854  }
2855  }
Create new PHPExcel object
obj_idprivate

◆ addToDeskObject()

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

Implements ilDesktopItemHandling.

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

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

3054  {
3055  $lng = $this->lng;
3056 
3057  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
3059  ilUtil::sendSuccess($lng->txt("added_to_desktop"));
3060  }
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 2922 of file class.ilObjBlogGUI.php.

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

2923  {
2924  $lng = $this->lng;
2925 
2926  if (!strlen(trim($_POST['user_login']))) {
2927  ilUtil::sendFailure($lng->txt('msg_no_search_string'));
2928  return $this->contributors();
2929  }
2930  $users = explode(',', ilUtil::stripSlashes($_POST['user_login']));
2931 
2932  $user_ids = array();
2933  foreach ($users as $user) {
2934  $user_id = ilObjUser::_lookupId($user);
2935 
2936  if (!$user_id) {
2937  ilUtil::sendFailure($lng->txt('user_not_known'));
2938  return $this->contributors();
2939  }
2940 
2941  $user_ids[] = $user_id;
2942  }
2943 
2944  return $this->addContributor($user_ids, ilUtil::stripSlashes($_POST["user_type"]));
2945  }
static _lookupId($a_user_str)
Lookup id by login.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
addContributor($a_user_ids=array(), $a_user_type=null)
Centralized method to add contributors.
Create styles array
The data for the language used.
$users
Definition: authpage.php:44
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 129 of file class.ilObjBlogGUI.php.

References ilObjectGUI\$ctrl, $ilCtrl, and ilUtil\sendSuccess().

130  {
132 
133  ilUtil::sendSuccess($this->lng->txt("object_added"), true);
134  $ilCtrl->redirect($this, "");
135  }
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 2857 of file class.ilObjBlogGUI.php.

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

2858  {
2859  if ($this->isAdmin() && (int) $_GET["apid"]) {
2860  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
2861  $post = new ilBlogPosting((int) $_GET["apid"]);
2862  $post->setApproved(true);
2863  $post->setBlogNodeId($this->node_id, ($this->id_type == self::WORKSPACE_NODE_ID));
2864  $post->update(true, false, true, "new"); // #13434
2865 
2866  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
2867  }
2868 
2869  $this->ctrl->redirect($this, "render");
2870  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilBlogPosting.
$_GET["client_id"]
$post
Definition: post.php:34
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 1100 of file class.ilObjBlogGUI.php.

References $a_content.

Referenced by executeCommand(), and getHTML().

1101  {
1102  $wtpl = new ilTemplate("tpl.blog_embedded.html", true, true, "Modules/Blog");
1103  $wtpl->setVariable("VAL_LIST", $a_content);
1104  $wtpl->setVariable("VAL_NAVIGATION", $a_nav);
1105  return $wtpl->get();
1106  }
$a_content
Definition: workflow.php:93
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 2277 of file class.ilObjBlogGUI.php.

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

Referenced by export().

2278  {
2279  // create export file
2280  include_once("./Services/Export/classes/class.ilExport.php");
2281  ilExport::_createExportDirectory($this->object->getId(), "html", "blog");
2282  $exp_dir = ilExport::_getExportDirectory($this->object->getId(), "html", "blog");
2283 
2284  $subdir = $this->object->getType() . "_" . $this->object->getId();
2285  $export_dir = $exp_dir . "/" . $subdir;
2286 
2287  // initialize temporary target directory
2288  ilUtil::delDir($export_dir);
2289  ilUtil::makeDir($export_dir);
2290 
2291  // system style html exporter
2292  include_once("./Services/Style/System/classes/class.ilSystemStyleHTMLExport.php");
2293  $this->sys_style_html_export = new ilSystemStyleHTMLExport($export_dir);
2294  $this->sys_style_html_export->addImage("icon_blog.svg");
2295  $this->sys_style_html_export->export();
2296 
2297  // init co page html exporter
2298  include_once("./Services/COPage/classes/class.ilCOPageHTMLExport.php");
2299  $this->co_page_html_export = new ilCOPageHTMLExport($export_dir);
2300  $this->co_page_html_export->setContentStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
2301  $this->object->getStyleSheetId(),
2302  "blog"
2303  ));
2304  $this->co_page_html_export->createDirectories();
2305  $this->co_page_html_export->exportStyles();
2306  $this->co_page_html_export->exportSupportScripts();
2307 
2308  // banner / profile picture
2309  $blga_set = new ilSetting("blga");
2310  if ($blga_set->get("banner")) {
2311  $banner = $this->object->getImageFullPath();
2312  if ($banner) {
2313  copy($banner, $export_dir . "/" . basename($banner));
2314  }
2315  }
2316  $ppic = ilObjUser::_getPersonalPicturePath($this->object->getOwner(), "xsmall", true, true);
2317  if ($ppic) {
2318  $ppic = array_shift(explode("?", $ppic));
2319  copy($ppic, $export_dir . "/" . basename($ppic));
2320  }
2321 
2322  // export pages
2323  $this->exportHTMLPages($export_dir);
2324 
2325  // zip everything
2326  if (true) {
2327  // zip it all
2328  $date = time();
2329  $zip_file = ilExport::_getExportDirectory($this->object->getId(), "html", "blog") .
2330  "/" . $date . "__" . IL_INST_ID . "__" .
2331  $this->object->getType() . "_" . $this->object->getId() . ".zip";
2332  ilUtil::zip($export_dir, $zip_file);
2333  ilUtil::delDir($export_dir);
2334  }
2335 
2336  return $zip_file;
2337  }
static _createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
HTML export class for pages.
HTML export class for system styles.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
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 _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 2480 of file class.ilObjBlogGUI.php.

References $a_type, and getKeywords().

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

2481  {
2482  switch ($a_type) {
2483  case "list":
2484  $a_type = "m";
2485  break;
2486  break;
2487 
2488  case "keyword":
2489  if (!self::$keyword_export_map) {
2490  self::$keyword_export_map = array_flip(array_keys($this->getKeywords(false)));
2491  }
2492  $a_id = self::$keyword_export_map[$a_id];
2493  $a_type = "k";
2494  break;
2495 
2496  default:
2497  $a_type = "p";
2498  break;
2499  }
2500 
2501  $link = str_replace("{TYPE}", $a_type, $a_template);
2502  return str_replace("{ID}", $a_id, $link);
2503  }
$a_type
Definition: workflow.php:92
getKeywords($a_show_inactive, $a_posting_id=null)
Get keywords for single posting or complete blog.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildExportTemplate()

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

Build export "frame".

Parameters
type$a_back_url
Returns
ilTemplate

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

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

Referenced by exportHTMLPages().

2512  {
2513  $ilTabs = $this->tabs;
2514  $lng = $this->lng;
2515 
2516  $tpl = $this->co_page_html_export->getPreparedMainTemplate();
2517 
2518  $tpl->getStandardTemplate();
2519 
2520  $ilTabs->clearTargets();
2521  if ($a_back_url) {
2522  $ilTabs->setBackTarget($lng->txt("back"), $a_back_url);
2523  }
2524 
2525  $this->renderFullscreenHeader($tpl, $this->object->getOwner(), true);
2526 
2527  return $tpl;
2528  }
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 1277 of file class.ilObjBlogGUI.php.

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

Referenced by __construct().

1278  {
1279  $author_found = false;
1280 
1281  $items = array();
1282  foreach (ilBlogPosting::getAllPostings($a_obj_id) as $posting) {
1283  if ($this->author &&
1284  ($posting["author"] == $this->author ||
1285  (is_array($posting["editors"]) && in_array($this->author, $posting["editors"])))) {
1286  $author_found = true;
1287  }
1288 
1289  $month = substr($posting["created"]->get(IL_CAL_DATE), 0, 7);
1290  $items[$month][$posting["id"]] = $posting;
1291  }
1292 
1293  if ($this->author && !$author_found) {
1294  $this->author = null;
1295  }
1296 
1297  return $items;
1298  }
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 2988 of file class.ilObjBlogGUI.php.

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

2989  {
2990  $ids = ilUtil::stripSlashesRecursive($_POST["id"]);
2991 
2992  if (!sizeof($ids)) {
2993  ilUtil::sendFailure($this->lng->txt("select_one"), true);
2994  $this->ctrl->redirect($this, "contributors");
2995  }
2996 
2997  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
2998  $confirm = new ilConfirmationGUI();
2999  $confirm->setHeaderText($this->lng->txt('blog_confirm_delete_contributors'));
3000  $confirm->setFormAction($this->ctrl->getFormAction($this, 'removeContributor'));
3001  $confirm->setConfirm($this->lng->txt('delete'), 'removeContributor');
3002  $confirm->setCancel($this->lng->txt('cancel'), 'contributors');
3003 
3004  include_once 'Services/User/classes/class.ilUserUtil.php';
3005 
3006  foreach ($ids as $user_id) {
3007  $confirm->addItem(
3008  'id[]',
3009  $user_id,
3010  ilUserUtil::getNamePresentation($user_id, false, false, "", true)
3011  );
3012  }
3013 
3014  $this->tpl->setContent($confirm->getHTML());
3015  }
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ contributors()

ilObjBlogGUI::contributors ( )

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

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

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

2878  {
2879  $ilTabs = $this->tabs;
2880  $ilToolbar = $this->toolbar;
2881  $ilCtrl = $this->ctrl;
2882  $lng = $this->lng;
2883  $tpl = $this->tpl;
2884 
2885  if (!$this->checkPermissionBool("write")) {
2886  return;
2887  }
2888 
2889  $ilTabs->activateTab("contributors");
2890 
2891  $local_roles = $this->object->getAllLocalRoles($this->node_id);
2892 
2893  // add member
2894  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
2896  $this,
2897  $ilToolbar,
2898  array(
2899  'auto_complete_name' => $lng->txt('user'),
2900  'submit_name' => $lng->txt('add'),
2901  'add_search' => true,
2902  'add_from_container' => $this->node_id,
2903  'user_type' => $local_roles
2904  ),
2905  true
2906  );
2907 
2908  $other_roles = $this->object->getRolesWithContributeOrRedact($this->node_id);
2909  if ($other_roles) {
2910  ilUtil::sendInfo(sprintf($lng->txt("blog_contribute_other_roles"), implode(", ", $other_roles)));
2911  }
2912 
2913  include_once "Modules/Blog/classes/class.ilContributorTableGUI.php";
2914  $tbl = new ilContributorTableGUI($this, "contributors", $this->object->getAllLocalRoles($this->node_id));
2915 
2916  $tpl->setContent($tbl->getHTML());
2917  }
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 852 of file class.ilObjBlogGUI.php.

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

853  {
856 
857  $title = trim(ilUtil::stripSlashes($_POST["title"]));
858  if ($title) {
859  // create new posting
860  include_once("./Modules/Blog/classes/class.ilBlogPosting.php");
861  $posting = new ilBlogPosting();
862  $posting->setTitle($title);
863  $posting->setBlogId($this->object->getId());
864  $posting->setActive(false);
865  $posting->setAuthor($ilUser->getId());
866  $posting->create();
867 
868  // switch month list to current month (will include new posting)
869  $ilCtrl->setParameter($this, "bmn", date("Y-m"));
870 
871  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $posting->getId());
872  $ilCtrl->redirectByClass("ilblogpostinggui", "edit");
873  } else {
874  ilUtil::sendFailure($this->lng->txt("msg_no_title"), true);
875  $ilCtrl->redirect($this, "render");
876  }
877  }
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 3185 of file class.ilObjBlogGUI.php.

3186  {
3187  $this->ctrl->redirectByClass("ilobjstylesheetgui", "create");
3188  }

◆ deactivateAdmin()

ilObjBlogGUI::deactivateAdmin ( )

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

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

3075  {
3076  if ($this->checkPermissionBool("write") && (int) $_GET["apid"]) {
3077  // ilBlogPostingGUI::deactivatePage()
3078  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
3079  $post = new ilBlogPosting((int) $_GET["apid"]);
3080  $post->setApproved(false);
3081  $post->setActive(false);
3082  $post->update(true, false, false);
3083 
3084  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
3085  }
3086 
3087  $this->ctrl->redirect($this, "render");
3088  }
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"]
$post
Definition: post.php:34
+ Here is the call graph for this function:

◆ deleteStyle()

ilObjBlogGUI::deleteStyle ( )

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

3196  {
3197  $this->ctrl->redirectByClass("ilobjstylesheetgui", "delete");
3198  }

◆ disableNotes()

ilObjBlogGUI::disableNotes (   $a_value = false)

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

2601  {
2602  $this->disable_notes = (bool) $a_value;
2603  }

◆ editStyle()

ilObjBlogGUI::editStyle ( )

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

3191  {
3192  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
3193  }

◆ editStyleProperties()

ilObjBlogGUI::editStyleProperties ( )

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

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

3114  {
3115  $this->checkPermission("write");
3116 
3117  $this->tabs_gui->activateTab("settings");
3118  $this->setSettingsSubTabs("style");
3119 
3120  $form = $this->initStylePropertiesForm();
3121  $this->tpl->setContent($form->getHTML());
3122  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
if(isset($_POST['submit'])) $form
setSettingsSubTabs($a_active)
+ Here is the call graph for this function:

◆ executeCommand()

ilObjBlogGUI::executeCommand ( )

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

References $_GET, ilObjectGUI\$ctrl, $ilCtrl, $info, ilObjectGUI\$lng, $nav_history, $ret, $tabs, 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(), renderToolbarNavigation(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilUtil\sendSuccess(), setContentStyleSheet(), ilObject2GUI\setLocator(), ilFileInputGUI\setPersonalWorkspaceQuotaCheck(), setSettingsSubTabs(), setTabs(), and ilUtil\stripSlashes().

489  {
491  $tpl = $this->tpl;
492  $ilTabs = $this->tabs;
493  $lng = $this->lng;
494  $ilNavigationHistory = $this->nav_history;
495 
496  // goto link to blog posting
497  if ($_GET["gtp"]) {
498  $page_id = (int) $_GET["gtp"];
499  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
500  if (ilBlogPosting::exists($this->object_id, $page_id)) {
501  // #12312
502  $ilCtrl->setCmdClass("ilblogpostinggui");
503  $_GET["blpg"] = $page_id;
504  $ilCtrl->setCmd("previewFullscreen");
505  } else {
506  ilUtil::sendFailure($lng->txt("blog_posting_not_found"));
507  }
508  }
509 
510  $next_class = $ilCtrl->getNextClass($this);
511  $cmd = $ilCtrl->getCmd();
512 
513  if ($this->id_type == self::REPOSITORY_NODE_ID) {
514  // add entry to navigation history
515  if (!$this->getCreationMode() &&
516  $this->getAccessHandler()->checkAccess("read", "", $this->node_id)) {
517  // see #22067
518  $link = $ilCtrl->getLinkTargetByClass(["ilrepositorygui", "ilObjBlogGUI"], "preview");
519  $ilNavigationHistory->addItem($this->node_id, $link, "blog");
520  }
521  }
522 
523  switch ($next_class) {
524  case 'ilblogpostinggui':
525  if (!$this->prtf_embed) {
526  $tpl->getStandardTemplate();
527  }
528 
529  if (!$this->checkPermissionBool("read") && !$this->prtf_embed) {
530  ilUtil::sendInfo($lng->txt("no_permission"));
531  return;
532  }
533 
534  // #9680
535  if ($this->id_type == self::REPOSITORY_NODE_ID) {
536  $this->setLocator();
537  } else {
538  include_once "Services/Form/classes/class.ilFileInputGUI.php";
540  }
541  $ilTabs->setBackTarget(
542  $lng->txt("back"),
543  $ilCtrl->getLinkTarget($this, "")
544  );
545 
547  $this->object->getStyleSheetId(),
548  "blog"
549  );
550 
551  include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
552  $bpost_gui = new ilBlogPostingGUI(
553  $this->node_id,
554  $this->getAccessHandler(),
555  ilUtil::stripSlashes($_GET["blpg"]),
556  ilUtil::stripSlashes($_GET["old_nr"]),
557  ($this->object->getNotesStatus() && !$this->disable_notes),
558  $this->mayEditPosting(ilUtil::stripSlashes($_GET["blpg"])),
559  $style_sheet_id
560  );
561 
562  // keep preview mode through notes gui (has its own commands)
563  switch ($cmd) {
564  // blog preview
565  case "previewFullscreen":
566  $ilCtrl->setParameter($this, "prvm", "fsc");
567  break;
568 
569  // blog in portfolio
570  case "previewEmbedded":
571  $ilCtrl->setParameter($this, "prvm", "emb");
572  break;
573 
574  // edit
575  default:
576  $this->setContentStyleSheet();
577 
578 
579  if (!$this->prtf_embed) {
580  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $_GET["blpg"]);
581  $this->tabs_gui->addNonTabbedLink(
582  "preview",
583  $lng->txt("blog_preview"),
584  $this->ctrl->getLinkTargetByClass("ilblogpostinggui", "previewFullscreen")
585  );
586  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", "");
587  } else {
588  $this->ctrl->setParameterByClass("ilobjportfoliogui", "user_page", $_GET["ppage"]);
589  $this->tabs_gui->addNonTabbedLink(
590  "preview",
591  $lng->txt("blog_preview"),
592  $this->ctrl->getLinkTargetByClass("ilobjportfoliogui", "preview")
593  );
594  $this->ctrl->setParameterByClass("ilobjportfoliogui", "user_page", "");
595  }
596  break;
597  }
598 
599  // keep preview mode through notes gui
600  if ($_REQUEST["prvm"]) {
601  $cmd = "preview" . (($_REQUEST["prvm"] == "fsc") ? "Fullscreen" : "Embedded");
602  }
603  if (in_array($cmd, array("previewFullscreen", "previewEmbedded"))) {
604  $this->renderToolbarNavigation($this->items, true);
605  }
606  $ret = $ilCtrl->forwardCommand($bpost_gui);
607  if ($ret != "") {
608 
609  // $is_owner = $this->object->getOwner() == $ilUser->getId();
610  $is_owner = $this->mayContribute();
611  $is_active = $bpost_gui->getBlogPosting()->getActive();
612 
613  // do not show inactive postings
614  if (($cmd == "previewFullscreen" || $cmd == "previewEmbedded")
615  && !$is_owner && !$is_active) {
616  $this->ctrl->redirect($this, "preview");
617  }
618 
619  switch ($cmd) {
620  // blog preview
621  case "previewFullscreen":
622  $this->addHeaderActionForCommand($cmd);
623  $this->filterInactivePostings();
624  $nav = $this->renderNavigation($this->items, "preview", $cmd);
625  $this->renderFullScreen($ret, $nav);
626  break;
627 
628  // blog in portfolio
629  case "previewEmbedded":
630  $this->filterInactivePostings();
631  $nav = $this->renderNavigation($this->items, "gethtml", $cmd);
632  return $this->buildEmbedded($ret, $nav);
633 
634  // ilias/editor
635  default:
636  // infos about draft status / snippet
637  $info = array();
638  if (!$is_active) {
639  // single author blog (owner) in personal workspace
640  if ($this->id_type == self::WORKSPACE_NODE_ID) {
641  $info[] = $lng->txt("blog_draft_info");
642  } else {
643  $info[] = $lng->txt("blog_draft_info_contributors");
644  }
645  }
646  if ($cmd != "history" && $is_active && empty($info)) {
647  $info[] = $lng->txt("blog_new_posting_info");
648  $public_action = true;
649  }
650  if ($this->object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved()) {
651  // #9737
652  $info[] = $lng->txt("blog_posting_edit_approval_info");
653  }
654  if (sizeof($info) && !$tpl->hasMessage("info")) { // #15121
655  if ($public_action) {
656  ilUtil::sendSuccess(implode("<br />", $info));
657  } else {
658  ilUtil::sendInfo(implode("<br />", $info));
659  }
660  }
661  // revert to edit cmd to avoid confusion
662  $this->addHeaderActionForCommand("render");
663  $tpl->setContent($ret);
664  $nav = $this->renderNavigation($this->items, "render", $cmd, null, $is_owner);
665  $tpl->setRightContent($nav);
666  break;
667  }
668  }
669  break;
670 
671  case "ilinfoscreengui":
672  $this->prepareOutput();
673  $this->addHeaderActionForCommand("render");
674  $this->infoScreenForward();
675  break;
676 
677  case "ilnotegui":
678  $this->preview();
679  break;
680 
681  case "ilcommonactiondispatchergui":
682  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
684  $this->ctrl->forwardCommand($gui);
685  break;
686 
687  case "ilpermissiongui":
688  $this->prepareOutput();
689  $ilTabs->activateTab("id_permissions");
690  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
691  $perm_gui = new ilPermissionGUI($this);
692  $this->ctrl->forwardCommand($perm_gui);
693  break;
694 
695  case "ilobjectcopygui":
696  $this->prepareOutput();
697  include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
698  $cp = new ilObjectCopyGUI($this);
699  $cp->setType("blog");
700  $this->ctrl->forwardCommand($cp);
701  break;
702 
703  case 'ilrepositorysearchgui':
704  $this->prepareOutput();
705  $ilTabs->activateTab("contributors");
706  include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
707  $rep_search = new ilRepositorySearchGUI();
708  $rep_search->setTitle($this->lng->txt("blog_add_contributor"));
709  $rep_search->setCallback($this, 'addContributor', $this->object->getAllLocalRoles($this->node_id));
710  $this->ctrl->setReturn($this, 'contributors');
711  $ret =&$this->ctrl->forwardCommand($rep_search);
712  break;
713 
714  case 'ilexportgui':
715  $this->prepareOutput();
716  $ilTabs->activateTab("export");
717  include_once("./Services/Export/classes/class.ilExportGUI.php");
718  $exp_gui = new ilExportGUI($this);
719  $exp_gui->addFormat("xml");
720  $exp_gui->addFormat("html", null, $this, "buildExportFile"); // #13419
721  $ret = $ilCtrl->forwardCommand($exp_gui);
722  break;
723 
724  case "ilobjstylesheetgui":
725  include_once("./Services/Style/Content/classes/class.ilObjStyleSheetGUI.php");
726  $this->ctrl->setReturn($this, "editStyleProperties");
727  $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
728  $style_gui->omitLocator();
729  if ($cmd == "create" || $_GET["new_type"]=="sty") {
730  $style_gui->setCreationMode(true);
731  }
732 
733  if ($cmd == "confirmedDelete") {
734  $this->object->setStyleSheetId(0);
735  $this->object->update();
736  }
737 
738  $ret = $this->ctrl->forwardCommand($style_gui);
739 
740  if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
741  $style_id = $ret;
742  $this->object->setStyleSheetId($style_id);
743  $this->object->update();
744  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
745  }
746  break;
747 
748  case "ilblogexercisegui":
749  $this->ctrl->setReturn($this, "render");
750  include_once "Modules/Blog/classes/class.ilBlogExerciseGUI.php";
751  $gui = new ilBlogExerciseGUI($this->node_id);
752  $this->ctrl->forwardCommand($gui);
753  break;
754 
755  case 'ilobjnotificationsettingsgui':
756  $this->prepareOutput();
757  $ilTabs->activateTab("settings");
758  $this->setSettingsSubTabs("notifications");
759  include_once("./Services/Notification/classes/class.ilObjNotificationSettingsGUI.php");
760  $gui = new ilObjNotificationSettingsGUI($this->object->getRefId());
761  $this->ctrl->forwardCommand($gui);
762  break;
763 
764  default:
765  if ($cmd != "gethtml") {
766  // desktop item handling, must be toggled before header action
767  if ($cmd == "addToDesk" || $cmd == "removeFromDesk") {
768  $this->{$cmd . "Object"}();
769  if ($_GET["prvm"]) {
770  $cmd = "preview";
771  } else {
772  $cmd = "render";
773  }
774  $ilCtrl->setCmd($cmd);
775  }
776  $this->addHeaderActionForCommand($cmd);
777  }
778  if (!$this->prtf_embed) {
779  return parent::executeCommand();
780  } else {
781  $this->setTabs();
782 
783  if (!$cmd) {
784  $cmd = "render";
785  }
786  return $this->$cmd();
787  }
788  }
789 
790  return true;
791  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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.
Class ilBlogExerciseGUI.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Export User Interface Class.
buildEmbedded($a_content, $a_nav)
Combine content (list/posting) and navigation to html chunk.
static exists($a_blog_id, $a_posting_id)
Checks whether a posting exists.
renderFullScreen($a_content, $a_navigation)
Build fullscreen context.
static setPersonalWorkspaceQuotaCheck($a_value)
omitLocator($a_omit=true)
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
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.
setSettingsSubTabs($a_active)
Handles general notification settings, see e.g.
$ret
Definition: parser.php:6
prepareOutput($a_show_subobjects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$info
Definition: index.php:5
addHeaderActionForCommand($a_cmd)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
renderToolbarNavigation($a_items, $single_posting=false)
Toolbar navigation.
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 1083 of file class.ilObjBlogGUI.php.

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

1084  {
1085  $zip = $this->buildExportFile();
1086 
1087  ilUtil::deliverFile($zip, $this->object->getTitle() . ".zip", '', false, true);
1088  }
buildExportFile()
Build export file.
Create new PHPExcel object
obj_idprivate
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

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

References $_GET, $file, $keyword, $list, $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().

2349  {
2350  require_once('Services/MathJax/classes/class.ilMathJax.php');
2352 
2353  if (!$a_link_template) {
2354  $a_link_template = "bl{TYPE}_{ID}.html";
2355  }
2356 
2357  if ($a_co_page_html_export) {
2358  $this->co_page_html_export = $a_co_page_html_export;
2359  }
2360 
2361 
2362  // lists
2363 
2364  // global nav
2365  $nav = $this->renderNavigation($this->items, "", "", $a_link_template);
2366 
2367  // month list
2368  $has_index = false;
2369  foreach (array_keys($this->items) as $month) {
2370  $list = $this->renderList($this->items[$month], "render", $a_link_template, false, $a_target_directory);
2371 
2372  if (!$list) {
2373  continue;
2374  }
2375 
2376  if (!$a_tpl_callback) {
2377  $tpl = $this->buildExportTemplate();
2378  } else {
2379  $tpl = call_user_func($a_tpl_callback);
2380  }
2381 
2382  $file = $this->buildExportLink($a_link_template, "list", $month);
2383  $file = $this->writeExportFile(
2384  $a_target_directory,
2385  $file,
2386  $tpl,
2387  $list,
2388  $nav
2389  );
2390 
2391  if (!$has_index) {
2392  copy($file, $a_target_directory . "/" . $a_index_name);
2393  $has_index = true;
2394  }
2395  }
2396 
2397  // keywords
2398  foreach (array_keys($this->getKeywords(false)) as $keyword) {
2399  $this->keyword = $keyword;
2400  $list_items = $this->filterItemsByKeyword($this->items, $keyword);
2401  $list = $this->renderList($list_items, "render", $a_link_template, false, $a_target_directory);
2402 
2403  if (!$list) {
2404  continue;
2405  }
2406 
2407  if (!$a_tpl_callback) {
2408  $tpl = $this->buildExportTemplate();
2409  } else {
2410  $tpl = call_user_func($a_tpl_callback);
2411  }
2412 
2413  $file = $this->buildExportLink($a_link_template, "keyword", $keyword);
2414  $file = $this->writeExportFile(
2415  $a_target_directory,
2416  $file,
2417  $tpl,
2418  $list,
2419  $nav
2420  );
2421  }
2422 
2423 
2424  // single postings
2425 
2426  include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
2427  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2428  $pages = ilBlogPosting::getAllPostings($this->object->getId(), 0);
2429  foreach ($pages as $page) {
2430  if (ilBlogPosting::_exists("blp", $page["id"])) {
2431  include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
2432  $blp_gui = new ilBlogPostingGUI(0, null, $page["id"]);
2433  $blp_gui->setOutputMode("offline");
2434  $blp_gui->setFullscreenLink("fullscreen.html"); // #12930 - see page.xsl
2435  $blp_gui->add_date = true;
2436  $page_content = $blp_gui->showPage();
2437 
2438  $back = $this->buildExportLink(
2439  $a_link_template,
2440  "list",
2441  substr($page["created"]->get(IL_CAL_DATE), 0, 7)
2442  );
2443 
2444  $file = $this->buildExportLink($a_link_template, "posting", $page["id"]);
2445 
2446  if (!$a_tpl_callback) {
2447  $tpl = $this->buildExportTemplate();
2448  } else {
2449  $tpl = call_user_func($a_tpl_callback);
2450  }
2451 
2452  // posting nav
2453  $_GET["blpg"] = $page["id"];
2454  $nav = $this->renderNavigation($this->items, "", "", $a_link_template);
2455  $_GET["blpg"] = null;
2456 
2457  $this->writeExportFile(
2458  $a_target_directory,
2459  $file,
2460  $tpl,
2461  $page_content,
2462  $nav,
2463  $back
2464  );
2465 
2466  $this->co_page_html_export->collectPageElements("blp:pg", $page["id"]);
2467  }
2468  }
2469  $this->co_page_html_export->exportPageElements();
2470  }
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.
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
$_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 2742 of file class.ilObjBlogGUI.php.

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

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

2743  {
2744  foreach ($this->items as $month => $postings) {
2745  foreach ($postings as $id => $item) {
2746  if (!ilBlogPosting::_lookupActive($id, "blp")) {
2747  unset($this->items[$month][$id]);
2748  } elseif ($this->object->hasApproval() && !$item["approved"]) {
2749  unset($this->items[$month][$id]);
2750  }
2751  }
2752  if (!sizeof($this->items[$month])) {
2753  unset($this->items[$month]);
2754  }
2755  }
2756 
2757  if ($this->items && !isset($this->items[$this->month])) {
2758  $this->month = array_shift(array_keys($this->items));
2759  }
2760  }
if(!array_key_exists('StateId', $_REQUEST)) $id
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 2762 of file class.ilObjBlogGUI.php.

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

2763  {
2764  $res = array();
2765  include_once("./Modules/Blog/classes/class.ilBlogPosting.php");
2766  foreach ($a_items as $month => $items) {
2767  foreach ($items as $item) {
2768  if (in_array(
2769  $a_keyword,
2770  ilBlogPosting::getKeywords($this->obj_id, $item["id"])
2771  )) {
2772  $res[] = $item;
2773  }
2774  }
2775  }
2776  return $res;
2777  }
static getKeywords($a_obj_id, $a_posting_id)
foreach($_POST as $key=> $value) $res
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 347 of file class.ilObjBlogGUI.php.

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

348  {
349  if ($this->id_type == self::REPOSITORY_NODE_ID) {
350  $a_values["approval"] = $this->object->hasApproval();
351  $a_values["nav_authors"] = $this->object->hasAuthors();
352  }
353  $a_values["keywords"] = $this->object->hasKeywords();
354  $a_values["notes"] = $this->object->getNotesStatus();
355  $a_values["ppic"] = $this->object->hasProfilePicture();
356  /*
357  $a_values["bg_color"] = $this->object->getBackgroundColor();
358  $a_values["font_color"] = $this->object->getFontColor();
359  */
360  $a_values["banner"] = $this->object->getImage();
361  $a_values["rss"] = $this->object->hasRSS();
362  $a_values["abss"] = $this->object->hasAbstractShorten();
363  $a_values["absi"] = $this->object->hasAbstractImage();
364  $a_values["nav"] = $this->object->getNavMode();
365  $a_values["nav_list_mon_with_post"] = $this->object->getNavModeListMonthsWithPostings();
366  $a_values["nav_list_mon"] = $this->object->getNavModeListMonths();
367  $a_values["ov_list_post_num"] = $this->object->getOverviewPostings();
368 
369  // #13420
370  $a_values["abssl"] = $this->object->getAbstractShortenLength() ? $this->object->getAbstractShortenLength() : ilObjBlog::ABSTRACT_DEFAULT_SHORTEN_LENGTH;
371  $a_values["absiw"] = $this->object->getAbstractImageWidth() ? $this->object->getAbstractImageWidth() : ilObjBlog::ABSTRACT_DEFAULT_IMAGE_WIDTH;
372  $a_values["absih"] = $this->object->getAbstractImageHeight() ? $this->object->getAbstractImageHeight() : ilObjBlog::ABSTRACT_DEFAULT_IMAGE_HEIGHT;
373  }
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 962 of file class.ilObjBlogGUI.php.

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

963  {
964  // getHTML() is called by ilRepositoryGUI::show()
965  if ($this->id_type == self::REPOSITORY_NODE_ID) {
966  return;
967  }
968 
969  // there is no way to do a permissions check here, we have no wsp
970 
971  $this->filterInactivePostings();
972 
973  $list_items = $this->getListItems();
974 
975  $list = $nav = "";
976  if ($list_items) {
977  $list = $this->renderList($list_items, "previewEmbedded");
978  $nav = $this->renderNavigation($this->items, "gethtml", "previewEmbedded");
979  }
980  // quick editing in portfolio
981  elseif ($_REQUEST["prt_id"]) {
984  $lng = $this->lng;
985 
986  // see renderList()
987  if (ilObject::_lookupOwner(ilUtil::stripSlashes($_REQUEST["prt_id"])) == $ilUser->getId()) {
988  // see ilPortfolioPageTableGUI::fillRow()
989  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", (int) $_REQUEST["user_page"]);
990  $link = $ilCtrl->getLinkTargetByClass(array("ilportfoliopagegui", "ilobjbloggui"), "render");
991  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", "");
992 
993  include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
994  $btn = ilLinkButton::getInstance();
995  $btn->setCaption(sprintf($lng->txt("prtf_edit_embedded_blog"), $this->object->getTitle()), false);
996  $btn->setUrl($link);
997  $btn->setPrimary(true);
998 
999  $list = $btn->render();
1000  }
1001  }
1002 
1003  return $this->buildEmbedded($list, $nav);
1004  }
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.
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
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
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
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 2238 of file class.ilObjBlogGUI.php.

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

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

2239  {
2240  $keywords = array();
2241  include_once("./Modules/Blog/classes/class.ilBlogPosting.php");
2242  if ($a_posting_id) {
2243  foreach (ilBlogPosting::getKeywords($this->obj_id, $a_posting_id) as $keyword) {
2244  $keywords[$keyword]++;
2245  }
2246  } else {
2247  foreach ($this->items as $month => $items) {
2248  foreach ($items as $item) {
2249  if ($a_show_inactive || ilBlogPosting::_lookupActive($item["id"], "blp")) {
2250  foreach (ilBlogPosting::getKeywords($this->obj_id, $item["id"]) as $keyword) {
2251  $keywords[$keyword]++;
2252  }
2253  }
2254  }
2255  }
2256  }
2257 
2258  // #15881
2259  $tmp = array();
2260  foreach ($keywords as $keyword => $counter) {
2261  $tmp[] = array("keyword"=>$keyword, "counter"=>$counter);
2262  }
2263  $tmp = ilUtil::sortArray($tmp, "keyword", "ASC");
2264 
2265  $keywords = array();
2266  foreach ($tmp as $item) {
2267  $keywords[$item["keyword"]] = $item["counter"];
2268  }
2269  return $keywords;
2270  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static getKeywords($a_obj_id, $a_posting_id)
$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:

◆ getLatestMonth()

ilObjBlogGUI::getLatestMonth (   $a_items)

Get next month.

Parameters
array$a_itemsitem array
Returns
string

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

Referenced by renderToolbarNavigation().

2045  {
2046  reset($a_items);
2047  return key($a_items);
2048  }
+ Here is the caller graph for this function:

◆ getLatestPosting()

ilObjBlogGUI::getLatestPosting (   $a_items)

Get previous posting.

Parameters
array$a_itemsitem array
Returns
int page id

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

References $month.

Referenced by renderToolbarNavigation().

2105  {
2106  reset($a_items);
2107  $month = current($a_items);
2108  if (is_array($month)) {
2109  return current($month)["id"];
2110  }
2111  return false;
2112  }
+ 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 1012 of file class.ilObjBlogGUI.php.

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

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

1013  {
1014  if ($this->author) {
1015  $list_items = array();
1016  foreach ($this->items as $month => $items) {
1017  foreach ($items as $id => $item) {
1018  if ($item["author"] == $this->author ||
1019  (is_array($item["editors"]) && in_array($this->author, $item["editors"]))) {
1020  $list_items[$id] = $item;
1021  }
1022  }
1023  }
1024  } elseif ($this->keyword) {
1025  $list_items = $this->filterItemsByKeyword($this->items, $this->keyword);
1026  } else {
1027  $max = $this->object->getOverviewPostings();
1028  if ($this->month_default && $max) {
1029  $list_items = array();
1030  foreach ($this->items as $month => $postings) {
1031  foreach ($postings as $id => $item) {
1032  if (!$a_show_inactive &&
1033  !ilBlogPosting::_lookupActive($id, "blp")) {
1034  continue;
1035  }
1036  $list_items[$id] = $item;
1037 
1038  if (sizeof($list_items) >= $max) {
1039  break(2);
1040  }
1041  }
1042  }
1043  } else {
1044  $list_items = $this->items[$this->month];
1045  }
1046  }
1047  return $list_items;
1048  }
if(!array_key_exists('StateId', $_REQUEST)) $id
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:

◆ getNextMonth()

ilObjBlogGUI::getNextMonth (   $a_items)

Get next month.

Parameters
array$a_itemsitem array
Returns
string

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

References $items, and $month.

Referenced by renderToolbarNavigation().

2009  {
2010  reset($a_items);
2011  $found = "";
2012  foreach ($a_items as $month => $items) {
2013  if ($month > $this->month) {
2014  $found = $month;
2015  }
2016  }
2017  return $found;
2018  }
+ Here is the caller graph for this function:

◆ getNextPosting()

ilObjBlogGUI::getNextPosting (   $a_items)

Get next posting.

Parameters
array$a_itemsitem array
Returns
int page id

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

References $_GET, $items, and $month.

Referenced by renderToolbarNavigation().

2057  {
2058  reset($a_items);
2059  $found = "";
2060  $next_blpg = 0;
2061  foreach ($a_items as $month => $items) {
2062  foreach ($items as $item) {
2063  if ($item["id"] == $_GET["blpg"]) {
2064  $found = true;
2065  }
2066  if (!$found) {
2067  $next_blpg = $item["id"];
2068  }
2069  }
2070  }
2071  return $next_blpg;
2072  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getNotesSubId()

ilObjBlogGUI::getNotesSubId ( )

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

2593  {
2594  if ($_REQUEST["blpg"]) {
2595  return $_REQUEST["blpg"];
2596  }
2597  return 0;
2598  }

◆ getPreviousMonth()

ilObjBlogGUI::getPreviousMonth (   $a_items)

Get next month.

Parameters
array$a_itemsitem array
Returns
string

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

References $items, and $month.

Referenced by renderToolbarNavigation().

2027  {
2028  reset($a_items);
2029  $found = "";
2030  foreach ($a_items as $month => $items) {
2031  if ($month < $this->month && $found == "") {
2032  $found = $month;
2033  }
2034  }
2035  return $found;
2036  }
+ Here is the caller graph for this function:

◆ getPreviousPosting()

ilObjBlogGUI::getPreviousPosting (   $a_items)

Get previous posting.

Parameters
array$a_itemsitem array
Returns
int page id

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

References $_GET, $items, and $month.

Referenced by renderToolbarNavigation().

2081  {
2082  reset($a_items);
2083  $found = "";
2084  $prev_blpg = 0;
2085  foreach ($a_items as $month => $items) {
2086  foreach ($items as $item) {
2087  if ($found && $prev_blpg == "") {
2088  $prev_blpg = $item["id"];
2089  }
2090  if ($item["id"] == $_GET["blpg"]) {
2091  $found = true;
2092  }
2093  }
2094  }
2095  return $prev_blpg;
2096  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getType()

ilObjBlogGUI::getType ( )

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

Referenced by renderList().

113  {
114  return "blog";
115  }
+ 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 798 of file class.ilObjBlogGUI.php.

References infoScreenForward().

799  {
800  $this->ctrl->setCmd("showSummary");
801  $this->ctrl->setCmdClass("ilinfoscreengui");
802  $this->infoScreenForward();
803  }
infoScreenForward()
show information screen
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjBlogGUI::infoScreenForward ( )

show information screen

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

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

Referenced by executeCommand(), and infoScreen().

809  {
810  $ilTabs = $this->tabs;
811 
812  $ilTabs->activateTab("id_info");
813 
814  $this->checkPermission("visible");
815 
816  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
817  $info = new ilInfoScreenGUI($this);
818 
819  if ($this->id_type != self::WORKSPACE_NODE_ID) {
820  $info->enablePrivateNotes();
821  }
822 
823  if ($this->checkPermissionBool("read")) {
824  $info->enableNews();
825  }
826 
827  // no news editing for files, just notifications
828  $info->enableNewsEditing(false);
829  if ($this->checkPermissionBool("write")) {
830  $news_set = new ilSetting("news");
831  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
832 
833  if ($enable_internal_rss) {
834  $info->setBlockProperty("news", "settings", true);
835  $info->setBlockProperty("news", "public_notifications_option", true);
836  }
837  }
838 
839  // standard meta data
840  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
841 
842  if ($this->id_type == self::WORKSPACE_NODE_ID) {
843  $info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget());
844  }
845 
846  $this->ctrl->forwardCommand($info);
847  }
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)
Create new PHPExcel object
obj_idprivate
$info
Definition: index.php:5
+ 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 117 of file class.ilObjBlogGUI.php.

118  {
119  $forms = parent::initCreationForms($a_new_type);
120 
121  if ($this->id_type == self::WORKSPACE_NODE_ID) {
122  unset($forms[self::CFORM_IMPORT]);
123  unset($forms[self::CFORM_CLONE]);
124  }
125 
126  return $forms;
127  }

◆ initEditCustomForm()

ilObjBlogGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

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

References $auth, $file, $ilSetting, $img, $list, ilObjectGUI\$lng, ilObjectGUI\$settings, 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().

177  {
178  $lng = $this->lng;
180 
181  $this->setSettingsSubTabs("properties");
182 
183  if ($this->id_type == self::REPOSITORY_NODE_ID) {
184  $appr = new ilCheckboxInputGUI($lng->txt("blog_enable_approval"), "approval");
185  $appr->setInfo($lng->txt("blog_enable_approval_info"));
186  $a_form->addItem($appr);
187  }
188 
189  $notes = new ilCheckboxInputGUI($lng->txt("blog_enable_notes"), "notes");
190  $a_form->addItem($notes);
191 
192  if ($ilSetting->get('enable_global_profiles')) {
193  $rss = new ilCheckboxInputGUI($lng->txt("blog_enable_rss"), "rss");
194  $rss->setInfo($lng->txt("blog_enable_rss_info"));
195  $a_form->addItem($rss);
196  }
197 
198 
199  // navigation
200 
201  $nav = new ilFormSectionHeaderGUI();
202  $nav->setTitle($lng->txt("blog_settings_navigation"));
203  $a_form->addItem($nav);
204 
205  $nav_mode = new ilRadioGroupInputGUI($lng->txt("blog_nav_mode"), "nav");
206  $nav_mode->setRequired(true);
207  $a_form->addItem($nav_mode);
208 
209  $opt = new ilRadioOption($lng->txt("blog_nav_mode_month_list"), ilObjBlog::NAV_MODE_LIST);
210  $opt->setInfo($lng->txt("blog_nav_mode_month_list_info"));
211  $nav_mode->addOption($opt);
212 
213  $detail_num = new ilNumberInputGUI($lng->txt("blog_nav_mode_month_list_num_month_with_post"), "nav_list_mon_with_post");
214  $detail_num->setInfo($lng->txt("blog_nav_mode_month_list_num_month_with_post_info"));
215  //$detail_num->setRequired(true);
216  $detail_num->setSize(3);
217  //$detail_num->setMinValue(0);
218  $opt->addSubItem($detail_num);
219 
220  $mon_num = new ilNumberInputGUI($lng->txt("blog_nav_mode_month_list_num_month"), "nav_list_mon");
221  $mon_num->setInfo($lng->txt("blog_nav_mode_month_list_num_month_info"));
222  $mon_num->setSize(3);
223  $mon_num->setMinValue(1);
224  $opt->addSubItem($mon_num);
225 
226  $opt = new ilRadioOption($lng->txt("blog_nav_mode_month_single"), ilObjBlog::NAV_MODE_MONTH);
227  $opt->setInfo($lng->txt("blog_nav_mode_month_single_info"));
228  $nav_mode->addOption($opt);
229 
230  $order_options = array();
231  if ($this->object->getOrder()) {
232  foreach ($this->object->getOrder() as $item) {
233  $order_options[] = $lng->txt("blog_" . $item);
234  }
235  }
236 
237  if (!in_array($lng->txt("blog_navigation"), $order_options)) {
238  $order_options[] = $lng->txt("blog_navigation");
239  }
240 
241  if ($this->id_type == self::REPOSITORY_NODE_ID) {
242  if (!in_array($lng->txt("blog_authors"), $order_options)) {
243  $order_options[] = $lng->txt("blog_authors");
244  }
245 
246  $auth = new ilCheckboxInputGUI($lng->txt("blog_enable_nav_authors"), "nav_authors");
247  $auth->setInfo($lng->txt("blog_enable_nav_authors_info"));
248  $a_form->addItem($auth);
249  }
250 
251  $keyw = new ilCheckboxInputGUI($lng->txt("blog_enable_keywords"), "keywords");
252  $keyw->setInfo($lng->txt("blog_enable_keywords_info"));
253  $a_form->addItem($keyw);
254 
255  if (!in_array($lng->txt("blog_keywords"), $order_options)) {
256  $order_options[] = $lng->txt("blog_keywords");
257  }
258 
259  $order = new ilNonEditableValueGUI($lng->txt("blog_nav_sortorder"), "order");
260  $order->setMultiValues($order_options);
261  $order->setValue(array_shift($order_options));
262  $order->setMulti(true, true, false);
263  $a_form->addItem($order);
264 
265 
266  // presentation (frame)
267 
268  $pres = new ilFormSectionHeaderGUI();
269  $pres->setTitle($lng->txt("blog_presentation_frame"));
270  $a_form->addItem($pres);
271 
272  $ppic = new ilCheckboxInputGUI($lng->txt("blog_profile_picture"), "ppic");
273  $a_form->addItem($ppic);
274 
275  if ($this->id_type == self::REPOSITORY_NODE_ID) {
276  $ppic->setInfo($lng->txt("blog_profile_picture_repository_info"));
277  }
278 
279  $blga_set = new ilSetting("blga");
280  if ($blga_set->get("banner")) {
281  include_once "Services/Form/classes/class.ilFileInputGUI.php";
283 
284  $dimensions = " (" . $blga_set->get("banner_width") . "x" .
285  $blga_set->get("banner_height") . ")";
286 
287  $img = new ilImageFileInputGUI($lng->txt("blog_banner") . $dimensions, "banner");
288  $a_form->addItem($img);
289 
290  // show existing file
291  $file = $this->object->getImageFullPath(true);
292  if ($file) {
293  $img->setImage($file);
294  }
295  }
296 
297  /* #15000
298  $bg_color = new ilColorPickerInputGUI($lng->txt("blog_background_color"), "bg_color");
299  $a_form->addItem($bg_color);
300 
301  $font_color = new ilColorPickerInputGUI($lng->txt("blog_font_color"), "font_color");
302  $a_form->addItem($font_color);
303  */
304 
305  // presentation (overview)
306 
308  $list->setTitle($lng->txt("blog_presentation_overview"));
309  $a_form->addItem($list);
310 
311  $post_num = new ilNumberInputGUI($lng->txt("blog_list_num_postings"), "ov_list_post_num");
312  $post_num->setInfo($lng->txt("blog_list_num_postings_info"));
313  $post_num->setSize(3);
314  $post_num->setMinValue(1);
315  $post_num->setRequired(true);
316  $a_form->addItem($post_num);
317 
318  $abs_shorten = new ilCheckboxInputGUI($lng->txt("blog_abstract_shorten"), "abss");
319  $a_form->addItem($abs_shorten);
320 
321  $abs_shorten_len = new ilNumberInputGUI($lng->txt("blog_abstract_shorten_length"), "abssl");
322  $abs_shorten_len->setSize(5);
323  $abs_shorten_len->setRequired(true);
324  $abs_shorten_len->setSuffix($lng->txt("blog_abstract_shorten_characters"));
325  $abs_shorten_len->setMinValue(50, true);
326  $abs_shorten->addSubItem($abs_shorten_len);
327 
328  $abs_img = new ilCheckboxInputGUI($lng->txt("blog_abstract_image"), "absi");
329  $abs_img->setInfo($lng->txt("blog_abstract_image_info"));
330  $a_form->addItem($abs_img);
331 
332  $abs_img_width = new ilNumberInputGUI($lng->txt("blog_abstract_image_width"), "absiw");
333  $abs_img_width->setSize(5);
334  $abs_img_width->setRequired(true);
335  $abs_img_width->setSuffix($lng->txt("blog_abstract_image_pixels"));
336  $abs_img_width->setMinValue(32, true);
337  $abs_img->addSubItem($abs_img_width);
338 
339  $abs_img_height = new ilNumberInputGUI($lng->txt("blog_abstract_image_height"), "absih");
340  $abs_img_height->setSize(5);
341  $abs_img_height->setRequired(true);
342  $abs_img_height->setSuffix($lng->txt("blog_abstract_image_pixels"));
343  $abs_img_height->setMinValue(32, true);
344  $abs_img->addSubItem($abs_img_height);
345  }
This class represents an option in a radio group.
$auth
Definition: metadata.php:48
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
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 2627 of file class.ilObjBlogGUI.php.

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

Referenced by addHeaderActionForCommand().

2628  {
2629  $ilUser = $this->user;
2630  $ilCtrl = $this->ctrl;
2631 
2632  if (!$this->obj_id) {
2633  return false;
2634  }
2635 
2636  $sub_type = $sub_id = null;
2637  if ($_GET["blpg"]) {
2638  $sub_type = "blp";
2639  $sub_id = (int) $_GET["blpg"];
2640  }
2641 
2642  $lg = parent::initHeaderAction($sub_type, $sub_id);
2643 
2644  if ($a_is_preview) {
2645  $lg->enableComments(false);
2646  $lg->enableNotes(false);
2647  $lg->enableTags(false);
2648 
2649  include_once "./Services/Notification/classes/class.ilNotification.php";
2651  $ilCtrl->setParameter($this, "ntf", 1);
2652  $link = $ilCtrl->getLinkTarget($this, "setNotification");
2653  $ilCtrl->setParameter($this, "ntf", "");
2654  if (ilNotification::hasOptOut($this->obj_id)) {
2655  $lg->addCustomCommand($link, "blog_notification_toggle_off");
2656  }
2657 
2658  $lg->addHeaderIcon(
2659  "not_icon",
2660  ilUtil::getImagePath("notification_on.svg"),
2661  $this->lng->txt("blog_notification_activated")
2662  );
2663  } else {
2664  $ilCtrl->setParameter($this, "ntf", 2);
2665  $link = $ilCtrl->getLinkTarget($this, "setNotification");
2666  $ilCtrl->setParameter($this, "ntf", "");
2667  $lg->addCustomCommand($link, "blog_notification_toggle_on");
2668 
2669  $lg->addHeaderIcon(
2670  "not_icon",
2671  ilUtil::getImagePath("notification_off.svg"),
2672  $this->lng->txt("blog_notification_deactivated")
2673  );
2674  }
2675 
2676  // #11758
2677  if ($this->mayContribute()) {
2678  $ilCtrl->setParameter($this, "prvm", "");
2679 
2680  $ilCtrl->setParameter($this, "bmn", "");
2681  $ilCtrl->setParameter($this, "blpg", "");
2682  $link = $ilCtrl->getLinkTarget($this, "");
2683  $ilCtrl->setParameter($this, "blpg", $sub_id);
2684  $ilCtrl->setParameter($this, "bmn", $this->month);
2685  $lg->addCustomCommand($link, "blog_edit"); // #11868
2686 
2687  if ($sub_id && $this->mayEditPosting($sub_id)) {
2688  $link = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit");
2689  $lg->addCustomCommand($link, "blog_edit_posting");
2690  }
2691 
2692  $ilCtrl->setParameter($this, "prvm", "fsc");
2693  }
2694 
2695  $ilCtrl->setParameter($this, "ntf", "");
2696  }
2697 
2698  return $lg;
2699  }
$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"]
static hasOptOut($obj_id)
Is opt out (disable notification) allowed?
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
mayEditPosting($a_posting_id, $a_author_id=null)
Check if user may edit posting.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initStylePropertiesForm()

ilObjBlogGUI::initStylePropertiesForm ( )

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

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

Referenced by editStyleProperties().

3125  {
3127 
3128  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3129  $this->lng->loadLanguageModule("style");
3130 
3131  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
3132  $form = new ilPropertyFormGUI();
3133 
3134  $fixed_style = $ilSetting->get("fixed_content_style_id");
3135  $style_id = $this->object->getStyleSheetId();
3136 
3137  if ($fixed_style > 0) {
3138  $st = new ilNonEditableValueGUI($this->lng->txt("style_current_style"));
3139  $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" .
3140  $this->lng->txt("global_fixed") . ")");
3141  $form->addItem($st);
3142  } else {
3144  true,
3145  false,
3146  (int) $_GET["ref_id"]
3147  );
3148 
3149  $st_styles[0] = $this->lng->txt("default");
3150  ksort($st_styles);
3151 
3152  if ($style_id > 0) {
3153  // individual style
3154  if (!ilObjStyleSheet::_lookupStandard($style_id)) {
3155  $st = new ilNonEditableValueGUI($this->lng->txt("style_current_style"));
3156  $st->setValue(ilObject::_lookupTitle($style_id));
3157  $form->addItem($st);
3158 
3159  // delete command
3160  $form->addCommandButton("editStyle", $this->lng->txt("style_edit_style"));
3161  $form->addCommandButton("deleteStyle", $this->lng->txt("style_delete_style"));
3162  }
3163  }
3164 
3165  if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id)) {
3166  $style_sel = new ilSelectInputGUI(
3167  $this->lng->txt("style_current_style"),
3168  "style_id"
3169  );
3170  $style_sel->setOptions($st_styles);
3171  $style_sel->setValue($style_id);
3172  $form->addItem($style_sel);
3173 
3174  $form->addCommandButton("saveStyleSettings", $this->lng->txt("save"));
3175  $form->addCommandButton("createStyle", $this->lng->txt("sty_create_ind_style"));
3176  }
3177  }
3178 
3179  $form->setTitle($this->lng->txt("blog_style"));
3180  $form->setFormAction($this->ctrl->getFormAction($this));
3181 
3182  return $form;
3183  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
static _getStandardStyles( $a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
static _lookupStandard($a_id)
Lookup standard flag.
if(isset($_POST['submit'])) $form
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 2784 of file class.ilObjBlogGUI.php.

References ilObject2GUI\checkPermissionBool().

Referenced by approve(), and renderList().

2785  {
2786  return ($this->checkPermissionBool("redact") ||
2787  $this->checkPermissionBool("write"));
2788  }
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 2727 of file class.ilObjBlogGUI.php.

References $post.

2728  {
2729  // page might be deleted, so setting halt on errors to false
2730  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
2731  $post = new ilBlogPosting($a_posting_id);
2732  if ($post->getBlogId() == $a_blog_id) {
2733  return $post->getTitle();
2734  }
2735  }
Class ilBlogPosting.
$post
Definition: post.php:34

◆ mayContribute()

ilObjBlogGUI::mayContribute ( )
protected

Check if user may contribute at all.

Returns
boolean

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

References ilObject2GUI\checkPermissionBool().

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

2838  {
2839  // single author blog (owner) in personal workspace
2840  if ($this->id_type == self::WORKSPACE_NODE_ID) {
2841  return $this->checkPermissionBool("write");
2842  }
2843 
2844  return ($this->checkPermissionBool("redact") ||
2845  $this->checkPermissionBool("contribute"));
2846  }
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 2797 of file class.ilObjBlogGUI.php.

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

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

2798  {
2799  $ilUser = $this->user;
2800 
2801  // single author blog (owner) in personal workspace
2802  if ($this->id_type == self::WORKSPACE_NODE_ID) {
2803  return $this->checkPermissionBool("write");
2804  }
2805 
2806  // repository blogs
2807 
2808  // redact allows to edit all postings
2809  if ($this->checkPermissionBool("redact")) {
2810  return true;
2811  }
2812 
2813  // contribute gives access to own postings
2814  if ($this->checkPermissionBool("contribute")) {
2815  // check owner of posting
2816  if (!$a_author_id) {
2817  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
2818  $post = new ilBlogPosting($a_posting_id);
2819  $a_author_id = $post->getAuthor();
2820  }
2821  if ($ilUser->getId() == $a_author_id) {
2822  return true;
2823  } else {
2824  return false;
2825  }
2826 
2827  return true;
2828  }
2829  return false;
2830  }
Class ilBlogPosting.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
$post
Definition: post.php:34
$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 1053 of file class.ilObjBlogGUI.php.

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

Referenced by executeCommand().

1054  {
1055  global $DIC;
1056 
1057  $lng = $DIC->language();
1058  $toolbar = $DIC->toolbar();
1059 
1060  if (!$this->checkPermissionBool("read")) {
1061  ilUtil::sendInfo($lng->txt("no_permission"));
1062  return;
1063  }
1064 
1065  $this->filterInactivePostings();
1066 
1067  $list_items = $this->getListItems();
1068 
1069  $list = $nav = "";
1070  if ($list_items) {
1071  $list = $this->renderList($list_items, "previewFullscreen");
1072  $nav = $this->renderNavigation($this->items, "preview", "previewFullscreen");
1073  $this->renderToolbarNavigation($this->items);
1074  $list.= $toolbar->getHTML();
1075  }
1076 
1077  $this->renderFullScreen($list, $nav);
1078  }
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.
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
global $DIC
Definition: saml.php:7
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.
renderToolbarNavigation($a_items, $single_posting=false)
Toolbar navigation.
+ 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 3020 of file class.ilObjBlogGUI.php.

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

3021  {
3022  $ilCtrl = $this->ctrl;
3023  $lng = $this->lng;
3025 
3026  $ids = ilUtil::stripSlashesRecursive($_POST["id"]);
3027 
3028  if (!sizeof($ids)) {
3029  ilUtil::sendFailure($lng->txt("select_one"), true);
3030  $ilCtrl->redirect($this, "contributors");
3031  }
3032 
3033  // get contributor role
3034  $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
3035  if (!$local_roles) {
3036  ilUtil::sendFailure($lng->txt("missing_perm"));
3037  return $this->contributors();
3038  }
3039 
3040  foreach ($ids as $user_id) {
3041  foreach ($local_roles as $role_id) {
3042  $rbacadmin->deassignUser($role_id, $user_id);
3043  }
3044  }
3045 
3046  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
3047  $this->ctrl->redirect($this, "contributors");
3048  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
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 3065 of file class.ilObjBlogGUI.php.

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

3066  {
3067  $lng = $this->lng;
3068 
3069  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
3071  ilUtil::sendSuccess($lng->txt("removed_from_desktop"));
3072  }
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 885 of file class.ilObjBlogGUI.php.

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

886  {
887  $tpl = $this->tpl;
888  $ilTabs = $this->tabs;
890  $lng = $this->lng;
891  $ilToolbar = $this->toolbar;
893  $tree = $this->tree;
894 
895  if (!$this->checkPermissionBool("read")) {
896  ilUtil::sendInfo($lng->txt("no_permission"));
897  return;
898  }
899 
900  $ilTabs->activateTab("content");
901 
902  // toolbar
903  if ($this->mayContribute()) {
904  $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "createPosting"));
905 
906  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
907  $title = new ilTextInputGUI($lng->txt("title"), "title");
908  $ilToolbar->addStickyItem($title, $lng->txt("title"));
909 
910  include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
911  $button = ilSubmitButton::getInstance();
912  $button->setCaption("blog_add_posting");
913  $button->setCommand("createPosting");
914  $ilToolbar->addStickyItem($button);
915 
916  // #18763
917  $first = array_shift((array_keys($this->items)));
918  if ($first != $this->month) {
919  $ilToolbar->addSeparator();
920 
921  $ilCtrl->setParameter($this, "bmn", $first);
922  $url = $ilCtrl->getLinkTarget($this, "");
923  $ilCtrl->setParameter($this, "bmn", $this->month);
924 
925  include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
926  $button = ilLinkButton::getInstance();
927  $button->setCaption("blog_show_latest");
928  $button->setUrl($url);
929  $ilToolbar->addButtonInstance($button);
930  }
931 
932  // exercise blog?
933  include_once "Modules/Blog/classes/class.ilBlogExerciseGUI.php";
934  $exercises = ilBlogExerciseGUI::checkExercise($this->node_id);
935  if ($exercises) {
936  ilUtil::sendInfo($exercises);
937  }
938  }
939 
940  // $is_owner = ($this->object->getOwner() == $ilUser->getId());
941  $is_owner = $this->mayContribute();
942 
943  $list_items = $this->getListItems($is_owner);
944 
945  $list = $nav = "";
946  if ($list_items) {
947  $list = $this->renderList($list_items, "preview", null, $is_owner);
948  $nav = $this->renderNavigation($this->items, "render", "preview", null, $is_owner);
949  }
950 
951  $this->setContentStyleSheet();
952 
953  $tpl->setContent($list);
954  $tpl->setRightContent($nav);
955  }
renderNavigation(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build navigation blocks.
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
mayContribute()
Check if user may contribute at all.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getListItems($a_show_inactive=false)
Filter blog postings by month, keyword or author.
renderList(array $items, $a_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_export_directory=null)
Build posting month list.
This class represents a text property in a property form.
$ilUser
Definition: imgupload.php:18
setContentStyleSheet($a_tpl=null)
$url
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 1114 of file class.ilObjBlogGUI.php.

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

Referenced by executeCommand(), and preview().

1115  {
1116  $tpl = $this->tpl;
1117  $ilUser = $this->user;
1118  $ilTabs = $this->tabs;
1119  $ilLocator = $this->locator;
1120 
1121  $owner = $this->object->getOwner();
1122 
1123  $ilTabs->clearTargets();
1124  $ilLocator->clearItems();
1125  $tpl->setLocator();
1126 
1127  $back_caption = "";
1128 
1129  // back (edit)
1130  if ($owner == $ilUser->getId()) {
1131  // from shared/deeplink
1132  if ($this->id_type == self::WORKSPACE_NODE_ID) {
1133  $back = "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&wsp_id=" . $this->node_id;
1134  }
1135  // from editor (#10073)
1136  elseif ($this->mayContribute()) {
1137  $prvm = ilUtil::stripSlashes($_GET["prvm"]);
1138  $this->ctrl->setParameter($this, "prvm", "");
1139  if (!$_GET["blpg"]) {
1140  $back = $this->ctrl->getLinkTarget($this, "");
1141  } else {
1142  $this->ctrl->setParameterByClass("ilblogpostinggui", "bmn", $this->month);
1143  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $_GET["blpg"]);
1144  $back = $this->ctrl->getLinkTargetByClass("ilblogpostinggui", "preview");
1145  }
1146  $this->ctrl->setParameter($this, "prvm", $prvm);
1147  }
1148 
1149  $back_caption = $this->lng->txt("blog_back_to_blog_owner");
1150  }
1151  // back
1152  elseif ($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID) {
1153  // workspace (always shared)
1154  if ($this->id_type == self::WORKSPACE_NODE_ID) {
1155  $back = "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=" . $owner;
1156  }
1157  // contributor
1158  elseif ($this->mayContribute()) {
1159  $back = $this->ctrl->getLinkTarget($this, "");
1160  $back_caption = $this->lng->txt("blog_back_to_blog_owner");
1161  }
1162  // listgui / parent container
1163  else {
1164  $tree = $this->tree;
1165  $parent_id = $tree->getParentId($this->node_id);
1166  include_once "Services/Link/classes/class.ilLink.php";
1168  }
1169  }
1170 
1171  $ilMainMenu = $this->main_menu;
1172  $ilMainMenu->setMode(ilMainMenuGUI::MODE_TOPBAR_ONLY);
1173  $ilMainMenu->setTopBarBack($back, $back_caption);
1174 
1175  $this->renderFullscreenHeader($tpl, $owner);
1176 
1177  // #13564
1178  $this->ctrl->setParameter($this, "bmn", "");
1179  $tpl->setTitleUrl($this->ctrl->getLinkTarget($this, "preview"));
1180  $this->ctrl->setParameter($this, "bmn", $this->month);
1181 
1182  $this->setContentStyleSheet();
1183 
1184  // content
1185  $tpl->setContent($a_content);
1186  $tpl->setRightContent($a_navigation);
1187  }
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:93
$ilUser
Definition: imgupload.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
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 1196 of file class.ilObjBlogGUI.php.

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

Referenced by buildExportTemplate(), and renderFullScreen().

1197  {
1198  $ilUser = $this->user;
1199 
1200  if (!$a_export) {
1201  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
1203  $this->object->getType(),
1205  $this->object->getId(),
1206  $ilUser->getId()
1207  );
1208  }
1209 
1210  // repository blogs are multi-author
1211  $name = null;
1212  if ($this->id_type != self::REPOSITORY_NODE_ID) {
1213  $name = ilObjUser::_lookupName($a_user_id);
1214  $name = $name["lastname"] . ", " . ($t = $name["title"] ? $t . " " : "") . $name["firstname"];
1215  }
1216 
1217  // show banner?
1218  $banner = false;
1219  $blga_set = new ilSetting("blga");
1220  if ($blga_set->get("banner")) {
1221  require_once('./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
1222  $banner = ilWACSignedPath::signFile($this->object->getImageFullPath());
1223  $banner_width = $blga_set->get("banner_width");
1224  $banner_height = $blga_set->get("banner_height");
1225  if ($a_export) {
1226  $banner = basename($banner);
1227  }
1228  }
1229 
1230  $ppic = null;
1231  if ($this->object->hasProfilePicture()) {
1232  // repository (multi-user)
1233  if ($this->id_type == self::REPOSITORY_NODE_ID) {
1234  // #15030
1235  if ($_GET["blpg"] && !$a_export) {
1236  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
1237  $post = new ilBlogPosting((int) $_GET["blpg"]);
1238  $author_id = $post->getAuthor();
1239  if ($author_id) {
1240  $ppic = ilObjUser::_getPersonalPicturePath($author_id, "xsmall", true, true);
1241 
1242  $name = ilObjUser::_lookupName($author_id);
1243  $name = $name["lastname"] . ", " . ($t = $name["title"] ? $t . " " : "") . $name["firstname"];
1244  }
1245  }
1246  }
1247  // workspace (author == owner)
1248  else {
1249  $ppic = ilObjUser::_getPersonalPicturePath($a_user_id, "xsmall", true, true);
1250  if ($a_export) {
1251  $ppic = basename($ppic);
1252  }
1253  }
1254  }
1255 
1256  $a_tpl->resetHeaderBlock(false);
1257  // $a_tpl->setBackgroundColor($this->object->getBackgroundColor());
1258  $a_tpl->setBanner($banner, $banner_width, $banner_height, $a_export);
1259  $a_tpl->setTitleIcon($ppic);
1260  $a_tpl->setTitle($this->object->getTitle());
1261  // $a_tpl->setTitleColor($this->object->getFontColor());
1262  $a_tpl->setDescription($name);
1263 
1264  // to get rid of locator in repository preview
1265  $a_tpl->setVariable("LOCATOR", "");
1266 
1267  // :TODO: obsolete?
1268  // $a_tpl->setBodyClass("std ilExternal ilBlog");
1269  }
static _lookupName($a_user_id)
lookup user name
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
Class ilBlogPosting.
$_GET["client_id"]
if($format !==null) $name
Definition: metadata.php:146
$post
Definition: post.php:34
$ilUser
Definition: imgupload.php:18
static signFile($path_to_file)
Create new PHPExcel object
obj_idprivate
+ 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 1310 of file class.ilObjBlogGUI.php.

References $author, ilObjectGUI\$ctrl, $ilCtrl, $ilUser, $keyword, $list, ilObjectGUI\$lng, $month, $preview, $title, ilObjectGUI\$user, 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(), object, and ilUtil\stripSlashes().

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

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

References $_GET, ilObjectGUI\$ctrl, $ilCtrl, $ilSetting, ilObject2GUI\$node_id, ilObjectGUI\$settings, $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().

2125  {
2126  $ilCtrl = $this->ctrl;
2128 
2129  if ($this->object->getOrder()) {
2130  $order = array_flip($this->object->getOrder());
2131  } else {
2132  $order = array(
2133  "navigation" => 0
2134  ,"keywords" => 2
2135  ,"authors" => 1
2136  );
2137  }
2138 
2139  $wtpl = new ilTemplate("tpl.blog_list_navigation.html", true, true, "Modules/Blog");
2140 
2141  $blocks = array();
2142 
2143  // by date
2144  if (sizeof($a_items)) {
2145  $blocks[$order["navigation"]] = array(
2146  $this->lng->txt("blog_navigation"),
2147  $this->renderNavigationByDate($a_items, $a_list_cmd, $a_posting_cmd, $a_link_template, $a_show_inactive)
2148  );
2149  }
2150 
2151  if ($this->object->hasKeywords()) {
2152  // keywords
2153  $may_edit_keywords = ($_GET["blpg"] &&
2154  $this->mayEditPosting((int) $_GET["blpg"]) &&
2155  $a_list_cmd != "preview" &&
2156  $a_list_cmd != "gethtml" &&
2157  !$a_link_template);
2158  $keywords = $this->renderNavigationByKeywords($a_list_cmd, $a_show_inactive, $a_link_template);
2159  if ($keywords || $may_edit_keywords) {
2160  if (!$keywords) {
2161  $keywords = $this->lng->txt("blog_no_keywords");
2162  }
2163  $cmd = null;
2164  if ($may_edit_keywords) {
2165  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $_GET["blpg"]);
2166  $cmd = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editKeywords");
2167  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", "");
2168  }
2169  $blocks[$order["keywords"]] = array(
2170  $this->lng->txt("blog_keywords"),
2171  $keywords,
2172  $cmd
2173  ? array($cmd, $this->lng->txt("blog_edit_keywords"))
2174  : null
2175  );
2176  }
2177  }
2178 
2179  // is not part of (html) export
2180  if (!$a_link_template) {
2181  // authors
2182  if ($this->id_type == self::REPOSITORY_NODE_ID &&
2183  $this->object->hasAuthors()) {
2184  $authors = $this->renderNavigationByAuthors($a_items, $a_list_cmd, $a_show_inactive);
2185  if ($authors) {
2186  $blocks[$order["authors"]] = array($this->lng->txt("blog_authors"), $authors);
2187  }
2188  }
2189 
2190  // rss
2191  if ($this->object->hasRSS() &&
2192  $ilSetting->get('enable_global_profiles') &&
2193  $a_list_cmd == "preview") {
2194  // #10827
2195  $blog_id = $this->node_id;
2196  if ($this->id_type != self::WORKSPACE_NODE_ID) {
2197  $blog_id .= "_cll";
2198  }
2199  $url = ILIAS_HTTP_PATH . "/feed.php?blog_id=" . $blog_id .
2200  "&client_id=" . rawurlencode(CLIENT_ID);
2201 
2202  include_once("./Services/News/classes/class.ilRSSButtonGUI.php");
2203  $wtpl->setVariable("RSS_BUTTON", ilRSSButtonGUI::get(ilRSSButtonGUI::ICON_RSS, $url));
2204  }
2205  }
2206 
2207  if (sizeof($blocks)) {
2208  include_once "Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
2209 
2210  ksort($blocks);
2211  foreach ($blocks as $block) {
2212  $panel = ilPanelGUI::getInstance();
2213  $panel->setPanelStyle(ilPanelGUI::PANEL_STYLE_SECONDARY);
2214  $panel->setHeadingStyle(ilPanelGUI::HEADING_STYLE_BLOCK);
2215  $panel->setHeading($block[0]);
2216  $panel->setBody($block[1]);
2217 
2218  if (isset($block[2]) && is_array($block[2])) {
2219  $panel->setFooter('<a href="' . $block[2][0] . '">' . $block[2][1] . '</a>');
2220  }
2221 
2222  $wtpl->setCurrentBlock("block_bl");
2223  $wtpl->setVariable("BLOCK", $panel->getHTML());
2224  $wtpl->parseCurrentBlock();
2225  }
2226  }
2227 
2228  return $wtpl->get();
2229  }
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"]
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
$url
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 1855 of file class.ilObjBlogGUI.php.

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

Referenced by renderNavigation().

1856  {
1857  $ilCtrl = $this->ctrl;
1858 
1859  $authors = array();
1860  foreach ($a_items as $month => $items) {
1861  foreach ($items as $item) {
1862  if (($a_show_inactive || ilBlogPosting::_lookupActive($item["id"], "blp"))) {
1863  if ($item["author"]) {
1864  $authors[] = $item["author"];
1865  }
1866 
1867  if (is_array($item["editors"])) {
1868  foreach ($item["editors"] as $editor_id) {
1869  if ($editor_id != $item["author"]) {
1870  $authors[] = $editor_id;
1871  }
1872  }
1873  }
1874  }
1875  }
1876  }
1877 
1878  $authors = array_unique($authors);
1879  if (sizeof($authors) > 1) {
1880  include_once "Services/User/classes/class.ilUserUtil.php";
1881 
1882  $list = array();
1883  foreach ($authors as $user_id) {
1884  if ($user_id) {
1885  $ilCtrl->setParameter($this, "ath", $user_id);
1886  $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1887  $ilCtrl->setParameter($this, "ath", "");
1888 
1889  $name = ilUserUtil::getNamePresentation($user_id, true);
1890  $idx = trim(strip_tags($name)) . "///" . $user_id; // #10934
1891  $list[$idx] = array($name, $url);
1892  }
1893  }
1894  ksort($list);
1895 
1896  $wtpl = new ilTemplate("tpl.blog_list_navigation_authors.html", true, true, "Modules/Blog");
1897 
1898  $wtpl->setCurrentBlock("author");
1899  foreach ($list as $author) {
1900  $wtpl->setVariable("TXT_AUTHOR", $author[0]);
1901  $wtpl->setVariable("URL_AUTHOR", $author[1]);
1902  $wtpl->parseCurrentBlock();
1903  }
1904 
1905  return $wtpl->get();
1906  }
1907  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
global $ilCtrl
Definition: ilias.php:18
if($format !==null) $name
Definition: metadata.php:146
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
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
Create styles array
The data for the language used.
$url
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderNavigationByDate()

ilObjBlogGUI::renderNavigationByDate ( array  $a_items,
  $a_list_cmd = "render",
  $a_posting_cmd = "preview",
  $a_link_template = null,
  $a_show_inactive = false 
)
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 1621 of file class.ilObjBlogGUI.php.

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

Referenced by renderNavigation().

1622  {
1623  $ilCtrl = $this->ctrl;
1624 
1625  // gather page active status
1626  foreach ($a_items as $month => $postings) {
1627  foreach (array_keys($postings) as $id) {
1628  $active = ilBlogPosting::_lookupActive($id, "blp");
1629  if (!$a_show_inactive && !$active) {
1630  unset($a_items[$month][$id]);
1631  } else {
1632  $a_items[$month][$id]["active"] = $active;
1633  }
1634  }
1635  if (!sizeof($a_items[$month])) {
1636  unset($a_items[$month]);
1637  }
1638  }
1639 
1640  // list month (incl. postings)
1641  if ($this->object->getNavMode() == ilObjBlog::NAV_MODE_LIST || $a_link_template) {
1642  //$max_detail_postings = $this->object->getNavModeListPostings();
1643  $max_months = $this->object->getNavModeListMonths();
1644 
1645  $wtpl = new ilTemplate("tpl.blog_list_navigation_by_date.html", true, true, "Modules/Blog");
1646 
1647  $ilCtrl->setParameter($this, "blpg", "");
1648 
1649  include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
1650  $counter = $mon_counter = $last_year = 0;
1651  foreach ($a_items as $month => $postings) {
1652  if (!$a_link_template && $max_months && $mon_counter >= $max_months) {
1653  break;
1654  }
1655 
1656  $add_year = false;
1657  $year = substr($month, 0, 4);
1658  if (!$last_year || $year != $last_year) {
1659  // #13562
1660  $add_year = true;
1661  $last_year = $year;
1662  }
1663 
1664  $mon_counter++;
1665 
1666  $month_name = ilCalendarUtil::_numericMonthToString((int) substr($month, 5));
1667 
1668  if (!$a_link_template) {
1669  $ilCtrl->setParameter($this, "bmn", $month);
1670  $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1671  } else {
1672  $month_url = $this->buildExportLink($a_link_template, "list", $month);
1673  }
1674 
1675  // list postings for month
1676  //if($counter < $max_detail_postings)
1677  if ($mon_counter <= $this->object->getNavModeListMonthsWithPostings()) {
1678  if ($add_year) {
1679  $wtpl->setCurrentBlock("navigation_year_details");
1680  $wtpl->setVariable("YEAR", $year);
1681  $wtpl->parseCurrentBlock();
1682  }
1683 
1684  foreach ($postings as $id => $posting) {
1685  //if($max_detail_postings && $counter >= $max_detail_postings)
1686  //{
1687  // break;
1688  //}
1689 
1690  $counter++;
1691 
1692  $caption = /* ilDatePresentation::formatDate($posting["created"], IL_CAL_DATETIME).
1693  ", ".*/ $posting["title"];
1694 
1695  if (!$a_link_template) {
1696  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", $month);
1697  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $id);
1698  $url = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", $a_posting_cmd);
1699  } else {
1700  $url = $this->buildExportLink($a_link_template, "posting", $id);
1701  }
1702 
1703  if (!$posting["active"]) {
1704  $wtpl->setVariable("NAV_ITEM_DRAFT", $this->lng->txt("blog_draft"));
1705  } elseif ($this->object->hasApproval() && !$posting["approved"]) {
1706  $wtpl->setVariable("NAV_ITEM_APPROVAL", $this->lng->txt("blog_needs_approval"));
1707  }
1708 
1709  $wtpl->setCurrentBlock("navigation_item");
1710  $wtpl->setVariable("NAV_ITEM_URL", $url);
1711  $wtpl->setVariable("NAV_ITEM_CAPTION", $caption);
1712  $wtpl->parseCurrentBlock();
1713  }
1714 
1715  $wtpl->setCurrentBlock("navigation_month_details");
1716  $wtpl->setVariable("NAV_MONTH", $month_name);
1717  $wtpl->setVariable("URL_MONTH", $month_url);
1718  $wtpl->parseCurrentBlock();
1719  }
1720  // summarized month
1721  else {
1722  if ($add_year) {
1723  $wtpl->setCurrentBlock("navigation_year");
1724  $wtpl->setVariable("YEAR", $year);
1725  $wtpl->parseCurrentBlock();
1726  }
1727 
1728  $wtpl->setCurrentBlock("navigation_month");
1729  $wtpl->setVariable("MONTH_NAME", $month_name);
1730  $wtpl->setVariable("URL_MONTH", $month_url);
1731  $wtpl->setVariable("MONTH_COUNT", sizeof($postings));
1732  $wtpl->parseCurrentBlock();
1733  }
1734  }
1735 
1736  $ilCtrl->setParameter($this, "bmn", $this->month);
1737  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", "");
1738 
1739  return $wtpl->get();
1740  }
1741  // single month
1742  else {
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  $month_name = ilCalendarUtil::_numericMonthToString((int) substr($month, 5)) .
1751  " " . substr($month, 0, 4);
1752 
1753  $month_options[$month] = $month_name;
1754 
1755  if ($month == $this->month) {
1756  if (!$a_link_template) {
1757  $ilCtrl->setParameter($this, "bmn", $month);
1758  $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1759  } else {
1760  $month_url = $this->buildExportLink($a_link_template, "list", $month);
1761  }
1762 
1763  foreach ($postings as $id => $posting) {
1764  $caption = /* ilDatePresentation::formatDate($posting["created"], IL_CAL_DATETIME).
1765  ", ".*/ $posting["title"];
1766 
1767  if (!$a_link_template) {
1768  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", $month);
1769  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $id);
1770  $url = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", $a_posting_cmd);
1771  } else {
1772  $url = $this->buildExportLink($a_link_template, "posting", $id);
1773  }
1774 
1775  if (!$posting["active"]) {
1776  $wtpl->setVariable("NAV_ITEM_DRAFT", $this->lng->txt("blog_draft"));
1777  } elseif ($this->object->hasApproval() && !$posting["approved"]) {
1778  $wtpl->setVariable("NAV_ITEM_APPROVAL", $this->lng->txt("blog_needs_approval"));
1779  }
1780 
1781  $wtpl->setCurrentBlock("navigation_item");
1782  $wtpl->setVariable("NAV_ITEM_URL", $url);
1783  $wtpl->setVariable("NAV_ITEM_CAPTION", $caption);
1784  $wtpl->parseCurrentBlock();
1785  }
1786 
1787  $wtpl->setCurrentBlock("navigation_month_details");
1788  if ($_GET["blpg"]) {
1789  $wtpl->setVariable("NAV_MONTH", $month_name);
1790  $wtpl->setVariable("URL_MONTH", $month_url);
1791  }
1792  $wtpl->parseCurrentBlock();
1793  }
1794  }
1795 
1796  if (!$_GET["blpg"]) {
1797  $wtpl->setCurrentBlock("option_bl");
1798  foreach ($month_options as $value => $caption) {
1799  $wtpl->setVariable("OPTION_VALUE", $value);
1800  $wtpl->setVariable("OPTION_CAPTION", $caption);
1801  if ($value == $this->month) {
1802  $wtpl->setVariable("OPTION_SEL", ' selected="selected"');
1803  }
1804  $wtpl->parseCurrentBlock();
1805  }
1806 
1807  $wtpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this, $a_list_cmd));
1808  }
1809 
1810  $ilCtrl->setParameter($this, "bmn", $this->month);
1811  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", "");
1812 
1813  return $wtpl->get();
1814  }
1815  }
$_GET["client_id"]
if(!array_key_exists('StateId', $_REQUEST)) $id
const NAV_MODE_LIST
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
$url
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderNavigationByKeywords()

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

Build navigation by keywords block.

Parameters
string$a_list_cmd
bool$a_show_inactive
Returns
string

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

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

Referenced by renderNavigation().

1825  {
1826  $ilCtrl = $this->ctrl;
1827 
1828  $keywords = $this->getKeywords($a_show_inactive, (int) $_GET["blpg"]);
1829  if ($keywords) {
1830  $wtpl = new ilTemplate("tpl.blog_list_navigation_keywords.html", true, true, "Modules/Blog");
1831 
1832  $max = max($keywords);
1833  include_once "Services/Tagging/classes/class.ilTagging.php";
1834 
1835  $wtpl->setCurrentBlock("keyword");
1836  foreach ($keywords as $keyword => $counter) {
1837  if (!$a_link_template) {
1838  $ilCtrl->setParameter($this, "kwd", urlencode($keyword)); // #15885
1839  $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1840  $ilCtrl->setParameter($this, "kwd", "");
1841  } else {
1842  $url = $this->buildExportLink($a_link_template, "keyword", $keyword);
1843  }
1844 
1845  $wtpl->setVariable("TXT_KEYWORD", $keyword);
1846  $wtpl->setVariable("CLASS_KEYWORD", ilTagging::getRelevanceClass($counter, $max));
1847  $wtpl->setVariable("URL_KEYWORD", $url);
1848  $wtpl->parseCurrentBlock();
1849  }
1850 
1851  return $wtpl->get();
1852  }
1853  }
$_GET["client_id"]
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.
$url
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderToolbarNavigation()

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

Toolbar navigation.

Parameters

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

References $_GET, ilObjectGUI\$ctrl, $DIC, ilObjectGUI\$lng, $prtf_embed, ilObjectGUI\$toolbar, getLatestMonth(), getLatestPosting(), getNextMonth(), getNextPosting(), getPreviousMonth(), and getPreviousPosting().

Referenced by executeCommand(), and preview().

1916  {
1917  global $DIC;
1918 
1919  $toolbar = $DIC->toolbar();
1920  $lng = $DIC->language();
1921  $ctrl = $DIC->ctrl();
1922 
1923  $f = $DIC->ui()->factory();
1924 
1925  $cmd = ($this->prtf_embed)
1926  ? "previewEmbedded"
1927  : "previewFullscreen";
1928 
1929  if ($single_posting) { // single posting view
1930  include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
1931 
1932  $latest_posting = $this->getLatestPosting($a_items);
1933  if ($latest_posting != "" && $_GET["blpg"] != $latest_posting) {
1934  $ctrl->setParameterByClass("ilblogpostinggui", "blpg", $latest_posting);
1935  $mb = $f->button()->standard(
1936  $lng->txt("blog_latest_posting"),
1937  $ctrl->getLinkTargetByClass("ilblogpostinggui", $cmd)
1938  );
1939  } else {
1940  $mb = $f->button()->standard($lng->txt("blog_latest_posting"), "#")->withUnavailableAction();
1941  }
1942 
1943  $prev_posting = $this->getPreviousPosting($a_items);
1944  if ($prev_posting != "") {
1945  $ctrl->setParameterByClass("ilblogpostinggui", "blpg", $prev_posting);
1946  $pb = $f->button()->standard(
1947  $lng->txt("previous"),
1948  $ctrl->getLinkTargetByClass("ilblogpostinggui", $cmd)
1949  );
1950  } else {
1951  $pb = $f->button()->standard($lng->txt("previous"), "#")->withUnavailableAction();
1952  }
1953 
1954  $next_posting = $this->getNextPosting($a_items);
1955  if ($next_posting != "") {
1956  $ctrl->setParameterByClass("ilblogpostinggui", "blpg", $next_posting);
1957  $nb = $f->button()->standard(
1958  $lng->txt("next"),
1959  $ctrl->getLinkTargetByClass("ilblogpostinggui", $cmd)
1960  );
1961  } else {
1962  $nb = $f->button()->standard($lng->txt("next"), "#")->withUnavailableAction();
1963  }
1964  $ctrl->setParameter($this, "blpg", $_GET["blpg"]);
1965  $vc = $f->viewControl()->section($pb, $mb, $nb);
1966  $toolbar->addComponent($vc);
1967  } else { // month view
1968  include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
1969 
1970  $latest_month = $this->getLatestMonth($a_items);
1971  if ($latest_month != "" && $_GET["bmn"] != $latest_month) {
1972  $ctrl->setParameter($this, "bmn", $latest_month);
1973  $mb = $f->button()->standard(
1974  $lng->txt("blog_latest_posting"),
1975  $ctrl->getLinkTarget($this, "preview")
1976  );
1977  } else {
1978  $mb = $f->button()->standard($lng->txt("blog_latest_posting"), "#")->withUnavailableAction();
1979  }
1980 
1981  $prev_month = $this->getPreviousMonth($a_items);
1982  if ($prev_month != "") {
1983  $ctrl->setParameter($this, "bmn", $prev_month);
1984  $pb = $f->button()->standard($lng->txt("previous"), $ctrl->getLinkTarget($this, "preview"));
1985  } else {
1986  $pb = $f->button()->standard($lng->txt("previous"), "#")->withUnavailableAction();
1987  }
1988 
1989  $next_month = $this->getNextMonth($a_items);
1990  if ($next_month != "") {
1991  $ctrl->setParameter($this, "bmn", $next_month);
1992  $nb = $f->button()->standard($lng->txt("next"), $ctrl->getLinkTarget($this, "preview"));
1993  } else {
1994  $nb = $f->button()->standard($lng->txt("next"), "#")->withUnavailableAction();
1995  }
1996  $ctrl->setParameter($this, "bmn", $_GET["bmn"]);
1997  $vc = $f->viewControl()->section($pb, $mb, $nb);
1998  $toolbar->addComponent($vc);
1999  }
2000  }
getLatestPosting($a_items)
Get previous posting.
getNextPosting($a_items)
Get next posting.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
getPreviousMonth($a_items)
Get next month.
getNextMonth($a_items)
Get next month.
getPreviousPosting($a_items)
Get previous posting.
getLatestMonth($a_items)
Get next month.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveStyleSettings()

ilObjBlogGUI::saveStyleSettings ( )

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

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

3201  {
3203 
3204  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3205  if ($ilSetting->get("fixed_content_style_id") <= 0 &&
3206  (ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId())
3207  || $this->object->getStyleSheetId() == 0)) {
3208  $this->object->setStyleSheetId(ilUtil::stripSlashes($_POST["style_id"]));
3209  $this->object->update();
3210 
3211  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
3212  }
3213  $this->ctrl->redirect($this, "editStyleProperties");
3214  }
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 3095 of file class.ilObjBlogGUI.php.

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

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

3096  {
3097  $tpl = $this->tpl;
3098 
3099  if ($a_tpl != null) {
3100  $ctpl = $a_tpl;
3101  } else {
3102  $ctpl = $tpl;
3103  }
3104 
3105  $ctpl->setCurrentBlock("ContentStyle");
3106  $ctpl->setVariable(
3107  "LOCATION_CONTENT_STYLESHEET",
3108  ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())
3109  );
3110  $ctpl->parseCurrentBlock();
3111  }
static getContentStylePath($a_style_id, $add_random=true)
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 2701 of file class.ilObjBlogGUI.php.

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

2702  {
2703  $ilUser = $this->user;
2704  $ilCtrl = $this->ctrl;
2705 
2706  include_once "./Services/Notification/classes/class.ilNotification.php";
2707  switch ($_GET["ntf"]) {
2708  case 1:
2710  break;
2711 
2712  case 2:
2714  break;
2715  }
2716 
2717  $ilCtrl->redirect($this, "preview");
2718  }
$_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 137 of file class.ilObjBlogGUI.php.

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

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

138  {
139  global $DIC;
140 
141  $tree = $DIC->repositoryTree();
142  $access = $DIC->access();
143 
144  // general properties
145  $this->tabs_gui->addSubTab(
146  "properties",
147  $this->lng->txt("blog_properties"),
148  $this->ctrl->getLinkTarget($this, 'edit')
149  );
150 
151  $this->tabs_gui->addSubTab(
152  "style",
153  $this->lng->txt("obj_sty"),
154  $this->ctrl->getLinkTarget($this, 'editStyleProperties')
155  );
156 
157  // notification settings for blogs in courses and groups
158  if ($this->id_type == self::REPOSITORY_NODE_ID) {
159  $grp_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
160  $crs_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
161 
162  if ((int) $grp_ref_id > 0 || (int) $crs_ref_id > 0) {
163  if ($access->checkAccess('write', '', $this->ref_id)) {
164  $this->tabs_gui->addSubTab(
165  'notifications',
166  $this->lng->txt("notifications"),
167  $this->ctrl->getLinkTargetByClass("ilobjnotificationsettingsgui", '')
168  );
169  }
170  }
171  }
172 
173  $this->tabs_gui->activateSubTab($a_active);
174  }
global $DIC
Definition: saml.php:7
Create new PHPExcel object
obj_idprivate
+ Here is the caller graph for this function:

◆ setTabs()

ilObjBlogGUI::setTabs ( )

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

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

Referenced by executeCommand().

425  {
426  $lng = $this->lng;
427  $ilHelp = $this->help;
428 
429  if ($this->id_type == self::WORKSPACE_NODE_ID) {
430  $this->ctrl->setParameter($this, "wsp_id", $this->node_id);
431  }
432 
433  $ilHelp->setScreenIdComponent("blog");
434 
435  if ($this->checkPermissionBool("read")) {
436  $this->tabs_gui->addTab(
437  "content",
438  $lng->txt("content"),
439  $this->ctrl->getLinkTarget($this, "")
440  );
441  }
442  if ($this->checkPermissionBool("read") && !$this->prtf_embed) {
443  $this->tabs_gui->addTab(
444  "id_info",
445  $lng->txt("info_short"),
446  $this->ctrl->getLinkTargetByClass(array("ilobjbloggui", "ilinfoscreengui"), "showSummary")
447  );
448  }
449 
450  if ($this->checkPermissionBool("write")) {
451  $this->tabs_gui->addTab(
452  "settings",
453  $lng->txt("settings"),
454  $this->ctrl->getLinkTarget($this, "edit")
455  );
456 
457  if (!$this->prtf_embed) {
458  if ($this->id_type == self::REPOSITORY_NODE_ID) {
459  $this->tabs_gui->addTab(
460  "contributors",
461  $lng->txt("blog_contributors"),
462  $this->ctrl->getLinkTarget($this, "contributors")
463  );
464  }
465 
466  if ($this->id_type == self::REPOSITORY_NODE_ID) {
467  $this->tabs_gui->addTab(
468  "export",
469  $lng->txt("export"),
470  $this->ctrl->getLinkTargetByClass("ilexportgui", "")
471  );
472  }
473  }
474  }
475 
476  if (!$this->prtf_embed) {
477  if ($this->mayContribute()) {
478  $this->tabs_gui->addNonTabbedLink(
479  "preview",
480  $lng->txt("blog_preview"),
481  $this->ctrl->getLinkTarget($this, "preview")
482  );
483  }
484  parent::setTabs();
485  }
486  }
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:
+ Here is the caller graph for this function:

◆ updateCustom()

ilObjBlogGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

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

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

376  {
377  $lng = $this->lng;
378 
379  if ($this->id_type == self::REPOSITORY_NODE_ID) {
380  $this->object->setApproval($a_form->getInput("approval"));
381  $this->object->setAuthors($a_form->getInput("nav_authors"));
382  }
383  $this->object->setKeywords($a_form->getInput("keywords"));
384  $this->object->setNotesStatus($a_form->getInput("notes"));
385  $this->object->setProfilePicture($a_form->getInput("ppic"));
386  /*
387  $this->object->setBackgroundColor($a_form->getInput("bg_color"));
388  $this->object->setFontColor($a_form->getInput("font_color"));
389  */
390  $this->object->setRSS($a_form->getInput("rss"));
391  $this->object->setAbstractShorten($a_form->getInput("abss"));
392  $this->object->setAbstractShortenLength($a_form->getInput("abssl"));
393  $this->object->setAbstractImage($a_form->getInput("absi"));
394  $this->object->setAbstractImageWidth($a_form->getInput("absiw"));
395  $this->object->setAbstractImageHeight($a_form->getInput("absih"));
396  $this->object->setNavMode($a_form->getInput("nav"));
397  $this->object->setNavModeListMonthsWithPostings($a_form->getInput("nav_list_mon_with_post"));
398  $this->object->setNavModeListMonths($a_form->getInput("nav_list_mon"));
399  $this->object->setOverviewPostings($a_form->getInput("ov_list_post_num"));
400 
401  $order = $a_form->getInput("order");
402  foreach ($order as $idx => $value) {
403  if ($value == $lng->txt("blog_navigation")) {
404  $order[$idx] = "navigation";
405  } elseif ($value == $lng->txt("blog_keywords")) {
406  $order[$idx] = "keywords";
407  } else {
408  $order[$idx]= "authors";
409  }
410  }
411  $this->object->setOrder($order);
412 
413  // banner field is optional
414  $banner = $a_form->getItemByPostVar("banner");
415  if ($banner) {
416  if ($_FILES["banner"]["tmp_name"]) {
417  $this->object->uploadImage($_FILES["banner"]);
418  } elseif ($banner->getDeletionFlag()) {
419  $this->object->deleteImage();
420  }
421  }
422  }
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 2540 of file class.ilObjBlogGUI.php.

References $a_content, and $file.

Referenced by exportHTMLPages().

2541  {
2542  $file = $a_target_directory . "/" . $a_file;
2543  // return if file is already existing
2544  if (@is_file($file)) {
2545  return;
2546  }
2547 
2548  // export template: page content
2549  $ep_tpl = new ilTemplate(
2550  "tpl.export_page.html",
2551  true,
2552  true,
2553  "Modules/Blog"
2554  );
2555  if ($a_back) {
2556  $ep_tpl->setVariable("PAGE_CONTENT", $a_content);
2557  } else {
2558  $ep_tpl->setVariable("LIST", $a_content);
2559  }
2560  unset($a_content);
2561  $a_tpl->setContent($ep_tpl->get());
2562  unset($ep_tpl);
2563 
2564  // template: right content
2565  if ($a_right_content) {
2566  $a_tpl->setRightContent($a_right_content);
2567  unset($a_right_content);
2568  }
2569 
2570  $content = $a_tpl->get(
2571  "DEFAULT",
2572  false,
2573  false,
2574  false,
2575  true,
2576  true,
2577  true
2578  );
2579 
2580  // open file
2581  if (!file_put_contents($file, $content)) {
2582  die("<b>Error</b>: Could not open \"" . $file . "\" for writing" .
2583  " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
2584  }
2585 
2586  // set file permissions
2587  chmod($file, 0770);
2588 
2589  return $file;
2590  }
$a_content
Definition: workflow.php:93
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 52 of file class.ilObjBlogGUI.php.

Referenced by renderList(), and renderNavigationByAuthors().

◆ $help

ilObjBlogGUI::$help
protected

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

Referenced by setTabs().

◆ $items

◆ $keyword

ilObjBlogGUI::$keyword
protected

◆ $keyword_export_map

ilObjBlogGUI::$keyword_export_map
staticprotected

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

◆ $main_menu

ilObjBlogGUI::$main_menu
protected

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

Referenced by renderFullScreen().

◆ $month

◆ $month_default

ilObjBlogGUI::$month_default
protected

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

◆ $nav_history

ilObjBlogGUI::$nav_history
protected

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

Referenced by executeCommand().

◆ $prtf_embed

ilObjBlogGUI::$prtf_embed = false

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

Referenced by renderToolbarNavigation(), and setTabs().

◆ $rbacadmin

ilObjBlogGUI::$rbacadmin
protected

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

Referenced by addContributor(), and removeContributor().

◆ $tabs

ilObjBlogGUI::$tabs
protected

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