ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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, $a_blpg=0)
 Build navigation blocks. More...
 
 getKeywords ($a_show_inactive, $a_posting_id=null)
 Get keywords for single posting or complete blog. More...
 
 buildExportFile ()
 Build export file. More...
 
 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...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. 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, $a_blpg=0)
 Build navigation by date block. More...
 
 renderNavigationByKeywords ( $a_list_cmd="render", $a_show_inactive=false, $a_link_template=false, $a_blpg=0)
 Build navigation by keywords block. More...
 
 renderNavigationByAuthors (array $a_items, $a_list_cmd="render", $a_show_inactive=false)
 
 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
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 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
 
 $gtp
 
 $blpg
 
 $old_nr
 
 $ppage
 
 $user_page
 
 $prvm
 
 $ntf
 
 $apid
 
 $new_type
 
 $prt_id
 
- 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
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

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

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

120  {
121  global $DIC;
122 
123  $this->settings = $DIC->settings();
124  $this->help = $DIC["ilHelp"];
125  $this->tabs = $DIC->tabs();
126  $this->nav_history = $DIC["ilNavigationHistory"];
127  $this->user = $DIC->user();
128  $this->toolbar = $DIC->toolbar();
129  $this->tree = $DIC->repositoryTree();
130  $this->locator = $DIC["ilLocator"];
131  $this->main_menu = $DIC["ilMainMenu"];
132  $this->rbacreview = $DIC->rbac()->review();
133  $this->rbacadmin = $DIC->rbac()->admin();
134 
135  $lng = $DIC->language();
136  $ilCtrl = $DIC->ctrl();
137 
138  $this->gtp = (int) $_GET["gtp"];
139  $this->blpg = (int) $_REQUEST["blpg"];
140  $this->old_nr = (int) $_GET["old_nr"];
141  $this->ppage = (int) $_GET["ppage"];
142  $this->user_page = (int) $_REQUEST["user_page"];
143  $this->new_type = ilUtil::stripSlashes($_REQUEST["new_type"]);
144  $this->prvm = ilUtil::stripSlashes($_REQUEST["prvm"]);
145  $this->ntf = (int) $_GET["ntf"];
146  $this->apid = (int) $_GET["apid"];
147  $this->month = ilUtil::stripSlashes($_REQUEST["bmn"]);
148  $this->keyword = ilUtil::stripSlashes($_REQUEST["kwd"]);
149  $this->author = (int) $_REQUEST["ath"];
150  $this->prt_id = (int) $_REQUEST["prt_id"];
151 
152  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
153 
154  if ($_REQUEST["blpg"] > 0 && ilBlogPosting::lookupBlogId($_REQUEST["blpg"]) != $this->object->getId()) {
155  throw new ilException("Posting ID does not match blog.");
156  }
157 
158  if ($this->object) {
159  // gather postings by month
160  $this->items = $this->buildPostingList($this->object->getId());
161  if ($this->items) {
162  // current month (if none given or empty)
163  if (!$this->month || !$this->items[$this->month]) {
164  $this->month = array_keys($this->items);
165  $this->month = array_shift($this->month);
166  $this->month_default = true;
167  }
168  }
169 
170  $ilCtrl->setParameter($this, "bmn", $this->month);
171  }
172 
173  $lng->loadLanguageModule("blog");
174  $ilCtrl->saveParameter($this, "prvm");
175  }
settings()
Definition: settings.php:2
static lookupBlogId($a_posting_id)
Lookup blog id.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
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
+ 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 3315 of file class.ilObjBlogGUI.php.

References $DIC, $id, and $ilCtrl.

3316  {
3317  global $DIC;
3318 
3319  $ilCtrl = $DIC->ctrl();
3320 
3321  if (substr($a_target, -3) == "wsp") {
3322  $id = explode("_", $a_target);
3323 
3324  $ilCtrl->setTargetScript("ilias.php");
3325  $ilCtrl->initBaseClass("ilSharedResourceGUI");
3326  $ilCtrl->setParameterByClass("ilSharedResourceGUI", "wsp_id", $id[0]);
3327 
3328  if (sizeof($id) >= 2) {
3329  if (is_numeric($id[1])) {
3330  $ilCtrl->setParameterByClass("ilSharedResourceGUI", "gtp", $id[1]);
3331  } else {
3332  $ilCtrl->setParameterByClass("ilSharedResourceGUI", "kwd", $id[1]);
3333  }
3334  }
3335  $ilCtrl->redirectByClass("ilSharedResourceGUI", "");
3336  } else {
3337  $id = explode("_", $a_target);
3338 
3339  $ilCtrl->setTargetScript("ilias.php");
3340  $ilCtrl->initBaseClass("ilRepositoryGUI");
3341  $ilCtrl->setParameterByClass("ilRepositoryGUI", "ref_id", $id[0]);
3342 
3343  if (sizeof($id) == 2) {
3344  if (is_numeric($id[1])) {
3345  $ilCtrl->setParameterByClass("ilRepositoryGUI", "gtp", $id[1]);
3346  } else {
3347  $ilCtrl->setParameterByClass("ilRepositoryGUI", "kwd", $id[1]);
3348  }
3349  }
3350  $ilCtrl->redirectByClass("ilRepositoryGUI", "preview");
3351  }
3352  }
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
global $ilCtrl
Definition: ilias.php:18

◆ addContributor()

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

Centralized method to add contributors.

Parameters
array$a_user_ids

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

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

Referenced by addUserFromAutoComplete().

3047  {
3048  $ilCtrl = $this->ctrl;
3049  $lng = $this->lng;
3052 
3053  if (!$this->checkPermissionBool("write")) {
3054  return;
3055  }
3056 
3057  if (!count($a_user_ids) || !$a_user_type) {
3058  ilUtil::sendFailure($lng->txt("no_checkbox"));
3059  return $this->contributors();
3060  }
3061 
3062  // get contributor role
3063  $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
3064  if (!in_array($a_user_type, $local_roles)) {
3065  ilUtil::sendFailure($lng->txt("missing_perm"));
3066  return $this->contributors();
3067  }
3068 
3069  foreach ($a_user_ids as $user_id) {
3070  if (!$rbacreview->isAssigned($user_id, $a_user_type)) {
3071  $rbacadmin->assignUser($a_user_type, $user_id);
3072  }
3073  }
3074 
3075  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
3076  $ilCtrl->redirect($this, "contributors");
3077  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addHeaderActionForCommand()

ilObjBlogGUI::addHeaderActionForCommand (   $a_cmd)
protected

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

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

Referenced by executeCommand().

2697  {
2698  $ilUser = $this->user;
2699  $ilCtrl = $this->ctrl;
2700 
2701  // preview?
2702  if ($a_cmd == "preview" || $a_cmd == "previewFullscreen" || $this->prvm) {
2703  // notification
2704  if ($ilUser->getId() != ANONYMOUS_USER_ID) {
2705  if (!$this->prvm) {
2706  $ilCtrl->setParameter($this, "prvm", "fsc");
2707  }
2708  $this->insertHeaderAction($this->initHeaderAction(null, null, true));
2709  if (!$this->prvm) {
2710  $ilCtrl->setParameter($this, "prvm", "");
2711  }
2712  }
2713  } else {
2714  return parent::addHeaderAction();
2715  }
2716  }
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 2939 of file class.ilObjBlogGUI.php.

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

2940  {
2941  $ilLocator = $this->locator;
2942 
2943  if (is_object($this->object)) {
2944  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->node_id);
2945  }
2946  }

◆ addToDeskObject()

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

Implements ilDesktopItemHandling.

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

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

3148  {
3149  $lng = $this->lng;
3150 
3151  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
3153  ilUtil::sendSuccess($lng->txt("added_to_desktop"));
3154  }
static addToDesktop()
Add desktop item public.
+ Here is the call graph for this function:

◆ addUserFromAutoComplete()

ilObjBlogGUI::addUserFromAutoComplete ( )

Autocomplete submit.

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

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

3014  {
3015  $lng = $this->lng;
3016 
3017  $user_login = ilUtil::stripSlashes($_POST['user_login']);
3018  $user_type = ilUtil::stripSlashes($_POST["user_type"]);
3019 
3020  if (!strlen(trim($user_login))) {
3021  ilUtil::sendFailure($lng->txt('msg_no_search_string'));
3022  return $this->contributors();
3023  }
3024  $users = explode(',', $user_login);
3025 
3026  $user_ids = array();
3027  foreach ($users as $user) {
3028  $user_id = ilObjUser::_lookupId($user);
3029 
3030  if (!$user_id) {
3031  ilUtil::sendFailure($lng->txt('user_not_known'));
3032  return $this->contributors();
3033  }
3034 
3035  $user_ids[] = $user_id;
3036  }
3037 
3038  return $this->addContributor($user_ids, $user_type);
3039  }
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.
$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 194 of file class.ilObjBlogGUI.php.

References ilObjectGUI\$ctrl, and $ilCtrl.

195  {
197 
198  ilUtil::sendSuccess($this->lng->txt("object_added"), true);
199  $ilCtrl->redirect($this, "");
200  }
global $ilCtrl
Definition: ilias.php:18

◆ approve()

ilObjBlogGUI::approve ( )

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

References $post, and isAdmin().

