ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjNewsSettingsGUI Class Reference

News Settings. More...

+ Inheritance diagram for ilObjNewsSettingsGUI:
+ Collaboration diagram for ilObjNewsSettingsGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Contructor.
 executeCommand ()
 Execute command.
 getAdminTabs ()
 Get tabs.
 editSettings ()
 Edit news settings.
 saveSettings ()
 Save news and external webfeeds settings.
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 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
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 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
 createObject ()
 create new object form
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 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.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

Static Private Attributes

static $ERROR_MESSAGE

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 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
 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
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 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= '')
 hitsperpageObject ()
__initTableGUI ()
 __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
 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.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Detailed Description

News Settings.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilObjNewsSettingsGUI: ilPermissionGUI

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

Constructor & Destructor Documentation

ilObjNewsSettingsGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Contructor.

public

Definition at line 24 of file class.ilObjNewsSettingsGUI.php.

References ilObjectGUI\ilObjectGUI().

{
$this->type = 'nwss';
parent::ilObjectGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
$this->lng->loadLanguageModule('news');
$this->lng->loadLanguageModule('feed');
}

+ Here is the call graph for this function:

Member Function Documentation

ilObjNewsSettingsGUI::editSettings ( )

Edit news settings.

Definition at line 103 of file class.ilObjNewsSettingsGUI.php.

References $feed_set, $ilCtrl, $ilSetting, ilObjectGUI\$lng, ilNewsItem\_lookupDefaultPDPeriod(), ilNewsItem\_lookupRSSPeriod(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), and ilCheckboxInputGUI\setValue().

