ILIAS  Release_3_10_x_branch Revision 61812
 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 13897 2007-05-15 11:15:02Z akill

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

Constructor & Destructor Documentation

ilNewsItemGUI::__construct ( )

Constructor.

Reimplemented from ilNewsItemGUIGen.

Definition at line 37 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 180 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 204 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 171 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 227 of file class.ilNewsItemGUI.php.

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

{
global $ilCtrl, $lng;
if (!$this->getEnableEdit())
{
return;
}
// check whether at least one item is selected
if (count($_POST["news_id"]) == 0)
{
ilUtil::sendInfo($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 266 of file class.ilNewsItemGUI.php.

References 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 194 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 132 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 160 of file class.ilNewsItemGUI.php.

References $ilCtrl.

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

Definition at line 46 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 60 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 70 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 99 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 79 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 212 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 122 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 150 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: