You are here

function cmis_repository_switcher_form in CMIS API 7

Same name and namespace in other branches
  1. 6.4 cmis.module \cmis_repository_switcher_form()
  2. 6.3 cmis.module \cmis_repository_switcher_form()
  3. 7.2 cmis.module \cmis_repository_switcher_form()

CMIS repository switcher form.

1 string reference to 'cmis_repository_switcher_form'
cmis_block_view in ./cmis.module
Implements hook_block_info

File

./cmis.module, line 273

Code

function cmis_repository_switcher_form($form, &$form_state) {
  $repositories = array();
  foreach (variable_get('cmis_repositories', array()) as $repository_name => $repository_info) {
    $repositories[$repository_name] = array_key_exists('label', $repository_info) ? $repository_info['label'] : $repository_name;
  }
  $form = array();
  $form['cmis_repository'] = array(
    '#type' => 'select',
    '#title' => t('CMIS repositories'),
    '#default_value' => isset($_SESSION['cmis_repository']) ? $_SESSION['cmis_repository'] : '',
    '#options' => $repositories,
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('OK'),
  );
  return $form;
}