ILIAS  Release_4_2_x_branch Revision 61807
 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.
 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)
 _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 ()
 getAdminTabs ($a)
 view ()
 view object content (repository/workspace switch)
 getTemplateFile ()
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.
 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
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 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.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 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.
 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.
- 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 ()
 addLocatorItems ()
 Functions to be overwritten.
 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
 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
- 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 24 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 = $_REQUEST["bmn"];
// 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 1547 of file class.ilObjBlogGUI.php.

References $_GET, and exit.

{
global $ilUser;
$id = explode("_", $a_target);
$_GET["baseClass"] = "ilsharedresourceGUI";
$_GET["wsp_id"] = $id[0];
if(sizeof($id) == 3)
{
$_GET["gtp"] = $id[1];
}
include("ilias.php");
}
ilObjBlogGUI::addHeaderAction (   $a_cmd)
protected

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

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

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

+ 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 68 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::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 704 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 1128 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.gif");
$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 1281 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 1301 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();
// workaround
/* $tpl->setVariable("MAINMENU", "<div style='min-height:40px;'></div>");
$tpl->setTitle($this->object->getTitle());
$tpl->setTitleIcon("./images/icon_blog_b.gif",
$lng->txt("obj_blog"));
*/
$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 827 of file class.ilObjBlogGUI.php.

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

Referenced by __construct().

