ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjPortfolioBaseGUI Class Reference

Portfolio view gui base class. More...

+ Inheritance diagram for ilObjPortfolioBaseGUI:
+ Collaboration diagram for ilObjPortfolioBaseGUI:

Public Member Functions

 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor.
 setAdditional ($a_additional)
 Set Additonal Information (used in public profile?)
 getAdditional ()
 Get Additonal Information.
 setPermaLink ($a_obj_id, $a_type)
 Set custom perma link (used in public profile?)
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 getPageGUIClassName ()
 view ()
 Show list of portfolio pages.
 initPageForm ($a_mode="create")
 Init portfolio page form.
 savePage ()
 Create new portfolio page.
 savePortfolioPagesOrdering ()
 Save ordering of portfolio pages.
 confirmPortfolioPageDeletion ()
 Confirm portfolio deletion.
 deletePortfolioPages ()
 Delete portfolio pages.
 preview ($a_return=false, $a_content=false, $a_show_notes=true)
 Show user page.
 export ()
 copyPageForm ($a_form=null)
 Select target portfolio for page(s) copy.
 copyPage ()
 initCopyPageForm ()
 setContentStyleSheet ($a_tpl=null)
 editStyleProperties ()
 initStylePropertiesForm ()
 createStyle ()
 editStyle ()
 deleteStyle ()
 saveStyleSettings ()
- Public Member Functions inherited from ilObject2GUI
executeCommand ()
 execute command
 delete ()
 Display delete confirmation form (repository/workspace switch)
 confirmedDelete ()
 Delete objects (repository/workspace switch)
 getHTML ()
 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 ()
 getType ()
 Functions that must be overwritten.
 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 renderFullscreenHeader ($a_portfolio, $a_tpl, $a_user_id, $a_export=false)
 Render banner, user name.
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $a_obj, $a_callback_ref_id)
 After creation callback.
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root.
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root.

Protected Member Functions

 addLocatorItems ()
 Functions to be overwritten.
 determinePageCall ()
 handlePageCall ($a_cmd)
 setSettingsSubTabs ($a_active)
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 getPageInstance ($a_page_id=null, $a_portfolio_id=null)
 getPageGUIInstance ($a_page_id)
 addPage ()
 Show portfolio page creation form.
 addBlog ()
 Show portfolio blog page creation form.
 initBlogForm ()
 saveBlog ()
 initCopyPageFormOptions (ilFormPropertyGUI $a_tgt)
- 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 ()
 setTabs ()
 create tabs (repository/workspace switch)
 getReturnLocation ()
 Deprecated functions.
 setReturnLocation ()
 showActions ()
 getTitlesByRefId ()
 getTabs ()
 __showButton ()
 hitsperpageObject ()
 __initTableGUI ()
 __setTableGUIBasicData ()
 initCreationForms ($a_new_type)
 Init creation froms.
 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)
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting.
- 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.
 showMountWebfolderIcon ()
 setAdminTabs ()
 set admin tabs public
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded)
 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.
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 initEditForm ()
 Init object edit form.
 getEditFormValues ()
 Get values for edit form.
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput())
 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
 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.
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files.

Protected Attributes

 $user_id
 $additional = array()
 $perma_link
 $page_id
 $page_mode
- Protected Attributes inherited from ilObject2GUI
 $object_id
 $node_id
 $creation_forms = array()
 $id_type = array()
 $parent_id
 $access_handler

Additional Inherited Members

- Data Fields inherited from ilObject2GUI
 $tree
const OBJECT_ID = 0
const REPOSITORY_NODE_ID = 1
const WORKSPACE_NODE_ID = 2
const REPOSITORY_OBJECT_ID = 3
const WORKSPACE_OBJECT_ID = 4
const PORTFOLIO_OBJECT_ID = 5

Detailed Description

Portfolio view gui base class.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 16 of file class.ilObjPortfolioBaseGUI.php.

Constructor & Destructor Documentation

ilObjPortfolioBaseGUI::__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.ilObjPortfolioBaseGUI.php.

References $ilUser.

{
global $ilUser;
parent::__construct($a_id, $a_id_type, $a_parent_node_id);
$this->user_id = $ilUser->getId();
$this->lng->loadLanguageModule("prtf");
$this->lng->loadLanguageModule("user");
}

Member Function Documentation

ilObjPortfolioBaseGUI::addBlog ( )
protected

Show portfolio blog page creation form.

Definition at line 453 of file class.ilObjPortfolioBaseGUI.php.

References initBlogForm().

