ILIAS  release_4-4 Revision
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...
 
 getExerciseInfo ($a_assignment_id)
 
 downloadExcAssFile ()
 
 downloadExcSubFile ()
 
 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_month, $a_cmd="preview", $a_link_template=null, $a_show_inactive=false)
 Build posting month list. More...
 
 renderNavigation (array $items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
 Build navigation block. 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())
 Centralized method to add contributors. More...
 
 removeContributor ()
 Used in ilContributorTableGUI. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
 deactivateAdmin ()
 
 setContentStyleSheet ($a_tpl=null)
 
 editStyleProperties ()
 
 initStylePropertiesForm ()
 
 createStyle ()
 
 editStyle ()
 
 deleteStyle ()
 
 saveStyleSettings ()
 
 _goto ($a_target)
 Deep link. More...
 
- 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 ()
 
 isVisible ()
 
 trash ()
 
 undelete ()
 
 cancelDelete ()
 
 removeFromSystem ()
 
 cloneAll ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 Deleted in ilObject. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 Import. More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Static Public Member Functions

static lookupSubObjectTitle ($a_blog_id, $a_posting_id)
 Get title for blog posting (used in ilNotesGUI) More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Protected Member Functions

 initCreationForms ($a_new_type)
 
 afterSave (ilObject $a_new_object)
 
 setSettingsSubTabs ($a_active)
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 
 getEditFormCustomValues (array &$a_values)
 
 updateCustom (ilPropertyFormGUI $a_form)
 
 getListItems ()
 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...
 
 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)
 Write HTML to file. More...
 
 finalize ()
 Finalize and submit blog to exercise. More...
 
 addHeaderAction ($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)
 
 mayContribute ($a_posting_id=null, $a_author_id=null)
 Check if user may contribute at all and may edit posting (if given) 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...
 
 prepareOutput ()
 
 setTitleAndDescription ()
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 
 setTargetFrame ($a_cmd, $a_target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 setColumnSettings ($column_gui)
 
 checkPermission ($a_perm, $a_cmd="")
 
 showPossibleSubObjects ()
 
 redirectToRefId ()
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ()
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ()
 Deprecated functions. More...
 
 setReturnLocation ()
 
 showActions ()
 
 getTitlesByRefId ()
 
 getTabs ()
 
 __showButton ()
 
 hitsperpageObject ()
 
 __initTableGUI ()
 
 __setTableGUIBasicData ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget ($a_append=null, $a_center=false)
 
 handleAutoRating (ilObject $a_new_obj)
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 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)
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $month
 
 $items
 
 $keyword
 
 $author
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References $_REQUEST, $ilCtrl, ilObjectGUI\$lng, and buildPostingList().

30  {
31  global $lng, $ilCtrl;
32 
33  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
34 
35  if($this->object)
36  {
37  $this->month = (string)$_REQUEST["bmn"];
38  $this->keyword = (string)$_REQUEST["kwd"];
39  $this->author = (int)$_REQUEST["ath"];
40 
41  // gather postings by month
42  $this->items = $this->buildPostingList($this->object->getId());
43  if($this->items)
44  {
45  // current month (if none given or empty)
46  if(!$this->month || !$this->items[$this->month])
47  {
48  $this->month = array_keys($this->items);
49  $this->month = array_shift($this->month);
50  }
51  }
52 
53  $ilCtrl->setParameter($this, "bmn", $this->month);
54  }
55 
56  $lng->loadLanguageModule("blog");
57  $ilCtrl->saveParameter($this, "prvm");
58  }
global $ilCtrl
Definition: ilias.php:18
buildPostingList($a_obj_id)
Gather all blog postings.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

ilObjBlogGUI::_goto (   $a_target)

Deep link.

Parameters
string$a_target

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

References $_GET, and exit.

2513  {
2514  if(substr($a_target, -3) == "wsp")
2515  {
2516  $id = explode("_", $a_target);
2517 
2518  $_GET["baseClass"] = "ilSharedResourceGUI";
2519  $_GET["wsp_id"] = $id[0];
2520  if(sizeof($id) == 3)
2521  {
2522  $_GET["gtp"] = $id[1];
2523  }
2524  }
2525  else
2526  {
2527  $id = explode("_", $a_target);
2528 
2529  $_GET["baseClass"] = "ilRepositoryGUI";
2530  $_GET["ref_id"] = $id[0];
2531  $_GET["cmd"] = "preview";
2532  if(sizeof($id) == 2)
2533  {
2534  $_GET["gtp"] = $id[1];
2535  }
2536  }
2537 
2538  include("ilias.php");
2539  exit;
2540  }
exit
Definition: login.php:54
$_GET["client_id"]

◆ addContributor()

ilObjBlogGUI::addContributor (   $a_user_ids = array())

Centralized method to add contributors.

Parameters
array$a_user_ids

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

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

Referenced by addUserFromAutoComplete().

