ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilNewsItemGUI Class Reference

User Interface for NewsItem entities. More...

+ Inheritance diagram for ilNewsItemGUI:
+ Collaboration diagram for ilNewsItemGUI:

Public Member Functions

 __construct ()
 Constructor.
 getHTML ()
 prepareBlockNewsForContext (&$a_block_gui)
 BLOCK NewsForContext: Prepare block.
 prepareBlockQueryNewsForContext (&$a_news_item)
 BLOCK NewsForContext: Prepare block query for news block.
 prepareSaveNewsItem (&$a_news_item)
 FORM NewsItem: Prepare saving.
 prepareFormNewsItem (&$a_form_gui)
 FORM NewsItem: Prepare form.
 saveNewsItem ()
 FORM NewsItem: Save NewsItem.
 exitSaveNewsItem ()
 FORM NewsItem: Exit save.
 updateNewsItem ()
 FORM NewsItem: Save NewsItem.
 exitUpdateNewsItem ()
 FORM NewsItem: Exit update.
 cancelUpdateNewsItem ()
 FORM NewsItem: Save NewsItem.
 cancelSaveNewsItem ()
 FORM NewsItem: Save NewsItem.
 editNews ()
 cancelUpdate ()
 prepareTableNewsForContext (&$a_table_gui)
 TABLE MewsForContext: Prepare the new table.
 confirmDeletionNewsItems ()
 Confirmation Screen.
 deleteNewsItems ()
 Delete news items.
- Public Member Functions inherited from ilNewsItemGUIGen
executeCommand ()
 Execute command.
 setEnableEdit ($a_enable_edit=0)
 Set EnableEdit.
 getEnableEdit ()
 Get EnableEdit.
 setContextObjId ($a_context_obj_id)
 Set ContextObjId.
 getContextObjId ()
 Get ContextObjId.
 setContextObjType ($a_context_obj_type)
 Set ContextObjType.
 getContextObjType ()
 Get ContextObjType.
 setContextSubObjId ($a_context_sub_obj_id)
 Set ContextSubObjId.
 getContextSubObjId ()
 Get ContextSubObjId.
 setContextSubObjType ($a_context_sub_obj_type)
 Set ContextSubObjType.
 getContextSubObjType ()
 Get ContextSubObjType.
 setFormEditMode ($a_form_edit_mode)
 Set FormEditMode.
 getFormEditMode ()
 Get FormEditMode.
 createNewsItem ()
 FORM NewsItem: Create NewsItem.
 editNewsItem ()
 FORM NewsItem: Edit form.
 initFormNewsItem ($a_mode)
 FORM NewsItem: Init form.
 getValuesNewsItem ()
 FORM NewsItem: Get current values for NewsItem form.
 getNewsForContextBlock ()
 BLOCK NewsForContext: Get block HTML.
 getNewsForContextTable ()
 TABLE NewsForContext: Get table HTML.
 prepareTableQueryNewsForContext (&$a_news_item)
 TABLE NewsForContext: Prepare query for getting data for list table.

Additional Inherited Members

- Protected Attributes inherited from ilNewsItemGUIGen
 $enable_edit = 0
 $context_obj_id
 $context_obj_type
 $context_sub_obj_id
 $context_sub_obj_type
 $form_edit_mode

Detailed Description

User Interface for NewsItem entities.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilNewsItemGUI.php 20152 2009-06-08 18:41:37Z akill

Definition at line 14 of file class.ilNewsItemGUI.php.

Constructor & Destructor Documentation

ilNewsItemGUI::__construct ( )

Constructor.

Reimplemented from ilNewsItemGUIGen.

Definition at line 17 of file class.ilNewsItemGUI.php.

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->saveParameter($this, "add_mode");
}

Member Function Documentation

ilNewsItemGUI::cancelSaveNewsItem ( )

FORM NewsItem: Save NewsItem.

Reimplemented from ilNewsItemGUIGen.

Definition at line 160 of file class.ilNewsItemGUI.php.

References $_GET, $ilCtrl, and editNews().

{
global $ilCtrl;
if ($_GET["add_mode"] == "block")
{
$ilCtrl->returnToParent($this);
}
else
{
return $this->editNews();
}
}

+ Here is the call graph for this function:

ilNewsItemGUI::cancelUpdate ( )

Definition at line 184 of file class.ilNewsItemGUI.php.

References editNews().

{
return $this->editNews();
}

+ Here is the call graph for this function:

ilNewsItemGUI::cancelUpdateNewsItem ( )

FORM NewsItem: Save NewsItem.

Reimplemented from ilNewsItemGUIGen.

Definition at line 151 of file class.ilNewsItemGUI.php.

References editNews().

{
return $this->editNews();
}

+ Here is the call graph for this function:

ilNewsItemGUI::confirmDeletionNewsItems ( )

Confirmation Screen.

Definition at line 207 of file class.ilNewsItemGUI.php.

References $_POST, $ilCtrl, $lng, editNews(), ilNewsItemGUIGen\getEnableEdit(), ilUtil\getImagePath(), and ilUtil\sendFailure().

{
global $ilCtrl, $lng;
if (!$this->getEnableEdit())
{
return;
}
// check whether at least one item is selected
if (count($_POST["news_id"]) == 0)
{
ilUtil::sendFailure($lng->txt("no_checkbox"));
return $this->editNews();
}
include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
$c_gui = new ilConfirmationGUI();
// set confirm/cancel commands
$c_gui->setFormAction($ilCtrl->getFormAction($this, "deleteNewsItems"));
$c_gui->setHeaderText($lng->txt("info_delete_sure"));
$c_gui->setCancel($lng->txt("cancel"), "editNews");
$c_gui->setConfirm($lng->txt("confirm"), "deleteNewsItems");
// add items to delete
foreach($_POST["news_id"] as $news_id)
{
$news = new ilNewsItem($news_id);
$c_gui->addItem("news_id[]", $news_id, $news->getTitle(),
ilUtil::getImagePath("icon_news.gif"));
}
return $c_gui->getHTML();
}

+ Here is the call graph for this function:

ilNewsItemGUI::deleteNewsItems ( )

Delete news items.

Definition at line 246 of file class.ilNewsItemGUI.php.

References $_POST, editNews(), and ilNewsItemGUIGen\getEnableEdit().

{
if (!$this->getEnableEdit())
{
return;
}
// delete all selected news items
foreach($_POST["news_id"] as $news_id)
{
$news = new ilNewsItem($news_id);
$news->delete();
}
return $this->editNews();
}

+ Here is the call graph for this function:

ilNewsItemGUI::editNews ( )

Definition at line 174 of file class.ilNewsItemGUI.php.

References ilNewsItemGUIGen\getEnableEdit(), and ilNewsItemGUIGen\getNewsForContextTable().

Referenced by cancelSaveNewsItem(), cancelUpdate(), cancelUpdateNewsItem(), confirmDeletionNewsItems(), and deleteNewsItems().

{
if (!$this->getEnableEdit())
{
return;
}
return $this->getNewsForContextTable();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNewsItemGUI::exitSaveNewsItem ( )

FORM NewsItem: Exit save.

(Can be overwritten in derived classes)

Reimplemented from ilNewsItemGUIGen.

Definition at line 112 of file class.ilNewsItemGUI.php.

References $_GET, and $ilCtrl.

{
global $ilCtrl;
if ($_GET["add_mode"] == "block")
{
$ilCtrl->returnToParent($this);
}
else
{
$ilCtrl->redirect($this, "editNews");
}
}
ilNewsItemGUI::exitUpdateNewsItem ( )

FORM NewsItem: Exit update.

(Can be overwritten in derived classes)

Reimplemented from ilNewsItemGUIGen.

Definition at line 140 of file class.ilNewsItemGUI.php.

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->redirect($this, "editNews");
}
ilNewsItemGUI::getHTML ( )

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

References $ilCtrl, $lng, and ilNewsItemGUIGen\getNewsForContextBlock().

{
global $lng, $ilCtrl;
$lng->LoadLanguageModule("news");
return $this->getNewsForContextBlock();
}

