ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilGeneralSettings Class Reference
+ Collaboration diagram for ilGeneralSettings:

Public Member Functions

 ilGeneralSettings ()
 setSettingsId ($a_settings_id=0)
 getSettingsId ()
 get ($a_type)
 getAll ()
 clearAll ()
 setAll ($a_values)

Static Public Member Functions

static _getInstance ()
static _isPaymentEnabled ()

Data Fields

 $db
 $settings

Private Member Functions

 fetchSettingsId ()
 Fetches and sets the primary key of the payment settings.
 __getSettings ()

Static Private Attributes

static $_instance

Detailed Description

Definition at line 4 of file class.ilGeneralSettings.php.

Member Function Documentation

ilGeneralSettings::__getSettings ( )
private

Definition at line 285 of file class.ilGeneralSettings.php.

References $data, $row, DB_FETCHMODE_OBJECT, and fetchSettingsId().

Referenced by ilGeneralSettings(), and setAll().

{
$this->fetchSettingsId();
$result = $this->db->query('SELECT * FROM payment_settings');
$data = array();
while($row = $result->fetchRow(DB_FETCHMODE_OBJECT))
{
$data['currency_unit'] = $row->currency_unit;
$data['currency_subunit'] = $row->currency_subunit;
$data['address'] = $row->address;
$data['bank_data'] = $row->bank_data;
$data['add_info'] = $row->add_info;
$data['pdf_path'] = $row->pdf_path;
$data['topics_allow_custom_sorting'] = $row->topics_allow_custom_sorting;
$data['topics_sorting_type'] = $row->topics_sorting_type;
$data['topics_sorting_direction'] = $row->topics_sorting_direction;
$data['max_hits'] = $row->max_hits;
$data['shop_enabled'] = $row->shop_enabled;
$data['hide_advanced_search'] = $row->hide_advanced_search;
$data['objects_allow_custom_sorting'] = $row->objects_allow_custom_sorting;
$data['hide_coupons'] = $row->hide_coupons;
$data['hide_news'] = $row->hide_news;
}
$this->settings = $data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilGeneralSettings::_getInstance ( )
static

Definition at line 11 of file class.ilGeneralSettings.php.

References $_instance, and ilGeneralSettings().

Referenced by ilShopBaseGUI\__construct(), ilShopSearchResult\__initSearchSettingsObject(), ilPaymentObject\_hasAccess(), ilPaymentObject\_isBuyable(), ilShopController\buildTabs(), ilShopController\executeCommand(), ilObjectListGUI\getListItemHTML(), and ilObjectListGUI\insertPayment().

{
if(!isset(self::$_instance))
{
self::$_instance = new ilGeneralSettings();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilGeneralSettings::_isPaymentEnabled ( )
static

Definition at line 313 of file class.ilGeneralSettings.php.

References $ilDB, $res, and $row.

Referenced by ilInitialisation\initSettings().

{
global $ilDB;
$res = $ilDB->query('SELECT shop_enabled FROM payment_settings');
$row = $ilDB->fetchAssoc($res);
return $row['shop_enabled'];
}

+ Here is the caller graph for this function:

ilGeneralSettings::clearAll ( )

Definition at line 64 of file class.ilGeneralSettings.php.

References getSettingsId().

{
$statement = $this->db->manipulateF('
UPDATE payment_settings
SET currency_unit = %s,
currency_subunit = %s,
address = %s,
bank_data = %s,
add_info = %s,
pdf_path = %s,
topics_sorting_type = %s,
topics_sorting_direction = %s,
topics_allow_custom_sorting = %s,
max_hits = %s,
shop_enabled = %s,
hide_advanced_search = %s,
objects_allow_custom_sorting = %s,
hide_coupons = %s,
hide_news = %s
WHERE settings_id = %s',
array( 'text',
'text',
'text',
'text',
'text',
'text',
'integer',
'integer',
'text',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer'),
array( NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
'1',
'asc',
'0',
'20',
'0',
'0',
'0',
'0',
'0',
$this->getSettingsId())
);
return true;
}

+ Here is the call graph for this function:

ilGeneralSettings::fetchSettingsId ( )
private

Fetches and sets the primary key of the payment settings.

private

Definition at line 35 of file class.ilGeneralSettings.php.

References $row, DB_FETCHMODE_OBJECT, and setSettingsId().

Referenced by __getSettings().

{
$result = $this->db->query('SELECT settings_id FROM payment_settings');
while($row = $result->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setSettingsId($row->settings_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGeneralSettings::get (   $a_type)

Definition at line 54 of file class.ilGeneralSettings.php.

{
return $this->settings[$a_type];
}
ilGeneralSettings::getAll ( )

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

References $settings.

{
}
ilGeneralSettings::getSettingsId ( )

Definition at line 49 of file class.ilGeneralSettings.php.

Referenced by clearAll(), and setAll().

{
return $this->settings_id;
}

+ Here is the caller graph for this function:

ilGeneralSettings::ilGeneralSettings ( )

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

References $ilDB, and __getSettings().

Referenced by _getInstance().

{
global $ilDB;
$this->db = $ilDB;
$this->__getSettings();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilGeneralSettings::setAll (   $a_values)

Definition at line 121 of file class.ilGeneralSettings.php.

References $ilDB, __getSettings(), and getSettingsId().

{
global $ilDB;
if ($this->getSettingsId())
{
if(!$a_values['currency_unit']) $a_values['currency_unit'] = NULL;
if(!$a_values['currency_subunit']) $a_values['currency_subunit'] = NULL;
if(!$a_values['address']) $a_values['address'] = NULL;
if(!$a_values['bank_data']) $a_values['bank_data'] = NULL;
if(!$a_values['add_info']) $a_values['add_info'] = NULL;
if(!$a_values['pdf_path']) $a_values['pdf_path'] = NULL;
if(!$a_values['topics_allow_custom_sorting']) $a_values['topics_allow_custom_sorting'] = 0;
if(!$a_values['topics_sorting_type']) $a_values['topics_sorting_type'] = 0;
if(!$a_values['topics_sorting_direction']) $a_values['topics_sorting_direction'] = NULL;
if(!$a_values['shop_enabled']) $a_values['shop_enabled'] = 0;
if(!$a_values['max_hits']) $a_values['max_hits'] = 0;
if(!$a_values['hide_advanced_search']) $a_values['hide_advanced_search'] = 0;
if(!$a_values['objects_allow_custom_sorting']) $a_values['objects_allow_custom_sorting'] = 0;
if(!$a_values['hide_coupons']) $a_values['hide_coupons'] = 0;
if(!$a_values['hide_news']) $a_values['hide_news'] = 0;
$statement = $this->db->manipulateF('
UPDATE payment_settings
SET currency_unit = %s,
currency_subunit = %s,
address = %s,
bank_data = %s,
add_info = %s,
pdf_path = %s,
topics_sorting_type = %s,
topics_sorting_direction = %s,
topics_allow_custom_sorting = %s,
max_hits = %s,
shop_enabled = %s,
hide_advanced_search = %s,
objects_allow_custom_sorting = %s,
hide_coupons = %s,
hide_news = %s
WHERE settings_id = %s',
array( 'text',
'text',
'text',
'text',
'text',
'text',
'integer',
'text',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer'),
array(
$a_values['currency_unit'],
$a_values['currency_subunit'],
$a_values['address'],
$a_values['bank_data'],
$a_values['add_info'],
$a_values['pdf_path'],
$a_values['topics_sorting_type'],
$a_values['topics_sorting_direction'],
$a_values['topics_allow_custom_sorting'],
$a_values['max_hits'],
$a_values['shop_enabled'],
$a_values['hide_advanced_search'],
$a_values['objects_allow_custom_sorting'],
$a_values['hide_coupons'],
$a_values['hide_news'],
$this->getSettingsId())
);
}
else
{
if(!$a_values['currency_unit']) $a_values['currency_unit'] = NULL;
if(!$a_values['currency_subunit']) $a_values['currency_subunit'] = NULL;
if(!$a_values['address']) $a_values['address'] = NULL;
if(!$a_values['bank_data']) $a_values['bank_data'] = NULL;
if(!$a_values['add_info']) $a_values['add_info'] = NULL;
if(!$a_values['pdf_path']) $a_values['pdf_path'] = NULL;
if(!$a_values['topics_allow_custom_sorting']) $a_values['topics_allow_custom_sorting'] = 0;
if(!$a_values['topics_sorting_type']) $a_values['topics_sorting_type'] = 0;
if(!$a_values['topics_sorting_direction']) $a_values['topics_sorting_direction'] = NULL;
if(!$a_values['shop_enabled']) $a_values['shop_enabled'] = 0;
if(!$a_values['max_hits']) $a_values['max_hits'] = 0;
if(!$a_values['hide_advanced_search']) $a_values['hide_advanced_search'] = 0;
if(!$a_values['objects_allow_custom_sorting']) $a_values['objects_allow_custom_sorting'] = 0;
if(!$a_values['hide_coupons']) $a_values['hide_coupons'] = 0;
if(!$a_values['hide_news']) $a_values['hide_news'] = 0;
$next_id = $ilDB->nextId('payment_settings');
$statement = $this->db->manipulateF('
INSERT INTO payment_settings
( settings_id,
currency_unit,
currency_subunit,
address,
bank_data,
add_info,
pdf_path,
topics_allow_custom_sorting,
topics_sorting_type,
topics_sorting_direction,
shop_enabled,
max_hits,
hide_advanced_search,
objects_allow_custom_sorting,
hide_coupons,
hide_news
)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)',
array( 'integer',
'text',
'text',
'text',
'text',
'text',
'text',
'integer',
'integer',
'text',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer'),
array(
$next_id,
$a_values['currency_unit'],
$a_values['currency_subunit'],
$a_values['address'],
$a_values['bank_data'],
$a_values['add_info'],
$a_values['pdf_path'],
$a_values['topics_allow_custom_sorting'],
$a_values['topics_sorting_type'],
$a_values['topics_sorting_direction'],
$a_values['shop_enabled'],
$a_values['max_hits'],
$a_values['hide_advanced_search'],
$a_values['objects_allow_custom_sorting'],
$a_values['hide_coupons'],
$a_values['hide_news']
)
);
}
$this->__getSettings();
return true;
}

+ Here is the call graph for this function:

ilGeneralSettings::setSettingsId (   $a_settings_id = 0)

Definition at line 44 of file class.ilGeneralSettings.php.

Referenced by fetchSettingsId().

{
$this->settings_id = $a_settings_id;
}

+ Here is the caller graph for this function:

Field Documentation

ilGeneralSettings::$_instance
staticprivate

Definition at line 6 of file class.ilGeneralSettings.php.

Referenced by _getInstance().

ilGeneralSettings::$db

Definition at line 8 of file class.ilGeneralSettings.php.

ilGeneralSettings::$settings

Definition at line 9 of file class.ilGeneralSettings.php.

Referenced by getAll().


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