ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjBlogGUI Class Reference

Class ilObjBlogGUI. More...

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

Public Member Functions

 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor.
 getType ()
 Functions that must be overwritten.
 setTabs ()
 create tabs (repository/workspace switch)
 executeCommand ()
 execute command
 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
 infoScreenForward ()
 show information screen
 createPosting ()
 Create new posting.
 render ()
 Render object context.
 getExerciseInfo ($a_assignment_id)
 downloadExcAssFile ()
 downloadExcSubFile ()
 getHTML ()
 Return embeddable HTML chunk.
 preview ()
 Render fullscreen presentation.
 export ()
 Build and deliver export file.
 renderFullScreen ($a_content, $a_navigation)
 Build fullscreen context.
 renderList (array $items, $a_month, $a_cmd="preview", $a_link_template=null, $a_show_inactive=false)
 Build posting month list.
 renderNavigation (array $items, $a_list_cmd="render", $a_posting_cmd="preview", $a_link_template=null, $a_show_inactive=false)
 Build navigation block.
 getKeywords ($a_show_inactive, $a_posting_id=null)
 Get keywords for single posting or complete blog.
 buildExportFile ()
 Build export file.
 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.
 getNotesSubId ()
 disableNotes ($a_value=false)
 addLocatorItems ()
 Functions to be overwritten.
 approve ()
 contributors ()
 addContributorContainer ()
 addContributorContainerAction ()
 Used in ilContributorTableGUI.
 addUserFromAutoComplete ()
 Autocomplete submit.
 addContributor ($a_user_ids=array())
 Centralized method to add contributors.
 removeContributor ()
 Used in ilContributorTableGUI.
 addToDeskObject ()
 removeFromDeskObject ()
 deactivateAdmin ()
 _goto ($a_target)
 Deep link.
- Public Member Functions inherited from ilObject2GUI
 delete ()
 Display delete confirmation form (repository/workspace switch)
 confirmedDelete ()
 Delete objects (repository/workspace switch)
 withReferences ()
 Final/Private declaration of unchanged parent methods.
 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
 getCreationMode ()
 get creation mode
 isVisible ()
 trash ()
 undelete ()
 cancelDelete ()
 removeFromSystem ()
 cloneAll ()
 view ()
 view object content (repository/workspace switch)
 create ()
 Deleted in ilObject.
 save ()
 edit ()
 update ()
 cancel ()
 importFile ()
 Import.
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 saveObject ()
 save object
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.

Static Public Member Functions

static lookupSubObjectTitle ($a_blog_id, $a_posting_id)
 Get title for blog posting (used in ilNotesGUI)

Protected Member Functions

 initCreationForms ($a_new_type)
 Init creation froms.
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 getListItems ()
 Filter blog postings by month, keyword or author.
 buildEmbedded ($a_content, $a_nav)
 Combine content (list/posting) and navigation to html chunk.
 renderFullscreenHeader ($a_tpl, $a_user_id, $a_export=false)
 Render banner, user name.
 buildPostingList ($a_obj_id)
 Gather all blog postings.
 buildExportLink ($a_template, $a_type, $a_id)
 Build static export link.
 buildExportTemplate ($a_back_url="")
 Build export "frame".
 writeExportFile ($a_target_directory, $a_file, $a_tpl, $a_content, $a_right_content=null)
 Write HTML to file.
 finalize ()
 Finalize and submit blog to exercise.
 addHeaderAction ($a_cmd)
 initHeaderAction ($sub_type=null, $sub_id=null, $a_is_preview=false)
 setNotification ()
 filterInactivePostings ()
 Filter inactive items from items list.
 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)
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here.
 assignObject ()
 create object instance as internal property (repository/workspace switch)
 getAccessHandler ()
 Get access handler.
 setLocator ()
 set Locator
 deleteConfirmation ()
 Display delete confirmation form (workspace specific)
 deleteConfirmedObjects ()
 Delete objects (workspace specific)
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 omitLocator ($a_omit=true)
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 redirectToRefId ()
 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.
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 searchCloneSource ()
 buildCloneSelect ($existing_objs)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 getReturnLocation ()
 Deprecated functions.
 setReturnLocation ()
 showActions ()
 getTitlesByRefId ()
 getTabs ()
 __showButton ()
 hitsperpageObject ()
 __initTableGUI ()
 __setTableGUIBasicData ()
 __showClipboardTable ()
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission.
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 redrawHeaderAction ()
 Updating icons after ajax call.
 getPermanentLinkWidget ($a_append=null, $a_center=false)
- Protected Member Functions inherited from ilObjectGUI
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 setAdminTabs ()
 set admin tabs public
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initCreateForm ($a_new_type)
 Init object creation form.
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 initEditForm ()
 Init object edit form.
 getEditFormValues ()
 Get values for edit form.
 afterUpdate ()
 Post (successful) object update hook.
 initImportForm ($a_new_type)
 Init object import form.
 importFileObject ($parent_id=null)
 Import.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 getTabs (&$tabs_gui)
 get tabs abstract method.
 __showButton ($a_cmd, $a_text, $a_target= '')
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 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
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error.

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

Detailed Description

Constructor & Destructor Documentation

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

Constructor.

Parameters
int$a_id
int$a_id_type
int$a_parent_node_id

Reimplemented from ilObject2GUI.

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

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

{
global $lng, $ilCtrl;
parent::__construct($a_id, $a_id_type, $a_parent_node_id);
if($this->object)
{
$this->month = (string)$_REQUEST["bmn"];
$this->keyword = (string)$_REQUEST["kwd"];
$this->author = (int)$_REQUEST["ath"];
// gather postings by month
$this->items = $this->buildPostingList($this->object->getId());
if($this->items)
{
// current month (if none given or empty)
if(!$this->month || !$this->items[$this->month])
{
$this->month = array_keys($this->items);
$this->month = array_shift($this->month);
}
}
$ilCtrl->setParameter($this, "bmn", $this->month);
}
$lng->loadLanguageModule("blog");
$ilCtrl->saveParameter($this, "prvm");
}

+ Here is the call graph for this function:

Member Function Documentation

ilObjBlogGUI::_goto (   $a_target)

Deep link.

Parameters
string$a_target

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

References $_GET, and exit.

{
if(substr($a_target, -3) == "wsp")
{
$id = explode("_", $a_target);
$_GET["baseClass"] = "ilSharedResourceGUI";
$_GET["wsp_id"] = $id[0];
if(sizeof($id) == 3)
{
$_GET["gtp"] = $id[1];
}
}
else
{
$id = explode("_", $a_target);
$_GET["baseClass"] = "ilRepositoryGUI";
$_GET["ref_id"] = $id[0];
$_GET["cmd"] = "preview";
if(sizeof($id) == 2)
{
$_GET["gtp"] = $id[1];
}
}
include("ilias.php");
}
ilObjBlogGUI::addContributor (   $a_user_ids = array())

Centralized method to add contributors.

Parameters
array$a_user_ids

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

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

Referenced by addContributorContainerAction(), and addUserFromAutoComplete().

