You are here

public function hostingService::form in Hosting 7.4

Same name and namespace in other branches
  1. 6.2 server/hosting_server.service.inc \hostingService::form()
  2. 7.3 server/hosting_server.service.inc \hostingService::form()
5 calls to hostingService::form()
hostingService_db_mysql::form in db_server/hosting_db_server.service.inc
hostingService_example_basic::form in example/example_service/hosting_example.service.inc
Extend the server node form.
hostingService_http_cluster::form in web_cluster/hosting_web_cluster.service.inc
hostingService_http_pack::form in web_pack/hosting_web_pack.service.inc
hostingService_http_ssl::form in web_server/ssl/hosting_ssl.service.inc
5 methods override hostingService::form()
hostingService_db_mysql::form in db_server/hosting_db_server.service.inc
hostingService_example_basic::form in example/example_service/hosting_example.service.inc
Extend the server node form.
hostingService_http_cluster::form in web_cluster/hosting_web_cluster.service.inc
hostingService_http_pack::form in web_pack/hosting_web_pack.service.inc
hostingService_http_ssl::form in web_server/ssl/hosting_ssl.service.inc

File

server/hosting_server.service.inc, line 126
Define the base Hosting service class.

Class

hostingService
@file Define the base Hosting service class.

Code

public function form(&$form) {
  if ($this->has_restart_cmd) {
    $form['restart_cmd'] = array(
      '#type' => 'textfield',
      '#title' => t('Restart command'),
      '#required' => !empty($this->available),
      '#description' => t('The command to run to restart this service.'),
      '#default_value' => isset($this->restart_cmd) ? $this->restart_cmd : $this
        ->default_restart_cmd(),
      '#size' => 40,
      '#maxlength' => 255,
      '#weight' => -7,
    );
  }
  else {
    $form['restart_cmd'] = array(
      '#type' => 'value',
      '#value' => NULL,
    );
  }
  if ($this->has_port) {
    $form['port'] = array(
      '#type' => 'textfield',
      '#title' => t('Port'),
      '#required' => !empty($this->available),
      '#size' => 40,
      '#default_value' => isset($this->port) ? $this->port : $this
        ->default_port(),
      '#description' => t("The port that this service is listening on."),
      '#maxlength' => 255,
      '#weight' => -8,
    );
  }
  else {
    $form['port'] = array(
      '#type' => 'value',
      '#value' => '0',
    );
  }
}