{
$news_set = new ilSetting("news");
$feed_set = new ilSetting("feed");
$enable_internal_news = $ilSetting->get("block_activated_news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
$rss_title_format = $news_set->get("rss_title_format");
$enable_private_feed = $news_set->get("enable_private_feed");
$news_default_visibility = ($news_set->get("default_visibility") != "")
? $news_set->get("default_visibility")
: "users";
$disable_repository_feeds = $feed_set->get("disable_rep_feeds");
$nr_personal_desktop_feeds = $ilSetting->get("block_limit_pdfeed");
$allow_shorter_periods = $news_set->get("allow_shorter_periods");
$allow_longer_periods = $news_set->get("allow_longer_periods");
include_once("./Services/News/classes/class.ilNewsItem.php");
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
$form->setTitle($lng->txt("news_settings"));
// Enable internal news
$cb_prop = new ilCheckboxInputGUI($lng->txt("news_enable_internal_news"),
"enable_internal_news");
$cb_prop->setValue("1");
$cb_prop->setInfo($lng->txt("news_enable_internal_news_info"));
$cb_prop->setChecked($enable_internal_news);
$form->addItem($cb_prop);
// Enable rss for internal news
$cb_prop = new ilCheckboxInputGUI($lng->txt("news_enable_internal_rss"),
"enable_internal_rss");
$cb_prop->setValue("1");
$cb_prop->setInfo($lng->txt("news_enable_internal_rss_info"));
$cb_prop->setChecked($enable_internal_rss);
// RSS News Period
$rssp_opts = array(
2 => "2 ".$lng->txt("days"),
3 => "3 ".$lng->txt("days"),
5 => "5 ".$lng->txt("days"),
7 => "1 ".$lng->txt("week"),
14 => "2 ".$lng->txt("weeks"),
30 => "1 ".$lng->txt("month"),
60 => "2 ".$lng->txt("months"),
120 => "4 ".$lng->txt("months"),
180 => "6 ".$lng->txt("months"),
365 => "1 ".$lng->txt("year")
);
$rssp_sel = new ilSelectInputGUI($lng->txt("news_rss_period"),
"news_rss_period");
$rssp_sel->setOptions($rssp_opts);
$rssp_sel->setValue((int) $rss_period);
$cb_prop->addSubItem($rssp_sel);
// title format for rss entries
$options = array(
"" => $lng->txt("news_rss_title_format_obj_news"),
"news_obj" => $lng->txt("news_rss_title_format_news_obj"),
);
$si = new ilSelectInputGUI($lng->txt("news_rss_title_format"), "rss_title_format");
$si->setOptions($options);
$si->setValue($rss_title_format);
$cb_prop->addSubItem($si);
$form->addItem($cb_prop);
// Enable private news feed
$cb_prop = new ilCheckboxInputGUI($lng->txt("news_enable_private_feed"),
"enable_private_feed");
$cb_prop->setValue("1");
$cb_prop->setInfo($lng->txt("news_enable_private_feed_info"));
$cb_prop->setChecked($enable_private_feed);
$form->addItem($cb_prop);
// Default Visibility
$radio_group = new ilRadioGroupInputGUI($lng->txt("news_default_visibility"), "news_default_visibility");
$radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "users");
$radio_group->addOption($radio_option);
$radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "public");
$radio_group->addOption($radio_option);
$radio_group->setInfo($lng->txt("news_news_item_visibility_info"));
$radio_group->setRequired(false);
$radio_group->setValue($news_default_visibility);
$form->addItem($radio_group);
// Number of news items per object
$nr_opts = array(50 => 50, 100 => 100, 200 => 200);
$nr_sel = new ilSelectInputGUI($lng->txt("news_nr_of_items"),
"news_max_items");
$nr_sel->setInfo($lng->txt("news_nr_of_items_info"));
$nr_sel->setOptions($nr_opts);
$nr_sel->setValue($news_set->get("max_items"));
$form->addItem($nr_sel);
// Access Cache
$min_opts = array(0 => 0, 1 => 1, 2 => 2, 5 => 5, 10 => 10, 20 => 20, 30 => 30, 60 => 60);
$min_sel = new ilSelectInputGUI($lng->txt("news_cache"),
"news_acc_cache_mins");
$min_sel->setInfo($lng->txt("news_cache_info"));
$min_sel->setOptions($min_opts);
$min_sel->setValue($news_set->get("acc_cache_mins"));
$form->addItem($min_sel);
// PD News Period
$per_opts = array(
2 => "2 ".$lng->txt("days"),
3 => "3 ".$lng->txt("days"),
5 => "5 ".$lng->txt("days"),
7 => "1 ".$lng->txt("week"),
14 => "2 ".$lng->txt("weeks"),
30 => "1 ".$lng->txt("month"),
60 => "2 ".$lng->txt("months"),
120 => "4 ".$lng->txt("months"),
180 => "6 ".$lng->txt("months"),
366 => "1 ".$lng->txt("year"));
$per_sel = new ilSelectInputGUI($lng->txt("news_pd_period"),
"news_pd_period");
$per_sel->setInfo($lng->txt("news_pd_period_info"));
$per_sel->setOptions($per_opts);
$per_sel->setValue((int) ilNewsItem::_lookupDefaultPDPeriod());
$form->addItem($per_sel);
// Allow user to choose lower values
$sp_prop = new ilCheckboxInputGUI($lng->txt("news_allow_shorter_periods"),
"allow_shorter_periods");
$sp_prop->setValue("1");
$sp_prop->setInfo($lng->txt("news_allow_shorter_periods_info"));
$sp_prop->setChecked($allow_shorter_periods);
$form->addItem($sp_prop);
// Allow user to choose higher values
$lp_prop = new ilCheckboxInputGUI($lng->txt("news_allow_longer_periods"),
"allow_longer_periods");
$lp_prop->setValue("1");
$lp_prop->setInfo($lng->txt("news_allow_longer_periods_info"));
$lp_prop->setChecked($allow_longer_periods);
$form->addItem($lp_prop);
// Section Header: External Web Feeds Settings
$sh->setTitle($lng->txt("feed_settings"));
$form->addItem($sh);
// Disable External Web Feeds in catetegories
$cb_prop = new ilCheckboxInputGUI($lng->txt("feed_disable_rep_feeds"),
"disable_repository_feeds");
$cb_prop->setValue("1");
$cb_prop->setInfo($lng->txt("feed_disable_rep_feeds_info"));
$cb_prop->setChecked($disable_repository_feeds);
$form->addItem($cb_prop);
// Number of External Feeds on personal desktop
$sel = new ilSelectInputGUI($lng->txt("feed_nr_pd_feeds"), "nr_pd_feeds");
$sel->setInfo($lng->txt("feed_nr_pd_feeds_info"));
$sel->setOptions(array(0 => "0",
1 => "1",
2 => "2",
3 => "3",
4 => "4",
5 => "5"));
$sel->setValue($nr_personal_desktop_feeds);
$form->addItem($sel);
// command buttons
$form->addCommandButton("saveSettings", $lng->txt("save"));
$form->addCommandButton("view", $lng->txt("cancel"));
$this->tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