2949  {
2950  if ($this->isAdmin() && $this->apid > 0) {
2951  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
2952  $post = new ilBlogPosting($this->apid);
2953  $post->setApproved(true);
2954  $post->setBlogNodeId($this->node_id, ($this->id_type == self::WORKSPACE_NODE_ID));
2955  $post->update(true, false, true, "new"); // #13434
2956 
2957  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
2958  }
2959 
2960  $this->ctrl->redirect($this, "render");
2961  }
Class ilBlogPosting.
$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 1170 of file class.ilObjBlogGUI.php.

References $a_content.

Referenced by executeCommand(), and getHTML().

1171  {
1172  $wtpl = new ilTemplate("tpl.blog_embedded.html", true, true, "Modules/Blog");
1173  $wtpl->setVariable("VAL_LIST", $a_content);
1174  $wtpl->setVariable("VAL_NAVIGATION", $a_nav);
1175  return $wtpl->get();
1176  }
$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 2366 of file class.ilObjBlogGUI.php.

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

Referenced by export().

2367  {
2368  // create export file
2369  include_once("./Services/Export/classes/class.ilExport.php");
2370  ilExport::_createExportDirectory($this->object->getId(), "html", "blog");
2371  $exp_dir = ilExport::_getExportDirectory($this->object->getId(), "html", "blog");
2372 
2373  $subdir = $this->object->getType() . "_" . $this->object->getId();
2374  $export_dir = $exp_dir . "/" . $subdir;
2375 
2376  // initialize temporary target directory
2377  ilUtil::delDir($export_dir);
2378  ilUtil::makeDir($export_dir);
2379 
2380  // system style html exporter
2381  include_once("./Services/Style/System/classes/class.ilSystemStyleHTMLExport.php");
2382  $this->sys_style_html_export = new ilSystemStyleHTMLExport($export_dir);
2383  $this->sys_style_html_export->addImage("icon_blog.svg");
2384  $this->sys_style_html_export->export();
2385 
2386  // init co page html exporter
2387  include_once("./Services/COPage/classes/class.ilCOPageHTMLExport.php");
2388  $this->co_page_html_export = new ilCOPageHTMLExport($export_dir);
2389  $this->co_page_html_export->setContentStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
2390  $this->object->getStyleSheetId(),
2391  "blog"
2392  ));
2393  $this->co_page_html_export->createDirectories();
2394  $this->co_page_html_export->exportStyles();
2395  $this->co_page_html_export->exportSupportScripts();
2396 
2397  // banner / profile picture
2398  $blga_set = new ilSetting("blga");
2399  if ($blga_set->get("banner")) {
2400  $banner = $this->object->getImageFullPath();
2401  if ($banner) {
2402  copy($banner, $export_dir . "/" . basename($banner));
2403  }
2404  }
2405  $ppic = ilObjUser::_getPersonalPicturePath($this->object->getOwner(), "xsmall", true, true);
2406  if ($ppic) {
2407  $ppic = array_shift(explode("?", $ppic));
2408  copy($ppic, $export_dir . "/" . basename($ppic));
2409  }
2410 
2411  // export pages
2412  $this->exportHTMLPages($export_dir);
2413 
2414  // zip everything
2415  if (true) {
2416  // zip it all
2417  $date = time();
2418  $zip_file = ilExport::_getExportDirectory($this->object->getId(), "html", "blog") .
2419  "/" . $date . "__" . IL_INST_ID . "__" .
2420  $this->object->getType() . "_" . $this->object->getId() . ".zip";
2421  ilUtil::zip($export_dir, $zip_file);
2422  ilUtil::delDir($export_dir);
2423  }
2424 
2425  return $zip_file;
2426  }
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 ...
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
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 2574 of file class.ilObjBlogGUI.php.

References $a_type, and getKeywords().

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

2575  {
2576  switch ($a_type) {
2577  case "list":
2578  $a_type = "m";
2579  break;
2580  break;
2581 
2582  case "keyword":
2583  if (!self::$keyword_export_map) {
2584  self::$keyword_export_map = array_flip(array_keys($this->getKeywords(false)));
2585  }
2586  $a_id = self::$keyword_export_map[$a_id];
2587  $a_type = "k";
2588  break;
2589 
2590  default:
2591  $a_type = "p";
2592  break;
2593  }
2594 
2595  $link = str_replace("{TYPE}", $a_type, $a_template);
2596  return str_replace("{ID}", $a_id, $link);
2597  }
$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 2605 of file class.ilObjBlogGUI.php.

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

Referenced by exportHTMLPages().

2606  {
2607  $ilTabs = $this->tabs;
2608  $lng = $this->lng;
2609 
2610  $tpl = $this->co_page_html_export->getPreparedMainTemplate();
2611 
2612  $tpl->getStandardTemplate();
2613 
2614  $ilTabs->clearTargets();
2615  if ($a_back_url) {
2616  $ilTabs->setBackTarget($lng->txt("back"), $a_back_url);
2617  }
2618 
2619  $this->renderFullscreenHeader($tpl, $this->object->getOwner(), true);
2620 
2621  return $tpl;
2622  }
renderFullscreenHeader($a_tpl, $a_user_id, $a_export=false)
Render banner, user name.
+ 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 1346 of file class.ilObjBlogGUI.php.

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

Referenced by __construct().

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

◆ confirmRemoveContributor()

ilObjBlogGUI::confirmRemoveContributor ( )

Used in ilContributorTableGUI.

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

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

3083  {
3084  $ids = ilUtil::stripSlashesRecursive($_POST["id"]);
3085 
3086  if (!is_array($ids)) {
3087  ilUtil::sendFailure($this->lng->txt("select_one"), true);
3088  $this->ctrl->redirect($this, "contributors");
3089  }
3090 
3091  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
3092  $confirm = new ilConfirmationGUI();
3093  $confirm->setHeaderText($this->lng->txt('blog_confirm_delete_contributors'));
3094  $confirm->setFormAction($this->ctrl->getFormAction($this, 'removeContributor'));
3095  $confirm->setConfirm($this->lng->txt('delete'), 'removeContributor');
3096  $confirm->setCancel($this->lng->txt('cancel'), 'contributors');
3097 
3098  include_once 'Services/User/classes/class.ilUserUtil.php';
3099 
3100  foreach ($ids as $user_id) {
3101  $confirm->addItem(
3102  'id[]',
3103  $user_id,
3104  ilUserUtil::getNamePresentation($user_id, false, false, "", true)
3105  );
3106  }
3107 
3108  $this->tpl->setContent($confirm->getHTML());
3109  }
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 2968 of file class.ilObjBlogGUI.php.

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

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

2969  {
2970  $ilTabs = $this->tabs;
2971  $ilToolbar = $this->toolbar;
2972  $ilCtrl = $this->ctrl;
2973  $lng = $this->lng;
2974  $tpl = $this->tpl;
2975 
2976  if (!$this->checkPermissionBool("write")) {
2977  return;
2978  }
2979 
2980  $ilTabs->activateTab("contributors");
2981 
2982  $local_roles = $this->object->getAllLocalRoles($this->node_id);
2983 
2984  // add member
2985  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
2987  $this,
2988  $ilToolbar,
2989  array(
2990  'auto_complete_name' => $lng->txt('user'),
2991  'submit_name' => $lng->txt('add'),
2992  'add_search' => true,
2993  'add_from_container' => $this->node_id,
2994  'user_type' => $local_roles
2995  ),
2996  true
2997  );
2998 
2999  $other_roles = $this->object->getRolesWithContributeOrRedact($this->node_id);
3000  if ($other_roles) {
3001  ilUtil::sendInfo(sprintf($lng->txt("blog_contribute_other_roles"), implode(", ", $other_roles)));
3002  }
3003 
3004  include_once "Modules/Blog/classes/class.ilContributorTableGUI.php";
3005  $tbl = new ilContributorTableGUI($this, "contributors", $this->object->getAllLocalRoles($this->node_id));
3006 
3007  $tpl->setContent($tbl->getHTML());
3008  }
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.
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 925 of file class.ilObjBlogGUI.php.

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

926  {
929 
930  $title = trim(ilUtil::stripSlashes($_POST["title"]));
931  if ($title) {
932  // create new posting
933  include_once("./Modules/Blog/classes/class.ilBlogPosting.php");
934  $posting = new ilBlogPosting();
935  $posting->setTitle($title);
936  $posting->setBlogId($this->object->getId());
937  $posting->setActive(false);
938  $posting->setAuthor($ilUser->getId());
939  $posting->create();
940 
941  // switch month list to current month (will include new posting)
942  $ilCtrl->setParameter($this, "bmn", date("Y-m"));
943 
944  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $posting->getId());
945  $ilCtrl->redirectByClass("ilblogpostinggui", "edit");
946  } else {
947  ilUtil::sendFailure($this->lng->txt("msg_no_title"), true);
948  $ilCtrl->redirect($this, "render");
949  }
950  }
Class ilBlogPosting.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ createStyle()

ilObjBlogGUI::createStyle ( )

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

3280  {
3281  $this->ctrl->redirectByClass("ilobjstylesheetgui", "create");
3282  }

◆ deactivateAdmin()

ilObjBlogGUI::deactivateAdmin ( )

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

References $post, and ilObject2GUI\checkPermissionBool().

