You are here

function clients_connection_broken::__construct in Web Service Clients 6.2

Same name and namespace in other branches
  1. 7.2 clients.inc \clients_connection_broken::__construct()

Constructor method for broken connections.

This expects the originator to have set a readable message in $object->broken_message.

Parameters

$object: An object of class stdClass returned from CTools.

Overrides clients_connection_base::__construct

File

./clients.inc, line 177
Contains basic classes for client connections.

Class

clients_connection_broken
Connection class for broken connections.

Code

function __construct($object) {

  // Call the base class to set the connection properties.
  $object = parent::__construct($object);

  // Add some output for the view connection page.
  $this->configuration['WARNING'] = t("This connection is broken.");
  $this->configuration['broken message'] = $object->broken_message;
  $connection_path = 'admin/build/clients/connections/' . $this->name;
  if ($_GET['q'] == $connection_path) {
    $message = t('This connection is broken.');
  }
  else {
    $message = t('A connection is broken. See its <a href="@url">view page</a> for further details.', array(
      '@url' => url($connection_path),
    ));
  }
  drupal_set_message($message, 'warning');
}