You are here

public static function RocketChat::renderAdminPage in Rocket.Chat 7.2

Same name and namespace in other branches
  1. 7 RocketChat.class.inc \RocketChat\RocketChat::renderAdminPage()

Renders the Admin page.<

Return value

array The Structured Drupal Render Array for this Admin page.

1 call to RocketChat::renderAdminPage()
rocket_chat_admin_page in ./rocket_chat.module
Admin Page Render.

File

src/RocketChat.class.inc, line 78

Class

RocketChat
Class RocketChat.

Namespace

RocketChat

Code

public static function renderAdminPage() {
  $form['rocket_chat_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Rocket.Chat Server'),
    '#default_value' => variable_get('rocket_chat_url', "https://localhost"),
    '#size' => 64,
    '#maxlength' => 128,
    '#description' => t("The URL of the Rocket.Chat server."),
    '#required' => TRUE,
  );
  $form['rocket_chat_route'] = array(
    '#type' => 'textarea',
    '#title' => t('Paths to show the chat widget on.'),
    '#default_value' => variable_get('rocket_chat_route', ""),
    '#cols' => 20,
    '#rows' => 15,
    '#description' => t("use '&lt;front&gt;' to signify the front page." . " clear this field to make it show on all pages."),
    '#required' => FALSE,
  );
  $form['rocket_chat_livechat_version'] = array(
    '#type' => 'select',
    '#title' => t('LiveChat widget version.'),
    '#default_value' => variable_get('rocket_chat_livechat_version', "1.0.0"),
    '#options' => array(
      "1.0.0" => "Version 1.0.0",
      "legacy" => "Legacy version",
    ),
    '#description' => t("Version of the Livechat widget to load"),
    '#required' => TRUE,
  );
  return system_settings_form($form);
}