{
global $ilCtrl, $lng, $rbacreview, $rbacadmin;
if(!$this->checkPermissionBool("write"))
{
return;
}
if(!count($a_user_ids))
{
ilUtil::sendFailure($lng->txt("no_checkbox"));
return $this->contributors();
}
// get contributor role
$contr_role_id = $this->object->getLocalContributorRole($this->node_id);
if(!$contr_role_id)
{
ilUtil::sendFailure($lng->txt("missing_perm"));
return $this->contributors();
}
foreach($a_user_ids as $user_id)
{
if(!$rbacreview->isAssigned($user_id, $contr_role_id))
{
$rbacadmin->assignUser($contr_role_id, $user_id);
}
}
ilUtil::sendSuccess($lng->txt("settings_saved"), true);
$ilCtrl->redirect($this, "contributors");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBlogGUI::addContributorContainer ( )

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

References $ilCtrl, ilObjectGUI\$tpl, and ilObject2GUI\checkPermissionBool().

{
global $ilTabs, $ilCtrl, $tpl;
if(!$this->checkPermissionBool("write"))
{
return;
}
$ilTabs->activateTab("contributors");
$members = $this->object->getParentMemberIds($this->node_id);
if(!$members)
{
$ilCtrl->redirect($this, "contributors");
}
include_once "Modules/Blog/classes/class.ilContributorTableGUI.php";
$tbl = new ilContributorTableGUI($this, "addContributorContainer",
$this->object->getLocalContributorRole($this->node_id), $members);
$tpl->setContent($tbl->getHTML());
}

+ Here is the call graph for this function:

ilObjBlogGUI::addContributorContainerAction ( )

Used in ilContributorTableGUI.

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

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

{
global $ilCtrl, $lng;
$ids = $_POST["id"];
if(!sizeof($ids))
{
ilUtil::sendFailure($lng->txt("select_one"), true);
$ilCtrl->redirect($this, "addContributorContainer");
}
return $this->addContributor($ids);
}

+ Here is the call graph for this function:

ilObjBlogGUI::addHeaderAction (   $a_cmd)
protected

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

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

{
global $ilUser, $ilCtrl;
// preview?
if($a_cmd == "preview" || $_GET["prvm"])
{
// notification
if($ilUser->getId() != ANONYMOUS_USER_ID)
{
if(!$_GET["prvm"])
{
$ilCtrl->setParameter($this, "prvm", "fsc");
}
$this->insertHeaderAction($this->initHeaderAction(null, null, true));
if(!$_GET["prvm"])
{
$ilCtrl->setParameter($this, "prvm", "");
}
}
}
else
{
}
}

+ Here is the call graph for this function:

ilObjBlogGUI::addLocatorItems ( )

Functions to be overwritten.

Reimplemented from ilObject2GUI.

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

References ilObject2GUI\$node_id.

{
global $ilLocator;
if (is_object($this->object))
{
$ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->node_id);
}
}
ilObjBlogGUI::addToDeskObject ( )
See Also
ilDesktopItemHandling::addToDesk()

Implements ilDesktopItemHandling.

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

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

{
global $lng;
include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
ilUtil::sendSuccess($lng->txt("added_to_desktop"));
}

+ Here is the call graph for this function:

ilObjBlogGUI::addUserFromAutoComplete ( )

Autocomplete submit.

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

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

{
global $lng;
if(!strlen(trim($_POST['user_login'])))
{
ilUtil::sendFailure($lng->txt('msg_no_search_string'));
return $this->contributors();
}
$users = explode(',', $_POST['user_login']);
$user_ids = array();
foreach($users as $user)
{
$user_id = ilObjUser::_lookupId($user);
if(!$user_id)
{
ilUtil::sendFailure($lng->txt('user_not_known'));
return $this->contributors();
}
$user_ids[] = $user_id;
}
return $this->addContributor($user_ids);
}

+ Here is the call graph for this function:

ilObjBlogGUI::afterSave ( ilObject  $a_new_object)
protected

Post (successful) object creation hook.

Parameters
ilObject$a_new_object

Reimplemented from ilObjectGUI.

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

References $ilCtrl, and ilUtil\sendSuccess().

{
global $ilCtrl;
ilUtil::sendSuccess($this->lng->txt("object_added"), true);
$ilCtrl->redirect($this, "");
}

+ Here is the call graph for this function:

ilObjBlogGUI::approve ( )

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

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

{
if($this->checkPermissionBool("write") && (int)$_GET["apid"])
{
include_once "Modules/Blog/classes/class.ilBlogPosting.php";
$post = new ilBlogPosting((int)$_GET["apid"]);
$post->setApproved(true);
$post->update();
ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
}
$this->ctrl->redirect($this, "render");
}

+ Here is the call graph for this function:

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

Referenced by executeCommand(), and getHTML().

{
$wtpl = new ilTemplate("tpl.blog_embedded.html", true, true, "Modules/Blog");
$wtpl->setVariable("VAL_LIST", $a_content);
$wtpl->setVariable("VAL_NAVIGATION", $a_nav);
return $wtpl->get();
}

+ Here is the caller graph for this function:

ilObjBlogGUI::buildExportFile ( )

Build export file.

Returns
string

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

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

Referenced by export().