3169  {
3170  if ($this->checkPermissionBool("write") && $this->apid > 0) {
3171  // ilBlogPostingGUI::deactivatePage()
3172  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
3173  $post = new ilBlogPosting($this->apid);
3174  $post->setApproved(false);
3175  $post->setActive(false);
3176  $post->update(true, false, false);
3177 
3178  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
3179  }
3180 
3181  $this->ctrl->redirect($this, "render");
3182  }
Class ilBlogPosting.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
$post
Definition: post.php:34
+ Here is the call graph for this function:

◆ deleteStyle()

ilObjBlogGUI::deleteStyle ( )

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

3290  {
3291  $this->ctrl->redirectByClass("ilobjstylesheetgui", "delete");
3292  }

◆ disableNotes()

ilObjBlogGUI::disableNotes (   $a_value = false)

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

2692  {
2693  $this->disable_notes = (bool) $a_value;
2694  }

◆ editStyle()

ilObjBlogGUI::editStyle ( )

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

3285  {
3286  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
3287  }

◆ editStyleProperties()

ilObjBlogGUI::editStyleProperties ( )

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

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

3208  {
3209  $this->checkPermission("write");
3210 
3211  $this->tabs_gui->activateTab("settings");
3212  $this->setSettingsSubTabs("style");
3213 
3214  $form = $this->initStylePropertiesForm();
3215  $this->tpl->setContent($form->getHTML());
3216  }
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 561 of file class.ilObjBlogGUI.php.

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

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

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

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

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

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

Referenced by buildExportFile().