2271  {
2272  global $ilCtrl, $lng, $rbacreview, $rbacadmin;
2273 
2274  if(!$this->checkPermissionBool("write"))
2275  {
2276  return;
2277  }
2278 
2279  if(!count($a_user_ids))
2280  {
2281  ilUtil::sendFailure($lng->txt("no_checkbox"));
2282  return $this->contributors();
2283  }
2284 
2285  // get contributor role
2286  $contr_role_id = $this->object->getLocalContributorRole($this->node_id);
2287  if(!$contr_role_id)
2288  {
2289  ilUtil::sendFailure($lng->txt("missing_perm"));
2290  return $this->contributors();
2291  }
2292 
2293  foreach($a_user_ids as $user_id)
2294  {
2295  if(!$rbacreview->isAssigned($user_id, $contr_role_id))
2296  {
2297  $rbacadmin->assignUser($contr_role_id, $user_id);
2298  }
2299  }
2300 
2301  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
2302  $ilCtrl->redirect($this, "contributors");
2303  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addHeaderAction()

ilObjBlogGUI::addHeaderAction (   $a_cmd)
protected

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

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

1937  {
1938  global $ilUser, $ilCtrl;
1939 
1940  // preview?
1941  if($a_cmd == "preview" || $a_cmd == "previewFullscreen" || $_GET["prvm"])
1942  {
1943  // notification
1944  if($ilUser->getId() != ANONYMOUS_USER_ID)
1945  {
1946  if(!$_GET["prvm"])
1947  {
1948  $ilCtrl->setParameter($this, "prvm", "fsc");
1949  }
1950  $this->insertHeaderAction($this->initHeaderAction(null, null, true));
1951  if(!$_GET["prvm"])
1952  {
1953  $ilCtrl->setParameter($this, "prvm", "");
1954  }
1955  }
1956  }
1957  else
1958  {
1959  return parent::addHeaderAction();
1960  }
1961  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
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:

◆ addLocatorItems()

ilObjBlogGUI::addLocatorItems ( )

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

References ilObject2GUI\$node_id.

2169  {
2170  global $ilLocator;
2171 
2172  if (is_object($this->object))
2173  {
2174  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->node_id);
2175  }
2176  }

◆ addToDeskObject()

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

Implements ilDesktopItemHandling.

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

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

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

◆ addUserFromAutoComplete()

ilObjBlogGUI::addUserFromAutoComplete ( )

Autocomplete submit.

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

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

2238  {
2239  global $lng;
2240 
2241  if(!strlen(trim($_POST['user_login'])))
2242  {
2243  ilUtil::sendFailure($lng->txt('msg_no_search_string'));
2244  return $this->contributors();
2245  }
2246  $users = explode(',', $_POST['user_login']);
2247 
2248  $user_ids = array();
2249  foreach($users as $user)
2250  {
2251  $user_id = ilObjUser::_lookupId($user);
2252 
2253  if(!$user_id)
2254  {
2255  ilUtil::sendFailure($lng->txt('user_not_known'));
2256  return $this->contributors();
2257  }
2258 
2259  $user_ids[] = $user_id;
2260  }
2261 
2262  return $this->addContributor($user_ids);
2263  }
$_POST['username']
Definition: cron.php:12
static _lookupId($a_user_str)
lookup id by login
addContributor($a_user_ids=array())
Centralized method to add contributors.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ afterSave()

ilObjBlogGUI::afterSave ( ilObject  $a_new_object)
protected

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

References $ilCtrl, and ilUtil\sendSuccess().

79  {
80  global $ilCtrl;
81 
82  ilUtil::sendSuccess($this->lng->txt("object_added"), true);
83  $ilCtrl->redirect($this, "");
84  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ approve()

ilObjBlogGUI::approve ( )

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

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

2179  {
2180  if($this->checkPermissionBool("write") && (int)$_GET["apid"])
2181  {
2182  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
2183  $post = new ilBlogPosting((int)$_GET["apid"]);
2184  $post->setApproved(true);
2185  $post->update();
2186 
2187  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
2188  }
2189 
2190  $this->ctrl->redirect($this, "render");
2191  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilBlogPosting.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
$_GET["client_id"]
+ Here is the call graph for this function:

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

Referenced by executeCommand(), and getHTML().

954  {
955  $wtpl = new ilTemplate("tpl.blog_embedded.html", true, true, "Modules/Blog");
956  $wtpl->setVariable("VAL_LIST", $a_content);
957  $wtpl->setVariable("VAL_NAVIGATION", $a_nav);
958  return $wtpl->get();
959  }
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 1655 of file class.ilObjBlogGUI.php.

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

Referenced by export().

1656  {
1657  // create export file
1658  include_once("./Services/Export/classes/class.ilExport.php");
1659  ilExport::_createExportDirectory($this->object->getId(), "html", "blog");
1660  $exp_dir = ilExport::_getExportDirectory($this->object->getId(), "html", "blog");
1661 
1662  $subdir = $this->object->getType()."_".$this->object->getId();
1663  $export_dir = $exp_dir."/".$subdir;
1664 
1665  // initialize temporary target directory
1666  ilUtil::delDir($export_dir);
1667  ilUtil::makeDir($export_dir);
1668 
1669  // system style html exporter
1670  include_once("./Services/Style/classes/class.ilSystemStyleHTMLExport.php");
1671  $this->sys_style_html_export = new ilSystemStyleHTMLExport($export_dir);
1672  $this->sys_style_html_export->addImage("icon_blog_b.png");
1673  $this->sys_style_html_export->export();
1674 
1675  // init co page html exporter
1676  include_once("./Services/COPage/classes/class.ilCOPageHTMLExport.php");
1677  $this->co_page_html_export = new ilCOPageHTMLExport($export_dir);
1678  $this->co_page_html_export->setContentStyleId($this->object->getStyleSheetId());
1679  $this->co_page_html_export->createDirectories();
1680  $this->co_page_html_export->exportStyles();
1681  $this->co_page_html_export->exportSupportScripts();
1682 
1683  // banner / profile picture
1684  $blga_set = new ilSetting("blga");
1685  if($blga_set->get("banner"))
1686  {
1687  $banner = $this->object->getImageFullPath();
1688  if($banner)
1689  {
1690  copy($banner, $export_dir."/".basename($banner));
1691  }
1692  }
1693  $ppic = ilObjUser::_getPersonalPicturePath($this->object->getOwner(), "big");
1694  if($ppic)
1695  {
1696  $ppic = array_shift(explode("?", $ppic));
1697  copy($ppic, $export_dir."/".basename($ppic));
1698  }
1699 
1700  // export pages
1701  $this->exportHTMLPages($export_dir);
1702 
1703  // zip everything
1704  if (true)
1705  {
1706  // zip it all
1707  $date = time();
1708  $zip_file = ilExport::_getExportDirectory($this->object->getId(), "html", "blog").
1709  "/".$date."__".IL_INST_ID."__".
1710  $this->object->getType()."_".$this->object->getId().".zip";
1711  ilUtil::zip($export_dir, $zip_file);
1712  ilUtil::delDir($export_dir);
1713  }
1714 
1715  return $zip_file;
1716  }
ILIAS Setting Class.
HTML export class for pages.
HTML export class for system styles.
_createExportDirectory($a_obj_id, $a_export_type="xml", $a_obj_type="")
Create export directory.
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 _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
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 1813 of file class.ilObjBlogGUI.php.

Referenced by exportHTMLPages(), renderList(), and renderNavigation().

1814  {
1815  if($a_type == "list")
1816  {
1817  $a_type = "m";
1818  }
1819  else
1820  {
1821  $a_type = "p";
1822  }
1823  $link = str_replace("{TYPE}", $a_type, $a_template);
1824  return str_replace("{ID}", $a_id, $link);
1825  }
+ 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 1833 of file class.ilObjBlogGUI.php.

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

Referenced by exportHTMLPages().

1834  {
1835  global $ilTabs, $lng;
1836 
1837  $tpl = $this->co_page_html_export->getPreparedMainTemplate();
1838 
1839  $tpl->getStandardTemplate();
1840 
1841  $ilTabs->clearTargets();
1842  if($a_back_url)
1843  {
1844  $ilTabs->setBackTarget($lng->txt("back"), $a_back_url);
1845  }
1846 
1847  $this->renderFullscreenHeader($tpl, $this->object->getOwner(), true);
1848  $tpl->setFrameFixedWidth(true);
1849 
1850  return $tpl;
1851  }
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 1101 of file class.ilObjBlogGUI.php.

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

Referenced by __construct().

1102  {
1103  $author_found = false;
1104 
1105  $items = array();
1106  foreach(ilBlogPosting::getAllPostings($a_obj_id) as $posting)
1107  {
1108  if($this->author && $posting["author"] == $this->author)
1109  {
1110  $author_found = true;
1111  }
1112 
1113  $month = substr($posting["created"]->get(IL_CAL_DATE), 0, 7);
1114  $items[$month][$posting["id"]] = $posting;
1115  }
1116 
1117  if($this->author && !$author_found)
1118  {
1119  $this->author = null;
1120  }
1121 
1122  return $items;
1123  }
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:

◆ contributors()

ilObjBlogGUI::contributors ( )

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

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

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

2199  {
2200  global $ilTabs, $ilToolbar, $ilCtrl, $lng, $tpl;
2201 
2202  if(!$this->checkPermissionBool("write"))
2203  {
2204  return;
2205  }
2206 
2207  $ilTabs->activateTab("contributors");
2208 
2209  // add member
2210  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
2212  $this,
2213  $ilToolbar,
2214  array(
2215  'auto_complete_name' => $lng->txt('user'),
2216  'submit_name' => $lng->txt('add'),
2217  'add_search' => true,
2218  'add_from_container' => $this->node_id
2219  )
2220  );
2221 
2222  $other_roles = $this->object->getRolesWithContribute($this->node_id);
2223  if($other_roles)
2224  {
2225  ilUtil::sendInfo(sprintf($lng->txt("blog_contribute_other_roles"), implode(", ", $other_roles)));
2226  }
2227 
2228  include_once "Modules/Blog/classes/class.ilContributorTableGUI.php";
2229  $tbl = new ilContributorTableGUI($this, "contributors", $this->object->getLocalContributorRole($this->node_id));
2230 
2231  $tpl->setContent($tbl->getHTML());
2232  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array())
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 582 of file class.ilObjBlogGUI.php.

References $_POST, $ilCtrl, $ilUser, and ilUtil\stripSlashes().

583  {
584  global $ilCtrl, $ilUser;
585 
586  $title = trim(ilUtil::stripSlashes($_POST["title"]));
587  if($title)
588  {
589  // create new posting
590  include_once("./Modules/Blog/classes/class.ilBlogPosting.php");
591  $posting = new ilBlogPosting();
592  $posting->setTitle($title);
593  $posting->setBlogId($this->object->getId());
594  $posting->setActive(false);
595  $posting->setAuthor($ilUser->getId());
596  $posting->create();
597 
598  // switch month list to current month (will include new posting)
599  $ilCtrl->setParameter($this, "bmn", date("Y-m"));
600 
601  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $posting->getId());
602  $ilCtrl->redirectByClass("ilblogpostinggui", "edit");
603  }
604  else
605  {
606  $ilCtrl->redirect($this, "render");
607  }
608  }
$_POST['username']
Definition: cron.php:12
Class ilBlogPosting.
global $ilCtrl
Definition: ilias.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ createStyle()

ilObjBlogGUI::createStyle ( )

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

2476  {
2477  $this->ctrl->redirectByClass("ilobjstylesheetgui", "create");
2478  }

◆ deactivateAdmin()

ilObjBlogGUI::deactivateAdmin ( )

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

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

2362  {
2363  if($this->checkPermissionBool("write") && (int)$_GET["apid"])
2364  {
2365  // ilBlogPostingGUI::deactivatePage()
2366  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
2367  $post = new ilBlogPosting((int)$_GET["apid"]);
2368  $post->setApproved(false);
2369  $post->setActive(false);
2370  $post->update(true, false, false);
2371 
2372  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
2373  }
2374 
2375  $this->ctrl->redirect($this, "render");
2376  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilBlogPosting.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
$_GET["client_id"]
+ Here is the call graph for this function:

◆ deleteStyle()

ilObjBlogGUI::deleteStyle ( )

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

2486  {
2487  $this->ctrl->redirectByClass("ilobjstylesheetgui", "delete");
2488  }

◆ disableNotes()

ilObjBlogGUI::disableNotes (   $a_value = false)

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

1932  {
1933  $this->disable_notes = (bool)$a_value;
1934  }

◆ downloadExcAssFile()

ilObjBlogGUI::downloadExcAssFile ( )

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

References $_GET, $file, ilUtil\deliverFile(), and ilExAssignment\getFiles().

799  {
800  if($_GET["ass"] && $_GET["file"])
801  {
802  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
803  $ass = new ilExAssignment((int)$_GET["ass"]);
804 
805  $ass_files = ilExAssignment::getFiles($ass->getExerciseId(), $ass->getId());
806  if (count($ass_files) > 0)
807  {
808  foreach($ass_files as $file)
809  {
810  if($file["name"] == $_GET["file"])
811  {
812  ilUtil::deliverFile($file["fullpath"], $file["name"]);
813  }
814  }
815  }
816  }
817  }
print $file
Exercise assignment.
$_GET["client_id"]
static getFiles($a_exc_id, $a_ass_id)
Get files.
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:

◆ downloadExcSubFile()

ilObjBlogGUI::downloadExcSubFile ( )

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

References $_GET, $ilUser, ilObjUser\_lookupName(), ilObject\_lookupTitle(), ilUtil\deliverFile(), and ilExAssignment\getDeliveredFiles().

820  {
821  global $ilUser;
822 
823  if($_GET["ass"])
824  {
825  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
826  $ass = new ilExAssignment((int)$_GET["ass"]);
827 
828  $submitted = ilExAssignment::getDeliveredFiles($ass->getExerciseId(), $ass->getId(), $ilUser->getId());
829  if (count($submitted) > 0)
830  {
831  $submitted = array_pop($submitted);
832 
833  $user_data = ilObjUser::_lookupName($submitted["user_id"]);
834  $title = ilObject::_lookupTitle($submitted["obj_id"])." - ".
835  $ass->getTitle()." - ".
836  $user_data["firstname"]." ".
837  $user_data["lastname"]." (".
838  $user_data["login"].").zip";
839 
840  ilUtil::deliverFile($submitted["filename"], $title);
841  }
842  }
843  }
static _lookupName($a_user_id)
lookup user name
Exercise assignment.
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
getDeliveredFiles($a_exc_id, $a_ass_id, $a_user_id, $a_filter_empty_filename=false)
was: getDeliveredFiles($a_member_id)
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ editStyle()

ilObjBlogGUI::editStyle ( )

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

2481  {
2482  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
2483  }

◆ editStyleProperties()

ilObjBlogGUI::editStyleProperties ( )

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

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

2403  {
2404  $this->checkPermission("write");
2405 
2406  $this->tabs_gui->activateTab("settings");
2407  $this->setSettingsSubTabs("style");
2408 
2409  $form = $this->initStylePropertiesForm();
2410  $this->tpl->setContent($form->getHTML());
2411  }
checkPermission($a_perm, $a_cmd="")
setSettingsSubTabs($a_active)
+ Here is the call graph for this function:

◆ executeCommand()

ilObjBlogGUI::executeCommand ( )

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

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

251  {
252  global $ilCtrl, $tpl, $ilTabs, $lng, $ilNavigationHistory;
253 
254  // goto link to blog posting
255  if($_GET["gtp"])
256  {
257  $page_id = (int)$_GET["gtp"];
258  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
259  if(ilBlogPosting::exists($this->object_id, $page_id))
260  {
261  // #12312
262  $ilCtrl->setCmdClass("ilblogpostinggui");
263  $_GET["blpg"] = $page_id;
264  $ilCtrl->setCmd("previewFullscreen");
265  }
266  else
267  {
268  ilUtil::sendFailure($lng->txt("blog_posting_not_found"));
269  }
270  }
271 
272  $next_class = $ilCtrl->getNextClass($this);
273  $cmd = $ilCtrl->getCmd();
274 
275  if($this->id_type == self::REPOSITORY_NODE_ID)
276  {
277  $tpl->getStandardTemplate();
278 
279  // add entry to navigation history
280  if(!$this->getCreationMode() &&
281  $this->getAccessHandler()->checkAccess("read", "", $this->node_id))
282  {
283  $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset");
284  $ilNavigationHistory->addItem($this->node_id, $link, "blog");
285  }
286  }
287 
288  switch($next_class)
289  {
290  case 'ilblogpostinggui':
291  // #9680
292  if($this->id_type == self::REPOSITORY_NODE_ID)
293  {
294  $this->setLocator();
295  }
296  else
297  {
298  include_once "Services/Form/classes/class.ilFileInputGUI.php";
300  }
301  $ilTabs->setBackTarget($lng->txt("back"),
302  $ilCtrl->getLinkTarget($this, ""));
303 
305  $this->object->getStyleSheetId(), "blog");
306 
307  include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
308  $bpost_gui = new ilBlogPostingGUI($this->node_id,
309  $this->getAccessHandler(),
310  $_GET["blpg"],
311  $_GET["old_nr"],
312  ($this->object->getNotesStatus() && !$this->disable_notes),
313  $this->mayContribute($_GET["blpg"]),
314  $style_sheet_id);
315 
316  // keep preview mode through notes gui (has its own commands)
317  switch($cmd)
318  {
319  // blog preview
320  case "previewFullscreen":
321  $ilCtrl->setParameter($this, "prvm", "fsc");
322  break;
323 
324  // blog in portfolio
325  case "previewEmbedded":
326  $ilCtrl->setParameter($this, "prvm", "emb");
327  break;
328 
329  // edit
330  default:
331  $this->setContentStyleSheet();
332 
333  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $_GET["blpg"]);
334  $this->tabs_gui->addNonTabbedLink("preview", $lng->txt("blog_preview"),
335  $this->ctrl->getLinkTargetByClass("ilblogpostinggui", "previewFullscreen"));
336  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", "");
337  break;
338  }
339 
340  $ret = $ilCtrl->forwardCommand($bpost_gui);
341  if ($ret != "")
342  {
343  // keep preview mode through notes gui
344  if($_REQUEST["prvm"])
345  {
346  $cmd = "preview".(($_REQUEST["prvm"] == "fsc") ? "Fullscreen" : "Embedded");
347  }
348 
349  // $is_owner = $this->object->getOwner() == $ilUser->getId();
350  $is_owner = $this->mayContribute();
351  $is_active = $bpost_gui->getBlogPosting()->getActive();
352 
353  // do not show inactive postings
354  if(($cmd == "previewFullscreen" || $cmd == "previewEmbedded")
355  && !$is_owner && !$is_active)
356  {
357  $this->ctrl->redirect($this, "preview");
358  }
359 
360  switch($cmd)
361  {
362  // blog preview
363  case "previewFullscreen":
364  $this->addHeaderAction($cmd);
365  $this->filterInactivePostings();
366  $nav = $this->renderNavigation($this->items, "preview", $cmd);
367  $this->renderFullScreen($ret, $nav);
368  break;
369 
370  // blog in portfolio
371  case "previewEmbedded":
372  $this->filterInactivePostings();
373  $nav = $this->renderNavigation($this->items, "gethtml", $cmd);
374  return $this->buildEmbedded($ret, $nav);
375 
376  // ilias/editor
377  default:
378  // infos about draft status / snippet
379  $info = array();
380  if(!$is_active)
381  {
382  // single author blog (owner) in personal workspace
383  if($this->id_type == self::WORKSPACE_NODE_ID)
384  {
385  $info[] = $lng->txt("blog_draft_info");
386  }
387  else
388  {
389  $info[] = $lng->txt("blog_draft_info_contributors");
390  }
391  }
392  if($cmd != "history" && !$bpost_gui->getBlogPosting()->getFirstParagraphText())
393  {
394  $info[] = $lng->txt("blog_new_posting_info");
395  }
396  if($this->object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved())
397  {
398  // #9737
399  $info[] = $lng->txt("blog_posting_edit_approval_info");
400  }
401  if(sizeof($info))
402  {
403  ilUtil::sendInfo(implode("<br />", $info));
404  }
405  // revert to edit cmd to avoid confusion
406  $this->addHeaderAction("render");
407  $tpl->setContent($ret);
408  $nav = $this->renderNavigation($this->items, "render", $cmd, null, $is_owner);
409  $tpl->setRightContent($nav);
410  break;
411  }
412  }
413  break;
414 
415  case "ilinfoscreengui":
416  $this->prepareOutput();
417  $this->infoScreenForward();
418  break;
419 
420  case "ilnotegui":
421  $this->preview();
422  break;
423 
424  case "ilcommonactiondispatchergui":
425  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
427  $this->ctrl->forwardCommand($gui);
428  break;
429 
430  case "ilpermissiongui":
431  $this->prepareOutput();
432  $ilTabs->activateTab("id_permissions");
433  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
434  $perm_gui = new ilPermissionGUI($this);
435  $this->ctrl->forwardCommand($perm_gui);
436  break;
437 
438  case "ilobjectcopygui":
439  include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
440  $cp = new ilObjectCopyGUI($this);
441  $cp->setType("blog");
442  $this->ctrl->forwardCommand($cp);
443  break;
444 
445  case 'ilrepositorysearchgui':
446  $this->prepareOutput();
447  $ilTabs->activateTab("contributors");
448  include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
449  $rep_search = new ilRepositorySearchGUI();
450  $rep_search->setTitle($this->lng->txt("blog_add_contributor"));
451  $rep_search->setCallback($this,'addContributor');
452  $this->ctrl->setReturn($this,'contributors');
453  $ret =& $this->ctrl->forwardCommand($rep_search);
454  break;
455 
456  case 'ilexportgui':
457  $this->prepareOutput();
458  $ilTabs->activateTab("export");
459  include_once("./Services/Export/classes/class.ilExportGUI.php");
460  $exp_gui = new ilExportGUI($this);
461  $exp_gui->addFormat("xml");
462  $exp_gui->addFormat("html", null, $this, "buildExportFile"); // #13419
463  $ret = $ilCtrl->forwardCommand($exp_gui);
464  break;
465 
466  case "ilobjstylesheetgui":
467  include_once ("./Services/Style/classes/class.ilObjStyleSheetGUI.php");
468  $this->ctrl->setReturn($this, "editStyleProperties");
469  $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
470  $style_gui->omitLocator();
471  if ($cmd == "create" || $_GET["new_type"]=="sty")
472  {
473  $style_gui->setCreationMode(true);
474  }
475 
476  if ($cmd == "confirmedDelete")
477  {
478  $this->object->setStyleSheetId(0);
479  $this->object->update();
480  }
481 
482  $ret = $this->ctrl->forwardCommand($style_gui);
483 
484  if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
485  {
486  $style_id = $ret;
487  $this->object->setStyleSheetId($style_id);
488  $this->object->update();
489  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
490  }
491  break;
492 
493  default:
494  if($cmd != "gethtml")
495  {
496  // desktop item handling, must be toggled before header action
497  if($cmd == "addToDesk" || $cmd == "removeFromDesk")
498  {
499  $this->{$cmd."Object"}();
500  if($_GET["prvm"])
501  {
502  $cmd = "preview";
503  }
504  else
505  {
506  $cmd = "render";
507  }
508  $ilCtrl->setCmd($cmd);
509  }
510  $this->addHeaderAction($cmd);
511  }
512  return parent::executeCommand();
513  }
514 
515  return true;
516  }
setLocator()
set Locator
filterInactivePostings()
Filter inactive items from items list.
preview()
Render fullscreen presentation.
GUI class for the workflow of copying objects.
$_GET["client_id"]
Class ilBlogPosting GUI class.
getAccessHandler()
Get access handler.
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Export User Interface Class.
renderNavigation(array $items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build navigation block.
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.
omitLocator($a_omit=true)
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
infoScreenForward()
show information screen
setContentStyleSheet($a_tpl=null)
Class ilObjStyleSheetGUI.
mayContribute($a_posting_id=null, $a_author_id=null)
Check if user may contribute at all and may edit posting (if given)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
setPersonalWorkspaceQuotaCheck($a_value)
addHeaderAction()
Add header action menu.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ export()

ilObjBlogGUI::export ( )

Build and deliver export file.

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

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

937  {
938  $zip = $this->buildExportFile();
939 
940  ilUtil::deliverFile($zip, $this->object->getTitle().".zip", '', false, true);
941  }
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 1727 of file class.ilObjBlogGUI.php.

References $file, $month, ilObjectGUI\$tpl, ilPageObject\_exists(), buildExportLink(), buildExportTemplate(), ilBlogPosting\getAllPostings(), IL_CAL_DATE, renderList(), renderNavigation(), and writeExportFile().

Referenced by buildExportFile().

1728  {
1729  if(!$a_link_template)
1730  {
1731  $a_link_template = "bl{TYPE}_{ID}.html";
1732  }
1733 
1734  if($a_co_page_html_export)
1735  {
1736  $this->co_page_html_export = $a_co_page_html_export;
1737  }
1738 
1739  $nav = $this->renderNavigation($this->items, "", "", $a_link_template);
1740 
1741  // month list
1742  $has_index = false;
1743  foreach(array_keys($this->items) as $month)
1744  {
1745  $file = $this->buildExportLink($a_link_template, "list", $month);
1746  $list = $this->renderList($this->items[$month], $month, "render", $a_link_template);
1747 
1748  if(!$a_tpl_callback)
1749  {
1750  $tpl = $this->buildExportTemplate();
1751  }
1752  else
1753  {
1754  $tpl = call_user_func($a_tpl_callback);
1755  }
1756 
1757  $file = $this->writeExportFile($a_target_directory, $file,
1758  $tpl, $list, $nav);
1759 
1760  if(!$has_index)
1761  {
1762  copy($file, $a_target_directory."/".$a_index_name);
1763  $has_index = true;
1764  }
1765  }
1766 
1767  // single postings
1768  include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
1769  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1770  $pages = ilBlogPosting::getAllPostings($this->object->getId(), 0);
1771  foreach ($pages as $page)
1772  {
1773  if (ilBlogPosting::_exists("blp", $page["id"]))
1774  {
1775  include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
1776  $blp_gui = new ilBlogPostingGUI(0, null, $page["id"]);
1777  $blp_gui->setOutputMode("offline");
1778  $blp_gui->setFullscreenLink("fullscreen.html"); // #12930 - see page.xsl
1779  $blp_gui->add_date = true;
1780  $page_content = $blp_gui->showPage();
1781 
1782  $back = $this->buildExportLink($a_link_template, "list",
1783  substr($page["created"]->get(IL_CAL_DATE), 0, 7));
1784 
1785  $file = $this->buildExportLink($a_link_template, "posting", $page["id"]);
1786 
1787  if(!$a_tpl_callback)
1788  {
1789  $tpl = $this->buildExportTemplate();
1790  }
1791  else
1792  {
1793  $tpl = call_user_func($a_tpl_callback);
1794  }
1795 
1796  $this->writeExportFile($a_target_directory, $file, $tpl,
1797  $page_content, $nav, $back);
1798 
1799  $this->co_page_html_export->collectPageElements("blp:pg", $page["id"]);
1800  }
1801  }
1802  $this->co_page_html_export->exportPageElements();
1803  }
renderList(array $items, $a_month, $a_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build posting month list.
print $file
writeExportFile($a_target_directory, $a_file, $a_tpl, $a_content, $a_right_content=null)
Write HTML to file.
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.
renderNavigation(array $items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build navigation block.
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
buildExportLink($a_template, $a_type, $a_id)
Build static export link.
const IL_CAL_DATE
+ 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 2080 of file class.ilObjBlogGUI.php.

References $month, and ilPageObject\_lookupActive().

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

2081  {
2082  foreach($this->items as $month => $postings)
2083  {
2084  foreach($postings as $id => $item)
2085  {
2086  if(!ilBlogPosting::_lookupActive($id, "blp"))
2087  {
2088  unset($this->items[$month][$id]);
2089  }
2090  else if($this->object->hasApproval() && !$item["approved"])
2091  {
2092  unset($this->items[$month][$id]);
2093  }
2094  }
2095  if(!sizeof($this->items[$month]))
2096  {
2097  unset($this->items[$month]);
2098  }
2099  }
2100 
2101  if($this->items && !isset($this->items[$this->month]))
2102  {
2103  $this->month = array_shift(array_keys($this->items));
2104  }
2105  }
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 2107 of file class.ilObjBlogGUI.php.

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

2108  {
2109  $res = array();
2110  include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
2111  foreach($a_items as $month => $items)
2112  {
2113  foreach($items as $item)
2114  {
2115  if(in_array($a_keyword,
2116  ilBlogPostingGUI::getKeywords($this->obj_id, $item["id"])))
2117  {
2118  $res[] = $item;
2119  }
2120  }
2121  }
2122  return $res;
2123  }
static getKeywords($a_obj_id, $a_posting_id)
+ Here is the call graph for this function:

◆ finalize()

ilObjBlogGUI::finalize ( )
protected

Finalize and submit blog to exercise.

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

References $_GET, $_REQUEST, $ilCtrl, ilObjectGUI\$lng, ilObject\_getAllReferences(), and ilUtil\sendSuccess().

1905  {
1906  global $ilCtrl, $lng;
1907 
1908  // to make exercise gui load assignment
1909  $_GET["ass_id"] = $_REQUEST["ass"];
1910 
1911  // #11173 - ref_id is needed for notifications
1912  $exc_ref_id = array_shift(ilObject::_getAllReferences($_REQUEST["exc"]));
1913 
1914  include_once "Modules/Exercise/classes/class.ilObjExerciseGUI.php";
1915  $exc_gui = new ilObjExerciseGUI(null, $exc_ref_id, true);
1916  $exc_gui->submitBlog($this->node_id);
1917 
1918  ilUtil::sendSuccess($lng->txt("blog_finalized"), true);
1919  $ilCtrl->redirect($this, "render");
1920  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
Class ilObjExerciseGUI.
static _getAllReferences($a_id)
get all reference ids of object
global $ilCtrl
Definition: ilias.php:18
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjBlogGUI::getEditFormCustomValues ( array &  $a_values)
protected

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

154  {
155  if($this->id_type == self::REPOSITORY_NODE_ID)
156  {
157  $a_values["approval"] = $this->object->hasApproval();
158  }
159  $a_values["notes"] = $this->object->getNotesStatus();
160  $a_values["ppic"] = $this->object->hasProfilePicture();
161  $a_values["bg_color"] = $this->object->getBackgroundColor();
162  $a_values["font_color"] = $this->object->getFontColor();
163  $a_values["banner"] = $this->object->getImage();
164  $a_values["rss"] = $this->object->hasRSS();
165  }

◆ getExerciseInfo()

ilObjBlogGUI::getExerciseInfo (   $a_assignment_id)

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

References $file, $ilCtrl, $ilUser, ilObjectGUI\$lng, ilObject\_getAllReferences(), ilLink\_getStaticLink(), ilObject\_lookupTitle(), ilDatePresentation\formatDate(), ilExAssignment\getDeliveredFiles(), ilExAssignment\getFiles(), IL_CAL_DATETIME, ilDatePresentation\setUseRelativeDates(), and ilDatePresentation\useRelativeDates().

Referenced by render().

691  {
692  global $lng, $ilCtrl, $ilUser;
693 
694  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
695  $ass = new ilExAssignment($a_assignment_id);
696  $exercise_id = $ass->getExerciseId();
697  if(!$exercise_id)
698  {
699  return;
700  }
701 
702  // is the assignment still open?
703  $times_up = false;
704  if($ass->getDeadline() && $ass->getDeadline() - time() <= 0)
705  {
706  $times_up = true;
707  }
708 
709  // exercise goto
710  include_once "./Services/Link/classes/class.ilLink.php";
711  $exc_ref_id = array_shift(ilObject::_getAllReferences($exercise_id));
712  $exc_link = ilLink::_getStaticLink($exc_ref_id, "exc");
713 
714  $info = sprintf($lng->txt("blog_exercise_info"),
715  $ass->getTitle(),
716  "<a href=\"".$exc_link."\">".
717  ilObject::_lookupTitle($exercise_id)."</a>");
718 
719  // submit button
720  if(!$times_up)
721  {
722  $ilCtrl->setParameter($this, "exc", $exercise_id);
723  $ilCtrl->setParameter($this, "ass", $a_assignment_id);
724  $submit_link = $ilCtrl->getLinkTarget($this, "finalize");
725  $ilCtrl->setParameter($this, "ass", "");
726  $ilCtrl->setParameter($this, "exc", "");
727  $info .= " <a class=\"submit emphsubmit\" href=\"".$submit_link."\">".$lng->txt("blog_finalize_blog")."</a>";
728  }
729 
730  // submitted files
731  $submitted = ilExAssignment::getDeliveredFiles($exercise_id, $a_assignment_id, $ilUser->getId(), true);
732  if($submitted)
733  {
734  $submitted = array_pop($submitted);
735 
736  $ilCtrl->setParameter($this, "ass", $a_assignment_id);
737  $dl_link = $ilCtrl->getLinkTarget($this, "downloadExcSubFile");
738  $ilCtrl->setParameter($this, "ass", "");
739 
742 
743  $info .= "<br />".sprintf($lng->txt("blog_exercise_submitted_info"),
745  "<a href=\"".$dl_link."\" class=\"submit\">".$lng->txt("download")."</a>");
746 
748  }
749 
750 
751  // work instructions incl. files
752 
753  $tooltip = "";
754 
755  $ass = $ass->getInstruction();
756  if($ass)
757  {
758  $tooltip .= nl2br($ass);
759  }
760 
761  $ass_files = ilExAssignment::getFiles($exercise_id, $a_assignment_id);
762  if (count($ass_files) > 0)
763  {
764  $tooltip .= "<br /><br />";
765 
766  foreach($ass_files as $file)
767  {
768  $ilCtrl->setParameter($this, "ass", $a_assignment_id);
769  $ilCtrl->setParameter($this, "file", urlencode($file["name"]));
770  $dl_link = $ilCtrl->getLinkTarget($this, "downloadExcAssFile");
771  $ilCtrl->setParameter($this, "file", "");
772  $ilCtrl->setParameter($this, "ass", "");
773 
774  $tooltip .= $file["name"].": <a href=\"".$dl_link."\">".
775  $lng->txt("download")."</a>";
776  }
777  }
778 
779  if($tooltip)
780  {
781  $ol_id = "exc_ass_".$a_assignment_id;
782 
783  include_once "Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
784  $overlay = new ilOverlayGUI($ol_id);
785 
786  // overlay
787  $overlay->setAnchor($ol_id."_tr");
788  $overlay->setTrigger($ol_id."_tr", "click", $ol_id."_tr");
789  $overlay->add();
790 
791  $info .= "<div id=\"".$ol_id."_tr\"><a href=\"#\">".$lng->txt("exc_instruction")."</a></div>".
792  "<div id=\"".$ol_id."\" style=\"display:none; padding:10px;\" class=\"ilOverlay\">".$tooltip."</div>";
793  }
794 
795  return "<div>".$info."</div>";
796  }
print $file
Exercise assignment.
const IL_CAL_DATETIME
static getFiles($a_exc_id, $a_ass_id)
Get files.
static setUseRelativeDates($a_status)
set use relative dates
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
static useRelativeDates()
check if relative dates are used
global $ilCtrl
Definition: ilias.php:18
getDeliveredFiles($a_exc_id, $a_ass_id, $a_user_id, $a_filter_empty_filename=false)
was: getDeliveredFiles($a_member_id)
This is a utility class for the yui overlays.
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilObjBlogGUI::getHTML ( )

Return embeddable HTML chunk.

Returns
string

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

References buildEmbedded(), filterInactivePostings(), getListItems(), renderList(), and renderNavigation().

851  {
852  // getHTML() is called by ilRepositoryGUI::show()
853  if($this->id_type == self::REPOSITORY_NODE_ID)
854  {
855  return;
856  }
857 
858  // there is no way to do a permissions check here, we have no wsp
859 
860  $this->filterInactivePostings();
861 
862  $list_items = $this->getListItems();
863 
864  $list = $nav = "";
865  if($list_items)
866  {
867  $list = $this->renderList($list_items, $this->month, "previewEmbedded");
868  $nav = $this->renderNavigation($this->items, "gethtml", "previewEmbedded");
869  }
870 
871  return $this->buildEmbedded($list, $nav);
872  }
renderList(array $items, $a_month, $a_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build posting month list.
filterInactivePostings()
Filter inactive items from items list.
getListItems()
Filter blog postings by month, keyword or author.
renderNavigation(array $items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build navigation block.
buildEmbedded($a_content, $a_nav)
Combine content (list/posting) and navigation to html chunk.
+ 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 1606 of file class.ilObjBlogGUI.php.

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

Referenced by renderNavigation().

1607  {
1608  $keywords = array();
1609  include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
1610  if($a_posting_id)
1611  {
1612  foreach(ilBlogPostingGUI::getKeywords($this->obj_id, $a_posting_id) as $keyword)
1613  {
1614  $keywords[$keyword]++;
1615  }
1616  }
1617  else
1618  {
1619  foreach($this->items as $month => $items)
1620  {
1621  foreach($items as $item)
1622  {
1623  if($a_show_inactive || ilBlogPosting::_lookupActive($item["id"], "blp"))
1624  {
1625  foreach(ilBlogPostingGUI::getKeywords($this->obj_id, $item["id"]) as $keyword)
1626  {
1627  $keywords[$keyword]++;
1628  }
1629  }
1630  }
1631  }
1632  }
1633 
1634  // #15881
1635  $tmp = array();
1636  foreach($keywords as $keyword => $counter)
1637  {
1638  $tmp[] = array("keyword"=>$keyword, "counter"=>$counter);
1639  }
1640  $tmp = ilUtil::sortArray($tmp, "keyword", "ASC");
1641 
1642  $keywords = array();
1643  foreach($tmp as $item)
1644  {
1645  $keywords[$item["keyword"]] = $item["counter"];
1646  }
1647  return $keywords;
1648  }
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:

◆ getListItems()

ilObjBlogGUI::getListItems ( )
protected

Filter blog postings by month, keyword or author.

Returns
array

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

References $items, and $month.

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

880  {
881  if($this->author)
882  {
883  $list_items = array();
884  foreach($this->items as $month => $items)
885  {
886  foreach($items as $id => $item)
887  {
888  if($item["author"] == $this->author)
889  {
890  $list_items[$id] = $item;
891  }
892  }
893  }
894  }
895  else if($this->keyword)
896  {
897  $list_items = $this->filterItemsByKeyword($this->items, $this->keyword);
898  }
899  else
900  {
901  $list_items = $this->items[$this->month];
902  }
903  return $list_items;
904  }
+ Here is the caller graph for this function:

◆ getNotesSubId()

ilObjBlogGUI::getNotesSubId ( )

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

References $_REQUEST.

1923  {
1924  if($_REQUEST["blpg"])
1925  {
1926  return $_REQUEST["blpg"];
1927  }
1928  return 0;
1929  }
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

◆ getType()

ilObjBlogGUI::getType ( )

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

Referenced by renderList().

61  {
62  return "blog";
63  }
+ 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 523 of file class.ilObjBlogGUI.php.

References infoScreenForward().

524  {
525  $this->ctrl->setCmd("showSummary");
526  $this->ctrl->setCmdClass("ilinfoscreengui");
527  $this->infoScreenForward();
528  }
infoScreenForward()
show information screen
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjBlogGUI::infoScreenForward ( )

show information screen

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

References $ilErr, ilObject2GUI\checkPermissionBool(), and ilObject2GUI\getPermanentLinkWidget().

Referenced by executeCommand(), and infoScreen().

534  {
535  global $ilTabs, $ilErr;
536 
537  $ilTabs->activateTab("id_info");
538 
539  if (!$this->checkPermissionBool("visible"))
540  {
541  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
542  }
543 
544  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
545  $info = new ilInfoScreenGUI($this);
546 
547  $info->enablePrivateNotes();
548 
549  if ($this->checkPermissionBool("read"))
550  {
551  $info->enableNews();
552  }
553 
554  // no news editing for files, just notifications
555  $info->enableNewsEditing(false);
556  if ($this->checkPermissionBool("write"))
557  {
558  $news_set = new ilSetting("news");
559  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
560 
561  if ($enable_internal_rss)
562  {
563  $info->setBlockProperty("news", "settings", true);
564  $info->setBlockProperty("news", "public_notifications_option", true);
565  }
566  }
567 
568  // standard meta data
569  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
570 
571  if($this->id_type == self::WORKSPACE_NODE_ID)
572  {
573  $info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget());
574  }
575 
576  $this->ctrl->forwardCommand($info);
577  }
ILIAS Setting Class.
Class ilInfoScreenGUI.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getPermanentLinkWidget($a_append=null, $a_center=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreationForms()

ilObjBlogGUI::initCreationForms (   $a_new_type)
protected

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

66  {
67  $forms = parent::initCreationForms($a_new_type);
68 
69  if($this->id_type == self::WORKSPACE_NODE_ID)
70  {
71  unset($forms[self::CFORM_IMPORT]);
72  unset($forms[self::CFORM_CLONE]);
73  }
74 
75  return $forms;
76  }

◆ initEditCustomForm()

ilObjBlogGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

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

References $file, $ilSetting, $img, ilObjectGUI\$lng, ilPropertyFormGUI\addItem(), ilFormPropertyGUI\setInfo(), ilFileInputGUI\setPersonalWorkspaceQuotaCheck(), and setSettingsSubTabs().

101  {
102  global $lng, $ilSetting;
103 
104  $this->setSettingsSubTabs("properties");
105 
106  if($this->id_type == self::REPOSITORY_NODE_ID)
107  {
108  $appr = new ilCheckboxInputGUI($lng->txt("blog_enable_approval"), "approval");
109  $appr->setInfo($lng->txt("blog_enable_approval_info"));
110  $a_form->addItem($appr);
111  }
112 
113  $notes = new ilCheckboxInputGUI($lng->txt("blog_enable_notes"), "notes");
114  $a_form->addItem($notes);
115 
116  if($ilSetting->get('enable_global_profiles'))
117  {
118  $rss = new ilCheckboxInputGUI($lng->txt("blog_enable_rss"), "rss");
119  $rss->setInfo($lng->txt("blog_enable_rss_info"));
120  $a_form->addItem($rss);
121  }
122 
123  $ppic = new ilCheckboxInputGUI($lng->txt("blog_profile_picture"), "ppic");
124  $a_form->addItem($ppic);
125 
126  $blga_set = new ilSetting("blga");
127  if($blga_set->get("banner"))
128  {
129  include_once "Services/Form/classes/class.ilFileInputGUI.php";
131 
132  $dimensions = " (".$blga_set->get("banner_width")."x".
133  $blga_set->get("banner_height").")";
134 
135  $img = new ilImageFileInputGUI($lng->txt("blog_banner").$dimensions, "banner");
136  $a_form->addItem($img);
137 
138  // show existing file
139  $file = $this->object->getImageFullPath(true);
140  if($file)
141  {
142  $img->setImage($file);
143  }
144  }
145 
146  $bg_color = new ilColorPickerInputGUI($lng->txt("blog_background_color"), "bg_color");
147  $a_form->addItem($bg_color);
148 
149  $font_color = new ilColorPickerInputGUI($lng->txt("blog_font_color"), "font_color");
150  $a_form->addItem($font_color);
151  }
ILIAS Setting Class.
print $file
Color picker form for selecting color hexcodes using yui library.
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
setInfo($a_info)
Set Information Text.
This class represents an image file property in a property form.
global $ilSetting
Definition: privfeed.php:40
setSettingsSubTabs($a_active)
setPersonalWorkspaceQuotaCheck($a_value)
+ 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 1963 of file class.ilObjBlogGUI.php.

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

Referenced by addHeaderAction().

1964  {
1965  global $ilUser, $ilCtrl;
1966 
1967  if(!$this->obj_id)
1968  {
1969  return false;
1970  }
1971 
1972  $sub_type = $sub_id = null;
1973  if($_GET["blpg"])
1974  {
1975  $sub_type = "blp";
1976  $sub_id = $_GET["blpg"];
1977  }
1978 
1979  $lg = parent::initHeaderAction($sub_type, $sub_id);
1980 
1981  if($a_is_preview)
1982  {
1983  $lg->enableComments(false);
1984  $lg->enableNotes(false);
1985  $lg->enableTags(false);
1986 
1987  include_once "./Services/Notification/classes/class.ilNotification.php";
1989  {
1990  $ilCtrl->setParameter($this, "ntf", 1);
1991  $link = $ilCtrl->getLinkTarget($this, "setNotification");
1992  $ilCtrl->setParameter($this, "ntf", "");
1993  $lg->addCustomCommand($link, "blog_notification_toggle_off");
1994 
1995  $lg->addHeaderIcon("not_icon",
1996  ilUtil::getImagePath("notification_on.png"),
1997  $this->lng->txt("blog_notification_activated"));
1998  }
1999  else
2000  {
2001  $ilCtrl->setParameter($this, "ntf", 2);
2002  $link = $ilCtrl->getLinkTarget($this, "setNotification");
2003  $ilCtrl->setParameter($this, "ntf", "");
2004  $lg->addCustomCommand($link, "blog_notification_toggle_on");
2005 
2006  $lg->addHeaderIcon("not_icon",
2007  ilUtil::getImagePath("notification_off.png"),
2008  $this->lng->txt("blog_notification_deactivated"));
2009  }
2010 
2011  // #11758
2012  if($this->mayContribute())
2013  {
2014  $ilCtrl->setParameter($this, "prvm", "");
2015 
2016  $ilCtrl->setParameter($this, "bmn", "");
2017  $ilCtrl->setParameter($this, "blpg", "");
2018  $link = $ilCtrl->getLinkTarget($this, "");
2019  $ilCtrl->setParameter($this, "blpg", $sub_id);
2020  $ilCtrl->setParameter($this, "bmn", $this->month);
2021  $lg->addCustomCommand($link, "blog_edit"); // #11868
2022 
2023  if($sub_id && $this->mayContribute($sub_id))
2024  {
2025  $link = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit");
2026  $lg->addCustomCommand($link, "blog_edit_posting");
2027  }
2028 
2029  $ilCtrl->setParameter($this, "prvm", "fsc");
2030  }
2031 
2032  $ilCtrl->setParameter($this, "ntf", "");
2033  }
2034 
2035  return $lg;
2036  }
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $ilUser
Definition: imgupload.php:15
mayContribute($a_posting_id=null, $a_author_id=null)
Check if user may contribute at all and may edit posting (if given)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initStylePropertiesForm()

ilObjBlogGUI::initStylePropertiesForm ( )

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

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

Referenced by editStyleProperties().

2414  {
2415  global $ilSetting;
2416 
2417  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
2418  $this->lng->loadLanguageModule("style");
2419 
2420  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
2421  $form = new ilPropertyFormGUI();
2422 
2423  $fixed_style = $ilSetting->get("fixed_content_style_id");
2424  $style_id = $this->object->getStyleSheetId();
2425 
2426  if ($fixed_style > 0)
2427  {
2428  $st = new ilNonEditableValueGUI($this->lng->txt("style_current_style"));
2429  $st->setValue(ilObject::_lookupTitle($fixed_style)." (".
2430  $this->lng->txt("global_fixed").")");
2431  $form->addItem($st);
2432  }
2433  else
2434  {
2435  $st_styles = ilObjStyleSheet::_getStandardStyles(true, false,
2436  $_GET["ref_id"]);
2437 
2438  $st_styles[0] = $this->lng->txt("default");
2439  ksort($st_styles);
2440 
2441  if ($style_id > 0)
2442  {
2443  // individual style
2444  if (!ilObjStyleSheet::_lookupStandard($style_id))
2445  {
2446  $st = new ilNonEditableValueGUI($this->lng->txt("style_current_style"));
2447  $st->setValue(ilObject::_lookupTitle($style_id));
2448  $form->addItem($st);
2449 
2450  // delete command
2451  $form->addCommandButton("editStyle", $this->lng->txt("style_edit_style"));
2452  $form->addCommandButton("deleteStyle", $this->lng->txt("style_delete_style"));
2453  }
2454  }
2455 
2456  if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id))
2457  {
2458  $style_sel = new ilSelectInputGUI($this->lng->txt("style_current_style"),
2459  "style_id");
2460  $style_sel->setOptions($st_styles);
2461  $style_sel->setValue($style_id);
2462  $form->addItem($style_sel);
2463 
2464  $form->addCommandButton("saveStyleSettings", $this->lng->txt("save"));
2465  $form->addCommandButton("createStyle", $this->lng->txt("sty_create_ind_style"));
2466  }
2467  }
2468 
2469  $form->setTitle($this->lng->txt("blog_style"));
2470  $form->setFormAction($this->ctrl->getFormAction($this));
2471 
2472  return $form;
2473  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
_getStandardStyles($a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
setOptions($a_options)
Set Options.
_lookupStandard($a_id)
Lookup standard flag.
This class represents a non editable value in a property form.
global $ilSetting
Definition: privfeed.php:40
+ 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 2064 of file class.ilObjBlogGUI.php.

2065  {
2066  // page might be deleted, so setting halt on errors to false
2067  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
2068  $post = new ilBlogPosting($a_posting_id);
2069  if($post->getBlogId() == $a_blog_id)
2070  {
2071  return $post->getTitle();
2072  }
2073  }
Class ilBlogPosting.

◆ mayContribute()

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

Check if user may contribute at all and may edit posting (if given)

Parameters
int$a_posting_id
int$a_author_id
Returns
boolean

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

References $ilUser, and ilObject2GUI\checkPermissionBool().

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

2133  {
2134  global $ilUser;
2135 
2136  // single author blog (owner) in personal workspace
2137  if($this->id_type == self::WORKSPACE_NODE_ID)
2138  {
2139  return $this->checkPermissionBool("write");
2140  }
2141 
2142  if($this->checkPermissionBool("contribute"))
2143  {
2144  // check owner of posting
2145  if($a_posting_id)
2146  {
2147  if(!$a_author_id)
2148  {
2149  include_once "Modules/Blog/classes/class.ilBlogPosting.php";
2150  $post = new ilBlogPosting($a_posting_id);
2151  $a_author_id = $post->getAuthor();
2152  }
2153  if($ilUser->getId() == $a_author_id)
2154  {
2155  return true;
2156  }
2157  else
2158  {
2159  return false;
2160  }
2161  }
2162 
2163  return true;
2164  }
2165  return false;
2166  }
Class ilBlogPosting.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
global $ilUser
Definition: imgupload.php:15
+ 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 909 of file class.ilObjBlogGUI.php.

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

Referenced by executeCommand().

910  {
911  global $lng;
912 
913  if(!$this->checkPermissionBool("read"))
914  {
915  ilUtil::sendInfo($lng->txt("no_permission"));
916  return;
917  }
918 
919  $this->filterInactivePostings();
920 
921  $list_items = $this->getListItems();
922 
923  $list = $nav = "";
924  if($list_items)
925  {
926  $list = $this->renderList($list_items, $this->month, "previewFullscreen");
927  $nav = $this->renderNavigation($this->items, "preview", "previewFullscreen");
928  }
929 
930  $this->renderFullScreen($list, $nav);
931  }
renderList(array $items, $a_month, $a_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build posting month list.
filterInactivePostings()
Filter inactive items from items list.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getListItems()
Filter blog postings by month, keyword or author.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
renderNavigation(array $items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build navigation block.
renderFullScreen($a_content, $a_navigation)
Build fullscreen context.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeContributor()

ilObjBlogGUI::removeContributor ( )

Used in ilContributorTableGUI.

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

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

2309  {
2310  global $ilCtrl, $lng, $rbacadmin;
2311 
2312  $ids = $_POST["id"];
2313 
2314  if(!sizeof($ids))
2315  {
2316  ilUtil::sendFailure($lng->txt("select_one"), true);
2317  $ilCtrl->redirect($this, "contributors");
2318  }
2319 
2320  // get contributor role
2321  $contr_role_id = $this->object->getLocalContributorRole($this->node_id);
2322  if(!$contr_role_id)
2323  {
2324  ilUtil::sendFailure($lng->txt("missing_perm"));
2325  return $this->contributors();
2326  }
2327 
2328  foreach($ids as $user_id)
2329  {
2330  $rbacadmin->deassignUser($contr_role_id, $user_id);
2331  }
2332 
2333  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
2334  $this->ctrl->redirect($this, "contributors");
2335  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
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:

◆ removeFromDeskObject()

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

Implements ilDesktopItemHandling.

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

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

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

◆ render()

ilObjBlogGUI::render ( )

Render object context.

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

References $ilCtrl, $ilUser, ilObjectGUI\$lng, ilObject2GUI\$node_id, ilObjectGUI\$ref_id, ilObjectGUI\$tpl, ilObject2GUI\$tree, ilObject\_getAllReferences(), ilObject2GUI\checkPermissionBool(), ilObjExercise\findUserFiles(), getExerciseInfo(), getListItems(), mayContribute(), renderList(), renderNavigation(), ilUtil\sendInfo(), and setContentStyleSheet().

617  {
618  global $tpl, $ilTabs, $ilCtrl, $lng, $ilToolbar, $ilUser, $tree;
619 
620  if(!$this->checkPermissionBool("read"))
621  {
622  ilUtil::sendInfo($lng->txt("no_permission"));
623  return;
624  }
625 
626  $ilTabs->activateTab("content");
627 
628  // toolbar
629  if($this->mayContribute())
630  {
631  $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "createPosting"));
632 
633  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
634  $title = new ilTextInputGUI($lng->txt("title"), "title");
635  $ilToolbar->addInputItem($title, $lng->txt("title"));
636 
637  $ilToolbar->addFormButton($lng->txt("blog_add_posting"), "createPosting");
638 
639  // exercise blog?
640  include_once "Modules/Exercise/classes/class.ilObjExercise.php";
641  $exercises = ilObjExercise::findUserFiles($ilUser->getId(), $this->node_id);
642  if($exercises)
643  {
644  $info = array();
645  foreach($exercises as $exercise)
646  {
647  // #9988
648  $active_ref = false;
649  foreach(ilObject::_getAllReferences($exercise["obj_id"]) as $ref_id)
650  {
651  if(!$tree->isSaved($ref_id))
652  {
653  $active_ref = true;
654  break;
655  }
656  }
657  if($active_ref)
658  {
659  $part = $this->getExerciseInfo($exercise["ass_id"]);
660  if($part)
661  {
662  $info[] = $part;
663  }
664  }
665  }
666  if(sizeof($info))
667  {
668  ilUtil::sendInfo(implode("<br />", $info));
669  }
670  }
671  }
672 
673  $list_items = $this->getListItems();
674 
675  $list = $nav = "";
676  if($list_items)
677  {
678  // $is_owner = ($this->object->getOwner() == $ilUser->getId());
679  $is_owner = $this->mayContribute();
680  $list = $this->renderList($list_items, $this->month, "preview", null, $is_owner);
681  $nav = $this->renderNavigation($this->items, "render", "preview", null, $is_owner);
682  }
683 
684  $this->setContentStyleSheet();
685 
686  $tpl->setContent($list);
687  $tpl->setRightContent($nav);
688  }
renderList(array $items, $a_month, $a_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build posting month list.
static findUserFiles($a_user_id, $a_filetitle)
Check if given file was assigned.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
static _getAllReferences($a_id)
get all reference ids of object
getListItems()
Filter blog postings by month, keyword or author.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
renderNavigation(array $items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
Build navigation block.
This class represents a text property in a property form.
setContentStyleSheet($a_tpl=null)
global $ilUser
Definition: imgupload.php:15
getExerciseInfo($a_assignment_id)
mayContribute($a_posting_id=null, $a_author_id=null)
Check if user may contribute at all and may edit posting (if given)
+ 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 967 of file class.ilObjBlogGUI.php.

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

Referenced by executeCommand(), and preview().

968  {
969  global $tpl, $ilUser, $ilTabs, $ilLocator;
970 
971  $owner = $this->object->getOwner();
972 
973  $ilTabs->clearTargets();
974  $ilLocator->clearItems();
975  $tpl->setLocator();
976 
977  // back (edit)
978  if($owner == $ilUser->getId())
979  {
980  // from shared/deeplink
981  if($this->id_type == self::WORKSPACE_NODE_ID)
982  {
983  $back = "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&wsp_id=".$this->node_id;
984  }
985  // from editor (#10073)
986  else if($this->mayContribute())
987  {
988  $prvm = $_GET["prvm"];
989  $this->ctrl->setParameter($this, "prvm", "");
990  if(!$_GET["blpg"])
991  {
992  $back = $this->ctrl->getLinkTarget($this, "");
993  }
994  else
995  {
996  $this->ctrl->setParameterByClass("ilblogpostinggui", "bmn", $this->month);
997  $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $_GET["blpg"]);
998  $back = $this->ctrl->getLinkTargetByClass("ilblogpostinggui", "preview");
999  }
1000  $this->ctrl->setParameter($this, "prvm", $prvm);
1001  }
1002  }
1003  // back
1004  else if($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
1005  {
1006  // workspace (always shared)
1007  if($this->id_type == self::WORKSPACE_NODE_ID)
1008  {
1009  $back = "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=".$owner;
1010  }
1011  // contributor
1012  else if($this->mayContribute())
1013  {
1014  $back = $this->ctrl->getLinkTarget($this, "");
1015  }
1016  // listgui / parent container
1017  else
1018  {
1019  global $tree;
1020  $parent_id = $tree->getParentId($this->node_id);
1021  include_once "Services/Link/classes/class.ilLink.php";
1023  }
1024  }
1025  $tpl->setTopBar($back);
1026 
1027  $this->renderFullscreenHeader($tpl, $owner);
1028 
1029  $this->setContentStyleSheet();
1030 
1031  // content
1032  $tpl->setContent($a_content);
1033  $tpl->setRightContent($a_navigation);
1034  $tpl->setFrameFixedWidth(true);
1035 
1036  echo $tpl->show("DEFAULT", true, true);
1037  exit();
1038  }
exit
Definition: login.php:54
renderFullscreenHeader($a_tpl, $a_user_id, $a_export=false)
Render banner, user name.
$_GET["client_id"]
setContentStyleSheet($a_tpl=null)
global $ilUser
Definition: imgupload.php:15
mayContribute($a_posting_id=null, $a_author_id=null)
Check if user may contribute at all and may edit posting (if given)
+ 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 1047 of file class.ilObjBlogGUI.php.

References $t, ilObjUser\_getPersonalPicturePath(), and ilObjUser\_lookupName().

Referenced by buildExportTemplate(), and renderFullScreen().

1048  {
1049  // repository blogs are multi-author
1050  $name = null;
1051  if($this->id_type != self::REPOSITORY_NODE_ID)
1052  {
1053  $name = ilObjUser::_lookupName($a_user_id);
1054  $name = $name["lastname"].", ".($t = $name["title"] ? $t . " " : "").$name["firstname"];
1055  }
1056 
1057  // show banner?
1058  $banner = false;
1059  $blga_set = new ilSetting("blga");
1060  if($blga_set->get("banner"))
1061  {
1062  $banner = $this->object->getImageFullPath();
1063  $banner_width = $blga_set->get("banner_width");
1064  $banner_height = $blga_set->get("banner_height");
1065  if($a_export)
1066  {
1067  $banner = basename($banner);
1068  }
1069  }
1070 
1071  $ppic = null;
1072  if($this->object->hasProfilePicture())
1073  {
1074  $ppic = ilObjUser::_getPersonalPicturePath($a_user_id, "big");
1075  if($a_export)
1076  {
1077  $ppic = basename($ppic);
1078  }
1079  }
1080 
1081  include_once("./Services/User/classes/class.ilUserUtil.php");
1082  $a_tpl->setFullscreenHeader($this->object->getTitle(),
1083  $name,
1084  $ppic,
1085  $banner,
1086  $this->object->getBackgroundColor(),
1087  $this->object->getFontColor(),
1088  $banner_width,
1089  $banner_height,
1090  $a_export);
1091  $a_tpl->setBodyClass("std ilExternal ilBlog");
1092 
1093  }
static _lookupName($a_user_id)
lookup user name
ILIAS Setting Class.
static _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderList()

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

Build posting month list.

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

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

References $author, $ilCtrl, $keyword, ilObjectGUI\$lng, $preview, ilNote\_getNotesOfObject(), ilLink\_getStaticLink(), ilPageObject\_lookupActive(), ilCalendarUtil\_numericMonthToString(), buildExportLink(), ilObject2GUI\checkPermissionBool(), ilDatePresentation\formatDate(), ilObject2GUI\getAccessHandler(), ilUserUtil\getNamePresentation(), ilObject2GUI\getPermanentLinkWidget(), ilBlogPostingGUI\getSnippet(), getType(), IL_CAL_DATE, IL_NOTE_PUBLIC, and mayContribute().

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

1136  {
1137  global $lng, $ilCtrl;
1138 
1139  include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
1140  $wtpl = new ilTemplate("tpl.blog_list.html", true, true, "Modules/Blog");
1141 
1142  // title according to current "filter"/navigation
1143  if($this->keyword)
1144  {
1145  $title = $lng->txt("blog_keyword").": ".$this->keyword;
1146  }
1147  else if($this->author)
1148  {
1149  include_once "Services/User/classes/class.ilUserUtil.php";
1150  $title = $lng->txt("blog_author").": ".ilUserUtil::getNamePresentation($this->author);
1151  }
1152  else
1153  {
1154  include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
1155  $title = ilCalendarUtil::_numericMonthToString((int)substr($a_month, 5)).
1156  " ".substr($a_month, 0, 4);
1157  }
1158  $wtpl->setVariable("TXT_CURRENT_MONTH", $title);
1159 
1160  $can_approve = ($this->object->hasApproval() && $this->checkPermissionBool("write"));
1161  $can_deactivate = $this->checkPermissionBool("write");
1162 
1163  include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
1164  foreach($items as $item)
1165  {
1166  // only published items
1167  $is_active = ilBlogPosting::_lookupActive($item["id"], "blp");
1168  if(!$is_active && !$a_show_inactive)
1169  {
1170  continue;
1171  }
1172 
1173  if(!$a_link_template)
1174  {
1175  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", $this->month);
1176  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $item["id"]);
1177  $preview = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", $a_cmd);
1178  }
1179  else
1180  {
1181  $preview = $this->buildExportLink($a_link_template, "posting", $item["id"]);
1182  }
1183 
1184  // actions
1185  $item_contribute = $this->mayContribute($item["id"], $item["author"]);
1186  if(($item_contribute || $can_approve || $can_deactivate) && !$a_link_template && $a_cmd == "preview")
1187  {
1188  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
1189  $alist = new ilAdvancedSelectionListGUI();
1190  $alist->setId($item["id"]);
1191  $alist->setListTitle($lng->txt("actions"));
1192 
1193  if($is_active && $this->object->hasApproval() && !$item["approved"])
1194  {
1195  if($can_approve)
1196  {
1197  $ilCtrl->setParameter($this, "apid", $item["id"]);
1198  $alist->addItem($lng->txt("blog_approve"), "approve",
1199  $ilCtrl->getLinkTarget($this, "approve"));
1200  $ilCtrl->setParameter($this, "apid", "");
1201  }
1202 
1203  $wtpl->setVariable("APPROVAL", $lng->txt("blog_needs_approval"));
1204  }
1205 
1206  if($item_contribute)
1207  {
1208  $alist->addItem($lng->txt("edit_content"), "edit",
1209  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit"));
1210 
1211  // #11858
1212  if($is_active)
1213  {
1214  $alist->addItem($lng->txt("blog_toggle_draft"), "deactivate",
1215  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deactivatePageToList"));
1216  }
1217  else
1218  {
1219  $alist->addItem($lng->txt("blog_toggle_final"), "activate",
1220  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "activatePageToList"));
1221  }
1222 
1223  $alist->addItem($lng->txt("rename"), "rename",
1224  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edittitle"));
1225  $alist->addItem($lng->txt("blog_edit_keywords"), "keywords",
1226  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editKeywords"));
1227  $alist->addItem($lng->txt("blog_edit_date"), "editdate",
1228  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editdate"));
1229  $alist->addItem($lng->txt("delete"), "delete",
1230  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deleteBlogPostingConfirmationScreen"));
1231  }
1232  else if($can_deactivate)
1233  {
1234  // #10513
1235  if($is_active)
1236  {
1237  $ilCtrl->setParameter($this, "apid", $item["id"]);
1238  $alist->addItem($lng->txt("blog_toggle_draft_admin"), "deactivate",
1239  $ilCtrl->getLinkTarget($this, "deactivateAdmin"));
1240  $ilCtrl->setParameter($this, "apid", "");
1241  }
1242 
1243  $alist->addItem($lng->txt("delete"), "delete",
1244  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deleteBlogPostingConfirmationScreen"));
1245  }
1246 
1247  $wtpl->setCurrentBlock("actions");
1248  $wtpl->setVariable("ACTION_SELECTOR", $alist->getHTML());
1249  $wtpl->parseCurrentBlock();
1250  }
1251 
1252  // comments
1253  if($this->object->getNotesStatus() && !$a_link_template && !$this->disable_notes)
1254  {
1255  // count (public) notes
1256  include_once("Services/Notes/classes/class.ilNote.php");
1257  $count = sizeof(ilNote::_getNotesOfObject($this->obj_id,
1258  $item["id"], "blp", IL_NOTE_PUBLIC));
1259 
1260  if($a_cmd != "preview")
1261  {
1262  $wtpl->setCurrentBlock("comments");
1263  $wtpl->setVariable("TEXT_COMMENTS", $lng->txt("blog_comments"));
1264  $wtpl->setVariable("URL_COMMENTS", $preview);
1265  $wtpl->setVariable("COUNT_COMMENTS", $count);
1266  $wtpl->parseCurrentBlock();
1267  }
1268  /* we disabled comments in edit mode (should always be done via pagegui)
1269  else
1270  {
1271  $hash = ilCommonActionDispatcherGUI::buildAjaxHash(ilCommonActionDispatcherGUI::TYPE_WORKSPACE,
1272  $this->node_id, "blog", $this->obj_id, "blp", $item["id"]);
1273  $notes_link = "#\" onclick=\"".ilNoteGUI::getListCommentsJSCall($hash);
1274  }
1275  */
1276  }
1277 
1278  // permanent link
1279  if($a_cmd != "preview" && $a_cmd != "previewEmbedded")
1280  {
1281  if($this->id_type == self::WORKSPACE_NODE_ID)
1282  {
1283  $goto = $this->getAccessHandler()->getGotoLink($this->node_id, $this->obj_id, "_".$item["id"]);
1284  }
1285  else
1286  {
1287  include_once "Services/Link/classes/class.ilLink.php";
1288  $goto = ilLink::_getStaticLink($this->node_id, $this->getType(), true, "_".$item["id"]);
1289  }
1290  $wtpl->setCurrentBlock("permalink");
1291  $wtpl->setVariable("URL_PERMALINK", $goto);
1292  $wtpl->setVariable("TEXT_PERMALINK", $lng->txt("blog_permanent_link"));
1293  $wtpl->parseCurrentBlock();
1294  }
1295 
1296  $snippet = ilBlogPostingGUI::getSnippet($item["id"]);
1297 
1298  if($snippet)
1299  {
1300  $wtpl->setCurrentBlock("more");
1301  $wtpl->setVariable("URL_MORE", $preview);
1302  $wtpl->setVariable("TEXT_MORE", $lng->txt("blog_list_more"));
1303  $wtpl->parseCurrentBlock();
1304  }
1305 
1306  $wtpl->setCurrentBlock("posting");
1307 
1308  if(!$is_active)
1309  {
1310  $wtpl->setVariable("DRAFT_CLASS", " ilBlogListItemDraft");
1311  }
1312 
1313  $author = "";
1314  if($this->id_type == self::REPOSITORY_NODE_ID)
1315  {
1316  $author_id = $item["author"];
1317  if($author_id)
1318  {
1319  include_once "Services/User/classes/class.ilUserUtil.php";
1320  $author = ilUserUtil::getNamePresentation($author_id)." - ";
1321  }
1322  }
1323 
1324  // title
1325  $wtpl->setVariable("URL_TITLE", $preview);
1326  $wtpl->setVariable("TITLE", $item["title"]);
1327  $wtpl->setVariable("DATETIME", $author.
1328  ilDatePresentation::formatDate($item["created"], IL_CAL_DATE));
1329 
1330  // content
1331  $wtpl->setVariable("CONTENT", $snippet);
1332 
1333  $wtpl->parseCurrentBlock();
1334  }
1335 
1336  // notes
1337  /*
1338  if($a_cmd == "previewFullscreen" && $this->object->getNotesStatus())
1339  {
1340  $wtpl->setVariable("NOTES", $this->getNotesHTML());
1341  }
1342  */
1343 
1344  // permalink
1345  if($a_cmd == "previewFullscreen")
1346  {
1347  $wtpl->setVariable("PERMALINK", $this->getPermanentLinkWidget(null, true));
1348  }
1349 
1350  return $wtpl->get();
1351  }
static getSnippet($a_id)
Get first text paragraph of page.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getAccessHandler()
Get access handler.
getPermanentLinkWidget($a_append=null, $a_center=false)
static _numericMonthToString($a_month, $a_long=true)
numeric month to string
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)
Default behaviour is:
global $ilCtrl
Definition: ilias.php:18
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
const IL_NOTE_PUBLIC
Definition: class.ilNote.php:5
special template class to simplify handling of ITX/PEAR
static formatDate(ilDateTime $date)
Format a date public.
_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)
get all notes related to a specific object
$preview
User interface class for advanced drop-down selection lists.
buildExportLink($a_template, $a_type, $a_id)
Build static export link.
const IL_CAL_DATE
mayContribute($a_posting_id=null, $a_author_id=null)
Check if user may contribute at all and may edit posting (if given)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderNavigation()

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

Build navigation block.

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

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

References $_GET, $author, $ilCtrl, $ilSetting, $keyword, $month, ilObject2GUI\$node_id, ilPageObject\_lookupActive(), ilCalendarUtil\_numericMonthToString(), buildExportLink(), ilTagging\calculateFontSize(), ilUtil\getImagePath(), getKeywords(), ilUserUtil\getNamePresentation(), and mayContribute().

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

1393  {
1394  global $ilCtrl, $ilSetting;
1395 
1396  $max_detail_postings = 10;
1397 
1398  $wtpl = new ilTemplate("tpl.blog_list_navigation.html", true, true,
1399  "Modules/Blog");
1400 
1401  $wtpl->setVariable("NAVIGATION_TITLE", $this->lng->txt("blog_navigation"));
1402 
1403  $ilCtrl->setParameter($this, "blpg", "");
1404 
1405  include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
1406  $counter = 0;
1407  foreach($items as $month => $postings)
1408  {
1409  $month_name = ilCalendarUtil::_numericMonthToString((int)substr($month, 5)).
1410  " ".substr($month, 0, 4);
1411 
1412  if(!$a_link_template)
1413  {
1414  $ilCtrl->setParameter($this, "bmn", $month);
1415  $month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1416  }
1417  else
1418  {
1419  $month_url = $this->buildExportLink($a_link_template, "list", $month);
1420  }
1421 
1422  // list postings for month
1423  if($counter < $max_detail_postings)
1424  {
1425  foreach($postings as $id => $posting)
1426  {
1427  $is_active = ilBlogPosting::_lookupActive($id, "blp");
1428  if(!$is_active && !$a_show_inactive)
1429  {
1430  continue;
1431  }
1432 
1433  $counter++;
1434 
1435  $caption = /* ilDatePresentation::formatDate($posting["created"], IL_CAL_DATETIME).
1436  ", ".*/ $posting["title"];
1437 
1438  if(!$a_link_template)
1439  {
1440  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", $month);
1441  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $id);
1442  $url = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", $a_posting_cmd);
1443  }
1444  else
1445  {
1446  $url = $this->buildExportLink($a_link_template, "posting", $id);
1447  }
1448 
1449  if(!$is_active)
1450  {
1451  $wtpl->setVariable("NAV_ITEM_DRAFT", $this->lng->txt("blog_draft"));
1452  }
1453  else if($this->object->hasApproval() && !$posting["approved"])
1454  {
1455  $wtpl->setVariable("NAV_ITEM_APPROVAL", $this->lng->txt("blog_needs_approval"));
1456  }
1457 
1458  $wtpl->setCurrentBlock("navigation_item");
1459  $wtpl->setVariable("NAV_ITEM_URL", $url);
1460  $wtpl->setVariable("NAV_ITEM_CAPTION", $caption);
1461  $wtpl->parseCurrentBlock();
1462  }
1463 
1464  $wtpl->setCurrentBlock("navigation_month_details");
1465  $wtpl->setVariable("NAV_MONTH", $month_name);
1466  $wtpl->setVariable("URL_MONTH", $month_url);
1467  $wtpl->parseCurrentBlock();
1468  }
1469  // summarized month
1470  else
1471  {
1472  $wtpl->setCurrentBlock("navigation_month");
1473  $wtpl->setVariable("MONTH_NAME", $month_name);
1474  $wtpl->setVariable("URL_MONTH", $month_url);
1475  $wtpl->setVariable("MONTH_COUNT", sizeof($postings));
1476  $wtpl->parseCurrentBlock();
1477  }
1478  }
1479 
1480  $ilCtrl->setParameter($this, "bmn", $this->month);
1481  $ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", "");
1482 
1483 
1484  // authors
1485  if($this->id_type == self::REPOSITORY_NODE_ID)
1486  {
1487  $authors = array();
1488  foreach($this->items as $month => $items)
1489  {
1490  foreach($items as $item)
1491  {
1492  if(($a_show_inactive || ilBlogPosting::_lookupActive($item["id"], "blp")) && $item["author"])
1493  {
1494  $authors[] = $item["author"];
1495  }
1496  }
1497  }
1498 
1499  $authors = array_unique($authors);
1500  if(sizeof($authors) > 1)
1501  {
1502  include_once "Services/User/classes/class.ilUserUtil.php";
1503 
1504  $list = array();
1505  foreach($authors as $user_id)
1506  {
1507  if($user_id)
1508  {
1509  $ilCtrl->setParameter($this, "ath", $user_id);
1510  $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1511  $ilCtrl->setParameter($this, "ath", "");
1512 
1513  $name = ilUserUtil::getNamePresentation($user_id, true);
1514  $idx = trim(strip_tags($name))."///".$user_id; // #10934
1515  $list[$idx] = array($name, $url);
1516  }
1517  }
1518  ksort($list);
1519 
1520  $wtpl->setVariable("AUTHORS_TITLE", $this->lng->txt("blog_authors"));
1521 
1522  $wtpl->setCurrentBlock("author");
1523  foreach($list as $author)
1524  {
1525  $wtpl->setVariable("TXT_AUTHOR", $author[0]);
1526  $wtpl->setVariable("URL_AUTHOR", $author[1]);
1527  $wtpl->parseCurrentBlock();
1528  }
1529  }
1530  }
1531 
1532  if(!$a_link_template)
1533  {
1534  // keywords
1535  $may_edit_keywords = ($_GET["blpg"] && $this->mayContribute($_GET["blpg"]) &&
1536  !$a_link_template && $a_list_cmd != "preview" && $a_list_cmd != "gethtml");
1537  $keywords = $this->getKeywords($a_show_inactive, $_GET["blpg"]);
1538  if($keywords || $may_edit_keywords)
1539  {
1540  $wtpl->setVariable("KEYWORDS_TITLE", $this->lng->txt("blog_keywords"));
1541 
1542  if($keywords)
1543  {
1544  $max = max($keywords);
1545  include_once "Services/Tagging/classes/class.ilTagging.php";
1546 
1547  $wtpl->setCurrentBlock("keyword");
1548  foreach($keywords as $keyword => $counter)
1549  {
1550  $ilCtrl->setParameter($this, "kwd", urlencode($keyword)); // #15885
1551  $url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
1552  $ilCtrl->setParameter($this, "kwd", "");
1553 
1554  $wtpl->setVariable("TXT_KEYWORD", $keyword);
1555  $wtpl->setVariable("SIZE_KEYWORD", ilTagging::calculateFontSize($counter, $max));
1556  $wtpl->setVariable("URL_KEYWORD", $url);
1557  $wtpl->parseCurrentBlock();
1558  }
1559  }
1560  else
1561  {
1562  $wtpl->setVariable("TXT_NO_KEYWORDS", $this->lng->txt("blog_no_keywords"));
1563  }
1564 
1565  if($may_edit_keywords)
1566  {
1567  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $_GET["blpg"]);
1568  $wtpl->setVariable("URL_EDIT_KEYWORDS",
1569  $ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editKeywords"));
1570  $ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", "");
1571  $wtpl->setVariable("TXT_EDIT_KEYWORDS", $this->lng->txt("blog_edit_keywords"));
1572  }
1573  }
1574 
1575  // rss
1576  if($this->object->hasRSS() &&
1577  $ilSetting->get('enable_global_profiles') &&
1578  $a_list_cmd == "preview")
1579  {
1580  // #10827
1581  $blog_id = $this->node_id;
1582  if($this->id_type != self::WORKSPACE_NODE_ID)
1583  {
1584  $blog_id .= "_cll";
1585  }
1586  $url = ILIAS_HTTP_PATH."/feed.php?blog_id=".$blog_id.
1587  "&client_id=".rawurlencode(CLIENT_ID);
1588 
1589  $wtpl->setCurrentBlock("rss");
1590  $wtpl->setVariable("URL_RSS", $url);
1591  $wtpl->setVariable("IMG_RSS", ilUtil::getImagePath("rss.png"));
1592  $wtpl->parseCurrentBlock();
1593  }
1594  }
1595 
1596  return $wtpl->get();
1597  }
$_GET["client_id"]
static calculateFontSize($cnt, $max)
Returns 100(%) for 1 and 150(%) for $max y = a + mx 100 = a + m (1) 150 = a + m * max (2) (1): a = 10...
static _numericMonthToString($a_month, $a_long=true)
numeric month to string
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)
Default behaviour is:
global $ilCtrl
Definition: ilias.php:18
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
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.
global $ilSetting
Definition: privfeed.php:40
mayContribute($a_posting_id=null, $a_author_id=null)
Check if user may contribute at all and may edit posting (if given)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveStyleSettings()

ilObjBlogGUI::saveStyleSettings ( )

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

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

2491  {
2492  global $ilSetting;
2493 
2494  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
2495  if ($ilSetting->get("fixed_content_style_id") <= 0 &&
2496  (ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId())
2497  || $this->object->getStyleSheetId() == 0))
2498  {
2499  $this->object->setStyleSheetId(ilUtil::stripSlashes($_POST["style_id"]));
2500  $this->object->update();
2501 
2502  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
2503  }
2504  $this->ctrl->redirect($this, "editStyleProperties");
2505  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
_lookupStandard($a_id)
Lookup standard flag.
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ setContentStyleSheet()

ilObjBlogGUI::setContentStyleSheet (   $a_tpl = null)

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

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

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

2384  {
2385  global $tpl;
2386 
2387  if ($a_tpl != null)
2388  {
2389  $ctpl = $a_tpl;
2390  }
2391  else
2392  {
2393  $ctpl = $tpl;
2394  }
2395 
2396  $ctpl->setCurrentBlock("ContentStyle");
2397  $ctpl->setVariable("LOCATION_CONTENT_STYLESHEET",
2398  ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
2399  $ctpl->parseCurrentBlock();
2400  }
getContentStylePath($a_style_id)
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 2038 of file class.ilObjBlogGUI.php.

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

2039  {
2040  global $ilUser, $ilCtrl;
2041 
2042  include_once "./Services/Notification/classes/class.ilNotification.php";
2043  switch($_GET["ntf"])
2044  {
2045  case 1:
2047  break;
2048 
2049  case 2:
2051  break;
2052  }
2053 
2054  $ilCtrl->redirect($this, "preview");
2055  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ setSettingsSubTabs()

ilObjBlogGUI::setSettingsSubTabs (   $a_active)
protected

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

Referenced by editStyleProperties(), and initEditCustomForm().

87  {
88  // general properties
89  $this->tabs_gui->addSubTab("properties",
90  $this->lng->txt("blog_properties"),
91  $this->ctrl->getLinkTarget($this, 'edit'));
92 
93  $this->tabs_gui->addSubTab("style",
94  $this->lng->txt("obj_sty"),
95  $this->ctrl->getLinkTarget($this, 'editStyleProperties'));
96 
97  $this->tabs_gui->activateSubTab($a_active);
98  }
+ Here is the caller graph for this function:

◆ setTabs()

ilObjBlogGUI::setTabs ( )

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

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

195  {
196  global $lng, $ilHelp;
197 
198  if($this->id_type == self::WORKSPACE_NODE_ID)
199  {
200  $this->ctrl->setParameter($this,"wsp_id",$this->node_id);
201  }
202 
203  $ilHelp->setScreenIdComponent("blog");
204 
205  if ($this->checkPermissionBool("read"))
206  {
207  $this->tabs_gui->addTab("content",
208  $lng->txt("content"),
209  $this->ctrl->getLinkTarget($this, ""));
210  }
211 
212  if ($this->checkPermissionBool("read"))
213  {
214  $this->tabs_gui->addTab("id_info",
215  $lng->txt("info_short"),
216  $this->ctrl->getLinkTargetByClass(array("ilobjbloggui", "ilinfoscreengui"), "showSummary"));
217  }
218 
219  if ($this->checkPermissionBool("write"))
220  {
221  $this->tabs_gui->addTab("settings",
222  $lng->txt("settings"),
223  $this->ctrl->getLinkTarget($this, "edit"));
224 
225  if($this->id_type == self::REPOSITORY_NODE_ID)
226  {
227  $this->tabs_gui->addTab("contributors",
228  $lng->txt("blog_contributors"),
229  $this->ctrl->getLinkTarget($this, "contributors"));
230  }
231 
232  if($this->id_type == self::REPOSITORY_NODE_ID)
233  {
234  $this->tabs_gui->addTab("export",
235  $lng->txt("export"),
236  $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
237  }
238  }
239 
240  if($this->mayContribute())
241  {
242  $this->tabs_gui->addNonTabbedLink("preview", $lng->txt("blog_preview"),
243  $this->ctrl->getLinkTarget($this, "preview"));
244  }
245 
246  // will add permissions if needed
247  parent::setTabs();
248  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
mayContribute($a_posting_id=null, $a_author_id=null)
Check if user may contribute at all and may edit posting (if given)
+ Here is the call graph for this function:

◆ updateCustom()

ilObjBlogGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

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

References ilPropertyFormGUI\getInput(), and ilPropertyFormGUI\getItemByPostVar().

168  {
169  if($this->id_type == self::REPOSITORY_NODE_ID)
170  {
171  $this->object->setApproval($a_form->getInput("approval"));
172  }
173  $this->object->setNotesStatus($a_form->getInput("notes"));
174  $this->object->setProfilePicture($a_form->getInput("ppic"));
175  $this->object->setBackgroundColor($a_form->getInput("bg_color"));
176  $this->object->setFontColor($a_form->getInput("font_color"));
177  $this->object->setRSS($a_form->getInput("rss"));
178 
179  // banner field is optional
180  $banner = $a_form->getItemByPostVar("banner");
181  if($banner)
182  {
183  if($_FILES["banner"]["tmp_name"])
184  {
185  $this->object->uploadImage($_FILES["banner"]);
186  }
187  else if($banner->getDeletionFlag())
188  {
189  $this->object->deleteImage();
190  }
191  }
192  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
+ Here is the call graph for this function:

◆ writeExportFile()

ilObjBlogGUI::writeExportFile (   $a_target_directory,
  $a_file,
  $a_tpl,
  $a_content,
  $a_right_content = null 
)
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 1863 of file class.ilObjBlogGUI.php.

References $file.

Referenced by exportHTMLPages().

1864  {
1865  $file = $a_target_directory."/".$a_file;
1866  // return if file is already existing
1867  if (@is_file($file))
1868  {
1869  return;
1870  }
1871 
1872  // export template: page content
1873  $ep_tpl = new ilTemplate("tpl.export_page.html", true, true,
1874  "Modules/Blog");
1875  $ep_tpl->setVariable("PAGE_CONTENT", $a_content);
1876 
1877  // export template: right content
1878  if($a_right_content)
1879  {
1880  $ep_tpl->setVariable("RIGHT_CONTENT", $a_right_content);
1881  }
1882 
1883  $a_tpl->setContent($ep_tpl->get());
1884 
1885  $content = $a_tpl->get("DEFAULT", false, false, false,
1886  true, true, true);
1887 
1888  // open file
1889  if (!file_put_contents($file, $content))
1890  {
1891  die ("<b>Error</b>: Could not open \"".$file."\" for writing".
1892  " in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
1893  }
1894 
1895  // set file permissions
1896  chmod($file, 0770);
1897 
1898  return $file;
1899  }
print $file
special template class to simplify handling of ITX/PEAR
+ Here is the caller graph for this function:

Field Documentation

◆ $author

ilObjBlogGUI::$author
protected

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

Referenced by renderList(), and renderNavigation().

◆ $items

ilObjBlogGUI::$items
protected

◆ $keyword

ilObjBlogGUI::$keyword
protected

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

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

◆ $month


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