Bitrix Site Manager

Module parameters

Module parameters are available in administrative interface in the Settings menu. When choosing the module on this page, the system includes the file /bitrix/modules/module ID/options.php which manages the module parameters, assigns permissions to the module etc.

Note!
The module parameters are stored in the database.

The COption class is used to handle the module parameters; contains the following methods:

When getting the module parameters, the default value specified in the file /bitrix/modules/module ID/default_option.php can be used. This file defines an array $module ID_default_option storing the default values.

Example

The file /bitrix/modules/module ID/default_option.php.

<?
$support_default_option = array(
    "SUPPORT_DIR"                => "#SITE_DIR#support/",
    "SUPPORT_MAX_FILESIZE"       => "100",
    "ONLINE_INTERVAL"            => "900",
    "DEFAULT_VALUE_HIDDEN"       => "N",
    "NOT_IMAGE_EXTENSION_SUFFIX" => "_",
    "NOT_IMAGE_UPLOAD_DIR"       => "support/not_image",
    "DEFAULT_AUTO_CLOSE_DAYS"    => "7"
    );
?>

Example


<?
// set the string parameter
COption::SetOptionString("my_module_id", 
                         "MY_PARAMETER_ID", "VALUE");

// get the string parameter
$value = COption::GetOptionString("my_module_id", 
                                  "MY_PARAMETER_ID",
                                  "DEFAULT_VALUE");
?>

See Also