ckeditor_font-8.x-1.x-dev/ckeditor_font.module

ckeditor_font.module
<?php

/**
 * @file
 * Provides CKEditor Font Size, Font Family, Font Color, and Font Background Color functionality.
 */

use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Hook\Attribute\LegacyHook;
use Drupal\ckeditor_font\Hook\CqeditorFontHooks;

/**
 * Implements hook_help().
 */
#[LegacyHook]
function ckeditor_font_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.ckeditor_font':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The CKEditor Font module adds Font Size, Font Family, Font Color, and Font Background Color functionality to CKEditor 5. This module enables font customization dropdowns in your WYSIWYG editor, allowing content creators to apply various font styles and colors.') . '</p>';

      $output .= '<h3>' . t('Important Notice') . '</h3>';
      $output .= '<p>' . t('<strong>PLEASE NOTE:</strong> The use of this project is deprecated. For new sites, it is highly recommended to use the <a href="@ckeditor5_plugin_pack">CKEditor5 Plugin Pack</a> module maintained by the CKSource team. Use this module if you are still using it in your existing sites and want to transition to other modules in the near future.', [
        '@ckeditor5_plugin_pack' => 'https://www.drupal.org/project/ckeditor5_plugin_pack',
      ]) . '</p>';

      $output .= '<h3>' . t('Features') . '</h3>';
      $output .= '<ul>';
      $output .= '<li>' . t('Font Size dropdown with customizable size options') . '</li>';
      $output .= '<li>' . t('Font Family dropdown with serif, sans-serif, and monospaced font options') . '</li>';
      $output .= '<li>' . t('Font Color picker for text styling') . '</li>';
      $output .= '<li>' . t('Font Background Color picker (CKEditor 5 only)') . '</li>';
      $output .= '<li>' . t('Customizable font lists for each text format') . '</li>';
      $output .= '</ul>';

      $output .= '<h3>' . t('Configuration') . '</h3>';
      $output .= '<p>' . t('To configure the CKEditor Font module:') . '</p>';
      $output .= '<ol>';
      $output .= '<li>' . t('Navigate to <em>Administration » Configuration » Text formats and editors</em>.') . '</li>';
      $output .= '<li>' . t('Select the text format you want to configure and click <em>Configure</em>.') . '</li>';
      $output .= '<li>' . t('In the <em>Toolbar configuration</em>, drag the font buttons from <em>Available buttons</em> to the <em>Active toolbar</em>:');
      $output .= '<ul>';
      $output .= '<li>' . t('<em>f</em> button for Font Family') . '</li>';
      $output .= '<li>' . t('<em>S</em> button for Font Size') . '</li>';
      $output .= '<li>' . t('Font Color and Font Background Color buttons') . '</li>';
      $output .= '</ul></li>';
      $output .= '<li>' . t('Configure the options under <em>CKEditor plugin settings » Font Settings</em>.') . '</li>';
      $output .= '<li>' . t('Click <em>Save Configuration</em>.') . '</li>';
      $output .= '</ol>';

      $output .= '<h3>' . t('Font Configuration Examples') . '</h3>';
      $output .= '<p>' . t('<strong>Font Families:</strong> Provide a list of approved font families using the format <code>Primary font, fallback1, fallback2|Font Label</code>. Example:') . '</p>';
      $output .= '<pre>';
      $output .= 'Verdana, Geneva, sans-serif' . "\n";
      $output .= 'Lucida Console, Courier New, monospace' . "\n";
      $output .= 'Times New Roman, Times, serif';
      $output .= '</pre>';

      $output .= '<p>' . t('<strong>Font Sizes:</strong> Provide a list of approved font sizes using the format <code>123px|Size label</code>. Example:') . '</p>';
      $output .= '<pre>';
      $output .= '10px|Small' . "\n";
      $output .= '14px|Normal' . "\n";
      $output .= '18px|Large' . "\n";
      $output .= '24px|Extra Large';
      $output .= '</pre>';

      $output .= '<p>' . t('<strong>Font Colors:</strong> For Font Background Color (CKEditor 5 only), enter colors using the following syntax:') . '</p>';
      $output .= '<pre>';
      $output .= 'rgb(255,255,255)|White' . "\n";
      $output .= 'hsl(0,0%,0%)|Black' . "\n";
      $output .= '#ff0000|Red';
      $output .= '</pre>';

      $output .= '<h3>' . t('Requirements') . '</h3>';
      $output .= '<p>' . t('This module requires:') . '</p>';
      $output .= '<ul>';
      $output .= '<li>' . t('Drupal core 9.4 or higher') . '</li>';
      $output .= '<li>' . t('CKEditor 5 module (included in Drupal core)') . '</li>';
      $output .= '</ul>';

      $output .= '<h3>' . t('More Information') . '</h3>';
      $output .= '<p>' . t('For more information, visit:') . '</p>';
      $output .= '<ul>';
      $output .= '<li>' . t('<a href="@project_page">Project page</a>', ['@project_page' => 'https://www.drupal.org/project/ckeditor_font']) . '</li>';
      $output .= '<li>' . t('<a href="@documentation">Community documentation</a>', ['@documentation' => 'https://www.drupal.org/docs/8/modules/ckeditor-font-size-and-family']) . '</li>';
      $output .= '<li>' . t('<a href="@issues">Issue tracker</a>', ['@issues' => 'https://www.drupal.org/project/issues/ckeditor_font']) . '</li>';
      $output .= '</ul>';

      return $output;
  }
}

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

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