diff --git a/fitvids.install b/fitvids.install index d027156..48ea88c 100644 --- a/fitvids.install +++ b/fitvids.install @@ -10,7 +10,7 @@ * If the plugin doesn't exist, show a warning on the status page */ function fitvids_requirements($phase) { - $requirements = array(); + $requirements = []; // Check if plugin exists if ($phase == 'install') { @@ -26,19 +26,19 @@ function fitvids_requirements($phase) { $path = DRUPAL_ROOT . '/libraries/fitvids/jquery.fitvids.js'; $installed = file_exists($path); if (!$installed) { - $requirements['fitvids'] = array( + $requirements['fitvids'] = [ 'title' => t('FitVids.js jQuery plugin'), 'value' => t('Missing'), - 'description' => t('Download the plugin and copy it to :library', array(':url' => FITVIDS_PLUGIN_URL, ':library' => FITVIDS_LIBRARY_PATH)), + 'description' => t('Download the plugin and copy it to :library', [':url' => FITVIDS_PLUGIN_URL, ':library' => FITVIDS_LIBRARY_PATH]), 'severity' => REQUIREMENT_WARNING, - ); + ]; } else { - $requirements['fitvids'] = array( + $requirements['fitvids'] = [ 'title' => t('FitVids.js jQuery plugin'), 'value' => t('Installed'), 'severity' => REQUIREMENT_OK, - ); + ]; } } @@ -53,17 +53,17 @@ function fitvids_enable() { $path = libraries_get_path('fitvids') . '/jquery.fitvids.js'; $installed = file_exists($path); if (!$installed) { - $message = t('You need to download the FitVids.js jQuery plugin to use this module. Download it from !fitvids-site, copy it to the !fitvids-library directory, and rename it to !fitvids-filename.', array( + $message = t('You need to download the FitVids.js jQuery plugin to use this module. Download it from !fitvids-site, copy it to the !fitvids-library directory, and rename it to !fitvids-filename.', [ '!fitvids-site' => l(t('here'), FITVIDS_PLUGIN_URL), '!fitvids-library' => libraries_get_path('fitvids'), '!fitvids-filename' => FITVIDS_PLUGIN_FILENAME, - )); + ]); drupal_set_message(filter_xss_admin($message), $type = 'warning'); } else { - $message = t('You already have the FitVids.js jQuery plugin installed. Configure the module !fitvids-configuration', array( + $message = t('You already have the FitVids.js jQuery plugin installed. Configure the module !fitvids-configuration', [ '!fitvids-configuration' => l(t('here'), 'admin/config/media/fitvids'), - )); + ]); drupal_set_message(filter_xss_admin($message)); } } */ diff --git a/fitvids.module b/fitvids.module index 8439210..27c3343 100644 --- a/fitvids.module +++ b/fitvids.module @@ -37,7 +37,7 @@ function fitvids_help($route_name, RouteMatchInterface $route_match) { case 'help.page.fitvids': $output = ''; $output .= '

' . t('About') . '

'; - $output .= '

' . t("The Fitvids module uses the FitVids.js jQuery plugin to achieve fluid/responsive video embeds. You don't need it for pure HTML5 videos.", array('@github' => FITVIDS_GITHUB_URL)) . '

'; + $output .= '

' . t("The Fitvids module uses the FitVids.js jQuery plugin to achieve fluid/responsive video embeds. You don't need it for pure HTML5 videos.", ['@github' => FITVIDS_GITHUB_URL]) . '

'; $output .= '

' . t('Uses') . '

'; $output .= '

' . t("Use this module if you are using a responsive theme (such as Bootstrap), and want the videos to scale to fit the available space. By default it supports YouTube, Vimeo and Kickstarter.") . '

'; return $output; diff --git a/src/Form/FitvidsAdminSettingsForm.php b/src/Form/FitvidsAdminSettingsForm.php index d0b5531..ced4512 100644 --- a/src/Form/FitvidsAdminSettingsForm.php +++ b/src/Form/FitvidsAdminSettingsForm.php @@ -33,34 +33,34 @@ class FitvidsAdminSettingsForm extends ConfigFormBase { public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('fitvids.settings'); - $form['fitvids_intro'] = array( + $form['fitvids_intro'] = [ '#markup' => '

FitVids is a jQuery plugin for fluid width video embeds. By default, it supports YouTube, Vimeo and Kickstarter.

', - ); + ]; - $form['fitvids_selectors'] = array( + $form['fitvids_selectors'] = [ '#type' => 'textarea', '#title' => $this->t('Video containers'), '#default_value' => $config->get('selectors'), '#rows' => 3, '#description' => $this->t('Enter some jQuery selectors for your video containers. Use a new line for each selector.'), '#required' => TRUE, - ); + ]; - $form['fitvids_custom_vendors'] = array( + $form['fitvids_custom_vendors'] = [ '#type' => 'textarea', '#title' => $this->t('Additional video providers'), '#default_value' => $config->get('custom_vendors'), '#rows' => 3, '#description' => $this->t('YouTube, Vimeo, Blip.tv, Viddler and Kickstarter are supported by default. Tell FitVids about videos from other sites by adding the domain of the player. Use a new line for each URL. Don\'t add trailing slashes.
E.g., "http://www.dailymotion.com".'), - ); + ]; - $form['fitvids_ignore_selectors'] = array( + $form['fitvids_ignore_selectors'] = [ '#type' => 'textarea', '#title' => $this->t('Ignore these videos'), '#default_value' => $config->get('ignore_selectors'), '#rows' => 3, '#description' => $this->t('Enter some jQuery selectors for any videos or containers that you want to ignore. Use a new line for each selector.'), - ); + ]; return parent::buildForm($form, $form_state); }