You are here

public static function InstapageCmsPluginHelper::getOption in Instapage plugin 8.3

Same name and namespace in other branches
  1. 7.3 core/InstapageCmsPluginHelper.php \InstapageCmsPluginHelper::getOption()

Gets a single value from plugin's options.

@uses \InstapageHelper::getOptions(). @uses \InstapageHelper::getVar() to check the existence of the option.

Parameters

string $name Option name.:

mixed $default Default value of the option. Defaulf: false.:

Return value

mixed Option value or default value passed to the function.

5 calls to InstapageCmsPluginHelper::getOption()
InstapageCmsPluginConnector::getURLWithSelectedProtocol in core/connectors/InstapageCmsPluginConnector.php
Toggles ssl on/off in given url
InstapageCmsPluginDebugLogModel::isDiagnosticMode in core/models/InstapageCmsPluginDebugLogModel.php
Checks if Diagnostic mode is on.
InstapageCmsPluginHelper::isCustomParamPresent in core/InstapageCmsPluginHelper.php
Checks if one of the custom params, stored in plugin's settings, are present in curent URL.
InstapageCmsPluginPageModel::fixHtmlHead in core/models/InstapageCmsPluginPageModel.php
Sets up the proper URL for Instapage proxy, if it is enabled.
InstapageCmsPluginSubaccountModel::getAccountBoundTokens in core/models/InstapageCmsPluginSubaccountModel.php
Gets the list of tokens bound to subaccount. User has to be logged in via email and password.

File

core/InstapageCmsPluginHelper.php, line 108

Class

InstapageCmsPluginHelper
Helper containing commonly used static functions.

Code

public static function getOption($name, $default = false) {
  $options = self::getOptions();
  if (in_array($name, array(
    'plugin_hash',
    'user_name',
    'api_keys',
  ))) {
    return isset($options->{$name}) ? $options->{$name} : $default;
  }
  else {
    return isset($options->config->{$name}) ? $options->config->{$name} : $default;
  }
}