{
global $ilHelp;
$this->tabs_gui->clearTargets();
$this->tabs_gui->setBackTarget($this->lng->txt("back"),
$this->ctrl->getLinkTarget($this, "view"));
$ilHelp->setScreenIdComponent("prtf");
$ilHelp->setScreenId("add_blog");
$form = $this->initBlogForm();
$this->tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

ilObjPortfolioBaseGUI::addLocatorItems ( )
protected

Functions to be overwritten.

Reimplemented from ilObject2GUI.

Definition at line 36 of file class.ilObjPortfolioBaseGUI.php.

References ilObject\_lookupTitle(), getPageGUIClassName(), getPageInstance(), and ilPortfolioPage\TYPE_BLOG.

Referenced by ilObjPortfolioGUI\addLocator().

{
global $ilLocator;
if($this->object)
{
$ilLocator->addItem($this->object->getTitle(),
$this->ctrl->getLinkTarget($this, "view"));
}
if($this->page_id)
{
$page = $this->getPageInstance($this->page_id);
$title = $page->getTitle();
if($page->getType() == ilPortfolioPage::TYPE_BLOG)
{
$title = ilObject::_lookupTitle($title);
}
$this->ctrl->setParameterByClass($this->getPageGUIClassName(), "ppage", $this->page_id);
$ilLocator->addItem($title,
$this->ctrl->getLinkTargetByClass($this->getPageGUIClassName(), "edit"));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::addPage ( )
protected

Show portfolio page creation form.

Definition at line 340 of file class.ilObjPortfolioBaseGUI.php.

References initPageForm().

{
global $ilHelp;
$this->tabs_gui->clearTargets();
$this->tabs_gui->setBackTarget($this->lng->txt("back"),
$this->ctrl->getLinkTarget($this, "view"));
$ilHelp->setScreenIdComponent("prtf");
$ilHelp->setScreenId("add_page");
$form = $this->initPageForm("create");
$this->tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

ilObjPortfolioBaseGUI::confirmPortfolioPageDeletion ( )

Confirm portfolio deletion.

Definition at line 504 of file class.ilObjPortfolioBaseGUI.php.

References $_POST, ilObject\_lookupTitle(), getPageInstance(), ilUtil\sendInfo(), and ilPortfolioPage\TYPE_BLOG.

{
if (!is_array($_POST["prtf_pages"]) || count($_POST["prtf_pages"]) == 0)
{
ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
$this->ctrl->redirect($this, "view");
}
else
{
$this->tabs_gui->activateTab("pages");
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($this->ctrl->getFormAction($this));
$cgui->setHeaderText($this->lng->txt("prtf_sure_delete_portfolio_pages"));
$cgui->setCancel($this->lng->txt("cancel"), "view");
$cgui->setConfirm($this->lng->txt("delete"), "deletePortfolioPages");
foreach ($_POST["prtf_pages"] as $id)
{
$page = $this->getPageInstance($id);
$title = $page->getTitle();
if($page->getType() == ilPortfolioPage::TYPE_BLOG)
{
$title = $this->lng->txt("obj_blog").": ".ilObject::_lookupTitle((int)$title);
}
$cgui->addItem("prtf_pages[]", $id, $title);
}
$this->tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

ilObjPortfolioBaseGUI::copyPage ( )

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

References $_POST, $page_id, copyPageForm(), getPageInstance(), initCopyPageForm(), and ilUtil\sendSuccess().

{
$form = $this->initCopyPageForm();
if($form->checkInput())
{
// existing
if($form->getInput("target") == "old")
{
$portfolio_id = $form->getInput("prtf");
}
// new
else
{
$portfolio = new ilObjPortfolio();
$portfolio->setTitle($form->getInput("title"));
$portfolio->create();
$portfolio_id = $portfolio->getId();
}
// copy page(s)
foreach($_POST["prtf_pages"] as $page_id)
{
$source = $this->getPageInstance($page_id);
$target = $this->getPageInstance(null, $portfolio_id);
$target->setXMLContent($source->copyXmlContent(true)); // copy mobs
$target->setType($source->getType());
$target->setTitle($source->getTitle());
$target->create();
}
ilUtil::sendSuccess($this->lng->txt("prtf_pages_copied"), true);
$this->ctrl->redirect($this, "view");
}
$form->setValuesByPost();
$this->copyPageForm($form);
}

+ Here is the call graph for this function:

ilObjPortfolioBaseGUI::copyPageForm (   $a_form = null)

Select target portfolio for page(s) copy.

Definition at line 823 of file class.ilObjPortfolioBaseGUI.php.

References $_POST, $page_id, initCopyPageForm(), and ilUtil\sendInfo().

Referenced by copyPage().

{
if (!is_array($_POST["prtf_pages"]) || count($_POST["prtf_pages"]) == 0)
{
ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
$this->ctrl->redirect($this, "view");
}
else
{
$this->tabs_gui->activateTab("pages");
if(!$a_form)
{
$a_form = $this->initCopyPageForm();
}
foreach($_POST["prtf_pages"] as $page_id)
{
$item = new ilHiddenInputGUI("prtf_pages[]");
$item->setValue($page_id);
$a_form->addItem($item);
}
$this->tpl->setContent($a_form->getHTML());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::createStyle ( )

Definition at line 1006 of file class.ilObjPortfolioBaseGUI.php.

{
$this->ctrl->redirectByClass("ilobjstylesheetgui", "create");
}
ilObjPortfolioBaseGUI::deletePortfolioPages ( )

Delete portfolio pages.

Definition at line 540 of file class.ilObjPortfolioBaseGUI.php.

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

{
if(!$this->checkPermissionBool("write"))
{
return;
}
if (is_array($_POST["prtf_pages"]))
{
foreach ($_POST["prtf_pages"] as $id)
{
$page = $this->getPageInstance($id);
$page->delete();
}
}
ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_page_deleted"), true);
$this->ctrl->redirect($this, "view");
}

+ Here is the call graph for this function:

ilObjPortfolioBaseGUI::deleteStyle ( )

Definition at line 1016 of file class.ilObjPortfolioBaseGUI.php.

{
$this->ctrl->redirectByClass("ilobjstylesheetgui", "delete");
}
ilObjPortfolioBaseGUI::determinePageCall ( )
protected

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

References $_REQUEST, and ilObject2GUI\checkPermissionBool().

Referenced by ilObjPortfolioTemplateGUI\executeCommand(), and ilObjPortfolioGUI\executeCommand().

{
// edit
if(isset($_REQUEST["ppage"]))
{
if(!$this->checkPermissionBool("write"))
{
$this->ctrl->redirect($this, "view");
}
$this->page_id = $_REQUEST["ppage"];
$this->page_mode = "edit";
$this->ctrl->setParameter($this, "ppage", $this->page_id);
return true;
}
// preview
else
{
$this->page_id = $_REQUEST["user_page"];
$this->page_mode = "preview";
$this->ctrl->setParameter($this, "user_page", $this->page_id);
return false;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::editStyle ( )

Definition at line 1011 of file class.ilObjPortfolioBaseGUI.php.

{
$this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
}
ilObjPortfolioBaseGUI::editStyleProperties ( )

Definition at line 933 of file class.ilObjPortfolioBaseGUI.php.

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

{
$this->checkPermission("write");
$this->tabs_gui->activateTab("settings");
$this->setSettingsSubTabs("style");
$form = $this->initStylePropertiesForm();
$this->tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

ilObjPortfolioBaseGUI::export ( )

Definition at line 810 of file class.ilObjPortfolioBaseGUI.php.

References ilUtil\deliverFile().

{
include_once "Modules/Portfolio/classes/class.ilPortfolioHTMLExport.php";
$export = new ilPortfolioHTMLExport($this, $this->object);
$zip = $export->buildExportFile();
ilUtil::deliverFile($zip, $this->object->getTitle().".zip", '', false, true);
}

+ Here is the call graph for this function:

ilObjPortfolioBaseGUI::getAdditional ( )

Get Additonal Information.

Returns
array Additonal Information

Definition at line 144 of file class.ilObjPortfolioBaseGUI.php.

References $additional.

Referenced by ilObjPortfolioTemplateGUI\getPageGUIInstance(), and ilObjPortfolioGUI\getPageGUIInstance().

{
}

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::getEditFormCustomValues ( array &  $a_values)
protected

Add values to custom edit fields.

Parameters
array$a_values

Reimplemented from ilObjectGUI.

Reimplemented in ilObjPortfolioGUI, and ilObjPortfolioTemplateGUI.

Definition at line 220 of file class.ilObjPortfolioBaseGUI.php.

{
$a_values["comments"] = $this->object->hasPublicComments();
$a_values["ppic"] = $this->object->hasProfilePicture();
/*
$a_values["bg_color"] = $this->object->getBackgroundColor();
$a_values["font_color"] = $this->object->getFontColor();
*/
}
ilObjPortfolioBaseGUI::getPageGUIClassName ( )
abstract

Reimplemented in ilObjPortfolioGUI, and ilObjPortfolioTemplateGUI.

Referenced by ilPortfolioPageTableGUI\__construct(), and addLocatorItems().

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::getPageGUIInstance (   $a_page_id)
abstractprotected

Reimplemented in ilObjPortfolioGUI, and ilObjPortfolioTemplateGUI.

Referenced by handlePageCall(), and preview().

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::getPageInstance (   $a_page_id = null,
  $a_portfolio_id = null 
)
abstractprotected
ilObjPortfolioBaseGUI::handlePageCall (   $a_cmd)
protected

Definition at line 85 of file class.ilObjPortfolioBaseGUI.php.

References $ret, ilPortfolioPageGUI\EMBEDDED_NO_OUTPUT, ilObjStyleSheet\getEffectiveContentStyleId(), getPageGUIInstance(), ilObject2GUI\getType(), preview(), and setContentStyleSheet().

Referenced by ilObjPortfolioTemplateGUI\executeCommand(), and ilObjPortfolioGUI\executeCommand().

{
$this->tabs_gui->clearTargets();
$this->tabs_gui->setBackTarget($this->lng->txt("back"),
$this->ctrl->getLinkTarget($this, "view"));
if(!$this->page_id)
{
$this->ctrl->redirect($this, "view");
}
$page_gui = $this->getPageGUIInstance($this->page_id);
// needed for editor
$this->object->getStyleSheetId(), $this->getType()));
$ret = $this->ctrl->forwardCommand($page_gui);
if ($ret != "" && $ret !== true)
{
// preview (fullscreen)
if($this->page_mode == "preview")
{
// embedded call which did not generate any output (e.g. calendar month navigation)
{
// suppress (portfolio) notes for blog postings
$this->preview(false, $ret, ($a_cmd != "previewEmbedded"));
}
else
{
$this->preview(false);
}
}
// edit
else
{
$this->tpl->setContent($ret);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::initBlogForm ( )
abstractprotected

Reimplemented in ilObjPortfolioGUI, and ilObjPortfolioTemplateGUI.

Referenced by addBlog().

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::initCopyPageForm ( )

Definition at line 890 of file class.ilObjPortfolioBaseGUI.php.

References initCopyPageFormOptions(), and ilFormPropertyGUI\setRequired().

Referenced by copyPage(), and copyPageForm().

{
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt("prtf_copy_page"));
$tgt = new ilRadioGroupInputGUI($this->lng->txt("target"), "target");
$tgt->setRequired(true);
$form->addItem($tgt);
$form->addCommandButton("copyPage", $this->lng->txt("save"));
$form->addCommandButton("view", $this->lng->txt("cancel"));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::initCopyPageFormOptions ( ilFormPropertyGUI  $a_tgt)
abstractprotected

Reimplemented in ilObjPortfolioGUI, and ilObjPortfolioTemplateGUI.

Referenced by initCopyPageForm().

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

Add custom fields to update form.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjectGUI.

Reimplemented in ilObjPortfolioTemplateGUI.

Definition at line 179 of file class.ilObjPortfolioBaseGUI.php.

References $file, $img, ilPropertyFormGUI\addItem(), ilFileInputGUI\setPersonalWorkspaceQuotaCheck(), and setSettingsSubTabs().

Referenced by ilObjPortfolioGUI\initEditForm().

{
$this->setSettingsSubTabs("properties");
// comments
$comments = new ilCheckboxInputGUI($this->lng->txt("prtf_public_comments"), "comments");
$a_form->addItem($comments);
// profile picture
$ppic = new ilCheckboxInputGUI($this->lng->txt("prtf_profile_picture"), "ppic");
$a_form->addItem($ppic);
$prfa_set = new ilSetting("prfa");
if($prfa_set->get("banner"))
{
include_once "Services/Form/classes/class.ilFileInputGUI.php";
$dimensions = " (".$prfa_set->get("banner_width")."x".
$prfa_set->get("banner_height").")";
$img = new ilImageFileInputGUI($this->lng->txt("prtf_banner").$dimensions, "banner");
$a_form->addItem($img);
// show existing file
$file = $this->object->getImageFullPath(true);
if($file)
{
$img->setImage($file);
}
}
/* #15000
$bg_color = new ilColorPickerInputGUI($this->lng->txt("prtf_background_color"), "bg_color");
$a_form->addItem($bg_color);
$font_color = new ilColorPickerInputGUI($this->lng->txt("prtf_font_color"), "font_color");
$a_form->addItem($font_color);
*/
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::initPageForm (   $a_mode = "create")

Init portfolio page form.

Parameters
string$a_mode
Returns
ilPropertyFormGUI

Definition at line 362 of file class.ilObjPortfolioBaseGUI.php.

References ilPageLayout\activeLayouts(), ilPageLayout\MODULE_PORTFOLIO, ilTextInputGUI\setMaxLength(), ilFormPropertyGUI\setRequired(), and ilRadioOption\setTitle().

Referenced by addPage(), and savePage().

{
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
// title
$ti = new ilTextInputGUI($this->lng->txt("title"), "title");
$ti->setMaxLength(200);
$ti->setRequired(true);
$form->addItem($ti);
// save and cancel commands
if ($a_mode == "create")
{
include_once "Services/Style/classes/class.ilPageLayout.php";
if($templates)
{
$use_template = new ilRadioGroupInputGUI($this->lng->txt("prtf_use_page_layout"), "tmpl");
$use_template->setRequired(true);
$form->addItem($use_template);
$opt = new ilRadioOption($this->lng->txt("none"), 0);
$use_template->addOption($opt);
foreach ($templates as $templ)
{
$templ->readObject();
$opt = new ilRadioOption($templ->getTitle().$templ->getPreview(), $templ->getId());
$use_template->addOption($opt);
}
}
$form->setTitle($this->lng->txt("prtf_add_page").": ".
$this->object->getTitle());
$form->addCommandButton("savePage", $this->lng->txt("save"));
$form->addCommandButton("view", $this->lng->txt("cancel"));
}
else
{
/* edit is done directly in table gui
$form->setTitle($this->lng->txt("prtf_edit_page"));
$form->addCommandButton("updatePage", $this->lng->txt("save"));
$form->addCommandButton("view", $this->lng->txt("cancel"));
*/
}
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::initStylePropertiesForm ( )

Definition at line 944 of file class.ilObjPortfolioBaseGUI.php.

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

Referenced by editStyleProperties().

{
global $ilSetting;
include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$this->lng->loadLanguageModule("style");
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$fixed_style = $ilSetting->get("fixed_content_style_id");
$style_id = $this->object->getStyleSheetId();
if ($fixed_style > 0)
{
$st = new ilNonEditableValueGUI($this->lng->txt("style_current_style"));
$st->setValue(ilObject::_lookupTitle($fixed_style)." (".
$this->lng->txt("global_fixed").")");
$form->addItem($st);
}
else
{
$st_styles = ilObjStyleSheet::_getStandardStyles(true, false,
$_GET["ref_id"]);
$st_styles[0] = $this->lng->txt("default");
ksort($st_styles);
if ($style_id > 0)
{
// individual style
{
$st = new ilNonEditableValueGUI($this->lng->txt("style_current_style"));
$st->setValue(ilObject::_lookupTitle($style_id));
$form->addItem($st);
// delete command
$form->addCommandButton("editStyle", $this->lng->txt("style_edit_style"));
$form->addCommandButton("deleteStyle", $this->lng->txt("style_delete_style"));
}
}
if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id))
{
$style_sel = new ilSelectInputGUI($this->lng->txt("style_current_style"),
"style_id");
$style_sel->setOptions($st_styles);
$style_sel->setValue($style_id);
$form->addItem($style_sel);
$form->addCommandButton("saveStyleSettings", $this->lng->txt("save"));
$form->addCommandButton("createStyle", $this->lng->txt("sty_create_ind_style"));
}
}
$form->setTitle($this->lng->txt($this->getType()."_style"));
$form->setFormAction($this->ctrl->getFormAction($this));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::preview (   $a_return = false,
  $a_content = false,
  $a_show_notes = true 
)

Show user page.

Reimplemented in ilObjPortfolioTemplateGUI.

Definition at line 562 of file class.ilObjPortfolioBaseGUI.php.

References $_GET, $_REQUEST, $ilSetting, ilObject2GUI\$parent_id, ilObject2GUI\$tree, $user_id, ilLink\_getStaticLink(), ilObject2\_lookupTitle(), ilObject2GUI\checkPermissionBool(), ilPortfolioPage\getAllPages(), getPageGUIInstance(), ilObject2GUI\getType(), ilMainMenuGUI\MODE_TOPBAR_ONLY, renderFullscreenHeader(), setContentStyleSheet(), and ilPortfolioPage\TYPE_BLOG.

Referenced by ilObjPortfolioGUI\executeCommand(), and handlePageCall().

{
global $ilSetting;
$portfolio_id = $this->object->getId();
$user_id = $this->object->getOwner();
$this->tabs_gui->clearTargets();
$pages = ilPortfolioPage::getAllPages($portfolio_id);
$current_page = (int)$_GET["user_page"];
// validate current page
if($pages && $current_page)
{
$found = false;
foreach($pages as $page)
{
if($page["id"] == $current_page)
{
$found = true;
break;
}
}
if(!$found)
{
$current_page = null;
}
}
// display first page of portfolio if none given
if(!$current_page && $pages)
{
$current_page = $pages;
$current_page = array_shift($current_page);
$current_page = $current_page["id"];
}
// #13788 - keep page after login
if($this->user_id == ANONYMOUS_USER_ID &&
$this->getType() == "prtf")
{
$this->tpl->setLoginTargetPar("prtf_".$this->object->getId()."_".$current_page);
}
// public profile
if($_REQUEST["back_url"])
{
$back = $_REQUEST["back_url"];
}
else if($_GET["baseClass"] != "ilPublicUserProfileGUI" &&
$this->user_id && $this->user_id != ANONYMOUS_USER_ID)
{
if(!$this->checkPermissionBool("write"))
{
// shared
if($this->getType() == "prtf")
{
$this->ctrl->setParameterByClass("ilportfoliorepositorygui", "shr_id", $this->object->getOwner());
$back = $this->ctrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilportfoliorepositorygui"), "showOther");
$this->ctrl->setParameterByClass("ilportfoliorepositorygui", "shr_id", "");
}
// listgui / parent container
else
{
// #12819
global $tree;
$parent_id = $tree->getParentId($this->node_id);
include_once "Services/Link/classes/class.ilLink.php";
}
}
// owner
else
{
$back = $this->ctrl->getLinkTarget($this, "view");
}
}
global $ilMainMenu;
$ilMainMenu->setMode(ilMainMenuGUI::MODE_TOPBAR_ONLY);
if($back)
{
// might already be set in ilPublicUserProfileGUI
$ilMainMenu->setTopBarBack($back);
}
// render tabs
$current_blog = null;
if(count($pages) > 1)
{
foreach ($pages as $p)
{
if($p["type"] == ilPortfolioPage::TYPE_BLOG)
{
// needed for blog comments (see below)
if($p["id"] == $current_page)
{
$current_blog = (int)$p["title"];
}
include_once "Modules/Blog/classes/class.ilObjBlog.php";
$p["title"] = ilObjBlog::_lookupTitle($p["title"]);
}
$this->ctrl->setParameter($this, "user_page", $p["id"]);
$this->tabs_gui->addTab("user_page_".$p["id"],
$p["title"],
$this->ctrl->getLinkTarget($this, "preview"));
}
$this->tabs_gui->activateTab("user_page_".$current_page);
}
$this->ctrl->setParameter($this, "user_page", $current_page);
if(!$a_content)
{
// get current page content
$page_gui = $this->getPageGUIInstance($current_page);
$page_gui->setEmbedded(true);
$content = $this->ctrl->getHTML($page_gui);
}
else
{
$content = $a_content;
}
if($a_return && $this->checkPermissionBool("write"))
{
return $content;
}
// blog posting comments are handled within the blog
$notes = "";
if($a_show_notes && $this->object->hasPublicComments() && !$current_blog)
{
include_once("./Services/Notes/classes/class.ilNoteGUI.php");
$note_gui = new ilNoteGUI($portfolio_id, $current_page, "pfpg");
$note_gui->setRepositoryMode(false);
$note_gui->enablePublicNotes(true);
$note_gui->enablePrivateNotes(false);
$note_gui->enablePublicNotesDeletion(($this->user_id == $user_id) &&
$ilSetting->get("comments_del_tutor", 1));
$next_class = $this->ctrl->getNextClass($this);
if ($next_class == "ilnotegui")
{
$notes = $this->ctrl->forwardCommand($note_gui);
}
else
{
$notes = $note_gui->getNotesHTML();
}
}
if($this->perma_link === null)
{
if($this->getType() == "prtf")
{
$this->tpl->setPermanentLink($this->getType(), $this->object->getId(), "_".$current_page);
}
else
{
$this->tpl->setPermanentLink($this->getType(), $this->object->getRefId());
}
}
else
{
$this->tpl->setPermanentLink($this->perma_link["type"], $this->perma_link["obj_id"]);
}
self::renderFullscreenHeader($this->object, $this->tpl, $user_id);
// #13564
$this->ctrl->setParameter($this, "user_page", "");
$this->tpl->setTitleUrl($this->ctrl->getLinkTarget($this, "preview"));
$this->ctrl->setParameter($this, "user_page", $this->page_id);
// blog pages do their own (page) style handling
if(!$current_blog)
{
$content = '<div id="ilCOPageContent" class="ilc_page_cont_PageContainer">'.
'<div class="ilc_page_Page">'.
$content.
'</div></div>';
$this->setContentStyleSheet($this->tpl);
}
// #10717
$this->tpl->setContent($content.
'<div class="ilClearFloat">'.$notes.'</div>');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilObjPortfolioBaseGUI::renderFullscreenHeader (   $a_portfolio,
  $a_tpl,
  $a_user_id,
  $a_export = false 
)
static

Render banner, user name.

Parameters
object$a_tpl
int$a_user_id
bool$a_export_path

Definition at line 765 of file class.ilObjPortfolioBaseGUI.php.

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

Referenced by ilPortfolioHTMLExport\buildExportTemplate(), and preview().

{
$name = ilObjUser::_lookupName($a_user_id);
$name = $name["lastname"].", ".($t = $name["title"] ? $t . " " : "").$name["firstname"];
// show banner?
$banner = $banner_width = $banner_height = false;
$prfa_set = new ilSetting("prfa");
if($prfa_set->get("banner"))
{
$banner = $a_portfolio->getImageFullPath();
$banner_width = $prfa_set->get("banner_width");
$banner_height = $prfa_set->get("banner_height");
if($a_export)
{
$banner = basename($banner);
}
}
// profile picture
$ppic = null;
if($a_portfolio->hasProfilePicture())
{
$ppic = ilObjUser::_getPersonalPicturePath($a_user_id, "xsmall", true, true);
if($a_export)
{
$ppic = basename($ppic);
}
}
$a_tpl->resetHeaderBlock(false);
// $a_tpl->setBackgroundColor($a_portfolio->getBackgroundColor());
$a_tpl->setBanner($banner, $banner_width, $banner_height, $a_export);
$a_tpl->setTitleIcon($ppic);
$a_tpl->setTitle($a_portfolio->getTitle());
// $a_tpl->setTitleColor($a_portfolio->getFontColor());
$a_tpl->setDescription($name);
// to get rid of locator in portfolio template preview
$a_tpl->setVariable("LOCATOR", "");
// :TODO: obsolete?
// $a_tpl->setBodyClass("std ilExternal ilPortfolio");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::saveBlog ( )
abstractprotected
ilObjPortfolioBaseGUI::savePage ( )

Create new portfolio page.

Definition at line 417 of file class.ilObjPortfolioBaseGUI.php.

References ilObject2GUI\checkPermissionBool(), getPageInstance(), initPageForm(), ilUtil\sendSuccess(), and ilPortfolioPage\TYPE_PAGE.

{
$form = $this->initPageForm("create");
if ($form->checkInput() && $this->checkPermissionBool("write"))
{
include_once("Modules/Portfolio/classes/class.ilPortfolioPage.php");
$page = $this->getPageInstance();
$page->setType(ilPortfolioPage::TYPE_PAGE);
$page->setTitle($form->getInput("title"));
// use template as basis
$layout_id = $form->getInput("tmpl");
if($layout_id)
{
include_once("./Services/Style/classes/class.ilPageLayout.php");
$layout_obj = new ilPageLayout($layout_id);
$page->setXMLContent($layout_obj->getXMLContent());
}
$page->create();
ilUtil::sendSuccess($this->lng->txt("prtf_page_created"), true);
$this->ctrl->redirect($this, "view");
}
$this->tabs_gui->clearTargets();
$this->tabs_gui->setBackTarget($this->lng->txt("back"),
$this->ctrl->getLinkTarget($this, "view"));
$form->setValuesByPost();
$this->tpl->setContent($form->getHtml());
}

+ Here is the call graph for this function:

ilObjPortfolioBaseGUI::savePortfolioPagesOrdering ( )

Save ordering of portfolio pages.

Definition at line 475 of file class.ilObjPortfolioBaseGUI.php.

References $_POST, ilObject2GUI\checkPermissionBool(), ilPortfolioPage\fixOrdering(), getPageInstance(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

{
if(!$this->checkPermissionBool("write"))
{
return;
}
if (is_array($_POST["order"]))
{
foreach ($_POST["order"] as $k => $v)
{
$page = $this->getPageInstance(ilUtil::stripSlashes($k));
if($_POST["title"][$k])
{
$page->setTitle(ilUtil::stripSlashes($_POST["title"][$k]));
}
$page->setOrderNr(ilUtil::stripSlashes($v));
$page->update();
}
ilPortfolioPage::fixOrdering($this->object->getId());
}
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
$this->ctrl->redirect($this, "view");
}

+ Here is the call graph for this function:

ilObjPortfolioBaseGUI::saveStyleSettings ( )

Definition at line 1021 of file class.ilObjPortfolioBaseGUI.php.

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

{
global $ilSetting;
include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
if ($ilSetting->get("fixed_content_style_id") <= 0 &&
(ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId())
|| $this->object->getStyleSheetId() == 0))
{
$this->object->setStyleSheetId(ilUtil::stripSlashes($_POST["style_id"]));
$this->object->update();
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
}
$this->ctrl->redirect($this, "editStyleProperties");
}

+ Here is the call graph for this function:

ilObjPortfolioBaseGUI::setAdditional (   $a_additional)

Set Additonal Information (used in public profile?)

Parameters
array$a_additionalAdditonal Information

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

{
$this->additional = $a_additional;
}
ilObjPortfolioBaseGUI::setContentStyleSheet (   $a_tpl = null)

Definition at line 914 of file class.ilObjPortfolioBaseGUI.php.

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

Referenced by handlePageCall(), and preview().

{
global $tpl;
if ($a_tpl != null)
{
$ctpl = $a_tpl;
}
else
{
$ctpl = $tpl;
}
$ctpl->setCurrentBlock("ContentStyle");
$ctpl->setVariable("LOCATION_CONTENT_STYLESHEET",
ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
$ctpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::setPermaLink (   $a_obj_id,
  $a_type 
)

Set custom perma link (used in public profile?)

Parameters
int$a_obj_id
string$a_type

Definition at line 155 of file class.ilObjPortfolioBaseGUI.php.

{
$this->perma_link = array("obj_id"=>$a_obj_id, "type"=>$a_type);
}
ilObjPortfolioBaseGUI::setSettingsSubTabs (   $a_active)
protected

Definition at line 165 of file class.ilObjPortfolioBaseGUI.php.

Referenced by editStyleProperties(), and initEditCustomForm().

{
// general properties
$this->tabs_gui->addSubTab("properties",
$this->lng->txt($this->getType()."_properties"),
$this->ctrl->getLinkTarget($this, 'edit'));
$this->tabs_gui->addSubTab("style",
$this->lng->txt("obj_sty"),
$this->ctrl->getLinkTarget($this, 'editStyleProperties'));
$this->tabs_gui->activateSubTab($a_active);
}

+ Here is the caller graph for this function:

ilObjPortfolioBaseGUI::updateCustom ( ilPropertyFormGUI  $a_form)

Insert custom update form values into object.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjectGUI.

Reimplemented in ilObjPortfolioGUI, and ilObjPortfolioTemplateGUI.

Definition at line 230 of file class.ilObjPortfolioBaseGUI.php.

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

{
$this->object->setPublicComments($a_form->getInput("comments"));
$this->object->setProfilePicture($a_form->getInput("ppic"));
/*
$this->object->setBackgroundColor($a_form->getInput("bg_color"));
$this->object->setFontcolor($a_form->getInput("font_color"));
*/
$prfa_set = new ilSetting("prfa");
if($_FILES["banner"]["tmp_name"])
{
$this->object->uploadImage($_FILES["banner"]);
}
else if($prfa_set->get('banner') and $a_form->getItemByPostVar("banner")->getDeletionFlag())
{
$this->object->deleteImage();
}
}

+ Here is the call graph for this function:

ilObjPortfolioBaseGUI::view ( )

Show list of portfolio pages.

Reimplemented from ilObject2GUI.

Definition at line 265 of file class.ilObjPortfolioBaseGUI.php.

References $ilSetting, ilObjectGUI\$ref_id, ilObject2GUI\$tree, ilObject\_getAllReferences(), ilObject2GUI\checkPermissionBool(), ilObjExercise\findUserFiles(), ilLinkButton\getInstance(), and ilUtil\sendInfo().

{
global $ilToolbar, $ilSetting, $tree;
if(!$this->checkPermissionBool("write"))
{
$this->ctrl->redirect($this, "infoScreen");
}
$this->tabs_gui->activateTab("pages");
include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
$button->setCaption("prtf_add_page");
$button->setUrl($this->ctrl->getLinkTarget($this, "addPage"));
$ilToolbar->addButtonInstance($button);
if(!$ilSetting->get('disable_wsp_blogs'))
{
$button->setCaption("prtf_add_blog");
$button->setUrl($this->ctrl->getLinkTarget($this, "addBlog"));
$ilToolbar->addButtonInstance($button);
}
$ilToolbar->addSeparator();
$button->setCaption("export_html");
$button->setUrl($this->ctrl->getLinkTarget($this, "export"));
$ilToolbar->addButtonInstance($button);
include_once "Modules/Portfolio/classes/class.ilPortfolioPageTableGUI.php";
$table = new ilPortfolioPageTableGUI($this, "view");
// exercise portfolio?
include_once "Modules/Exercise/classes/class.ilObjExercise.php";
$exercises = ilObjExercise::findUserFiles($this->user_id, $this->object->getId());
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"], $table->dataExists());
if($part)
{
$info[] = $part;
}
}
}
if(sizeof($info))
{
ilUtil::sendInfo(implode("<br />", $info));
}
}
$this->tpl->setContent($table->getHTML());
}

+ Here is the call graph for this function:

Field Documentation

ilObjPortfolioBaseGUI::$additional = array()
protected

Definition at line 19 of file class.ilObjPortfolioBaseGUI.php.

Referenced by getAdditional().

ilObjPortfolioBaseGUI::$page_id
protected

Definition at line 21 of file class.ilObjPortfolioBaseGUI.php.

Referenced by copyPage(), and copyPageForm().

ilObjPortfolioBaseGUI::$page_mode
protected

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

ilObjPortfolioBaseGUI::$perma_link
protected

Definition at line 20 of file class.ilObjPortfolioBaseGUI.php.

ilObjPortfolioBaseGUI::$user_id
protected

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