/** * {@inheritdoc} */ public function alterForm(array &$form, FormStateInterface $form_state, $form_id = NULL) { parent::alterForm($form, $form_state, $form_id); $group = $this->getGroup($form, $form_state); $group->setProperty('description', t('These are global options. Each modal can independently override desired settings by appending the option name to <code>data-</code>. Example: <code>data-backdrop="false"</code>.')); $group->setProperty('states', ['visible' => [':input[name="modal_enabled"]' => ['checked' => TRUE]]]); }
/** * {@inheritdoc} */ public function __construct(array $configuration, $plugin_id, $plugin_definition) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->providerManager = new ProviderManager($this->theme); if (isset($plugin_definition['cdn_provider'])) { $this->provider = $this->theme->getProvider($plugin_definition['cdn_provider']); } }
/** * {@inheritdoc} */ public function alterForm(array &$form, FormStateInterface $form_state, $form_id = NULL) { parent::alterForm($form, $form_state, $form_id); $update_manager = new UpdateManager($this->theme); $pending = $update_manager->getPendingUpdates(); if ($pending) { $form['update'] = ['#type' => 'details', '#title' => \Drupal::translation()->formatPlural(count($pending), 'Pending Update', 'Pending Updates'), '#panel_type' => 'primary', '#weight' => -20]; $rows = []; foreach ($pending as $version => $update) { $row = []; $row[] = $version; $row[] = new FormattableMarkup('<strong>@title</strong><p class="help-block">@description</p>', ['@title' => $update->getTitle(), '@description' => $update->getDescription()]); $rows[] = ['class' => [$update->getLevel() ?: 'default'], 'data' => $row]; } $form['update']['table'] = ['#type' => 'table', '#header' => [t('Update'), t('Description')], '#rows' => $rows]; $form['update']['update'] = ['#type' => 'submit', '#value' => t('Update @theme', ['@theme' => $this->theme->getTitle()]), '#icon' => Bootstrap::glyphicon('open'), '#attributes' => ['class' => ['btn-primary']], '#submit' => [[get_class($this), 'updateTheme']]]; } }
/** * {@inheritdoc} */ public function alterForm(array &$form, FormStateInterface $form_state, $form_id = NULL) { parent::alterForm($form, $form_state, $form_id); $updates = []; foreach ($this->theme->getPendingUpdates() as $version => $update) { $row = []; $row[] = $update->getSchema(); $row[] = new FormattableMarkup('<strong>@title</strong><p class="help-block">@description</p>', ['@title' => $update->getLabel(), '@description' => $update->getDescription()]); $row[] = $update->getTheme()->getTitle(); $updates[] = ['class' => [$update->getSeverity() ?: 'default'], 'data' => $row]; } $form['update'] = ['#type' => 'details', '#title' => $this->t('Theme Updates'), '#panel_type' => !!$updates ? 'primary' : 'default', '#open' => !!$updates, '#weight' => -20]; $form['update']['table'] = ['#type' => 'table', '#header' => [t('Schema'), t('Description'), t('Provider')], '#empty' => t('There are currently no pending updates for this theme.'), '#rows' => $updates]; if ($updates) { $form['update']['actions'] = ['#type' => 'actions']; $form['update']['actions']['update'] = ['#type' => 'submit', '#value' => t('Update theme'), '#icon' => Bootstrap::glyphicon('open'), '#attributes' => ['class' => ['btn-primary']], '#submit' => [[get_class($this), 'updateTheme']]]; } }
/** * {@inheritdoc} */ public function alterForm(array &$form, FormStateInterface $form_state, $form_id = NULL) { parent::alterForm($form, $form_state, $form_id); $group = $this->getGroup($form, $form_state); $setting = $this->getElement($form, $form_state); // Move description. $group->setProperty('description', $setting->getProperty('description')); // Retrieve the current default values. $default_values = $group->getProperty('default_value', $this->getDefaultValue()); $wells = ['' => t('None'), 'well' => t('.well (normal)'), 'well well-sm' => t('.well-sm (small)'), 'well well-lg' => t('.well-lg (large)')]; // Create dynamic well settings for each region. $regions = system_region_list($this->theme->getName()); foreach ($regions as $name => $title) { if (in_array($name, ['page_top', 'page_bottom'])) { continue; } $setting->{'region_well-' . $name} = ['#title' => $title, '#type' => 'select', '#attributes' => ['class' => ['input-sm']], '#options' => $wells, '#default_value' => isset($default_values[$name]) ? $default_values[$name] : '']; } }
/** * {@inheritdoc} */ public function alterForm(array &$form, FormStateInterface $form_state, $form_id = NULL) { parent::alterForm($form, $form_state, $form_id); $element = $this->getElement($form, $form_state); $element->setProperty('states', ['invisible' => [':input[name="breadcrumb"]' => ['value' => 0]]]); }
/** * {@inheritdoc} */ public function alterForm(array &$form, FormStateInterface $form_state, $form_id = NULL) { parent::alterForm($form, $form_state, $form_id); $group = $this->getGroup($form, $form_state); $group->setProperty('description', t('Add small overlays of content, like those on the iPad, to any element for housing secondary information.')); }
/** * {@inheritdoc} */ public function alterForm(array &$form, FormStateInterface $form_state, $form_id = NULL) { parent::alterForm($form, $form_state, $form_id); $group = $this->getGroup($form, $form_state); $group->setProperty('description', t('Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don\'t rely on images, use CSS3 for animations, and data-attributes for local title storage. See <a href=":url" target="_blank">Bootstrap tooltips</a> for more documentation.', [':url' => 'http://getbootstrap.com/javascript/#tooltips'])); }
/** * {@inheritdoc} */ public function alterForm(array &$form, FormStateInterface $form_state, $form_id = NULL) { parent::alterForm($form, $form_state, $form_id); $element = $this->getElement($form, $form_state); $element->setProperty('states', ['visible' => [':input[name="forms_smart_descriptions"]' => ['checked' => TRUE]]]); }
/** * {@inheritdoc} */ public function alterForm(array &$form, FormStateInterface $form_state, $form_id = NULL) { parent::alterForm($form, $form_state, $form_id); $group = $this->getGroup($form, $form_state); $group->setProperty('description', t('Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults. See <a href=":url" target="_blank">Bootstrap Modals</a> for more documentation.', [':url' => 'http://getbootstrap.com/javascript/#modals'])); }