ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilShopNewsGUI Class Reference

Class ilShopNewsGUI. More...

+ Inheritance diagram for ilShopNewsGUI:
+ Collaboration diagram for ilShopNewsGUI:

Public Member Functions

 __construct ()
 executeCommand ()
 saveSettings ()
 initSettingsForm ($a_mode= 'edit')
 showSettings ()
 saveNews ()
 updateArchiveNews ()
 updateNews ()
 update ($view)
 performDeleteNews ()
 performDeleteArchiveNews ()
 performDelete ($view)
 confirmDeleteNews ()
 confirmDeleteArchiveNews ()
 confirmDelete ($view)
 initNewsForm ($a_mode= 'create', $view= 'news')
 addNewsForm ()
 editNews ()
 editArchiveNews ()
 editNewsForm ($view)
 getPropertiesValues ()
 getSettingsValues ()
 showNews ($confirmation_gui= '')
 showArchive ($confirmation_gui= '')

Data Fields

 $ilErr = null

Protected Member Functions

 buildSubTabs ()
 prepareOutput ()
- Protected Member Functions inherited from ilShopBaseGUI
 addPager ($result, $a_session_key)
 setSection ($a_section)
 getSection ()
 setSubSection ($a_sub_section)
 getSubSection ()
 showButton ($a_cmd, $a_text, $a_target= '')
 initTableGUI ()
 setTableGUIBasicData ($tbl, $result_set, $a_default_order_column= '')

Private Attributes

 $form_gui = null
 $settings_form = null
 $oCurrentNewsItem = null

Additional Inherited Members

- Protected Attributes inherited from ilShopBaseGUI
 $ctrl = null
 $lng = null
 $tpl = null
 $oGeneralSettings = null
 $section = 0
 $sub_section = 0

Detailed Description

Class ilShopNewsGUI.

Author
Nadia Ahmad nahma.nosp@m.d@da.nosp@m.tabay.nosp@m..de

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

Constructor & Destructor Documentation

ilShopNewsGUI::__construct ( )

Reimplemented from ilShopBaseGUI.

Definition at line 25 of file class.ilShopNewsGUI.php.

References $_GET, and $ilErr.

{
global $ilErr;
$this->oCurrentNewsItem = new ilShopNewsItem((int)$_GET['news_id']);
$this->lng->loadLanguageModule('news');
$this->ilErr = $ilErr;
}

Member Function Documentation

ilShopNewsGUI::addNewsForm ( )

Definition at line 412 of file class.ilShopNewsGUI.php.

References initNewsForm().

{
$this->initNewsForm('create');
$this->tpl->setVariable('ADM_CONTENT', $this->form_gui->getHtml());
}

+ Here is the call graph for this function:

ilShopNewsGUI::buildSubTabs ( )
protected

Reimplemented from ilShopBaseGUI.

Definition at line 56 of file class.ilShopNewsGUI.php.

References $ilUser.

{
global $ilTabs, $ilUser, $rbacreview;
$ilTabs->addSubTabTarget('news', $this->ctrl->getLinkTarget($this, 'showNews'), '', '', '','showNews');
$ilTabs->addSubTabTarget('archive', $this->ctrl->getLinkTarget($this, 'showArchive'), '', '', '','archive');
if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
{
$ilTabs->addSubTabTarget('settings', $this->ctrl->getLinkTarget($this, 'showSettings'), '', '', '','settings');
}
}
ilShopNewsGUI::confirmDelete (   $view)

Definition at line 276 of file class.ilShopNewsGUI.php.

References $_GET, $ilUser, ilUtil\sendInfo(), showArchive(), and showNews().

Referenced by confirmDeleteArchiveNews(), and confirmDeleteNews().

