You are here

function cmis_repository_switcher_form in CMIS API 6.3

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

CMIS repository switcher form.

1 string reference to 'cmis_repository_switcher_form'
cmis_block in ./cmis.module
CMIS repository switcher block.

File

./cmis.module, line 248

Code

function cmis_repository_switcher_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' => $_SESSION['cmis_repository'],
    '#options' => $repositories,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('OK'),
  );
  return $form;
}