2438  {
2439  require_once('Services/MathJax/classes/class.ilMathJax.php');
2441 
2442  if (!$a_link_template) {
2443  $a_link_template = "bl{TYPE}_{ID}.html";
2444  }
2445 
2446  if ($a_co_page_html_export) {
2447  $this->co_page_html_export = $a_co_page_html_export;
2448  }
2449 
2450 
2451  // lists
2452 
2453  // global nav
2454  $nav = $this->renderNavigation($this->items, "", "", $a_link_template);
2455 
2456  // month list
2457  $has_index = false;
2458  foreach (array_keys($this->items) as $month) {
2459  $list = $this->renderList($this->items[$month], "render", $a_link_template, false, $a_target_directory);
2460 
2461  if (!$list) {
2462  continue;
2463  }
2464 
2465  if (!$a_tpl_callback) {
2466  $tpl = $this->buildExportTemplate();
2467  } else {
2468  $tpl = call_user_func($a_tpl_callback);
2469  }
2470 
2471  $file = $this->buildExportLink($a_link_template, "list", $month);
2472  $file = $this->writeExportFile(
2473  $a_target_directory,
2474  $file,
2475  $tpl,
2476  $list,
2477  $nav
2478  );
2479 
2480  if (!$has_index) {
2481  copy($file, $a_target_directory . "/" . $a_index_name);
2482  $has_index = true;
2483  }
2484  }
2485 
2486  // keywords
2487  foreach (array_keys($this->getKeywords(false)) as $keyword) {
2488  $this->keyword = $keyword;
2489  $list_items = $this->filterItemsByKeyword($this->items, $keyword);
2490  $list = $this->renderList($list_items, "render", $a_link_template, false, $a_target_directory);
2491 
2492  if (!$list) {
2493  continue;
2494  }
2495 
2496  if (!$a_tpl_callback) {
2497  $tpl = $this->buildExportTemplate();
2498  } else {
2499  $tpl = call_user_func($a_tpl_callback);
2500  }
2501 
2502  $file = $this->buildExportLink($a_link_template, "keyword", $keyword);
2503  $file = $this->writeExportFile(
2504  $a_target_directory,
2505  $file,
2506  $tpl,
2507  $list,
2508  $nav
2509  );
2510  }
2511 
2512 
2513  // single postings
2514 
2515  include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
2516  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
2517  $pages = ilBlogPosting::getAllPostings($this->object->getId(), 0);
2518  foreach ($pages as $page) {
2519  if (ilBlogPosting::_exists("blp", $page["id"])) {
2520  include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
2521  $blp_gui = new ilBlogPostingGUI(0, null, $page["id"]);
2522  $blp_gui->setOutputMode("offline");
2523  $blp_gui->setFullscreenLink("fullscreen.html"); // #12930 - see page.xsl
2524  $blp_gui->add_date = true;
2525  $page_content = $blp_gui->showPage();
2526 
2527  $back = $this->buildExportLink(
2528  $a_link_template,
2529  "list",
2530  substr($page["created"]->get(IL_CAL_DATE), 0, 7)
2531  );
2532 
2533  $file = $this->buildExportLink($a_link_template, "posting", $page["id"]);
2534 
2535  if (!$a_tpl_callback) {
2536  $tpl = $this->buildExportTemplate();
2537  } else {
2538  $tpl = call_user_func($a_tpl_callback);
2539  }
2540 
2541  // posting nav
2542  $nav = $this->renderNavigation(
2543  $this->items,
2544  "",
2545  "",
2546  $a_link_template,
2547  false,
2548  $page["id"]
2549  );
2550 
2551  $this->writeExportFile(
2552  $a_target_directory,
2553  $file,
2554  $tpl,
2555  $page_content,
2556  $nav,
2557  $back
2558  );
2559 
2560  $this->co_page_html_export->collectPageElements("blp:pg", $page["id"]);
2561  }
2562  }
2563  $this->co_page_html_export->exportPageElements();
2564  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
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
renderNavigation(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
Build navigation blocks.
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.
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 2833 of file class.ilObjBlogGUI.php.

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

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

2834  {
2835  foreach ($this->items as $month => $postings) {
2836  foreach ($postings as $id => $item) {
2837  if (!ilBlogPosting::_lookupActive($id, "blp")) {
2838  unset($this->items[$month][$id]);
2839  } elseif ($this->object->hasApproval() && !$item["approved"]) {
2840  unset($this->items[$month][$id]);
2841  }
2842  }
2843  if (!sizeof($this->items[$month])) {
2844  unset($this->items[$month]);
2845  }
2846  }
2847 
2848  if ($this->items && !isset($this->items[$this->month])) {
2849  $this->month = array_shift(array_keys($this->items));
2850  }
2851  }
if(!array_key_exists('StateId', $_REQUEST)) $id
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filterItemsByKeyWord()

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

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

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

2854  {
2855  $res = array();
2856  include_once("./Modules/Blog/classes/class.ilBlogPosting.php");
2857  foreach ($a_items as $month => $items) {
2858  foreach ($items as $item) {
2859  if (in_array(
2860  $a_keyword,
2861  ilBlogPosting::getKeywords($this->obj_id, $item["id"])
2862  )) {
2863  $res[] = $item;
2864  }
2865  }
2866  }
2867  return $res;
2868  }
static getKeywords($a_obj_id, $a_posting_id)
foreach($_POST as $key=> $value) $res
+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjBlogGUI::getEditFormCustomValues ( array &  $a_values)
protected

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

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

420  {
421  if ($this->id_type == self::REPOSITORY_NODE_ID) {
422  $a_values["approval"] = $this->object->hasApproval();
423  $a_values["nav_authors"] = $this->object->hasAuthors();
424  }
425  $a_values["keywords"] = $this->object->hasKeywords();
426  $a_values["notes"] = $this->object->getNotesStatus();
427  $a_values["ppic"] = $this->object->hasProfilePicture();
428  /*
429  $a_values["bg_color"] = $this->object->getBackgroundColor();
430  $a_values["font_color"] = $this->object->getFontColor();
431  */
432  $a_values["banner"] = $this->object->getImage();
433  $a_values["rss"] = $this->object->hasRSS();
434  $a_values["abss"] = $this->object->hasAbstractShorten();
435  $a_values["absi"] = $this->object->hasAbstractImage();
436  $a_values["nav"] = $this->object->getNavMode();
437  $a_values["nav_list_mon_with_post"] = $this->object->getNavModeListMonthsWithPostings();
438  $a_values["nav_list_mon"] = $this->object->getNavModeListMonths();
439  $a_values["ov_list_post_num"] = $this->object->getOverviewPostings();
440 
441  // #13420
442  $a_values["abssl"] = $this->object->getAbstractShortenLength() ? $this->object->getAbstractShortenLength() : ilObjBlog::ABSTRACT_DEFAULT_SHORTEN_LENGTH;
443  $a_values["absiw"] = $this->object->getAbstractImageWidth() ? $this->object->getAbstractImageWidth() : ilObjBlog::ABSTRACT_DEFAULT_IMAGE_WIDTH;
444  $a_values["absih"] = $this->object->getAbstractImageHeight() ? $this->object->getAbstractImageHeight() : ilObjBlog::ABSTRACT_DEFAULT_IMAGE_HEIGHT;
445  }
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 1032 of file class.ilObjBlogGUI.php.

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

1033  {
1034  $ilUser = $this->user;
1035  $ilCtrl = $this->ctrl;
1036  $lng = $this->lng;
1037 
1038  // getHTML() is called by ilRepositoryGUI::show()
1039  if ($this->id_type == self::REPOSITORY_NODE_ID) {
1040  return;
1041  }
1042 
1043  // there is no way to do a permissions check here, we have no wsp
1044 
1045  $this->filterInactivePostings();
1046 
1047  $list_items = $this->getListItems();
1048 
1049  $list = $nav = "";
1050  if ($list_items) {
1051  $list = $this->renderList($list_items, "previewEmbedded");
1052  $nav = $this->renderNavigation($this->items, "gethtml", "previewEmbedded");
1053  }
1054  // quick editing in portfolio
1055  elseif ($this->prt_id) {
1056  // see renderList()
1057  if (ilObject::_lookupOwner($this->prt_id) == $ilUser->getId()) {
1058  // see ilPortfolioPageTableGUI::fillRow()
1059  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", $this->user_page);
1060  $link = $ilCtrl->getLinkTargetByClass(array("ilportfoliopagegui", "ilobjbloggui"), "render");
1061  $ilCtrl->setParameterByClass("ilportfoliopagegui", "ppage", "");
1062 
1063  include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
1064  $btn = ilLinkButton::getInstance();
1065  $btn->setCaption(sprintf($lng->txt("prtf_edit_embedded_blog"), $this->object->getTitle()), false);
1066  $btn->setUrl($link);
1067  $btn->setPrimary(true);
1068 
1069  $list = $btn->render();
1070  }
1071  }
1072 
1073  return $this->buildEmbedded($list, $nav);
1074  }
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
renderNavigation(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
Build navigation blocks.
+ Here is the call graph for this function:

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

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

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

2328  {
2329  $keywords = array();
2330  include_once("./Modules/Blog/classes/class.ilBlogPosting.php");
2331  if ($a_posting_id) {
2332  foreach (ilBlogPosting::getKeywords($this->obj_id, $a_posting_id) as $keyword) {
2333  $keywords[$keyword]++;
2334  }
2335  } else {
2336  foreach ($this->items as $month => $items) {
2337  foreach ($items as $item) {
2338  if ($a_show_inactive || ilBlogPosting::_lookupActive($item["id"], "blp")) {
2339  foreach (ilBlogPosting::getKeywords($this->obj_id, $item["id"]) as $keyword) {
2340  $keywords[$keyword]++;
2341  }
2342  }
2343  }
2344  }
2345  }
2346 
2347  // #15881
2348  $tmp = array();
2349  foreach ($keywords as $keyword => $counter) {
2350  $tmp[] = array("keyword" => $keyword, "counter" => $counter);
2351  }
2352  $tmp = ilUtil::sortArray($tmp, "keyword", "ASC");
2353 
2354  $keywords = array();
2355  foreach ($tmp as $item) {
2356  $keywords[$item["keyword"]] = $item["counter"];
2357  }
2358  return $keywords;
2359  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static getKeywords($a_obj_id, $a_posting_id)
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLatestMonth()

ilObjBlogGUI::getLatestMonth (   $a_items)

Get next month.

Parameters
array$a_itemsitem array
Returns
string

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

Referenced by renderToolbarNavigation().

2134  {
2135  reset($a_items);
2136  return key($a_items);
2137  }
+ 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 2193 of file class.ilObjBlogGUI.php.

References $month.

Referenced by renderToolbarNavigation().

2194  {
2195  reset($a_items);
2196  $month = current($a_items);
2197  if (is_array($month)) {
2198  return current($month)["id"];
2199  }
2200  return false;
2201  }
+ 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 1082 of file class.ilObjBlogGUI.php.

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

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

1083  {
1084  if ($this->author) {
1085  $list_items = array();
1086  foreach ($this->items as $month => $items) {
1087  foreach ($items as $id => $item) {
1088  if ($item["author"] == $this->author ||
1089  (is_array($item["editors"]) && in_array($this->author, $item["editors"]))) {
1090  $list_items[$id] = $item;
1091  }
1092  }
1093  }
1094  } elseif ($this->keyword) {
1095  $list_items = $this->filterItemsByKeyword($this->items, $this->keyword);
1096  } else {
1097  $max = $this->object->getOverviewPostings();
1098  if ($this->month_default && $max) {
1099  $list_items = array();
1100  foreach ($this->items as $month => $postings) {
1101  foreach ($postings as $id => $item) {
1102  if (!$a_show_inactive &&
1103  !ilBlogPosting::_lookupActive($id, "blp")) {
1104  continue;
1105  }
1106  $list_items[$id] = $item;
1107 
1108  if (sizeof($list_items) >= $max) {
1109  break(2);
1110  }
1111  }
1112  }
1113  } else {
1114  $list_items = $this->items[$this->month];
1115  }
1116  }
1117  return $list_items;
1118  }
if(!array_key_exists('StateId', $_REQUEST)) $id
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNextMonth()

ilObjBlogGUI::getNextMonth (   $a_items)

Get next month.

Parameters
array$a_itemsitem array
Returns
string

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

References $items, and $month.

Referenced by renderToolbarNavigation().

2098  {
2099  reset($a_items);
2100  $found = "";
2101  foreach ($a_items as $month => $items) {
2102  if ($month > $this->month) {
2103  $found = $month;
2104  }
2105  }
2106  return $found;
2107  }
+ 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 2145 of file class.ilObjBlogGUI.php.

References $items, and $month.

Referenced by renderToolbarNavigation().

2146  {
2147  reset($a_items);
2148  $found = "";
2149  $next_blpg = 0;
2150  foreach ($a_items as $month => $items) {
2151  foreach ($items as $item) {
2152  if ($item["id"] == $this->blpg) {
2153  $found = true;
2154  }
2155  if (!$found) {
2156  $next_blpg = $item["id"];
2157  }
2158  }
2159  }
2160  return $next_blpg;
2161  }
+ Here is the caller graph for this function:

◆ getNotesSubId()

ilObjBlogGUI::getNotesSubId ( )

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

References $blpg.

2687  {
2688  return $this->blpg;
2689  }

◆ getPreviousMonth()

ilObjBlogGUI::getPreviousMonth (   $a_items)

Get next month.

Parameters
array$a_itemsitem array
Returns
string

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

References $items, and $month.

Referenced by renderToolbarNavigation().

2116  {
2117  reset($a_items);
2118  $found = "";
2119  foreach ($a_items as $month => $items) {
2120  if ($month < $this->month && $found == "") {
2121  $found = $month;
2122  }
2123  }
2124  return $found;
2125  }
+ 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 2169 of file class.ilObjBlogGUI.php.

References $items, and $month.

Referenced by renderToolbarNavigation().

2170  {
2171  reset($a_items);
2172  $found = "";
2173  $prev_blpg = 0;
2174  foreach ($a_items as $month => $items) {
2175  foreach ($items as $item) {
2176  if ($found && $prev_blpg == "") {
2177  $prev_blpg = $item["id"];
2178  }
2179  if ($item["id"] == $this->blpg) {
2180  $found = true;
2181  }
2182  }
2183  }
2184  return $prev_blpg;
2185  }
+ Here is the caller graph for this function:

◆ getType()

ilObjBlogGUI::getType ( )

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

Referenced by renderList().

178  {
179  return "blog";
180  }
+ 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 871 of file class.ilObjBlogGUI.php.

References infoScreenForward().

872  {
873  $this->ctrl->setCmd("showSummary");
874  $this->ctrl->setCmdClass("ilinfoscreengui");
875  $this->infoScreenForward();
876  }
infoScreenForward()
show information screen
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjBlogGUI::infoScreenForward ( )

show information screen

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

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

Referenced by executeCommand(), and infoScreen().

882  {
883  $ilTabs = $this->tabs;
884 
885  $ilTabs->activateTab("id_info");
886 
887  $this->checkPermission("visible");
888 
889  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
890  $info = new ilInfoScreenGUI($this);
891 
892  if ($this->id_type != self::WORKSPACE_NODE_ID) {
893  $info->enablePrivateNotes();
894  }
895 
896  if ($this->checkPermissionBool("read")) {
897  $info->enableNews();
898  }
899 
900  // no news editing for files, just notifications
901  $info->enableNewsEditing(false);
902  if ($this->checkPermissionBool("write")) {
903  $news_set = new ilSetting("news");
904  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
905 
906  if ($enable_internal_rss) {
907  $info->setBlockProperty("news", "settings", true);
908  $info->setBlockProperty("news", "public_notifications_option", true);
909  }
910  }
911 
912  // standard meta data
913  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
914 
915  if ($this->id_type == self::WORKSPACE_NODE_ID) {
916  $info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget());
917  }
918 
919  $this->ctrl->forwardCommand($info);
920  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Class ilInfoScreenGUI.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getPermanentLinkWidget($a_append=null, $a_center=false)
$info
Definition: 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 182 of file class.ilObjBlogGUI.php.

183  {
184  $forms = parent::initCreationForms($a_new_type);
185 
186  if ($this->id_type == self::WORKSPACE_NODE_ID) {
187  unset($forms[self::CFORM_IMPORT]);
188  unset($forms[self::CFORM_CLONE]);
189  }
190 
191  return $forms;
192  }

◆ initEditCustomForm()

ilObjBlogGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

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

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

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

◆ initHeaderAction()

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

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

References $blpg, 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().

2719  {
2720  $ilUser = $this->user;
2721  $ilCtrl = $this->ctrl;
2722 
2723  if (!$this->obj_id) {
2724  return false;
2725  }
2726 
2727  $sub_type = $sub_id = null;
2728  if ($this->blpg > 0) {
2729  $sub_type = "blp";
2730  $sub_id = $this->blpg;
2731  }
2732 
2733  $lg = parent::initHeaderAction($sub_type, $sub_id);
2734 
2735  if ($a_is_preview) {
2736  $lg->enableComments(false);
2737  $lg->enableNotes(false);
2738  $lg->enableTags(false);
2739 
2740  include_once "./Services/Notification/classes/class.ilNotification.php";
2742  $ilCtrl->setParameter($this, "ntf", 1);
2743  $link = $ilCtrl->getLinkTarget($this, "setNotification");
2744  $ilCtrl->setParameter($this, "ntf", "");
2745  if (ilNotification::hasOptOut($this->obj_id)) {
2746  $lg->addCustomCommand($link, "blog_notification_toggle_off");
2747  }
2748 
2749  $lg->addHeaderIcon(
2750  "not_icon",
2751  ilUtil::getImagePath("notification_on.svg"),
2752  $this->lng->txt("blog_notification_activated")
2753  );
2754  } else {
2755  $ilCtrl->setParameter($this, "ntf", 2);
2756  $link = $ilCtrl->getLinkTarget($this, "setNotification");
2757  $ilCtrl->setParameter($this, "ntf", "");
2758  $lg->addCustomCommand($link, "blog_notification_toggle_on");
2759 
2760  $lg->addHeaderIcon(
2761  "not_icon",
2762  ilUtil::getImagePath("notification_off.svg"),
2763  $this->lng->txt("blog_notification_deactivated")
2764  );
2765  }
2766 
2767  // #11758
2768  if ($this->mayContribute()) {
2769  $ilCtrl->setParameter($this, "prvm", "");
2770 
2771  $ilCtrl->setParameter($this, "bmn", "");
2772  $ilCtrl->setParameter($this, "blpg", "");
2773  $link = $ilCtrl->getLinkTarget($this, "");
2774  $ilCtrl->setParameter($this, "blpg", $sub_id);
2775  $ilCtrl->setParameter($this, "bmn", $this->month);
2776  $lg->addCustomCommand($link, "blog_edit"); // #11868
2777 
2778  if ($sub_id && $this->mayEditPosting($sub_id)) {
2779  $link = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit");
2780  $lg->addCustomCommand($link, "blog_edit_posting");
2781  }
2782 
2783  $ilCtrl->setParameter($this, "prvm", "fsc");
2784  }
2785 
2786  $ilCtrl->setParameter($this, "ntf", "");
2787  }
2788 
2789  return $lg;
2790  }
$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.
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 3218 of file class.ilObjBlogGUI.php.

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

Referenced by editStyleProperties().

3219  {
3221 
3222  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3223  $this->lng->loadLanguageModule("style");
3224 
3225  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
3226  $form = new ilPropertyFormGUI();
3227 
3228  $fixed_style = $ilSetting->get("fixed_content_style_id");
3229  $style_id = $this->object->getStyleSheetId();
3230 
3231  if ($fixed_style > 0) {
3232  $st = new ilNonEditableValueGUI($this->lng->txt("style_current_style"));
3233  $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" .
3234  $this->lng->txt("global_fixed") . ")");
3235  $form->addItem($st);
3236  } else {
3238  true,
3239  false,
3240  $this->ref_id
3241  );
3242 
3243  $st_styles[0] = $this->lng->txt("default");
3244  ksort($st_styles);
3245 
3246  if ($style_id > 0) {
3247  // individual style
3248  if (!ilObjStyleSheet::_lookupStandard($style_id)) {
3249  $st = new ilNonEditableValueGUI($this->lng->txt("style_current_style"));
3250  $st->setValue(ilObject::_lookupTitle($style_id));
3251  $form->addItem($st);
3252 
3253  // delete command
3254  $form->addCommandButton("editStyle", $this->lng->txt("style_edit_style"));
3255  $form->addCommandButton("deleteStyle", $this->lng->txt("style_delete_style"));
3256  }
3257  }
3258 
3259  if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id)) {
3260  $style_sel = new ilSelectInputGUI(
3261  $this->lng->txt("style_current_style"),
3262  "style_id"
3263  );
3264  $style_sel->setOptions($st_styles);
3265  $style_sel->setValue($style_id);
3266  $form->addItem($style_sel);
3267 
3268  $form->addCommandButton("saveStyleSettings", $this->lng->txt("save"));
3269  $form->addCommandButton("createStyle", $this->lng->txt("sty_create_ind_style"));
3270  }
3271  }
3272 
3273  $form->setTitle($this->lng->txt("blog_style"));
3274  $form->setFormAction($this->ctrl->getFormAction($this));
3275 
3276  return $form;
3277  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
static _lookupTitle($a_id)
lookup object title
static _getStandardStyles( $a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
static _lookupStandard($a_id)
Lookup standard flag.
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 2875 of file class.ilObjBlogGUI.php.

References ilObject2GUI\checkPermissionBool().

Referenced by approve(), and renderList().

2876  {
2877  return ($this->checkPermissionBool("redact") ||
2878  $this->checkPermissionBool("write"));
2879  }
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 2818 of file class.ilObjBlogGUI.php.

References $post.

2819  {
2820  // page might be deleted, so setting halt on errors to false
2821  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
2822  $post = new ilBlogPosting($a_posting_id);
2823  if ($post->getBlogId() == $a_blog_id) {
2824  return $post->getTitle();
2825  }
2826  }
Class ilBlogPosting.
$post
Definition: post.php:34

◆ mayContribute()

ilObjBlogGUI::mayContribute ( )
protected

Check if user may contribute at all.

Returns
boolean

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

References ilObject2GUI\checkPermissionBool().

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

2929  {
2930  // single author blog (owner) in personal workspace
2931  if ($this->id_type == self::WORKSPACE_NODE_ID) {
2932  return $this->checkPermissionBool("write");
2933  }
2934 
2935  return ($this->checkPermissionBool("redact") ||
2936  $this->checkPermissionBool("contribute"));
2937  }
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 2888 of file class.ilObjBlogGUI.php.

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

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

2889  {
2890  $ilUser = $this->user;
2891 
2892  // single author blog (owner) in personal workspace
2893  if ($this->id_type == self::WORKSPACE_NODE_ID) {
2894  return $this->checkPermissionBool("write");
2895  }
2896 
2897  // repository blogs
2898 
2899  // redact allows to edit all postings
2900  if ($this->checkPermissionBool("redact")) {
2901  return true;
2902  }
2903 
2904  // contribute gives access to own postings
2905  if ($this->checkPermissionBool("contribute")) {
2906  // check owner of posting
2907  if (!$a_author_id) {
2908  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
2909  $post = new ilBlogPosting($a_posting_id);
2910  $a_author_id = $post->getAuthor();
2911  }
2912  if ($ilUser->getId() == $a_author_id) {
2913  return true;
2914  } else {
2915  return false;
2916  }
2917 
2918  return true;
2919  }
2920  return false;
2921  }
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 1123 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().

1124  {
1125  global $DIC;
1126 
1127  $lng = $DIC->language();
1128  $toolbar = $DIC->toolbar();
1129 
1130  if (!$this->checkPermissionBool("read")) {
1131  ilUtil::sendInfo($lng->txt("no_permission"));
1132  return;
1133  }
1134 
1135  $this->filterInactivePostings();
1136 
1137  $list_items = $this->getListItems();
1138 
1139  $list = $nav = "";
1140  if ($list_items) {
1141  $list = $this->renderList($list_items, "previewFullscreen");
1142  $nav = $this->renderNavigation($this->items, "preview", "previewFullscreen");
1143  $this->renderToolbarNavigation($this->items);
1144  $list .= $toolbar->getHTML();
1145  }
1146 
1147  $this->renderFullScreen($list, $nav);
1148  }
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.
renderNavigation(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
Build navigation blocks.
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 3114 of file class.ilObjBlogGUI.php.

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

3115  {
3116  $ilCtrl = $this->ctrl;
3117  $lng = $this->lng;
3119 
3120  $ids = ilUtil::stripSlashesRecursive($_POST["id"]);
3121 
3122  if (!is_array($ids)) {
3123  ilUtil::sendFailure($lng->txt("select_one"), true);
3124  $ilCtrl->redirect($this, "contributors");
3125  }
3126 
3127  // get contributor role
3128  $local_roles = array_keys($this->object->getAllLocalRoles($this->node_id));
3129  if (!$local_roles) {
3130  ilUtil::sendFailure($lng->txt("missing_perm"));
3131  return $this->contributors();
3132  }
3133 
3134  foreach ($ids as $user_id) {
3135  foreach ($local_roles as $role_id) {
3136  $rbacadmin->deassignUser($role_id, $user_id);
3137  }
3138  }
3139 
3140  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
3141  $this->ctrl->redirect($this, "contributors");
3142  }
global $ilCtrl
Definition: ilias.php:18
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ removeFromDeskObject()

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

Implements ilDesktopItemHandling.

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

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

3160  {
3161  $lng = $this->lng;
3162 
3163  include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
3165  ilUtil::sendSuccess($lng->txt("removed_from_desktop"));
3166  }
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 958 of file class.ilObjBlogGUI.php.

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

959  {
960  $tpl = $this->tpl;
961  $ilTabs = $this->tabs;
963  $lng = $this->lng;
964  $ilToolbar = new ilToolbarGUI();
966  $tree = $this->tree;
967 
968  if (!$this->checkPermissionBool("read")) {
969  ilUtil::sendInfo($lng->txt("no_permission"));
970  return;
971  }
972 
973  $ilTabs->activateTab("content");
974 
975  // toolbar
976  if ($this->mayContribute()) {
977  $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "createPosting"));
978 
979  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
980  $title = new ilTextInputGUI($lng->txt("title"), "title");
981  $ilToolbar->addStickyItem($title, $lng->txt("title"));
982 
983  include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
984  $button = ilSubmitButton::getInstance();
985  $button->setCaption("blog_add_posting");
986  $button->setCommand("createPosting");
987  $ilToolbar->addStickyItem($button);
988 
989  // #18763
990  $first = array_shift((array_keys($this->items)));
991  if ($first != $this->month) {
992  $ilToolbar->addSeparator();
993 
994  $ilCtrl->setParameter($this, "bmn", $first);
995  $url = $ilCtrl->getLinkTarget($this, "");
996  $ilCtrl->setParameter($this, "bmn", $this->month);
997 
998  include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
999  $button = ilLinkButton::getInstance();
1000  $button->setCaption("blog_show_latest");
1001  $button->setUrl($url);
1002  $ilToolbar->addButtonInstance($button);
1003  }
1004 
1005  // exercise blog?
1006  include_once "Modules/Blog/classes/class.ilBlogExerciseGUI.php";
1007  $message = ilBlogExerciseGUI::checkExercise($this->node_id);
1008  }
1009 
1010  // $is_owner = ($this->object->getOwner() == $ilUser->getId());
1011  $is_owner = $this->mayContribute();
1012 
1013  $list_items = $this->getListItems($is_owner);
1014 
1015  $list = $nav = "";
1016  if ($list_items) {
1017  $list = $this->renderList($list_items, "preview", null, $is_owner);
1018  $nav = $this->renderNavigation($this->items, "render", "preview", null, $is_owner);
1019  }
1020 
1021  $this->setContentStyleSheet();
1022 
1023  $tpl->setContent($message . $ilToolbar->getHTML() . $list);
1024  $tpl->setRightContent($nav);
1025  }
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.
catch(Exception $e) $message
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
renderNavigation(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
Build navigation blocks.
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 1184 of file class.ilObjBlogGUI.php.

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

Referenced by executeCommand(), and preview().

1185  {
1186  $tpl = $this->tpl;
1187  $ilUser = $this->user;
1188  $ilTabs = $this->tabs;
1189  $ilLocator = $this->locator;
1190 
1191  $owner = $this->object->getOwner();
1192 
1193  $ilTabs->clearTargets();
1194  $ilLocator->clearItems();
1195  $tpl->setLocator();
1196 
1197  $back_caption = "";
1198 
1199  // back (edit)
1200  if ($owner == $ilUser->getId()) {
1201  // from shared/deeplink
1202  if ($this->id_type == self::WORKSPACE_NODE_ID) {
1203  $back = "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&wsp_id=" . $this->node_id;
1204  }
1205  // from editor (#10073)
1206  elseif ($this->mayContribute()) {
1207  $this->ctrl->setParameter($this, "prvm", "");
1208  if ($this->blpg == 0) {
1209  $back = $this->ctrl->getLinkTarget($this, "");
1210  } else {
1211  $this->ctrl->setParameterByClass("ilblogpostinggui", "bmn", $this->month);
1212  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $this->blpg);
1213  $back = $this->ctrl->getLinkTargetByClass("ilblogpostinggui", "preview");
1214  }
1215  $this->ctrl->setParameter($this, "prvm", $this->prvm);
1216  }
1217 
1218  $back_caption = $this->lng->txt("blog_back_to_blog_owner");
1219  }
1220  // back
1221  elseif ($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID) {
1222  // workspace (always shared)
1223  if ($this->id_type == self::WORKSPACE_NODE_ID) {
1224  $back = "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=" . $owner;
1225  }
1226  // contributor
1227  elseif ($this->mayContribute()) {
1228  $back = $this->ctrl->getLinkTarget($this, "");
1229  $back_caption = $this->lng->txt("blog_back_to_blog_owner");
1230  }
1231  // listgui / parent container
1232  else {
1233  $tree = $this->tree;
1234  $parent_id = $tree->getParentId($this->node_id);
1235  include_once "Services/Link/classes/class.ilLink.php";
1237  }
1238  }
1239 
1240  $ilMainMenu = $this->main_menu;
1241  $ilMainMenu->setMode(ilMainMenuGUI::MODE_TOPBAR_ONLY);
1242  $ilMainMenu->setTopBarBack($back, $back_caption);
1243 
1244  $this->renderFullscreenHeader($tpl, $owner);
1245 
1246  // #13564
1247  $this->ctrl->setParameter($this, "bmn", "");
1248  $tpl->setTitleUrl($this->ctrl->getLinkTarget($this, "preview"));
1249  $this->ctrl->setParameter($this, "bmn", $this->month);
1250 
1251  $this->setContentStyleSheet();
1252 
1253  // content
1254  $tpl->setContent($a_content);
1255  $tpl->setRightContent($a_navigation);
1256  }
mayContribute()
Check if user may contribute at all.
renderFullscreenHeader($a_tpl, $a_user_id, $a_export=false)
Render banner, user name.
$a_content
Definition: workflow.php:93
$ilUser
Definition: imgupload.php:18
setContentStyleSheet($a_tpl=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderFullscreenHeader()

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

Render banner, user name.

Parameters
object$a_tpl
int$a_user_id
bool$a_export_path

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

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

Referenced by buildExportTemplate(), and renderFullScreen().

1266  {
1267  $ilUser = $this->user;
1268 
1269  if (!$a_export) {
1270  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
1272  $this->object->getType(),
1274  $this->object->getId(),
1275  $ilUser->getId()
1276  );
1277  }
1278 
1279  // repository blogs are multi-author
1280  $name = null;
1281  if ($this->id_type != self::REPOSITORY_NODE_ID) {
1282  $name = ilObjUser::_lookupName($a_user_id);
1283  $name = $name["lastname"] . ", " . ($t = $name["title"] ? $t . " " : "") . $name["firstname"];
1284  }
1285 
1286  // show banner?
1287  $banner = false;
1288  $blga_set = new ilSetting("blga");
1289  if ($blga_set->get("banner")) {
1290  require_once('./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
1291  $banner = ilWACSignedPath::signFile($this->object->getImageFullPath());
1292  $banner_width = $blga_set->get("banner_width");
1293  $banner_height = $blga_set->get("banner_height");
1294  if ($a_export) {
1295  $banner = basename($banner);
1296  }
1297  }
1298 
1299  $ppic = null;
1300  if ($this->object->hasProfilePicture()) {
1301  // repository (multi-user)
1302  if ($this->id_type == self::REPOSITORY_NODE_ID) {
1303  // #15030
1304  if ($this->blpg > 0 && !$a_export) {
1305  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
1306  $post = new ilBlogPosting($this->blpg);
1307  $author_id = $post->getAuthor();
1308  if ($author_id) {
1309  $ppic = ilObjUser::_getPersonalPicturePath($author_id, "xsmall", true, true);
1310 
1311  $name = ilObjUser::_lookupName($author_id);
1312  $name = $name["lastname"] . ", " . ($t = $name["title"] ? $t . " " : "") . $name["firstname"];
1313  }
1314  }
1315  }
1316  // workspace (author == owner)
1317  else {
1318  $ppic = ilObjUser::_getPersonalPicturePath($a_user_id, "xsmall", true, true);
1319  if ($a_export) {
1320  $ppic = basename($ppic);
1321  }
1322  }
1323  }
1324 
1325  $a_tpl->resetHeaderBlock(false);
1326  // $a_tpl->setBackgroundColor($this->object->getBackgroundColor());
1327  $a_tpl->setBanner($banner, $banner_width, $banner_height, $a_export);
1328  $a_tpl->setTitleIcon($ppic);
1329  $a_tpl->setTitle($this->object->getTitle());
1330  // $a_tpl->setTitleColor($this->object->getFontColor());
1331  $a_tpl->setDescription($name);
1332 
1333  // to get rid of locator in repository preview
1334  $a_tpl->setVariable("LOCATOR", "");
1335 
1336  // :TODO: obsolete?
1337  // $a_tpl->setBodyClass("std ilExternal ilBlog");
1338  }
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.
$post
Definition: post.php:34
$ilUser
Definition: imgupload.php:18
static signFile($path_to_file)
+ 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 1379 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(), buildExportLink(), ilDatePresentation\formatDate(), ilObject2GUI\getAccessHandler(), ilBlogPosting\getKeywords(), ilUserUtil\getNamePresentation(), ilBlogPostingGUI\getSnippet(), getType(), IL_CAL_DATE, IL_NOTE_PUBLIC, isAdmin(), and mayEditPosting().

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

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

Build navigation blocks.

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

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

References $blpg, ilObjectGUI\$ctrl, $ilCtrl, $ilSetting, ilObject2GUI\$node_id, ilObjectGUI\$settings, $url, ilRSSButtonGUI\get(), ilPanelGUI\getInstance(), ilPanelGUI\HEADING_STYLE_BLOCK, ilRSSButtonGUI\ICON_RSS, mayEditPosting(), ilPanelGUI\PANEL_STYLE_SECONDARY, renderNavigationByAuthors(), renderNavigationByDate(), and renderNavigationByKeywords().

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

2215  {
2216  $ilCtrl = $this->ctrl;
2218 
2219  $blpg = ($a_blpg > 0)
2220  ? $a_blpg
2221  : $this->blpg;
2222 
2223  if ($this->object->getOrder()) {
2224  $order = array_flip($this->object->getOrder());
2225  } else {
2226  $order = array(
2227  "navigation" => 0
2228  ,"keywords" => 2
2229  ,"authors" => 1
2230  );
2231  }
2232 
2233  $wtpl = new ilTemplate("tpl.blog_list_navigation.html", true, true, "Modules/Blog");
2234 
2235  $blocks = array();
2236 
2237  // by date
2238  if (sizeof($a_items)) {
2239  $blocks[$order["navigation"]] = array(
2240  $this->lng->txt("blog_navigation"),
2241  $this->renderNavigationByDate($a_items, $a_list_cmd, $a_posting_cmd, $a_link_template, $a_show_inactive, $a_blpg)
2242  );
2243  }
2244 
2245  if ($this->object->hasKeywords()) {
2246  // keywords
2247  $may_edit_keywords = ($blpg > 0 &&
2248  $this->mayEditPosting($blpg) &&
2249  $a_list_cmd != "preview" &&
2250  $a_list_cmd != "gethtml" &&
2251  !$a_link_template);
2252  $keywords = $this->renderNavigationByKeywords($a_list_cmd, $a_show_inactive, $a_link_template, $a_blpg);
2253  if ($keywords || $may_edit_keywords) {
2254  if (!$keywords) {
2255  $keywords = $this->lng->txt("blog_no_keywords");
2256  }
2257  $cmd = null;
2258  $blocks[$order["keywords"]] = array(
2259  $this->lng->txt("blog_keywords"),
2260  $keywords,
2261  $cmd
2262  ? array($cmd, $this->lng->txt("blog_edit_keywords"))
2263  : null
2264  );
2265  }
2266  }
2267 
2268  // is not part of (html) export
2269  if (!$a_link_template) {
2270  // authors
2271  if ($this->id_type == self::REPOSITORY_NODE_ID &&
2272  $this->object->hasAuthors()) {
2273  $authors = $this->renderNavigationByAuthors($a_items, $a_list_cmd, $a_show_inactive);
2274  if ($authors) {
2275  $blocks[$order["authors"]] = array($this->lng->txt("blog_authors"), $authors);
2276  }
2277  }
2278 
2279  // rss
2280  if ($this->object->hasRSS() &&
2281  $ilSetting->get('enable_global_profiles') &&
2282  $a_list_cmd == "preview") {
2283  // #10827
2284  $blog_id = $this->node_id;
2285  if ($this->id_type != self::WORKSPACE_NODE_ID) {
2286  $blog_id .= "_cll";
2287  }
2288  $url = ILIAS_HTTP_PATH . "/feed.php?blog_id=" . $blog_id .
2289  "&client_id=" . rawurlencode(CLIENT_ID);
2290 
2291  include_once("./Services/News/classes/class.ilRSSButtonGUI.php");
2292  $wtpl->setVariable("RSS_BUTTON", ilRSSButtonGUI::get(ilRSSButtonGUI::ICON_RSS, $url));
2293  }
2294  }
2295 
2296  if (sizeof($blocks)) {
2297  include_once "Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
2298 
2299  ksort($blocks);
2300  foreach ($blocks as $block) {
2301  $panel = ilPanelGUI::getInstance();
2302  $panel->setPanelStyle(ilPanelGUI::PANEL_STYLE_SECONDARY);
2303  $panel->setHeadingStyle(ilPanelGUI::HEADING_STYLE_BLOCK);
2304  $panel->setHeading($block[0]);
2305  $panel->setBody($block[1]);
2306 
2307  if (isset($block[2]) && is_array($block[2])) {
2308  $panel->setFooter('<a href="' . $block[2][0] . '">' . $block[2][1] . '</a>');
2309  }
2310 
2311  $wtpl->setCurrentBlock("block_bl");
2312  $wtpl->setVariable("BLOCK", $panel->getHTML());
2313  $wtpl->parseCurrentBlock();
2314  }
2315  }
2316 
2317  return $wtpl->get();
2318  }
static get($a_type, $a_href="")
Get icon html.
global $ilCtrl
Definition: ilias.php:18
renderNavigationByKeywords( $a_list_cmd="render", $a_show_inactive=false, $a_link_template=false, $a_blpg=0)
Build navigation by keywords block.
renderNavigationByDate(array $a_items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false, $a_blpg=0)
Build navigation by date block.
special template class to simplify handling of ITX/PEAR
renderNavigationByAuthors(array $a_items, $a_list_cmd="render", $a_show_inactive=false)
static getInstance()
Get instance.
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 1944 of file class.ilObjBlogGUI.php.

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

Referenced by renderNavigation().

1945  {
1946  $ilCtrl = $this->ctrl;
1947 
1948  $authors = array();
1949  foreach ($a_items as $month => $items) {
1950  foreach ($items as $item) {
1951  if (($a_show_inactive || ilBlogPosting::_lookupActive($item["id"], "blp"))) {
1952  if ($item["author"]) {
1953  $authors[] = $item["author"];
1954  }
1955 
1956  if (is_array($item["editors"])) {
1957  foreach ($item["editors"] as $editor_id) {
1958  if ($editor_id != $item["author"]) {
1959  $authors[] = $editor_id;
1960  }
1961  }
1962  }
1963  }
1964  }
1965  }
1966 
1967  $authors = array_unique($authors);
1968  if (sizeof($authors) > 1) {
1969  include_once "Services/User/classes/class.ilUserUtil.php";
1970 
1971  $list = array();
1972  foreach ($authors as $user_id) {
1973  if ($user_id) {
1974  $ilCtrl->setParameter($this, "ath", $user_id);
1975  $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1976  $ilCtrl->setParameter($this, "ath", "");
1977 
1978  $name = ilUserUtil::getNamePresentation($user_id, true);
1979  $idx = trim(strip_tags($name)) . "///" . $user_id; // #10934
1980  $list[$idx] = array($name, $url);
1981  }
1982  }
1983  ksort($list);
1984 
1985  $wtpl = new ilTemplate("tpl.blog_list_navigation_authors.html", true, true, "Modules/Blog");
1986 
1987  $wtpl->setCurrentBlock("author");
1988  foreach ($list as $author) {
1989  $wtpl->setVariable("TXT_AUTHOR", $author[0]);
1990  $wtpl->setVariable("URL_AUTHOR", $author[1]);
1991  $wtpl->parseCurrentBlock();
1992  }
1993 
1994  return $wtpl->get();
1995  }
1996  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
global $ilCtrl
Definition: ilias.php:18
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:
$url
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderNavigationByDate()

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

Build navigation by date block.

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

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

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

Referenced by renderNavigation().

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

◆ renderNavigationByKeywords()

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

Build navigation by keywords block.

Parameters
string$a_list_cmd
bool$a_show_inactive
Returns
string

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

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

Referenced by renderNavigation().

1910  {
1911  $ilCtrl = $this->ctrl;
1912 
1913  $blpg = ($a_blpg > 0)
1914  ? $a_blpg
1915  : $this->blpg;
1916 
1917  $keywords = $this->getKeywords($a_show_inactive, $blpg);
1918  if ($keywords) {
1919  $wtpl = new ilTemplate("tpl.blog_list_navigation_keywords.html", true, true, "Modules/Blog");
1920 
1921  $max = max($keywords);
1922  include_once "Services/Tagging/classes/class.ilTagging.php";
1923 
1924  $wtpl->setCurrentBlock("keyword");
1925  foreach ($keywords as $keyword => $counter) {
1926  if (!$a_link_template) {
1927  $ilCtrl->setParameter($this, "kwd", urlencode($keyword)); // #15885
1928  $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1929  $ilCtrl->setParameter($this, "kwd", "");
1930  } else {
1931  $url = $this->buildExportLink($a_link_template, "keyword", $keyword);
1932  }
1933 
1934  $wtpl->setVariable("TXT_KEYWORD", $keyword);
1935  $wtpl->setVariable("CLASS_KEYWORD", ilTagging::getRelevanceClass($counter, $max));
1936  $wtpl->setVariable("URL_KEYWORD", $url);
1937  $wtpl->parseCurrentBlock();
1938  }
1939 
1940  return $wtpl->get();
1941  }
1942  }
global $ilCtrl
Definition: ilias.php:18
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 2004 of file class.ilObjBlogGUI.php.

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

Referenced by executeCommand(), and preview().

2005  {
2006  global $DIC;
2007 
2008  $toolbar = $DIC->toolbar();
2009  $lng = $DIC->language();
2010  $ctrl = $DIC->ctrl();
2011 
2012  $f = $DIC->ui()->factory();
2013 
2014  $cmd = ($this->prtf_embed)
2015  ? "previewEmbedded"
2016  : "previewFullscreen";
2017 
2018  if ($single_posting) { // single posting view
2019  include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
2020 
2021  $latest_posting = $this->getLatestPosting($a_items);
2022  if ($latest_posting != "" && $this->blpg != $latest_posting) {
2023  $ctrl->setParameterByClass("ilblogpostinggui", "blpg", $latest_posting);
2024  $mb = $f->button()->standard(
2025  $lng->txt("blog_latest_posting"),
2026  $ctrl->getLinkTargetByClass("ilblogpostinggui", $cmd)
2027  );
2028  } else {
2029  $mb = $f->button()->standard($lng->txt("blog_latest_posting"), "#")->withUnavailableAction();
2030  }
2031 
2032  $prev_posting = $this->getPreviousPosting($a_items);
2033  if ($prev_posting != "") {
2034  $ctrl->setParameterByClass("ilblogpostinggui", "blpg", $prev_posting);
2035  $pb = $f->button()->standard(
2036  $lng->txt("previous"),
2037  $ctrl->getLinkTargetByClass("ilblogpostinggui", $cmd)
2038  );
2039  } else {
2040  $pb = $f->button()->standard($lng->txt("previous"), "#")->withUnavailableAction();
2041  }
2042 
2043  $next_posting = $this->getNextPosting($a_items);
2044  if ($next_posting != "") {
2045  $ctrl->setParameterByClass("ilblogpostinggui", "blpg", $next_posting);
2046  $nb = $f->button()->standard(
2047  $lng->txt("next"),
2048  $ctrl->getLinkTargetByClass("ilblogpostinggui", $cmd)
2049  );
2050  } else {
2051  $nb = $f->button()->standard($lng->txt("next"), "#")->withUnavailableAction();
2052  }
2053  $ctrl->setParameter($this, "blpg", $this->blpg);
2054  $vc = $f->viewControl()->section($pb, $mb, $nb);
2055  $toolbar->addComponent($vc);
2056  } else { // month view
2057  include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
2058 
2059  $latest_month = $this->getLatestMonth($a_items);
2060  if ($latest_month != "" && $this->month != $latest_month) {
2061  $ctrl->setParameter($this, "bmn", $latest_month);
2062  $mb = $f->button()->standard(
2063  $lng->txt("blog_latest_posting"),
2064  $ctrl->getLinkTarget($this, "preview")
2065  );
2066  } else {
2067  $mb = $f->button()->standard($lng->txt("blog_latest_posting"), "#")->withUnavailableAction();
2068  }
2069 
2070  $prev_month = $this->getPreviousMonth($a_items);
2071  if ($prev_month != "") {
2072  $ctrl->setParameter($this, "bmn", $prev_month);
2073  $pb = $f->button()->standard($lng->txt("previous"), $ctrl->getLinkTarget($this, "preview"));
2074  } else {
2075  $pb = $f->button()->standard($lng->txt("previous"), "#")->withUnavailableAction();
2076  }
2077 
2078  $next_month = $this->getNextMonth($a_items);
2079  if ($next_month != "") {
2080  $ctrl->setParameter($this, "bmn", $next_month);
2081  $nb = $f->button()->standard($lng->txt("next"), $ctrl->getLinkTarget($this, "preview"));
2082  } else {
2083  $nb = $f->button()->standard($lng->txt("next"), "#")->withUnavailableAction();
2084  }
2085  $ctrl->setParameter($this, "bmn", $this->month);
2086  $vc = $f->viewControl()->section($pb, $mb, $nb);
2087  $toolbar->addComponent($vc);
2088  }
2089  }
getLatestPosting($a_items)
Get previous posting.
getNextPosting($a_items)
Get next posting.
global $DIC
Definition: saml.php:7
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 3294 of file class.ilObjBlogGUI.php.

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

3295  {
3297 
3298  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3299  if ($ilSetting->get("fixed_content_style_id") <= 0 &&
3300  (ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId())
3301  || $this->object->getStyleSheetId() == 0)) {
3302  $this->object->setStyleSheetId((int) $_POST["style_id"]);
3303  $this->object->update();
3304 
3305  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
3306  }
3307  $this->ctrl->redirect($this, "editStyleProperties");
3308  }
static _lookupStandard($a_id)
Lookup standard flag.
global $ilSetting
Definition: privfeed.php:17
$_POST["username"]
+ Here is the call graph for this function:

◆ setContentStyleSheet()

ilObjBlogGUI::setContentStyleSheet (   $a_tpl = null)

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

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

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

3190  {
3191  $tpl = $this->tpl;
3192 
3193  if ($a_tpl != null) {
3194  $ctpl = $a_tpl;
3195  } else {
3196  $ctpl = $tpl;
3197  }
3198 
3199  $ctpl->setCurrentBlock("ContentStyle");
3200  $ctpl->setVariable(
3201  "LOCATION_CONTENT_STYLESHEET",
3202  ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())
3203  );
3204  $ctpl->parseCurrentBlock();
3205  }
static getContentStylePath($a_style_id, $add_random=true)
get content style path
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setNotification()