ilObjNewsSettingsGUI::executeCommand ( )

Execute command.

public

Reimplemented from ilObjectGUI.

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

References $cmd, $ilErr, $ret, and ilObjectGUI\prepareOutput().

{
global $rbacsystem,$ilErr,$ilAccess;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$this->prepareOutput();
if(!$ilAccess->checkAccess('read','',$this->object->getRefId()))
{
$ilErr->raiseError($this->lng->txt('no_permission'),$ilErr->WARNING);
}
switch($next_class)
{
case 'ilpermissiongui':
$this->tabs_gui->setTabActive('perm_settings');
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
default:
if(!$cmd || $cmd == 'view')
{
$cmd = "editSettings";
}
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilObjNewsSettingsGUI::getAdminTabs ( )

Get tabs.

public

Definition at line 81 of file class.ilObjNewsSettingsGUI.php.

{
global $rbacsystem, $ilAccess;
if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
{
$this->tabs_gui->addTarget("news_edit_news_settings",
$this->ctrl->getLinkTarget($this, "editSettings"),
array("editSettings", "view"));
}
if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
{
$this->tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass('ilpermissiongui',"perm"),
array(),'ilpermissiongui');
}
}
ilObjNewsSettingsGUI::saveSettings ( )

Save news and external webfeeds settings.

Definition at line 284 of file class.ilObjNewsSettingsGUI.php.

References $_POST, $feed_set, $ilCtrl, $ilSetting, and ilUtil\sendSuccess().

{
// empty news cache
include_once("./Services/News/classes/class.ilNewsCache.php");
$this->acache = new ilNewsCache();
$this->acache->deleteAllEntries();
$news_set = new ilSetting("news");
$feed_set = new ilSetting("feed");
$ilSetting->set("block_activated_news", $_POST["enable_internal_news"]);
$ilSetting->set("block_activated_pdnews", $_POST["enable_internal_news"]);
$news_set->set("enable_rss_for_internal", $_POST["enable_internal_rss"]);
$news_set->set("max_items", $_POST["news_max_items"]);
$news_set->set("acc_cache_mins", $_POST["news_acc_cache_mins"]);
$news_set->set("pd_period", $_POST["news_pd_period"]);
$news_set->set("default_visibility", $_POST["news_default_visibility"]);
$news_set->set("allow_shorter_periods", $_POST["allow_shorter_periods"]);
$news_set->set("allow_longer_periods", $_POST["allow_longer_periods"]);
$news_set->set("rss_period", $_POST["news_rss_period"]);
$news_set->set("rss_title_format", $_POST["rss_title_format"]);
$feed_set->set("disable_rep_feeds", $_POST["disable_repository_feeds"]);
$ilSetting->set("block_limit_pdfeed", $_POST["nr_pd_feeds"]);
if ($_POST["nr_pd_feeds"] > 0)
{
$ilSetting->set("block_activated_pdfeed", 1);
}
else
{
$ilSetting->set("block_activated_pdfeed", 0);
}
if ($_POST["enable_internal_rss"]!=0)
{
$news_set->set("enable_private_feed", $_POST["enable_private_feed"]);
}
else
{
$news_set->set("enable_private_feed", 0);
}
ilUtil::sendSuccess($this->lng->txt("settings_saved"),true);
$ilCtrl->redirect($this, "view");
}

+ Here is the call graph for this function:

Field Documentation

ilObjNewsSettingsGUI::$ERROR_MESSAGE
staticprivate

Definition at line 18 of file class.ilObjNewsSettingsGUI.php.


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