{
// create export file
include_once("./Services/Export/classes/class.ilExport.php");
ilExport::_createExportDirectory($this->object->getId(), "html", "blog");
$exp_dir = ilExport::_getExportDirectory($this->object->getId(), "html", "blog");
$subdir = $this->object->getType()."_".$this->object->getId();
$export_dir = $exp_dir."/".$subdir;
// initialize temporary target directory
ilUtil::delDir($export_dir);
ilUtil::makeDir($export_dir);
// system style html exporter
include_once("./Services/Style/classes/class.ilSystemStyleHTMLExport.php");
$this->sys_style_html_export = new ilSystemStyleHTMLExport($export_dir);
$this->sys_style_html_export->addImage("icon_blog_b.png");
$this->sys_style_html_export->export();
// init co page html exporter
include_once("./Services/COPage/classes/class.ilCOPageHTMLExport.php");
$this->co_page_html_export = new ilCOPageHTMLExport($export_dir);
$this->co_page_html_export->createDirectories();
$this->co_page_html_export->exportStyles();
$this->co_page_html_export->exportSupportScripts();
// banner / profile picture
$blga_set = new ilSetting("blga");
if($blga_set->get("banner"))
{
$banner = $this->object->getImageFullPath();
copy($banner, $export_dir."/".basename($banner));
}
$ppic = ilObjUser::_getPersonalPicturePath($this->object->getOwner(), "big");
if($ppic)
{
$ppic = array_shift(explode("?", $ppic));
copy($ppic, $export_dir."/".basename($ppic));
}
// export pages
$this->exportHTMLPages($export_dir);
// zip everything
if (true)
{
// zip it all
$date = time();
$zip_file = ilExport::_getExportDirectory($this->object->getId(), "html", "blog").
"/".$date."__".IL_INST_ID."__".
$this->object->getType()."_".$this->object->getId().".zip";
ilUtil::zip($export_dir, $zip_file);
ilUtil::delDir($export_dir);
}
return $zip_file;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

{
if($a_type == "list")
{
$a_type = "m";
}
else
{
$a_type = "p";
}
$link = str_replace("{TYPE}", $a_type, $a_template);
return str_replace("{ID}", $a_id, $link);
}

+ Here is the caller graph for this function:

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

Build export "frame".

Parameters
type$a_back_url
Returns
ilTemplate

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

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

Referenced by exportHTMLPages().

{
global $ilTabs, $lng;
$tpl = $this->co_page_html_export->getPreparedMainTemplate();
$tpl->getStandardTemplate();
$ilTabs->clearTargets();
if($a_back_url)
{
$ilTabs->setBackTarget($lng->txt("back"), $a_back_url);
}
$this->renderFullscreenHeader($tpl, $this->object->getOwner(), true);
$tpl->setFrameFixedWidth(true);
return $tpl;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBlogGUI::buildPostingList (   $a_obj_id)
protected

Gather all blog postings.

Parameters
int$a_obj_id
Returns
array

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

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

Referenced by __construct().

{
$author_found = false;
$items = array();
foreach(ilBlogPosting::getAllPostings($a_obj_id) as $posting)
{
if($this->author && $posting["author"] == $this->author)
{
$author_found = true;
}
$month = substr($posting["created"]->get(IL_CAL_DATE), 0, 7);
$items[$month][$posting["id"]] = $posting;
}
if($this->author && !$author_found)
{
$this->author = null;
}
return $items;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBlogGUI::contributors ( )

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

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

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

{
global $ilTabs, $ilToolbar, $ilCtrl, $lng, $tpl;
if(!$this->checkPermissionBool("write"))
{
return;
}
$ilTabs->activateTab("contributors");
// add member
include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
$this,
$ilToolbar,
array(
'auto_complete_name' => $lng->txt('user'),
'submit_name' => $lng->txt('add')
)
);
$ilToolbar->addSpacer();
$ilToolbar->addButton(
$lng->txt("blog_search_users"),
$ilCtrl->getLinkTargetByClass('ilRepositorySearchGUI',''));
$ilToolbar->setFormAction($ilCtrl->getFormAction($this));
$parent_container_id = $this->object->getParentContainerId($this->node_id);
if ($parent_container_id)
{
$ilCtrl->setParameterByClass('ilRepositorySearchGUI', "list_obj", $parent_container_id);
$ilToolbar->addSpacer();
$ilToolbar->addButton($lng->txt("blog_contributor_container_add"),
$ilCtrl->getLinkTarget($this, "addContributorContainer"));
}
$other_roles = $this->object->getRolesWithContribute($this->node_id);
if($other_roles)
{
ilUtil::sendInfo(sprintf($lng->txt("blog_contribute_other_roles"), implode(", ", $other_roles)));
}
include_once "Modules/Blog/classes/class.ilContributorTableGUI.php";
$tbl = new ilContributorTableGUI($this, "contributors", $this->object->getLocalContributorRole($this->node_id));
$tpl->setContent($tbl->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBlogGUI::createPosting ( )

Create new posting.

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

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

{
global $ilCtrl, $ilUser;
$title = trim(ilUtil::stripSlashes($_POST["title"]));
if($title)
{
// create new posting
include_once("./Modules/Blog/classes/class.ilBlogPosting.php");
$posting = new ilBlogPosting();
$posting->setTitle($title);
$posting->setBlogId($this->object->getId());
$posting->setActive(false);
$posting->setAuthor($ilUser->getId());
$posting->create();
// switch month list to current month (will include new posting)
$ilCtrl->setParameter($this, "bmn", date("Y-m"));
$ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $posting->getId());
$ilCtrl->redirectByClass("ilblogpostinggui", "edit");
}
else
{
$ilCtrl->redirect($this, "render");
}
}

+ Here is the call graph for this function:

ilObjBlogGUI::deactivateAdmin ( )

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

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

{
if($this->checkPermissionBool("write") && (int)$_GET["apid"])
{
// ilBlogPostingGUI::deactivatePage()
include_once "Modules/Blog/classes/class.ilBlogPosting.php";
$post = new ilBlogPosting((int)$_GET["apid"]);
$post->setApproved(false);
$post->setActive(false);
$post->update(true, false, false);
ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
}
$this->ctrl->redirect($this, "render");
}

+ Here is the call graph for this function:

ilObjBlogGUI::disableNotes (   $a_value = false)

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

{
$this->disable_notes = (bool)$a_value;
}
ilObjBlogGUI::downloadExcAssFile ( )

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

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

{
if($_GET["ass"] && $_GET["file"])
{
include_once "Modules/Exercise/classes/class.ilExAssignment.php";
$ass = new ilExAssignment((int)$_GET["ass"]);
$ass_files = ilExAssignment::getFiles($ass->getExerciseId(), $ass->getId());
if (count($ass_files) > 0)
{
foreach($ass_files as $file)
{
if($file["name"] == $_GET["file"])
{
ilUtil::deliverFile($file["fullpath"], $file["name"]);
}
}
}
}
}

+ Here is the call graph for this function:

ilObjBlogGUI::downloadExcSubFile ( )

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

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

{
global $ilUser;
if($_GET["ass"])
{
include_once "Modules/Exercise/classes/class.ilExAssignment.php";
$ass = new ilExAssignment((int)$_GET["ass"]);
$submitted = ilExAssignment::getDeliveredFiles($ass->getExerciseId(), $ass->getId(), $ilUser->getId());
if (count($submitted) > 0)
{
$submitted = array_pop($submitted);
$user_data = ilObjUser::_lookupName($submitted["user_id"]);
$title = ilObject::_lookupTitle($submitted["obj_id"])." - ".
$ass->getTitle()." - ".
$user_data["firstname"]." ".
$user_data["lastname"]." (".
$user_data["login"].").zip";
ilUtil::deliverFile($submitted["filename"], $title);
}
}
}

+ Here is the call graph for this function:

ilObjBlogGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

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

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

{
global $ilCtrl, $tpl, $ilTabs, $lng, $ilUser, $ilNavigationHistory;
// goto link to blog posting
if($_GET["gtp"])
{
$page_id = (int)$_GET["gtp"];
include_once "Modules/Blog/classes/class.ilBlogPosting.php";
if(ilBlogPosting::exists($this->object_id, $page_id))
{
// #12312
$ilCtrl->setCmdClass("ilblogpostinggui");
$_GET["blpg"] = $page_id;
$ilCtrl->setCmd("previewFullscreen");
}
else
{
ilUtil::sendFailure($lng->txt("blog_posting_not_found"));
}
}
$next_class = $ilCtrl->getNextClass($this);
$cmd = $ilCtrl->getCmd();
if($this->id_type == self::REPOSITORY_NODE_ID)
{
$tpl->getStandardTemplate();
// add entry to navigation history
if(!$this->getCreationMode() &&
$this->getAccessHandler()->checkAccess("read", "", $this->node_id))
{
$link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset");
$ilNavigationHistory->addItem($this->node_id, $link, "blog");
}
}
switch($next_class)
{
case 'ilblogpostinggui':
// #9680
if($this->id_type == self::REPOSITORY_NODE_ID)
{
$this->setLocator();
}
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, ""));
include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
$bpost_gui = new ilBlogPostingGUI($this->node_id,
$this->getAccessHandler(),
$_GET["blpg"],
$_GET["old_nr"],
($this->object->getNotesStatus() && !$this->disable_notes),
$this->mayContribute($_GET["blpg"]));
// needed for editor
// keep preview mode through notes gui (has its own commands)
switch($cmd)
{
// blog preview
case "previewFullscreen":
$ilCtrl->setParameter($this, "prvm", "fsc");
break;
// blog in portfolio
case "previewEmbedded":
$ilCtrl->setParameter($this, "prvm", "emb");
break;
// edit
default:
$this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $_GET["blpg"]);
$this->tabs_gui->addNonTabbedLink("preview", $lng->txt("blog_preview"),
$this->ctrl->getLinkTargetByClass("ilblogpostinggui", "previewFullscreen"));
$this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", "");
break;
}
$ret = $ilCtrl->forwardCommand($bpost_gui);
if ($ret != "")
{
// keep preview mode through notes gui
if($_REQUEST["prvm"])
{
$cmd = "preview".(($_REQUEST["prvm"] == "fsc") ? "Fullscreen" : "Embedded");
}
// $is_owner = $this->object->getOwner() == $ilUser->getId();
$is_owner = $this->mayContribute();
$is_active = $bpost_gui->getBlogPosting()->getActive();
// do not show inactive postings
if(($cmd == "previewFullscreen" || $cmd == "previewEmbedded")
&& !$is_owner && !$is_active)
{
$this->ctrl->redirect($this, "preview");
}
switch($cmd)
{
// blog preview
case "previewFullscreen":
$nav = $this->renderNavigation($this->items, "preview", $cmd);
$this->renderFullScreen($ret, $nav);
break;
// blog in portfolio
case "previewEmbedded":
$nav = $this->renderNavigation($this->items, "gethtml", $cmd);
return $this->buildEmbedded($ret, $nav);
// ilias/editor
default:
// infos about draft status / snippet
$info = array();
if(!$is_active)
{
// single author blog (owner) in personal workspace
if($this->id_type == self::WORKSPACE_NODE_ID)
{
$info[] = $lng->txt("blog_draft_info");
}
else
{
$info[] = $lng->txt("blog_draft_info_contributors");
}
}
if($cmd != "history" && !$bpost_gui->getBlogPosting()->getFirstParagraphText())
{
$info[] = $lng->txt("blog_new_posting_info");
}
if($this->object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved())
{
// #9737
$info[] = $lng->txt("blog_posting_edit_approval_info");
}
if(sizeof($info))
{
ilUtil::sendInfo(implode("<br />", $info));
}
// revert to edit cmd to avoid confusion
$this->addHeaderAction("render");
$tpl->setContent($ret);
$nav = $this->renderNavigation($this->items, "render", $cmd, null, $is_owner);
$tpl->setRightContent($nav);
break;
}
}
break;
case "ilinfoscreengui":
$this->prepareOutput();
$this->infoScreenForward();
break;
case "ilnotegui":
$this->preview();
break;
case "ilcommonactiondispatchergui":
include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
$this->ctrl->forwardCommand($gui);
break;
case "ilpermissiongui":
$this->prepareOutput();
$ilTabs->activateTab("id_permissions");
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui = new ilPermissionGUI($this);
$this->ctrl->forwardCommand($perm_gui);
break;
case "ilobjectcopygui":
include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
$cp = new ilObjectCopyGUI($this);
$cp->setType("blog");
$this->ctrl->forwardCommand($cp);
break;
case 'ilrepositorysearchgui':
$this->prepareOutput();
$ilTabs->activateTab("contributors");
include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
$rep_search = new ilRepositorySearchGUI();
$rep_search->setTitle($this->lng->txt("blog_add_contributor"));
$rep_search->setCallback($this,'addContributor');
$this->ctrl->setReturn($this,'contributors');
$ret =& $this->ctrl->forwardCommand($rep_search);
break;
case 'ilexportgui':
$this->prepareOutput();
$ilTabs->activateTab("export");
include_once("./Services/Export/classes/class.ilExportGUI.php");
$exp_gui = new ilExportGUI($this);
$exp_gui->addFormat("xml");
$ret = $ilCtrl->forwardCommand($exp_gui);
break;
default:
if($cmd != "gethtml")
{
// desktop item handling, must be toggled before header action
if($cmd == "addToDesk" || $cmd == "removeFromDesk")
{
$this->{$cmd."Object"}();
if($_GET["prvm"])
{
$cmd = "preview";
}
else
{
$cmd = "render";
}
$ilCtrl->setCmd($cmd);
}
}
}
return true;
}

