content_workflow_bynder-1.0.0/content_workflow_bynder_ui/content_workflow_bynder_ui.install

content_workflow_bynder_ui/content_workflow_bynder_ui.install
<?php

/**
 * @file
 * Install and uninstall script for Content Workflow UI module.
 */

use Drupal\views\Views;

/**
 * Implements hook_requirements().
 */
function content_workflow_bynder_ui_requirements($phase) {
  if ($phase !== 'runtime') {
    return [];
  }

  $t = 't';
  $requirements = [
    'content_workflow_bynder_tablesorter' => [
      'title' => $t('ContentWorkflowBynder: Tablesorter plugin'),
      'value' => $t('Unavailable.'),
      'description' => $t('Install <a href="@libraries-page">Libraries</a> module.',
        [
          '@libraries-page' => 'https://www.drupal.org/project/libraries',
        ]),
      'severity' => REQUIREMENT_INFO,
    ],
  ];

  if (\Drupal::moduleHandler()->moduleExists('libraries')) {
    $tablesorter_lib_info = libraries_detect('tablesorter-mottie');

    if ($tablesorter_lib_info['installed'] && $tablesorter_lib_info['version']) {
      $requirements['content_workflow_bynder_tablesorter']['value'] = $tablesorter_lib_info['version'];
      $requirements['content_workflow_bynder_tablesorter']['severity'] = REQUIREMENT_OK;
      unset($requirements['content_workflow_bynder_tablesorter']['description']);
    }
    else {
      $requirements['content_workflow_bynder_tablesorter']['description'] = $t('Download <a href="@tablesorter-github">Mottie\'s tablesorter plugin</a> to <code>sites/all/libraries</code> toget sortable table headers at Content Workflow admin UI. Rename it\'s folder to <code>tablesorter-mottie</code>.',
        [
          '@tablesorter-github' => 'https://github.com/Mottie/tablesorter/archive/v2.25.8.zip',
        ]);
    }
  }

  return $requirements;
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc