You are here

public function InstapageCmsPluginDrupal7Connector::checkPage in Instapage plugin 8.3

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

Checks (and displays) if a landing page should be displayed instead of normal content served by CMS.

Parameters

string $type Type of page to check ('page', 'home' or '404').:

string $slug Slug to check. Default: ''.:

3 calls to InstapageCmsPluginDrupal7Connector::checkPage()
InstapageCmsPluginDrupal7Connector::check404 in core/connectors/InstapageCmsPluginDrupal7Connector.php
Checks (and displays) if a landing page marked as 404 should be displayed instead of normal CMS 404 page.
InstapageCmsPluginDrupal7Connector::checkCustomUrl in core/connectors/InstapageCmsPluginDrupal7Connector.php
Checks (and displays) if a landing page hould be displayed instead of normal CMS page under current URL.
InstapageCmsPluginDrupal7Connector::checkHomepage in core/connectors/InstapageCmsPluginDrupal7Connector.php
Checks (and displays) if a landing page marked as homepage should be displayed instead of normal CMS homepage.

File

core/connectors/InstapageCmsPluginDrupal7Connector.php, line 628

Class

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

Code

public function checkPage($type, $slug = '') {
  $page = InstapageCmsPluginPageModel::getInstance();
  $result = $page
    ->check($type, $slug);
  if (!$result) {
    return;
  }
  if ($type == '404') {
    $page
      ->display($result, 404);
  }
  else {
    $page
      ->display($result);
  }
}