{
global $ilUser, $rbacreview;
if(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
{
$this->ilErr->raiseError($this->lng->txt('permission_denied'),$this->ilErr->MESSAGE);
}
if(!isset($_GET['news_id']))
{
ilUtil::sendInfo($this->lng->txt('payment_news_missing_id'));
switch($view)
{
case 'archive':
return $this->showArchive();
break;
case 'news':
default:
return $this->showNews();
break;
}
}
include_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
$c_gui = new ilConfirmationGUI();
$c_gui->setHeaderText($this->lng->txt('payment_news_delete_sure'));
$c_gui->addHiddenItem('news_id', (int)$_GET['news_id']);
$oNewsItem = new ilShopNewsItem($_GET['news_id']);
$title=$oNewsItem->getTitle();
$c_gui->addItem($news_title,$_GET['news_id'],$title);
switch($view)
{
case 'archive':
$c_gui->setFormAction($this->ctrl->getFormAction($this, 'performDeleteArchiveNews'));
$c_gui->setConfirm($this->lng->txt('confirm'), 'performDeleteArchiveNews');
$c_gui->setCancel($this->lng->txt('cancel'), 'showArchive');
$this->showArchive($c_gui->getHTML());
break;
case 'news':
default:
$c_gui->setFormAction($this->ctrl->getFormAction($this, 'performDeleteNews'));
$c_gui->setConfirm($this->lng->txt('confirm'), 'performDeleteNews');
$c_gui->setCancel($this->lng->txt('cancel'), 'showNews');
$this->showNews($c_gui->getHTML());
break;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopNewsGUI::confirmDeleteArchiveNews ( )

Definition at line 271 of file class.ilShopNewsGUI.php.

References confirmDelete().

{
$this->confirmDelete('archive');
}

+ Here is the call graph for this function:

ilShopNewsGUI::confirmDeleteNews ( )

Definition at line 266 of file class.ilShopNewsGUI.php.

References confirmDelete().

{
$this->confirmDelete('news');
}

+ Here is the call graph for this function:

ilShopNewsGUI::editArchiveNews ( )

Definition at line 423 of file class.ilShopNewsGUI.php.

References editNewsForm().

{
return $this->editNewsForm('archive');
}

+ Here is the call graph for this function:

ilShopNewsGUI::editNews ( )

Definition at line 418 of file class.ilShopNewsGUI.php.

References editNewsForm().

{
return $this->editNewsForm('news');
}

+ Here is the call graph for this function:

ilShopNewsGUI::editNewsForm (   $view)

Definition at line 428 of file class.ilShopNewsGUI.php.

References getPropertiesValues(), and initNewsForm().

Referenced by editArchiveNews(), and editNews().

{
$this->initNewsForm('edit', $view);
$this->tpl->setVariable('ADM_CONTENT', $this->form_gui->getHtml());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopNewsGUI::executeCommand ( )

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

References $cmd, and prepareOutput().

{
// $next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
switch($cmd)
{
default:
if(!$cmd)
{
$cmd = 'showNews';
}
$this->prepareOutput();
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilShopNewsGUI::getPropertiesValues ( )

Definition at line 435 of file class.ilShopNewsGUI.php.

Referenced by editNewsForm().

{
$this->form_gui->setValuesByArray(array(
'news_creation_date' => $this->oCurrentNewsItem->getCreationDate(),
'news_title' => $this->oCurrentNewsItem->getTitle(),
'news_content' => $this->oCurrentNewsItem->getContent(),
'news_visibility' =>$this->oCurrentNewsItem->getVisibility()
));
}

+ Here is the caller graph for this function:

ilShopNewsGUI::getSettingsValues ( )

Definition at line 445 of file class.ilShopNewsGUI.php.

References $ilSetting.

Referenced by saveSettings(), and showSettings().

{
global $ilSetting;
$this->settings_form->setValuesByArray(array(
'archive_period' => $ilSetting->get('payment_news_archive_period')
));
}

+ Here is the caller graph for this function:

ilShopNewsGUI::initNewsForm (   $a_mode = 'create',
  $view = 'news' 
)

Definition at line 332 of file class.ilShopNewsGUI.php.

References $ilUser, ilUtil\getImagePath(), ilRadioOption\setInfo(), and ilFormPropertyGUI\setInfo().

Referenced by addNewsForm(), editNewsForm(), saveNews(), and update().

{
global $ilTabs, $rbacreview, $ilUser;
if(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
{
$this->ilErr->raiseError($this->lng->txt('permission_denied'),$this->ilErr->MESSAGE);
}
if($view == 'archive')
{
$ilTabs->setSubTabActive('archive');
}
else
{
$ilTabs->setSubTabActive('news');
}
// include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setTitle($this->lng->txt('shopnews_settings'));
$this->form_gui->setTitleIcon(ilUtil::getImagePath('icon_news.png'));
// Property Title
$text_input = new ilTextInputGUI($this->lng->txt('news_news_item_title'), 'news_title');
$text_input->setInfo('');
$text_input->setRequired(true);
$text_input->setMaxLength(200);
$text_input->setSize(93);
$this->form_gui->addItem($text_input);
// Property Content
$text_area = new ilTextAreaInputGUI($this->lng->txt('news_news_item_content'), 'news_content');
$text_area->setInfo('');
$text_area->setRequired(false);
$text_area->setCols(90);
$text_area->setRows(10);
$this->form_gui->addItem($text_area);
// Property Visibility
$radio_group = new ilRadioGroupInputGUI($this->lng->txt('news_news_item_visibility'), 'news_visibility');
$radio_option = new ilRadioOption($this->lng->txt('news_visibility_users'), 'users');
$radio_group->addOption($radio_option);
$radio_option = new ilRadioOption($this->lng->txt('news_visibility_public'), 'public');
$radio_group->addOption($radio_option);
$radio_group->setInfo($this->lng->txt('news_news_item_visibility_info'));
$radio_group->setRequired(false);
$radio_group->setValue('users');
$this->form_gui->addItem($radio_group);
// save and cancel commands
if($a_mode == 'create')
{
$this->form_gui->addCommandButton('saveNews', $this->lng->txt('save'));
$this->form_gui->addCommandButton('showNews', $this->lng->txt('cancel'));
$this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'saveNews'));
}
else
{
$this->ctrl->setParameter($this, 'news_id', $this->oCurrentNewsItem->getId());
if($view == 'archive')
{
$this->form_gui->addCommandButton('updateArchiveNews', $this->lng->txt('save'));
$this->form_gui->addCommandButton('showArchive', $this->lng->txt('cancel'));
$this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'updateArchiveNews'));
}
else
{
$this->form_gui->addCommandButton('updateNews', $this->lng->txt('save'));
$this->form_gui->addCommandButton('showNews', $this->lng->txt('cancel'));
$this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'updateNews'));
}
}
$this->form_gui->setTitle($this->lng->txt('news_news_item_head'));
$this->tpl->setVariable('ADM_CONTENT', $this->form_gui->getHtml());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopNewsGUI::initSettingsForm (   $a_mode = 'edit')

Definition at line 96 of file class.ilShopNewsGUI.php.

References $options, ilUtil\getImagePath(), and ilFormPropertyGUI\setInfo().

Referenced by saveSettings(), and showSettings().

{
$this->settings_form = new ilPropertyFormGUI();
$this->settings_form->setTitle($this->lng->txt('payment_news_settings'));
$this->settings_form->setTitleIcon(ilUtil::getImagePath('icon_news.png'));
$oSelectBox = new ilSelectInputGUI($this->lng->txt('payment_news_archive_period'), 'archive_period');
$oSelectBox->setInfo($this->lng->txt('payment_news_archive_period_info'));
$options = array();
for($i = 5; $i <= 100; $i += 5)
{
$options[$i] = $i;
}
$oSelectBox->setOptions($options);
$this->settings_form->addItem($oSelectBox);
$this->settings_form->addCommandButton('saveSettings', $this->lng->txt('save'));
$this->settings_form->addCommandButton('showNews', $this->lng->txt('cancel'));
$this->settings_form->setFormAction($this->ctrl->getFormaction($this, 'saveSettings'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopNewsGUI::performDelete (   $view)

Definition at line 222 of file class.ilShopNewsGUI.php.

References $_POST, $ilUser, ilUtil\sendInfo(), showArchive(), and showNews().

Referenced by performDeleteArchiveNews(), and performDeleteNews().

{
global $ilUser, $rbacreview;
if(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
{
$this->ilErr->raiseError($this->lng->txt('permission_denied'),$this->ilErr->MESSAGE);
}
if(!(int)$_POST['news_id'])
{
ilUtil::sendInfo($this->lng->txt('payment_news_missing_id'));
switch($view)
{
case 'archive':
return $this->showArchive();
break;
case 'news':
default:
return $this->showNews();
break;
}
}
else
{
$this->oCurrentNewsItem->setId($_POST['news_id']);
$this->oCurrentNewsItem->delete();
ilUtil::sendInfo($this->lng->txt('payment_news_deleted'));
}
switch($view)
{
case 'archive':
return $this->showArchive();
break;
case 'news':
default:
return $this->showNews();
break;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopNewsGUI::performDeleteArchiveNews ( )

Definition at line 217 of file class.ilShopNewsGUI.php.

References performDelete().

{
return $this->performDelete('archive');
}

+ Here is the call graph for this function:

ilShopNewsGUI::performDeleteNews ( )

Definition at line 212 of file class.ilShopNewsGUI.php.

References performDelete().

{
return $this->performDelete('news');
}

+ Here is the call graph for this function:

ilShopNewsGUI::prepareOutput ( )
protected

Reimplemented from ilShopBaseGUI.

Definition at line 626 of file class.ilShopNewsGUI.php.

Referenced by executeCommand().

{
global $ilTabs;
$ilTabs->setTabActive('payment_news');
}

+ Here is the caller graph for this function:

ilShopNewsGUI::saveNews ( )

Definition at line 135 of file class.ilShopNewsGUI.php.

References $ilUser, initNewsForm(), ilUtil\sendInfo(), and showNews().

{
global $ilUser, $rbacreview;
if(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
{
$this->ilErr->raiseError($this->lng->txt('permission_denied'),$this->ilErr->MESSAGE);
}
$this->initNewsForm('create');
if ($this->form_gui->checkInput())
{
$this->oCurrentNewsItem->setTitle($this->form_gui->getInput('news_title'));
$this->oCurrentNewsItem->setContent($this->form_gui->getInput('news_content'));
$this->oCurrentNewsItem->setVisibility($this->form_gui->getInput('news_visibility'));
$this->oCurrentNewsItem->setUserId($ilUser->getId());
$this->oCurrentNewsItem->create();
ilUtil::sendInfo($this->lng->txt('payment_news_created'));
return $this->showNews();
}
else
{
$this->form_gui->setValuesByPost();
return $this->tpl->setVariable('ADM_CONTENT', $this->form_gui->getHtml());
}
}

+ Here is the call graph for this function:

ilShopNewsGUI::saveSettings ( )

Definition at line 69 of file class.ilShopNewsGUI.php.

References $ilSetting, $ilUser, getSettingsValues(), initSettingsForm(), and ilUtil\sendInfo().

{
global $ilTabs, $ilSetting, $rbacreview, $ilUser;
if(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
{
$this->ilErr->raiseError($this->lng->txt('permission_denied'), $this->ilErr->MESSAGE);
}
$ilTabs->setSubTabActive('settings');
$this->initSettingsForm('edit');
if($this->settings_form->checkInput())
{
$ilSetting->set('payment_news_archive_period', $this->settings_form->getInput('archive_period'));
ilUtil::sendInfo($this->lng->txt('payment_news_settings_saved'));
return $this->tpl->setVariable('ADM_CONTENT', $this->settings_form->getHtml());
}
else
{
$this->form_gui->setValuesByPost();
return $this->tpl->setVariable('ADM_CONTENT', $this->settings_form->getHtml());
}
}

+ Here is the call graph for this function:

ilShopNewsGUI::showArchive (   $confirmation_gui = '')

Definition at line 542 of file class.ilShopNewsGUI.php.

References $ilSetting, $ilUser, $result, ilShopBaseGUI\$tpl, ilShopNewsItemList\_getInstance(), ilDatePresentation\formatDate(), IL_CAL_DATETIME, and ilShopNewsItemList\TYPE_ARCHIVE.

Referenced by confirmDelete(), performDelete(), and update().

{
global $ilUser, $tpl, $ilTabs, $ilSetting, $rbacreview;
$ilTabs->setSubTabActive('archive');
include_once 'Services/Payment/classes/class.ilShopNewsItemList.php';
include_once 'Services/Table/classes/class.ilTable2GUI.php';
$news_tpl = new ilTemplate('tpl.main_view.html', true, true, 'Services/Payment');
if((int)strlen($confirmation_gui))
{
$news_tpl->setVariable('CONFIRMATION', $confirmation_gui);
}
$tbl = new ilTable2GUI($this);
$tbl->setId('shop_news_archive_tbl');
$tbl->setTitle($this->lng->txt('archive'), 'icon_news.png',$this->lng->txt('news'));
$tbl->setRowTemplate('tpl.shop_news_row.html', 'Services/Payment');
$tbl->setFormAction($this->ctrl->getFormAction($this), 'showArchive');
$tbl->addColumn($this->lng->txt('archive'), 'title', '100%');
$oNewsList->setMode(ilShopNewsItemList::TYPE_ARCHIVE)
->setPublicSection($ilUser->getId() == ANONYMOUS_USER_ID)
->setArchiveDate(time() - ($ilSetting->get('payment_news_archive_period') * 24 * 60 * 60))
->read();
$result = array();
if($oNewsList->hasItems())
{
$tbl->setEnableTitle(true);
$tbl->setEnableHeader(true);
$counter = 0;
foreach($oNewsList as $entry)
{
if($entry->getVisibility() != 'public' && $ilUser->getId() == ANONYMOUS_USER_ID) continue;
if(strtotime($entry->getCreationDate()) > time() - ($ilSetting->get('payment_news_archive_period') * 24 * 60 * 60)) continue;
if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID) == true)
{
$this->ctrl->setParameter($this, 'news_id', $entry->getId());
$result[$counter]['news_id']= $entry->getId();
$result[$counter]['edit_src'] = $this->ctrl->getLinkTarget($this, 'editArchiveNews');
$result[$counter]['edit_txt'] = $this->lng->txt('edit');
$result[$counter]['delete_src'] = $this->ctrl->getLinkTarget($this, 'confirmDeleteArchiveNews');
$result[$counter]['delete_txt'] = $this->lng->txt('delete');
$this->ctrl->clearParameters($this);
}
$result[$counter]['creation_date'] = ilDatePresentation::formatDate(
new ilDateTime($entry->getCreationDate(), IL_CAL_DATETIME));
$result[$counter]['title'] = $entry->getTitle();
$result[$counter]['content'] = $entry->getContent();
$result[$counter]['user_id'] = $entry->getUserId();
$result[$counter]['author'] = $ilUser->getLogin();
$result[$counter]['creation_date'] = ilDatePresentation::formatDate(
new ilDateTime($entry->getCreationDate(), IL_CAL_DATETIME));
$result[$counter]['update_date'] = ilDatePresentation::formatDate(
new ilDateTime($entry->getCreationDate(), IL_CAL_DATETIME));
$result[$counter]['txt_author'] = $this->lng->txt('author');
$result[$counter]['txt_creation_date'] = $this->lng->txt('create_date');
$result[$counter]['txt_update_date'] = $this->lng->txt('last_update');
$this->ctrl->clearParameters($this);
++$counter;
}
}
else
{
$tbl->setNoEntriesText($this->lng->txt('payment_news_no_news_items'));
}
$tbl->setData($result);
$news_tpl->setVariable('TABLE', $tbl->getHTML());
$tpl->setContent($news_tpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopNewsGUI::showNews (   $confirmation_gui = '')

Definition at line 454 of file class.ilShopNewsGUI.php.

References $ilSetting, $ilUser, $result, ilShopBaseGUI\$tpl, ilShopNewsItemList\_getInstance(), ilDatePresentation\formatDate(), IL_CAL_DATETIME, and ilShopNewsItemList\TYPE_NEWS.

Referenced by confirmDelete(), performDelete(), saveNews(), and update().

{
global $ilUser, $tpl, $ilTabs, $ilSetting, $rbacreview, $ilToolbar;
$ilTabs->setSubTabActive('news');
include_once 'Services/Payment/classes/class.ilShopNewsItemList.php';
include_once 'Services/Table/classes/class.ilTable2GUI.php';
if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID) == true)
{
$ilToolbar->addButton($this->lng->txt('payment_news_add_news'), $this->ctrl->getLinkTarget($this, 'addNewsForm'));
}
$news_tpl = new ilTemplate('tpl.main_view.html', true, true, 'Services/Payment');
if((int)strlen($confirmation_gui))
{
$news_tpl->setVariable('CONFIRMATION', $confirmation_gui);
}
$tbl = new ilTable2GUI($this);
$tbl->setId('shop_news_tbl');
$tbl->setTitle($this->lng->txt('news'), 'icon_news.png', $this->lng->txt('news'));
$tbl->setRowTemplate('tpl.shop_news_row.html', 'Services/Payment');
$tbl->setFormAction($this->ctrl->getFormAction($this), 'showNews');
$tbl->addColumn($this->lng->txt('news'), 'title', '100%');
$oNewsList->setMode(ilShopNewsItemList::TYPE_NEWS)
->setPublicSection($ilUser->getId() == ANONYMOUS_USER_ID)
->setArchiveDate(time() - ($ilSetting->get('payment_news_archive_period') * 24 * 60 * 60))
->read();
$result = array();
if($oNewsList->hasItems())
{
$tbl->setEnableHeader(true);
$tbl->setEnableTitle(true);
$counter = 0;
foreach($oNewsList as $entry)
{
if($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID) == true)
{
$this->ctrl->setParameter($this, 'news_id', $entry->getId());
$result[$counter]['news_id'] = $entry->getId();
$result[$counter]['edit_src'] = $this->ctrl->getLinkTarget($this, 'editNews');
$result[$counter]['edit_txt'] = $this->lng->txt('edit');
$result[$counter]['delete_src'] = $this->ctrl->getLinkTarget($this, 'confirmDeleteNews');
$result[$counter]['delete_txt'] = $this->lng->txt('delete');
$this->ctrl->clearParameters($this);
}
$result[$counter]['title'] = $entry->getTitle();
$result[$counter]['content'] = $entry->getContent();
$result[$counter]['user_id'] = $entry->getUserId();
$result[$counter]['txt_author'] = $this->lng->txt('author');
$result[$counter]['author'] = $ilUser->getLogin();
$result[$counter]['txt_creation_date'] = $this->lng->txt('create_date');
$result[$counter]['creation_date'] = ilDatePresentation::formatDate(
new ilDateTime($entry->getCreationDate(), IL_CAL_DATETIME));
$result[$counter]['txt_update_date'] = $this->lng->txt('last_update');
$result[$counter]['update_date'] = ilDatePresentation::formatDate(
new ilDateTime($entry->getUpdateDate(), IL_CAL_DATETIME));
$result[$counter]['txt_access'] = $this->lng->txt('access');
$result[$counter]['access'] = $entry->getVisibility();
++$counter;
}
}
else
{
$tbl->setNoEntriesText($this->lng->txt('payment_news_no_news_items'));
}
$tbl->setData($result);
$news_tpl->setVariable('TABLE', $tbl->getHTML());
$tpl->setContent($news_tpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopNewsGUI::showSettings ( )

Definition at line 118 of file class.ilShopNewsGUI.php.

References $ilUser, getSettingsValues(), and initSettingsForm().

{
global $ilTabs, $ilUser, $rbacreview;
if(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
{
$this->ilErr->raiseError($this->lng->txt('permission_denied'),$this->ilErr->MESSAGE);
}
$ilTabs->setSubTabActive('settings');
$this->initSettingsForm('edit');
return $this->tpl->setVariable('ADM_CONTENT', $this->settings_form->getHtml());
}

+ Here is the call graph for this function:

ilShopNewsGUI::update (   $view)

Definition at line 173 of file class.ilShopNewsGUI.php.

References $ilUser, initNewsForm(), ilUtil\sendInfo(), showArchive(), and showNews().

Referenced by updateArchiveNews(), and updateNews().

{
global $ilUser, $rbacreview;
if(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID))
{
$this->ilErr->raiseError($this->lng->txt('permission_denied'),$this->ilErr->MESSAGE);
}
$this->initNewsForm('edit', $view);
if ($this->form_gui->checkInput())
{
$this->oCurrentNewsItem->setTitle($this->form_gui->getInput('news_title'));
$this->oCurrentNewsItem->setContent($this->form_gui->getInput('news_content'));
$this->oCurrentNewsItem->setVisibility($this->form_gui->getInput('news_visibility'));
$this->oCurrentNewsItem->setUserId($ilUser->getId());
$this->oCurrentNewsItem->update();
ilUtil::sendInfo($this->lng->txt('payment_news_updated'));
if($view == 'archive')
{
return $this->showArchive();
}
else
{
return $this->showNews();
}
}
else
{
$this->form_gui->setValuesByPost();
return $this->tpl->setVariable('ADM_CONTENT', $this->form_gui->getHtml());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopNewsGUI::updateArchiveNews ( )

Definition at line 163 of file class.ilShopNewsGUI.php.

References update().

{
return $this->update('archive');
}

+ Here is the call graph for this function:

ilShopNewsGUI::updateNews ( )

Definition at line 168 of file class.ilShopNewsGUI.php.

References update().

{
return $this->update('news');
}

+ Here is the call graph for this function:

Field Documentation

ilShopNewsGUI::$form_gui = null
private

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

ilShopNewsGUI::$ilErr = null

Definition at line 23 of file class.ilShopNewsGUI.php.

Referenced by __construct().

ilShopNewsGUI::$oCurrentNewsItem = null
private

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

ilShopNewsGUI::$settings_form = null
private

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


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