ilObjBlogGUI::setNotification ( )
protected

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

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

2793  {
2794  $ilUser = $this->user;
2795  $ilCtrl = $this->ctrl;
2796 
2797  include_once "./Services/Notification/classes/class.ilNotification.php";
2798  switch ($this->ntf) {
2799  case 1:
2801  break;
2802 
2803  case 2:
2805  break;
2806  }
2807 
2808  $ilCtrl->redirect($this, "preview");
2809  }
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 202 of file class.ilObjBlogGUI.php.

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

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

203  {
204  global $DIC;
205 
206  $tree = $DIC->repositoryTree();
207  $access = $DIC->access();
208 
209  // general properties
210  $this->tabs_gui->addSubTab(
211  "properties",
212  $this->lng->txt("blog_properties"),
213  $this->ctrl->getLinkTarget($this, 'edit')
214  );
215 
216  $this->tabs_gui->addSubTab(
217  "style",
218  $this->lng->txt("obj_sty"),
219  $this->ctrl->getLinkTarget($this, 'editStyleProperties')
220  );
221 
222  // notification settings for blogs in courses and groups
223  if ($this->id_type == self::REPOSITORY_NODE_ID) {
224  $grp_ref_id = $tree->checkForParentType($this->object->getRefId(), 'grp');
225  $crs_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs');
226 
227  if ((int) $grp_ref_id > 0 || (int) $crs_ref_id > 0) {
228  if ($access->checkAccess('write', '', $this->ref_id)) {
229  $this->tabs_gui->addSubTab(
230  'notifications',
231  $this->lng->txt("notifications"),
232  $this->ctrl->getLinkTargetByClass("ilobjnotificationsettingsgui", '')
233  );
234  }
235  }
236  }
237 
238  $this->tabs_gui->activateSubTab($a_active);
239  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ setTabs()

ilObjBlogGUI::setTabs ( )

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

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

Referenced by executeCommand().

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

◆ updateCustom()

ilObjBlogGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

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

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

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

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

References $a_content.

Referenced by exportHTMLPages().

2635  {
2636  $file = $a_target_directory . "/" . $a_file;
2637  // return if file is already existing
2638  if (@is_file($file)) {
2639  return;
2640  }
2641 
2642  // export template: page content
2643  $ep_tpl = new ilTemplate(
2644  "tpl.export_page.html",
2645  true,
2646  true,
2647  "Modules/Blog"
2648  );
2649  if ($a_back) {
2650  $ep_tpl->setVariable("PAGE_CONTENT", $a_content);
2651  } else {
2652  $ep_tpl->setVariable("LIST", $a_content);
2653  }
2654  unset($a_content);
2655  $a_tpl->setContent($ep_tpl->get());
2656  unset($ep_tpl);
2657 
2658  // template: right content
2659  if ($a_right_content) {
2660  $a_tpl->setRightContent($a_right_content);
2661  unset($a_right_content);
2662  }
2663 
2664  $content = $a_tpl->get(
2665  "DEFAULT",
2666  false,
2667  false,
2668  false,
2669  true,
2670  true,
2671  true
2672  );
2673 
2674  // open file
2675  if (!file_put_contents($file, $content)) {
2676  die("<b>Error</b>: Could not open \"" . $file . "\" for writing" .
2677  " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />");
2678  }
2679 
2680  // set file permissions
2681  chmod($file, 0770);
2682 
2683  return $file;
2684  }
$a_content
Definition: workflow.php:93
special template class to simplify handling of ITX/PEAR
+ Here is the caller graph for this function:

Field Documentation

◆ $apid

ilObjBlogGUI::$apid
protected

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

◆ $author

ilObjBlogGUI::$author
protected

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

Referenced by renderList(), and renderNavigationByAuthors().

◆ $blpg

ilObjBlogGUI::$blpg
protected

◆ $gtp

ilObjBlogGUI::$gtp
protected

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

Referenced by executeCommand().

◆ $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 117 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().

◆ $new_type

ilObjBlogGUI::$new_type
protected

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

◆ $ntf

ilObjBlogGUI::$ntf
protected

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

◆ $old_nr

ilObjBlogGUI::$old_nr
protected

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

◆ $ppage

ilObjBlogGUI::$ppage
protected

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

◆ $prt_id

ilObjBlogGUI::$prt_id
protected

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

◆ $prtf_embed

ilObjBlogGUI::$prtf_embed = false

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

Referenced by renderToolbarNavigation(), and setTabs().

◆ $prvm

ilObjBlogGUI::$prvm
protected

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

◆ $rbacadmin

ilObjBlogGUI::$rbacadmin
protected

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

Referenced by addContributor(), and removeContributor().

◆ $tabs

ilObjBlogGUI::$tabs
protected

◆ $user_page

ilObjBlogGUI::$user_page
protected

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


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