+ Here is the call graph for this function:

ilObjBlogGUI::export ( )

Build and deliver export file.

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

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

{
$zip = $this->buildExportFile();
ilUtil::deliverFile($zip, $this->object->getTitle().".zip", '', false, true);
}

+ Here is the call graph for this function:

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 1642 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().

{
if(!$a_link_template)
{
$a_link_template = "bl{TYPE}_{ID}.html";
}
if($a_co_page_html_export)
{
$this->co_page_html_export = $a_co_page_html_export;
}
$nav = $this->renderNavigation($this->items, "", "", $a_link_template);
// month list
$has_index = false;
foreach(array_keys($this->items) as $month)
{
$file = $this->buildExportLink($a_link_template, "list", $month);
$list = $this->renderList($this->items[$month], $month, "render", $a_link_template);
if(!$a_tpl_callback)
{
}
else
{
$tpl = call_user_func($a_tpl_callback);
}
$file = $this->writeExportFile($a_target_directory, $file,
$tpl, $list, $nav);
if(!$has_index)
{
copy($file, $a_target_directory."/".$a_index_name);
$has_index = true;
}
}
// single postings
include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
$pages = ilBlogPosting::getAllPostings($this->object->getId(), 0);
foreach ($pages as $page)
{
if (ilPageObject::_exists("blp", $page["id"]))
{
include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
$blp_gui = new ilBlogPostingGUI(0, null, $page["id"]);
$blp_gui->setOutputMode("offline");
$blp_gui->setFullscreenLink("fullscreen.html"); // #12930 - see page.xsl
$blp_gui->add_date = true;
$page_content = $blp_gui->showPage();
$back = $this->buildExportLink($a_link_template, "list",
substr($page["created"]->get(IL_CAL_DATE), 0, 7));
$file = $this->buildExportLink($a_link_template, "posting", $page["id"]);
if(!$a_tpl_callback)
{
}
else
{
$tpl = call_user_func($a_tpl_callback);
}
$this->writeExportFile($a_target_directory, $file, $tpl,
$page_content, $nav, $back);
$this->co_page_html_export->collectPageElements("blp:pg", $page["id"]);
}
}
$this->co_page_html_export->exportPageElements();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBlogGUI::filterInactivePostings ( )
protected

Filter inactive items from items list.

Returns
array

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

References $month, and ilPageObject\_lookupActive().

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

{
foreach($this->items as $month => $postings)
{
foreach($postings as $id => $item)
{
{
unset($this->items[$month][$id]);
}
else if($this->object->hasApproval() && !$item["approved"])
{
unset($this->items[$month][$id]);
}
}
if(!sizeof($this->items[$month]))
{
unset($this->items[$month]);
}
}
if($this->items && !isset($this->items[$this->month]))
{
$this->month = array_shift(array_keys($this->items));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

{
$res = array();
include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
foreach($a_items as $month => $items)
{
foreach($items as $item)
{
if(in_array($a_keyword,
ilBlogPostingGUI::getKeywords($this->obj_id, $item["id"])))
{
$res[] = $item;
}
}
}
return $res;
}

+ Here is the call graph for this function:

ilObjBlogGUI::finalize ( )
protected

Finalize and submit blog to exercise.

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

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

{
global $ilCtrl, $lng;
// to make exercise gui load assignment
$_GET["ass_id"] = $_REQUEST["ass"];
// #11173 - ref_id is needed for notifications
$exc_ref_id = array_shift(ilObject::_getAllReferences($_REQUEST["exc"]));
include_once "Modules/Exercise/classes/class.ilObjExerciseGUI.php";
$exc_gui = new ilObjExerciseGUI(null, $exc_ref_id, true);
$exc_gui->submitBlog($this->node_id);
ilUtil::sendSuccess($lng->txt("blog_finalized"), true);
$ilCtrl->redirect($this, "render");
}

+ Here is the call graph for this function:

ilObjBlogGUI::getEditFormCustomValues ( array &  $a_values)
protected

Add values to custom edit fields.

Parameters
array$a_values

Reimplemented from ilObjectGUI.

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

{
if($this->id_type == self::REPOSITORY_NODE_ID)
{
$a_values["approval"] = $this->object->hasApproval();
}
$a_values["notes"] = $this->object->getNotesStatus();
$a_values["ppic"] = $this->object->hasProfilePicture();
$a_values["bg_color"] = $this->object->getBackgroundColor();
$a_values["font_color"] = $this->object->getFontColor();
$a_values["banner"] = $this->object->getImage();
$a_values["rss"] = $this->object->hasRSS();
}
ilObjBlogGUI::getExerciseInfo (   $a_assignment_id)

Definition at line 633 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().

{
global $lng, $ilCtrl, $ilUser;
include_once "Modules/Exercise/classes/class.ilExAssignment.php";
$ass = new ilExAssignment($a_assignment_id);
$exercise_id = $ass->getExerciseId();
if(!$exercise_id)
{
return;
}
// is the assignment still open?
$times_up = false;
if($ass->getDeadline() && $ass->getDeadline() - time() <= 0)
{
$times_up = true;
}
// exercise goto
include_once "./Services/Link/classes/class.ilLink.php";
$exc_ref_id = array_shift(ilObject::_getAllReferences($exercise_id));
$exc_link = ilLink::_getStaticLink($exc_ref_id, "exc");
$info = sprintf($lng->txt("blog_exercise_info"),
$ass->getTitle(),
"<a href=\"".$exc_link."\">".
ilObject::_lookupTitle($exercise_id)."</a>");
// submit button
if(!$times_up)
{
$ilCtrl->setParameter($this, "exc", $exercise_id);
$ilCtrl->setParameter($this, "ass", $a_assignment_id);
$submit_link = $ilCtrl->getLinkTarget($this, "finalize");
$ilCtrl->setParameter($this, "ass", "");
$ilCtrl->setParameter($this, "exc", "");
$info .= " <a class=\"submit\" href=\"".$submit_link."\">".$lng->txt("blog_finalize_blog")."</a>";
}
// submitted files
$submitted = ilExAssignment::getDeliveredFiles($exercise_id, $a_assignment_id, $ilUser->getId(), true);
if($submitted)
{
$submitted = array_pop($submitted);
$ilCtrl->setParameter($this, "ass", $a_assignment_id);
$dl_link = $ilCtrl->getLinkTarget($this, "downloadExcSubFile");
$ilCtrl->setParameter($this, "ass", "");
$info .= "<br />".sprintf($lng->txt("blog_exercise_submitted_info"),
"<a href=\"".$dl_link."\">".$lng->txt("download")."</a>");
}
// work instructions incl. files
$tooltip = "";
$ass = $ass->getInstruction();
if($ass)
{
$tooltip .= nl2br($ass);
}
$ass_files = ilExAssignment::getFiles($exercise_id, $a_assignment_id);
if (count($ass_files) > 0)
{
$tooltip .= "<br /><br />";
foreach($ass_files as $file)
{
$ilCtrl->setParameter($this, "ass", $a_assignment_id);
$ilCtrl->setParameter($this, "file", urlencode($file["name"]));
$dl_link = $ilCtrl->getLinkTarget($this, "downloadExcAssFile");
$ilCtrl->setParameter($this, "file", "");
$ilCtrl->setParameter($this, "ass", "");
$tooltip .= $file["name"].": <a href=\"".$dl_link."\">".
$lng->txt("download")."</a>";
}
}
if($tooltip)
{
$ol_id = "exc_ass_".$a_assignment_id;
include_once "Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
$overlay = new ilOverlayGUI($ol_id);
// overlay
$overlay->setAnchor($ol_id."_tr");
$overlay->setTrigger($ol_id."_tr", "click", $ol_id."_tr");
$overlay->setAutoHide(false);
// $overlay->setCloseElementId($cl_id);
$overlay->add();
// trigger
$overlay->addTrigger($ol_id."_tr", "click", $ol_id."_tr");
$info .= "<div id=\"".$ol_id."_tr\"><a href=\"#\">".$lng->txt("exc_instruction")."</a></div>".
"<div id=\"".$ol_id."\" style=\"display:none; background-color:white; border: 1px solid #bbb; padding: 10px;\">".$tooltip."</div>";
}
return "<div>".$info."</div>";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBlogGUI::getHTML ( )

Return embeddable HTML chunk.

Returns
string

Reimplemented from ilObject2GUI.

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

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

{
// getHTML() is called by ilRepositoryGUI::show()
if($this->id_type == self::REPOSITORY_NODE_ID)
{
return;
}
// there is no way to do a permissions check here, we have no wsp
$list_items = $this->getListItems();
$list = $nav = "";
if($list_items)
{
$list = $this->renderList($list_items, $this->month, "previewEmbedded");
$nav = $this->renderNavigation($this->items, "gethtml", "previewEmbedded");
}
return $this->buildEmbedded($list, $nav);
}

+ Here is the call graph for this function:

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

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

Referenced by renderNavigation().

{
$keywords = array();
include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
if($a_posting_id)
{
foreach(ilBlogPostingGUI::getKeywords($this->obj_id, $a_posting_id) as $keyword)
{
$keywords[$keyword]++;
}
}
else
{
foreach($this->items as $month => $items)
{
foreach($items as $item)
{
if($a_show_inactive || ilBlogPosting::_lookupActive($item["id"], "blp"))
{
foreach(ilBlogPostingGUI::getKeywords($this->obj_id, $item["id"]) as $keyword)
{
$keywords[$keyword]++;
}
}
}
}
}
ksort($keywords);
return $keywords;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBlogGUI::getListItems ( )
protected

Filter blog postings by month, keyword or author.

Returns
array

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

References $items, and $month.

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

{
if($this->author)
{
$list_items = array();
foreach($this->items as $month => $items)
{
foreach($items as $id => $item)
{
if($item["author"] == $this->author)
{
$list_items[$id] = $item;
}
}
}
}
else if($this->keyword)
{
$list_items = $this->filterItemsByKeyword($this->items, $this->keyword);
}
else
{
$list_items = $this->items[$this->month];
}
return $list_items;
}

+ Here is the caller graph for this function:

ilObjBlogGUI::getNotesSubId ( )

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

References $_REQUEST.

{
if($_REQUEST["blpg"])
{
return $_REQUEST["blpg"];
}
return 0;
}
ilObjBlogGUI::getType ( )

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

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

Referenced by renderList().

{
return "blog";
}

+ Here is the caller graph for this function:

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

References infoScreenForward().

{
$this->ctrl->setCmd("showSummary");
$this->ctrl->setCmdClass("ilinfoscreengui");
}

+ Here is the call graph for this function:

ilObjBlogGUI::infoScreenForward ( )

show information screen

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

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

Referenced by executeCommand(), and infoScreen().

{
global $ilTabs, $ilErr;
$ilTabs->activateTab("id_info");
if (!$this->checkPermissionBool("visible"))
{
$ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
}
include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
$info = new ilInfoScreenGUI($this);
$info->enablePrivateNotes();
if ($this->checkPermissionBool("read"))
{
$info->enableNews();
}
// no news editing for files, just notifications
$info->enableNewsEditing(false);
if ($this->checkPermissionBool("write"))
{
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
if ($enable_internal_rss)
{
$info->setBlockProperty("news", "settings", true);
$info->setBlockProperty("news", "public_notifications_option", true);
}
}
// standard meta data
$info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
if($this->id_type == self::WORKSPACE_NODE_ID)
{
$info->addProperty($this->lng->txt("perma_link"), $this->getPermanentLinkWidget());
}
$this->ctrl->forwardCommand($info);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBlogGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

this will create the default creation forms: new, import, clone

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObject2GUI.

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

{
$forms = parent::initCreationForms($a_new_type);
if($this->id_type == self::WORKSPACE_NODE_ID)
{
unset($forms[self::CFORM_IMPORT]);
unset($forms[self::CFORM_CLONE]);
}
return $forms;
}
ilObjBlogGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

Add custom fields to update form.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjectGUI.

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

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

{
global $lng, $ilSetting;
if($this->id_type == self::REPOSITORY_NODE_ID)
{
$appr = new ilCheckboxInputGUI($lng->txt("blog_enable_approval"), "approval");
$appr->setInfo($lng->txt("blog_enable_approval_info"));
$a_form->addItem($appr);
}
$notes = new ilCheckboxInputGUI($lng->txt("blog_enable_notes"), "notes");
$a_form->addItem($notes);
if($ilSetting->get('enable_global_profiles'))
{
$rss = new ilCheckboxInputGUI($lng->txt("blog_enable_rss"), "rss");
$rss->setInfo($lng->txt("blog_enable_rss_info"));
$a_form->addItem($rss);
}
$ppic = new ilCheckboxInputGUI($lng->txt("blog_profile_picture"), "ppic");
$a_form->addItem($ppic);
$blga_set = new ilSetting("blga");
if($blga_set->get("banner"))
{
$dimensions = " (".$blga_set->get("banner_width")."x".
$blga_set->get("banner_height").")";
$img = new ilImageFileInputGUI($lng->txt("blog_banner").$dimensions, "banner");
$a_form->addItem($img);
// show existing file
$file = $this->object->getImageFullPath(true);
if($file)
{
$img->setImage($file);
}
}
$bg_color = new ilColorPickerInputGUI($lng->txt("blog_background_color"), "bg_color");
$a_form->addItem($bg_color);
$font_color = new ilColorPickerInputGUI($lng->txt("blog_font_color"), "font_color");
$a_form->addItem($font_color);
}

+ Here is the call graph for this function:

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

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

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

Referenced by addHeaderAction().

{
global $ilUser, $ilCtrl;
if(!$this->obj_id)
{
return false;
}
$sub_type = $sub_id = null;
if($_GET["blpg"])
{
$sub_type = "blp";
$sub_id = $_GET["blpg"];
}
$lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
if($a_is_preview)
{
$lg->enableComments(false);
$lg->enableNotes(false);
$lg->enableTags(false);
include_once "./Services/Notification/classes/class.ilNotification.php";
{
$ilCtrl->setParameter($this, "ntf", 1);
$link = $ilCtrl->getLinkTarget($this, "setNotification");
$lg->addCustomCommand($link, "blog_notification_toggle_off");
$lg->addHeaderIcon("not_icon",
ilUtil::getImagePath("notification_on.png"),
$this->lng->txt("blog_notification_activated"));
}
else
{
$ilCtrl->setParameter($this, "ntf", 2);
$link = $ilCtrl->getLinkTarget($this, "setNotification");
$lg->addCustomCommand($link, "blog_notification_toggle_on");
$lg->addHeaderIcon("not_icon",
ilUtil::getImagePath("notification_off.png"),
$this->lng->txt("blog_notification_deactivated"));
}
$ilCtrl->setParameter($this, "ntf", "");
}
return $lg;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

{
// page might be deleted, so setting halt on errors to false
include_once "Modules/Blog/classes/class.ilBlogPosting.php";
$post = new ilBlogPosting($a_posting_id, 0, false);
if($post->getBlogId() == $a_blog_id)
{
return $post->getTitle();
}
}
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 2024 of file class.ilObjBlogGUI.php.

References $ilUser, and ilObject2GUI\checkPermissionBool().

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

{
global $ilUser;
// single author blog (owner) in personal workspace
if($this->id_type == self::WORKSPACE_NODE_ID)
{
return $this->checkPermissionBool("write");
}
if($this->checkPermissionBool("contribute"))
{
// check owner of posting
if($a_posting_id)
{
if(!$a_author_id)
{
include_once "Modules/Blog/classes/class.ilBlogPosting.php";
$post = new ilBlogPosting($a_posting_id, 0, false);
$a_author_id = $post->getAuthor();
}
if($ilUser->getId() == $a_author_id)
{
return true;
}
else
{
return false;
}
}
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBlogGUI::preview ( )

Render fullscreen presentation.

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

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

Referenced by executeCommand().

{
global $lng;
if(!$this->checkPermissionBool("read"))
{
ilUtil::sendInfo($lng->txt("no_permission"));
return;
}
$list_items = $this->getListItems();
$list = $nav = "";
if($list_items)
{
$list = $this->renderList($list_items, $this->month, "previewFullscreen");
$nav = $this->renderNavigation($this->items, "preview", "previewFullscreen");
}
$this->renderFullScreen($list, $nav);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBlogGUI::removeContributor ( )

Used in ilContributorTableGUI.

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

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

{
global $ilCtrl, $lng, $rbacadmin;
$ids = $_POST["id"];
if(!sizeof($ids))
{
ilUtil::sendFailure($lng->txt("select_one"), true);
$ilCtrl->redirect($this, "contributors");
}
// get contributor role
$contr_role_id = $this->object->getLocalContributorRole($this->node_id);
if(!$contr_role_id)
{
ilUtil::sendFailure($lng->txt("missing_perm"));
return $this->contributors();
}
foreach($ids as $user_id)
{
$rbacadmin->deassignUser($contr_role_id, $user_id);
}
ilUtil::sendSuccess($lng->txt("settings_saved"), true);
$this->ctrl->redirect($this, "contributors");
}

+ Here is the call graph for this function:

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

Implements ilDesktopItemHandling.

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

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

{
global $lng;
include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
ilUtil::sendSuccess($lng->txt("removed_from_desktop"));
}

+ Here is the call graph for this function:

ilObjBlogGUI::render ( )

Render object context.

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

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

{
global $tpl, $ilTabs, $ilCtrl, $lng, $ilToolbar, $ilUser, $tree;
if(!$this->checkPermissionBool("read"))
{
ilUtil::sendInfo($lng->txt("no_permission"));
return;
}
$ilTabs->activateTab("content");
// toolbar
if($this->mayContribute())
{
$ilToolbar->setFormAction($ilCtrl->getFormAction($this, "createPosting"));
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$title = new ilTextInputGUI($lng->txt("title"), "title");
$ilToolbar->addInputItem($title, $lng->txt("title"));
$ilToolbar->addFormButton($lng->txt("blog_add_posting"), "createPosting");
// exercise blog?
include_once "Modules/Exercise/classes/class.ilObjExercise.php";
$exercises = ilObjExercise::findUserFiles($ilUser->getId(), $this->node_id);
if($exercises)
{
$info = array();
foreach($exercises as $exercise)
{
// #9988
$active_ref = false;
foreach(ilObject::_getAllReferences($exercise["obj_id"]) as $ref_id)
{
if(!$tree->isSaved($ref_id))
{
$active_ref = true;
break;
}
}
if($active_ref)
{
$part = $this->getExerciseInfo($exercise["ass_id"]);
if($part)
{
$info[] = $part;
}
}
}
if(sizeof($info))
{
ilUtil::sendInfo(implode("<br />", $info));
}
}
}
$list_items = $this->getListItems();
$list = $nav = "";
if($list_items)
{
// $is_owner = ($this->object->getOwner() == $ilUser->getId());
$is_owner = $this->mayContribute();
$list = $this->renderList($list_items, $this->month, "preview", null, $is_owner);
$nav = $this->renderNavigation($this->items, "render", "preview", null, $is_owner);
}
$tpl->setContent($list);
$tpl->setRightContent($nav);
}

+ Here is the call graph for this function:

ilObjBlogGUI::renderFullScreen (   $a_content,
  $a_navigation 
)

Build fullscreen context.

Parameters
string$a_content
string$a_navigation

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

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

Referenced by executeCommand(), and preview().

{
global $tpl, $ilUser, $ilTabs, $ilLocator;
$owner = $this->object->getOwner();
$ilTabs->clearTargets();
$ilLocator->clearItems();
$tpl->setLocator();
// back (edit)
if($owner == $ilUser->getId())
{
// from shared/deeplink
if($this->id_type == self::WORKSPACE_NODE_ID)
{
$back = "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&wsp_id=".$this->node_id;
}
// from editor (#10073)
else if($this->mayContribute())
{
$prvm = $_GET["prvm"];
$this->ctrl->setParameter($this, "prvm", "");
if(!$_GET["blpg"])
{
$back = $this->ctrl->getLinkTarget($this, "");
}
else
{
$this->ctrl->setParameterByClass("ilblogpostinggui", "bmn", $this->month);
$this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $_GET["blpg"]);
$back = $this->ctrl->getLinkTargetByClass("ilblogpostinggui", "preview");
}
$this->ctrl->setParameter($this, "prvm", $prvm);
}
}
// back
else if($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
{
// workspace (always shared)
if($this->id_type == self::WORKSPACE_NODE_ID)
{
$back = "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=".$owner;
}
// contributor
else if($this->mayContribute())
{
$back = $this->ctrl->getLinkTarget($this, "");
}
// listgui / parent container
else
{
global $tree;
$parent_id = $tree->getParentId($this->node_id);
include_once "Services/Link/classes/class.ilLink.php";
}
}
$tpl->setTopBar($back);
$this->renderFullscreenHeader($tpl, $owner);
// content
$tpl->setContent($a_content);
$tpl->setRightContent($a_navigation);
$tpl->setFrameFixedWidth(true);
echo $tpl->show("DEFAULT", true, true);
exit();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

Referenced by buildExportTemplate(), and renderFullScreen().

{
// repository blogs are multi-author
$name = null;
if($this->id_type != self::REPOSITORY_NODE_ID)
{
$name = ilObjUser::_lookupName($a_user_id);
$name = $name["lastname"].", ".($t = $name["title"] ? $t . " " : "").$name["firstname"];
}
// show banner?
$banner = false;
$blga_set = new ilSetting("blga");
if($blga_set->get("banner"))
{
$banner = $this->object->getImageFullPath();
$banner_width = $blga_set->get("banner_width");
$banner_height = $blga_set->get("banner_height");
if($a_export)
{
$banner = basename($banner);
}
}
$ppic = null;
if($this->object->hasProfilePicture())
{
$ppic = ilObjUser::_getPersonalPicturePath($a_user_id, "big");
if($a_export)
{
$ppic = basename($ppic);
}
}
include_once("./Services/User/classes/class.ilUserUtil.php");
$a_tpl->setFullscreenHeader($this->object->getTitle(),
$name,
$ppic,
$banner,
$this->object->getBackgroundColor(),
$this->object->getFontColor(),
$banner_width,
$banner_height,
$a_export);
$a_tpl->setBodyClass("std ilExternal ilBlog");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

References $author, $ilCtrl, $keyword, ilObjectGUI\$lng, $preview, $title, 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().

{
global $lng, $ilCtrl;
include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
$wtpl = new ilTemplate("tpl.blog_list.html", true, true, "Modules/Blog");
// title according to current "filter"/navigation
if($this->keyword)
{
$title = $lng->txt("blog_keyword").": ".$this->keyword;
}
else if($this->author)
{
include_once "Services/User/classes/class.ilUserUtil.php";
$title = $lng->txt("blog_author").": ".ilUserUtil::getNamePresentation($this->author);
}
else
{
include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
$title = ilCalendarUtil::_numericMonthToString((int)substr($a_month, 5)).
" ".substr($a_month, 0, 4);
}
$wtpl->setVariable("TXT_CURRENT_MONTH", $title);
$can_approve = ($this->object->hasApproval() && $this->checkPermissionBool("write"));
$can_deactivate = $this->checkPermissionBool("write");
include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
foreach($items as $item)
{
// only published items
$is_active = ilBlogPosting::_lookupActive($item["id"], "blp");
if(!$is_active && !$a_show_inactive)
{
continue;
}
if(!$a_link_template)
{
$ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", $this->month);
$ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $item["id"]);
$preview = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", $a_cmd);
}
else
{
$preview = $this->buildExportLink($a_link_template, "posting", $item["id"]);
}
// actions
$item_contribute = $this->mayContribute($item["id"], $item["author"]);
if(($item_contribute || $can_approve || $can_deactivate) && !$a_link_template && $a_cmd == "preview")
{
include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
$alist->setId($item["id"]);
$alist->setListTitle($lng->txt("actions"));
if($is_active && $this->object->hasApproval() && !$item["approved"])
{
if($can_approve)
{
$ilCtrl->setParameter($this, "apid", $item["id"]);
$alist->addItem($lng->txt("blog_approve"), "approve",
$ilCtrl->getLinkTarget($this, "approve"));
$ilCtrl->setParameter($this, "apid", "");
}
$wtpl->setVariable("APPROVAL", $lng->txt("blog_needs_approval"));
}
if($item_contribute)
{
$alist->addItem($lng->txt("edit_content"), "edit",
$ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edit"));
$alist->addItem($lng->txt("rename"), "rename",
$ilCtrl->getLinkTargetByClass("ilblogpostinggui", "edittitle"));
$alist->addItem($lng->txt("blog_edit_keywords"), "keywords",
$ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editKeywords"));
$alist->addItem($lng->txt("blog_edit_date"), "editdate",
$ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editdate"));
$alist->addItem($lng->txt("delete"), "delete",
$ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deleteBlogPostingConfirmationScreen"));
}
else if($can_deactivate)
{
// #10513
if($is_active)
{
$ilCtrl->setParameter($this, "apid", $item["id"]);
$alist->addItem($lng->txt("blog_toggle_draft_admin"), "deactivate",
$ilCtrl->getLinkTarget($this, "deactivateAdmin"));
$ilCtrl->setParameter($this, "apid", "");
}
$alist->addItem($lng->txt("delete"), "delete",
$ilCtrl->getLinkTargetByClass("ilblogpostinggui", "deleteBlogPostingConfirmationScreen"));
}
$wtpl->setCurrentBlock("actions");
$wtpl->setVariable("ACTION_SELECTOR", $alist->getHTML());
$wtpl->parseCurrentBlock();
}
// comments
if($this->object->getNotesStatus() && !$a_link_template && !$this->disable_notes)
{
// count (public) notes
include_once("Services/Notes/classes/class.ilNote.php");
$count = sizeof(ilNote::_getNotesOfObject($this->obj_id,
$item["id"], "blp", IL_NOTE_PUBLIC));
if($a_cmd != "preview")
{
$wtpl->setCurrentBlock("comments");
$wtpl->setVariable("TEXT_COMMENTS", $lng->txt("blog_comments"));
$wtpl->setVariable("URL_COMMENTS", $preview);
$wtpl->setVariable("COUNT_COMMENTS", $count);
$wtpl->parseCurrentBlock();
}
/* we disabled comments in edit mode (should always be done via pagegui)
else
{
$hash = ilCommonActionDispatcherGUI::buildAjaxHash(ilCommonActionDispatcherGUI::TYPE_WORKSPACE,
$this->node_id, "blog", $this->obj_id, "blp", $item["id"]);
$notes_link = "#\" onclick=\"".ilNoteGUI::getListCommentsJSCall($hash);
}
*/
}
// permanent link
if($a_cmd != "preview" && $a_cmd != "previewEmbedded")
{
if($this->id_type == self::WORKSPACE_NODE_ID)
{
$goto = $this->getAccessHandler()->getGotoLink($this->node_id, $this->obj_id, "_".$item["id"]);
}
else
{
include_once "Services/Link/classes/class.ilLink.php";
$goto = ilLink::_getStaticLink($this->node_id, $this->getType(), true, "_".$item["id"]);
}
$wtpl->setCurrentBlock("permalink");
$wtpl->setVariable("URL_PERMALINK", $goto);
$wtpl->setVariable("TEXT_PERMALINK", $lng->txt("blog_permanent_link"));
$wtpl->parseCurrentBlock();
}
$snippet = ilBlogPostingGUI::getSnippet($item["id"]);
if($snippet)
{
$wtpl->setCurrentBlock("more");
$wtpl->setVariable("URL_MORE", $preview);
$wtpl->setVariable("TEXT_MORE", $lng->txt("blog_list_more"));
$wtpl->parseCurrentBlock();
}
$wtpl->setCurrentBlock("posting");
if(!$is_active)
{
$wtpl->setVariable("DRAFT_CLASS", " ilBlogListItemDraft");
}
$author = "";
if($this->id_type == self::REPOSITORY_NODE_ID)
{
$author_id = $item["author"];
if($author_id)
{
include_once "Services/User/classes/class.ilUserUtil.php";
}
}
// title
$wtpl->setVariable("URL_TITLE", $preview);
$wtpl->setVariable("TITLE", $item["title"]);
$wtpl->setVariable("DATETIME", $author.
// content
$wtpl->setVariable("CONTENT", $snippet);
$wtpl->parseCurrentBlock();
}
// notes
/*
if($a_cmd == "previewFullscreen" && $this->object->getNotesStatus())
{
$wtpl->setVariable("NOTES", $this->getNotesHTML());
}
*/
// permalink
if($a_cmd == "previewFullscreen")
{
$wtpl->setVariable("PERMALINK", $this->getPermanentLinkWidget(null, true));
}
return $wtpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 1325 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().

{
$max_detail_postings = 10;
$wtpl = new ilTemplate("tpl.blog_list_navigation.html", true, true,
"Modules/Blog");
$wtpl->setVariable("NAVIGATION_TITLE", $this->lng->txt("blog_navigation"));
$ilCtrl->setParameter($this, "blpg", "");
include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
$counter = 0;
foreach($items as $month => $postings)
{
$month_name = ilCalendarUtil::_numericMonthToString((int)substr($month, 5)).
" ".substr($month, 0, 4);
if(!$a_link_template)
{
$ilCtrl->setParameter($this, "bmn", $month);
$month_url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
}
else
{
$month_url = $this->buildExportLink($a_link_template, "list", $month);
}
// list postings for month
if($counter < $max_detail_postings)
{
foreach($postings as $id => $posting)
{
$is_active = ilBlogPosting::_lookupActive($id, "blp");
if(!$is_active && !$a_show_inactive)
{
continue;
}
$counter++;
$caption = /* ilDatePresentation::formatDate($posting["created"], IL_CAL_DATETIME).
", ".*/ $posting["title"];
if(!$a_link_template)
{
$ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", $month);
$ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $id);
$url = $ilCtrl->getLinkTargetByClass("ilblogpostinggui", $a_posting_cmd);
}
else
{
$url = $this->buildExportLink($a_link_template, "posting", $id);
}
if(!$is_active)
{
$wtpl->setVariable("NAV_ITEM_DRAFT", $this->lng->txt("blog_draft"));
}
else if($this->object->hasApproval() && !$posting["approved"])
{
$wtpl->setVariable("NAV_ITEM_APPROVAL", $this->lng->txt("blog_needs_approval"));
}
$wtpl->setCurrentBlock("navigation_item");
$wtpl->setVariable("NAV_ITEM_URL", $url);
$wtpl->setVariable("NAV_ITEM_CAPTION", $caption);
$wtpl->parseCurrentBlock();
}
$wtpl->setCurrentBlock("navigation_month_details");
$wtpl->setVariable("NAV_MONTH", $month_name);
$wtpl->setVariable("URL_MONTH", $month_url);
$wtpl->parseCurrentBlock();
}
// summarized month
else
{
$wtpl->setCurrentBlock("navigation_month");
$wtpl->setVariable("MONTH_NAME", $month_name);
$wtpl->setVariable("URL_MONTH", $month_url);
$wtpl->setVariable("MONTH_COUNT", sizeof($postings));
$wtpl->parseCurrentBlock();
}
}
$ilCtrl->setParameter($this, "bmn", $this->month);
$ilCtrl->setParameterByClass("ilblogpostinggui", "bmn", "");
// authors
if($this->id_type == self::REPOSITORY_NODE_ID)
{
$authors = array();
foreach($this->items as $month => $items)
{
foreach($items as $item)
{
if(($a_show_inactive || ilBlogPosting::_lookupActive($item["id"], "blp")) && $item["author"])
{
$authors[] = $item["author"];
}
}
}
$authors = array_unique($authors);
if(sizeof($authors) > 1)
{
include_once "Services/User/classes/class.ilUserUtil.php";
$list = array();
foreach($authors as $user_id)
{
if($user_id)
{
$ilCtrl->setParameter($this, "ath", $user_id);
$url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
$ilCtrl->setParameter($this, "ath", "");
$name = ilUserUtil::getNamePresentation($user_id, true);
$idx = trim(strip_tags($name))."///".$user_id; // #10934
$list[$idx] = array($name, $url);
}
}
ksort($list);
$wtpl->setVariable("AUTHORS_TITLE", $this->lng->txt("blog_authors"));
$wtpl->setCurrentBlock("author");
foreach($list as $author)
{
$wtpl->setVariable("TXT_AUTHOR", $author[0]);
$wtpl->setVariable("URL_AUTHOR", $author[1]);
$wtpl->parseCurrentBlock();
}
}
}
if(!$a_link_template) // #12850
{
// keywords
$may_edit_keywords = ($_GET["blpg"] && $this->mayContribute($_GET["blpg"]) &&
!$a_link_template && $a_list_cmd != "preview" && $a_list_cmd != "gethtml");
$keywords = $this->getKeywords($a_show_inactive, $_GET["blpg"]);
if($keywords || $may_edit_keywords)
{
$wtpl->setVariable("KEYWORDS_TITLE", $this->lng->txt("blog_keywords"));
if($keywords)
{
$max = max($keywords);
include_once "Services/Tagging/classes/class.ilTagging.php";
$wtpl->setCurrentBlock("keyword");
foreach($keywords as $keyword => $counter)
{
$ilCtrl->setParameter($this, "kwd", $keyword);
$url = $ilCtrl->getLinkTarget($this, $a_list_cmd);
$ilCtrl->setParameter($this, "kwd", "");
$wtpl->setVariable("TXT_KEYWORD", $keyword);
$wtpl->setVariable("SIZE_KEYWORD", ilTagging::calculateFontSize($counter, $max));
$wtpl->setVariable("URL_KEYWORD", $url);
$wtpl->parseCurrentBlock();
}
}
else
{
$wtpl->setVariable("TXT_NO_KEYWORDS", $this->lng->txt("blog_no_keywords"));
}
if($may_edit_keywords)
{
$ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", $_GET["blpg"]);
$wtpl->setVariable("URL_EDIT_KEYWORDS",
$ilCtrl->getLinkTargetByClass("ilblogpostinggui", "editKeywords"));
$ilCtrl->setParameterByClass("ilblogpostinggui", "blpg", "");
$wtpl->setVariable("TXT_EDIT_KEYWORDS", $this->lng->txt("blog_edit_keywords"));
}
}
// rss
if($this->object->hasRSS() && $ilSetting->get('enable_global_profiles') &&
!$a_link_template && $a_list_cmd == "preview")
{
// #10827
$blog_id = $this->node_id;
if($this->id_type != self::WORKSPACE_NODE_ID)
{
$blog_id .= "_cll";
}
$url = ILIAS_HTTP_PATH."/feed.php?blog_id=".$blog_id.
"&client_id=".rawurlencode(CLIENT_ID);
$wtpl->setCurrentBlock("rss");
$wtpl->setVariable("URL_RSS", $url);
$wtpl->setVariable("IMG_RSS", ilUtil::getImagePath("rss.png"));
$wtpl->parseCurrentBlock();
}
}
return $wtpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBlogGUI::setNotification ( )
protected

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

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

{
global $ilUser, $ilCtrl;
include_once "./Services/Notification/classes/class.ilNotification.php";
switch($_GET["ntf"])
{
case 1:
break;
case 2:
break;
}
$ilCtrl->redirect($this, "preview");
}
ilObjBlogGUI::setTabs ( )

create tabs (repository/workspace switch)

this had to be moved here because of the context-specific permission tab

Reimplemented from ilObject2GUI.

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

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

{
global $lng, $ilHelp;
if($this->id_type == self::WORKSPACE_NODE_ID)
{
$this->ctrl->setParameter($this,"wsp_id",$this->node_id);
}
$ilHelp->setScreenIdComponent("blog");
if ($this->checkPermissionBool("read"))
{
$this->tabs_gui->addTab("content",
$lng->txt("content"),
$this->ctrl->getLinkTarget($this, ""));
}
if ($this->checkPermissionBool("read"))
{
$this->tabs_gui->addTab("id_info",
$lng->txt("info_short"),
$this->ctrl->getLinkTargetByClass(array("ilobjbloggui", "ilinfoscreengui"), "showSummary"));
}
if ($this->checkPermissionBool("write"))
{
$this->tabs_gui->addTab("settings",
$lng->txt("settings"),
$this->ctrl->getLinkTarget($this, "edit"));
if($this->id_type == self::REPOSITORY_NODE_ID)
{
$this->tabs_gui->addTab("contributors",
$lng->txt("blog_contributors"),
$this->ctrl->getLinkTarget($this, "contributors"));
}
if($this->id_type == self::REPOSITORY_NODE_ID)
{
$this->tabs_gui->addTab("export",
$lng->txt("export"),
$this->ctrl->getLinkTargetByClass("ilexportgui", ""));
}
}
if($this->mayContribute())
{
$this->tabs_gui->addNonTabbedLink("preview", $lng->txt("blog_preview"),
$this->ctrl->getLinkTarget($this, "preview"));
}
// will add permissions if needed
}

+ Here is the call graph for this function:

ilObjBlogGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

Insert custom update form values into object.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjectGUI.

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

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

{
if($this->id_type == self::REPOSITORY_NODE_ID)
{
$this->object->setApproval($a_form->getInput("approval"));
}
$this->object->setNotesStatus($a_form->getInput("notes"));
$this->object->setProfilePicture($a_form->getInput("ppic"));
$this->object->setBackgroundColor($a_form->getInput("bg_color"));
$this->object->setFontColor($a_form->getInput("font_color"));
$this->object->setRSS($a_form->getInput("rss"));
// banner field is optional
$banner = $a_form->getItemByPostVar("banner");
if($banner)
{
if($_FILES["banner"]["tmp_name"])
{
$this->object->uploadImage($_FILES["banner"]);
}
else if($banner->getDeletionFlag())
{
$this->object->deleteImage();
}
}
}

+ Here is the call graph for this function:

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

References $file.

Referenced by exportHTMLPages().

{
$file = $a_target_directory."/".$a_file;
// return if file is already existing
if (@is_file($file))
{
return;
}
// export template: page content
$ep_tpl = new ilTemplate("tpl.export_page.html", true, true,
"Modules/Blog");
$ep_tpl->setVariable("PAGE_CONTENT", $a_content);
// export template: right content
if($a_right_content)
{
$ep_tpl->setVariable("RIGHT_CONTENT", $a_right_content);
}
$a_tpl->setContent($ep_tpl->get());
$content = $a_tpl->get("DEFAULT", false, false, false,
true, true, true);
// open file
if (!file_put_contents($file, $content))
{
die ("<b>Error</b>: Could not open \"".$file."\" for writing".
" in <b>".__FILE__."</b> on line <b>".__LINE__."</b><br />");
}
// set file permissions
chmod($file, 0770);
return $file;
}

+ Here is the caller graph for this function:

Field Documentation

ilObjBlogGUI::$author
protected

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

Referenced by renderList(), and renderNavigation().

ilObjBlogGUI::$items
protected
ilObjBlogGUI::$keyword
protected

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

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


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