You are here

public function InstapageCmsPluginDrupal7Connector::isHtmlReplaceNecessary in Instapage plugin 8.3

Same name and namespace in other branches
  1. 7.3 core/connectors/InstapageCmsPluginDrupal7Connector.php \InstapageCmsPluginDrupal7Connector::isHtmlReplaceNecessary()

Checks if there is a need to replace content of CMS with a landing page. Prevents content replacement on admin/login pages.

Return value

bool True if replace is possible.

File

core/connectors/InstapageCmsPluginDrupal7Connector.php, line 834

Class

InstapageCmsPluginDrupal7Connector
Class that utilizes native Drupal 7 functions to perform actions like remote requests and DB operations.

Code

public function isHtmlReplaceNecessary() {
  if ($this
    ->isAdmin() || $this
    ->isLoginPage() || InstapageCmsPluginHelper::isCustomParamPresent()) {
    InstapageCmsPluginHelper::writeDiagnostics('is_admin || isLoginPage || isCustomParamPresent', 'HTML Replace is not necessary');
    return false;
  }
  return true;
}