+ Here is the call graph for this function:

ilNewsItemGUI::prepareBlockNewsForContext ( $a_block_gui)

BLOCK NewsForContext: Prepare block.

(Can be overwritten in derived classes)

Parameters
object$a_block_guiilBlockGUI instance.

Reimplemented from ilNewsItemGUIGen.

Definition at line 40 of file class.ilNewsItemGUI.php.

References ilNewsItemGUIGen\getEnableEdit().

{
$a_block_gui->setParentClass("ilinfoscreengui");
$a_block_gui->setParentCmd("showSummary");
$a_block_gui->setEnableEdit($this->getEnableEdit());
}

+ Here is the call graph for this function:

ilNewsItemGUI::prepareBlockQueryNewsForContext ( $a_news_item)

BLOCK NewsForContext: Prepare block query for news block.

Reimplemented from ilNewsItemGUIGen.

Definition at line 50 of file class.ilNewsItemGUI.php.

{
$a_news_item->setContextObjId($this->ctrl->getContextObjId());
$a_news_item->setContextObjType($this->ctrl->getContextObjType());
}
ilNewsItemGUI::prepareFormNewsItem ( $a_form_gui)

FORM NewsItem: Prepare form.

Parameters
object$a_form_guiilPropertyFormGUI instance.

Reimplemented from ilNewsItemGUIGen.

Definition at line 79 of file class.ilNewsItemGUI.php.

References $_GET, ilNewsItem\_getDefaultVisibilityForRefId(), and ilUtil\getImagePath().

{
$a_form_gui->setTitleIcon(ilUtil::getImagePath("icon_news.gif"));
$news_set = new ilSetting("news");
if (!$news_set->get("enable_rss_for_internal"))
{
$a_form_gui->removeItemByPostVar("news_visibility");
}
else
{
$nv = $a_form_gui->getItemByPostVar("news_visibility");
if (is_object($nv))
{
}
}
}

+ Here is the call graph for this function:

ilNewsItemGUI::prepareSaveNewsItem ( $a_news_item)

FORM NewsItem: Prepare saving.

Reimplemented from ilNewsItemGUIGen.

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

{
global $ilUser;
$a_news_item->setContextObjId($this->ctrl->getContextObjId());
$a_news_item->setContextObjType($this->ctrl->getContextObjType());
$a_news_item->setUserId($ilUser->getId());
$news_set = new ilSetting("news");
if (!$news_set->get("enable_rss_for_internal"))
{
$a_news_item->setVisibility("users");
}
}
ilNewsItemGUI::prepareTableNewsForContext ( $a_table_gui)

TABLE MewsForContext: Prepare the new table.

Reimplemented from ilNewsItemGUIGen.

Definition at line 192 of file class.ilNewsItemGUI.php.

References $ilCtrl, and $lng.

{
global $ilCtrl, $lng;
$a_table_gui->setDefaultOrderField("creation_date");
$a_table_gui->setDefaultOrderDirection("desc");
$a_table_gui->addCommandButton("createNewsItem", $lng->txt("add"));
$a_table_gui->addMultiCommand("confirmDeletionNewsItems", $lng->txt("delete"));
$a_table_gui->setTitle($lng->txt("news"), "icon_news.gif", $lng->txt("news"));
$a_table_gui->setSelectAllCheckbox("news_id");
}
ilNewsItemGUI::saveNewsItem ( )

FORM NewsItem: Save NewsItem.

Reimplemented from ilNewsItemGUIGen.

Definition at line 102 of file class.ilNewsItemGUI.php.

References ilNewsItemGUIGen\getEnableEdit().

{
if (!$this->getEnableEdit())
{
return;
}
}

+ Here is the call graph for this function:

ilNewsItemGUI::updateNewsItem ( )

FORM NewsItem: Save NewsItem.

Reimplemented from ilNewsItemGUIGen.

Definition at line 130 of file class.ilNewsItemGUI.php.

References ilNewsItemGUIGen\getEnableEdit().

{
if (!$this->getEnableEdit())
{
return;
}
}

+ Here is the call graph for this function:


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