{
$items = array();
foreach(ilBlogPosting::getAllPostings($a_obj_id) as $posting)
{
$month = substr($posting["created"]->get(IL_CAL_DATE), 0, 7);
$items[$month][$posting["id"]] = $posting;
}
return $items;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjBlogGUI::createPosting ( )

Create new posting.

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

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

{
global $ilCtrl, $lng;
$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->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::disableNotes (   $a_value = false)

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

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

Definition at line 591 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 612 of file class.ilObjBlogGUI.php.

References $_GET, $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 175 of file class.ilObjBlogGUI.php.

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

{
global $ilCtrl, $tpl, $ilTabs, $lng, $ilUser;
// goto link to blog posting
if($_GET["gtp"])
{
$ilCtrl->setCmdClass("ilblogpostinggui");
$_GET["blpg"] = $_GET["gtp"];
$ilCtrl->setCmd("previewFullscreen");
}
$next_class = $ilCtrl->getNextClass($this);
$cmd = $ilCtrl->getCmd();
switch($next_class)
{
case 'ilblogpostinggui':
$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);
// needed for editor
if (!$this->checkPermissionBool("write"))
{
$bpost_gui->setEnableEditing(false);
}
// 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_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)
{
$info[] = $lng->txt("blog_draft_info");
}
if($cmd != "history" && !$bpost_gui->getBlogPosting()->getFirstParagraphText())
{
$info[] = $lng->txt("blog_new_posting_info");
}
if(sizeof($info))
{
ilUtil::sendInfo(implode("<br />", $info));
}
$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;
default:
if($cmd != "gethtml")
{
}
}
return true;
}

+ Here is the call graph for this function:

ilObjBlogGUI::export ( )

Build and deliver export file.

Definition at line 687 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 1196 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->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 1519 of file class.ilObjBlogGUI.php.

References $month, and ilPageObject\_lookupActive().

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

{
foreach($this->items as $month => $postings)
{
foreach(array_keys($postings) as $id)
{
{
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::finalize ( )
protected

Finalize and submit blog to exercise.

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

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

{
global $ilCtrl, $lng;
// to make exercise gui load assignment
$_GET["ass_id"] = $_REQUEST["ass"];
include_once "Modules/Exercise/classes/class.ilObjExerciseGUI.php";
$exc_gui = new ilObjExerciseGUI(null, $_REQUEST["exc"], false);
$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 110 of file class.ilObjBlogGUI.php.

{
$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();
}
ilObjBlogGUI::getExerciseInfo (   $a_assignment_id)

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

References $file, $ilCtrl, 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 "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 643 of file class.ilObjBlogGUI.php.

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

{
// there is no way to do a permissions check here, we have no wsp
$list = $nav = "";
if($this->items[$this->month])
{
$list = $this->renderList($this->items[$this->month], $this->month, "previewEmbedded");
$nav = $this->renderNavigation($this->items, "gethtml", "previewEmbedded");
}
return $this->buildEmbedded($list, $nav);
}

+ Here is the call graph for this function:

ilObjBlogGUI::getNotesSubId ( )

Definition at line 1394 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 53 of file class.ilObjBlogGUI.php.

{
return "blog";
}
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 320 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 330 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());
$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 58 of file class.ilObjBlogGUI.php.

{
$forms = parent::initCreationForms($a_new_type);
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 76 of file class.ilObjBlogGUI.php.

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

{
global $lng;
$notes = new ilCheckboxInputGUI($lng->txt("blog_enable_notes"), "notes");
$a_form->addItem($notes);
$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 1427 of file class.ilObjBlogGUI.php.

References $_GET, $ilCtrl, ilObject2GUI\$node_id, ilUtil\getImagePath(), ilNotification\hasNotification(), and ilNotification\TYPE_BLOG.

Referenced by addHeaderAction().

{
global $ilUser, $ilCtrl;
if(!$this->node_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"));
}
}
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 1503 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::preview ( )

Render fullscreen presentation.

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

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

Referenced by executeCommand().

{
global $lng, $ilCtrl;
if(!$this->checkPermissionBool("read"))
{
ilUtil::sendInfo($lng->txt("no_permission"));
return;
}
$list = $nav = "";
if($this->items[$this->month])
{
$list = $this->renderList($this->items[$this->month], $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::render ( )

Render object context.

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

References $ilCtrl, ilObjectGUI\$lng, ilObject2GUI\$node_id, ilObjectGUI\$ref_id, $title, ilObjectGUI\$tpl, ilObject2GUI\$tree, ilObject\_getAllReferences(), ilObject2GUI\checkPermissionBool(), ilObjExercise\findUserFiles(), getExerciseInfo(), 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->checkPermissionBool("write"))
{
$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 = $nav = "";
if($this->items[$this->month])
{
$is_owner = ($this->object->getOwner() == $ilUser->getId());
$list = $this->renderList($this->items[$this->month], $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 718 of file class.ilObjBlogGUI.php.

References $_GET, ilObjectGUI\$tpl, exit, 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 editor
if($_GET["baseClass"] == "ilPersonalDesktopGUI")
{
$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);
}
// from shared/deeplink
else
{
$back = "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&wsp_id=".$this->node_id;
}
}
// back (shared resources)
else if($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
{
$back = "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=".$owner;
}
$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 780 of file class.ilObjBlogGUI.php.

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

Referenced by buildExportTemplate(), and renderFullScreen().

{
$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);
}

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

References $ilCtrl, ilObjectGUI\$lng, $preview, $title, ilNote\_getNotesOfObject(), ilPageObject\_lookupActive(), ilCalendarUtil\_numericMonthToString(), buildExportLink(), ilObject2GUI\checkPermissionBool(), ilDatePresentation\formatDate(), ilObject2GUI\getAccessHandler(), ilObject2GUI\getPermanentLinkWidget(), IL_CAL_DATE, and IL_NOTE_PUBLIC.

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");
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);
foreach($items as $item)
{
$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
if($this->checkPermissionBool("write") && !$a_link_template && $a_cmd == "preview")
{
include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
$alist->setId($item["id"]);
$alist->setListTitle($lng->txt("actions"));
$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("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")
{
$goto = $this->getAccessHandler()->getGotoLink($this->node_id, $this->obj_id, "_".$item["id"]);
$wtpl->setCurrentBlock("permalink");
$wtpl->setVariable("URL_PERMALINK", $goto);
$wtpl->setVariable("TEXT_PERMALINK", $lng->txt("blog_permanent_link"));
$wtpl->parseCurrentBlock();
}
include_once("./Modules/Blog/classes/class.ilBlogPostingGUI.php");
$bpgui = new ilBlogPostingGUI($this->node_id, $this->getAccessHandler(), $item["id"]);
$bpgui->setRawPageContent(true);
$bpgui->setAbstractOnly(true);
// #8627: export won't work - should we set offline mode?
$bpgui->setFileDownloadLink(".");
$bpgui->setFullscreenLink(".");
$bpgui->setSourcecodeDownloadScript(".");
$snippet = $bpgui->showPage();
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");
}
// title
$wtpl->setVariable("URL_TITLE", $preview);
$wtpl->setVariable("TITLE", $item["title"]);
$wtpl->setVariable("DATETIME",
// 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 1030 of file class.ilObjBlogGUI.php.

References $ilCtrl, $month, ilPageObject\_lookupActive(), ilCalendarUtil\_numericMonthToString(), and buildExportLink().

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

{
global $ilCtrl;
$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->setCurrentBlock("navigation_item_draft");
$wtpl->setVariable("NAV_ITEM_DRAFT", $this->lng->txt("blog_draft"));
$wtpl->parseCurrentBlock();
}
$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", "");
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 1477 of file class.ilObjBlogGUI.php.

References $_GET, $ilCtrl, ilObject2GUI\$node_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 141 of file class.ilObjBlogGUI.php.

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

{
global $lng;
$this->ctrl->setParameter($this,"wsp_id",$this->node_id);
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"));
$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 119 of file class.ilObjBlogGUI.php.

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

{
$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"));
// 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 1338 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::$items
protected

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

Referenced by buildPostingList().

ilObjBlogGUI::$month
protected

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