From 4d046637f8e4212218c950120e87b40f1a04de8e Mon Sep 17 00:00:00 2001 From: asghar <mr.asghar.khan@gmail.com> Date: Tue, 24 Jun 2025 15:26:01 +0500 Subject: [PATCH 1/7] Fix the formatting issues and dependencies issues. --- modules/noahs_ai/noahs_ai.info.yml | 2 + modules/noahs_gallery/noahs_gallery.info.yml | 2 + noahs_page_builder.info.yml | 17 ++++---- noahs_page_builder.routing.yml | 42 +++++++++----------- 4 files changed, 30 insertions(+), 33 deletions(-) diff --git a/modules/noahs_ai/noahs_ai.info.yml b/modules/noahs_ai/noahs_ai.info.yml index 9fd0865..739cc1f 100644 --- a/modules/noahs_ai/noahs_ai.info.yml +++ b/modules/noahs_ai/noahs_ai.info.yml @@ -3,3 +3,5 @@ type: module description: 'Generate text from AI' package: Noahs Page Builder core_version_requirement: ^10 || ^11 +dependencies: + - noahs_page_builder:noahs_page_builder diff --git a/modules/noahs_gallery/noahs_gallery.info.yml b/modules/noahs_gallery/noahs_gallery.info.yml index 222a3c2..b1158a1 100644 --- a/modules/noahs_gallery/noahs_gallery.info.yml +++ b/modules/noahs_gallery/noahs_gallery.info.yml @@ -3,3 +3,5 @@ type: module description: 'Create Galleries and use it in Noahs' package: Noahs Page Builder core_version_requirement: ^10 || ^11 +dependencies: + - noahs_page_builder:noahs_page_builder diff --git a/noahs_page_builder.info.yml b/noahs_page_builder.info.yml index b9be5a4..e93d2c2 100644 --- a/noahs_page_builder.info.yml +++ b/noahs_page_builder.info.yml @@ -1,15 +1,14 @@ -name: Noahs Page Builder +name: Noahs Page Builder type: module description: 'Fast page builder on drupal' package: Noahs Page Builder version: 1.1.x core_version_requirement: ^10 | ^11 dependencies: - - block - - views - - token - - views - - field_group - - media - - ckeditor5 - \ No newline at end of file + - drupal:block + - drupal:views + - drupal:token + - drupal:views + - drupal:field_group + - drupal:media + - drupal:ckeditor5 diff --git a/noahs_page_builder.routing.yml b/noahs_page_builder.routing.yml index e734f6a..44bd222 100644 --- a/noahs_page_builder.routing.yml +++ b/noahs_page_builder.routing.yml @@ -20,7 +20,7 @@ noahs_page_builder.noahs_settings_styles: _title: 'Noahs settings configuration' _controller: '\Drupal\noahs_page_builder\Controller\NoahsSettingsController::editor' requirements: - _permission: 'administer noahs_page_builder' + _permission: 'administer noahs_page_builder' noahs_page_builder.noahs_settings_iframe: path: '/admin/structure/noahs/settings_iframe' @@ -28,7 +28,7 @@ noahs_page_builder.noahs_settings_iframe: _title: 'Noahs settings configuration' _controller: '\Drupal\noahs_page_builder\Controller\NoahsSettingsController::iframe' requirements: - _permission: 'administer noahs_page_builder' + _permission: 'administer noahs_page_builder' noahs_page_builder.editor: path: '/noahs_edit/{entity_type}/{entity}' @@ -37,7 +37,7 @@ noahs_page_builder.editor: _controller: '\Drupal\noahs_page_builder\Controller\NoahsController::editor' _format: 'html' options: - no_cache: 'TRUE' + no_cache: TRUE parameters: entity_type: type: 'string' @@ -51,9 +51,8 @@ noahs_page_builder.preview: defaults: _title: 'Edit Noahs Preview' _controller: '\Drupal\noahs_page_builder\Controller\NoahsController::preview' - _format: 'html' options: - no_cache: 'TRUE' + no_cache: TRUE parameters: entity_type: type: 'string' @@ -67,9 +66,8 @@ noahs_page_builder.product_preview: defaults: _title: 'Edit noahs_page_builder' _controller: '\Drupal\noahs_page_builder\Controller\NoahsController::preview' - _format: 'html' options: - no_cache: 'TRUE' + no_cache: TRUE parameters: node: type: 'entity:commerce_product' @@ -81,9 +79,8 @@ noahs_page_builder.widget: defaults: _title: 'Edit noahs_page_builder' _controller: '\Drupal\noahs_page_builder\Controller\NoahsController::renderWidget' - _format: 'html' options: - no_cache: 'TRUE' + no_cache: TRUE requirements: _permission: 'administer noahs_page_builder' @@ -92,9 +89,8 @@ noahs_page_builder.get_widget_form: defaults: _title: 'Edit noahs_page_builder' _controller: '\Drupal\noahs_page_builder\Controller\NoahsController::getWidgetForm' - _format: 'html' options: - no_cache: 'TRUE' + no_cache: TRUE requirements: _permission: 'administer noahs_page_builder' @@ -103,9 +99,8 @@ noahs_page_builder.regenerate_widget: defaults: _title: 'Edit noahs_page_builder' _controller: '\Drupal\noahs_page_builder\Controller\NoahsController::regenerateWidget' - _format: 'html' options: - no_cache: 'TRUE' + no_cache: TRUE requirements: _permission: 'administer noahs_page_builder' @@ -114,9 +109,8 @@ noahs_page_builder.default_widget_template: defaults: _title: 'Edit noahs_page_builder' _controller: '\Drupal\noahs_page_builder\Controller\NoahsController::renderDefaultTemplateWidget' - _format: 'html' options: - no_cache: 'TRUE' + no_cache: TRUE requirements: _permission: 'administer noahs_page_builder' @@ -126,7 +120,7 @@ noahs_page_builder.modal: _controller: '\Drupal\noahs_page_builder\Controller\NoahsModalController::modal' _title: 'Modal Form' options: - no_cache: 'TRUE' + no_cache: TRUE requirements: _permission: 'administer noahs_page_builder' @@ -137,7 +131,7 @@ noahs_page_builder.edit_widget: _title: 'Edit Widget Form' requirements: _permission: 'administer noahs_page_builder' - + noahs_page_builder.widget_clone: path: '/noahs-admin/widget-clone/{old_id}/{new_id}' defaults: @@ -185,8 +179,8 @@ noahs_page_builder.save_page: _title: 'Save Configuration' _controller: '\Drupal\noahs_page_builder\Controller\NoahsController::savePage' requirements: - _permission: 'administer noahs_page_builder' - + _permission: 'administer noahs_page_builder' + noahs_page_builder.get_icons_list: path: '/admin/structure/noahs_page_builder/icons' defaults: @@ -202,7 +196,7 @@ noahs_page_builder.get_icons_list_modal: _controller: '\Drupal\noahs_page_builder\Controller\NoahsIconsController::modal' requirements: _permission: 'administer noahs_page_builder' - + noahs_page_builder.get_tokens: path: '/noahs-admin/get_token' defaults: @@ -224,7 +218,7 @@ noahs_page_builder.functions.get_media_image: _title: 'Get Media Image' _controller: '\Drupal\noahs_page_builder\Controller\NoahsFunctionsController::getMediaImage' options: - no_cache: 'TRUE' + no_cache: TRUE requirements: _permission: 'administer noahs_page_builder' @@ -234,7 +228,7 @@ noahs_page_builder.functions.get_media_token: _title: 'Get Media Token' _controller: '\Drupal\noahs_page_builder\Controller\NoahsFunctionsController::getMediaImageToken' options: - no_cache: 'TRUE' + no_cache: TRUE requirements: _permission: 'administer noahs_page_builder' @@ -244,7 +238,7 @@ noahs_page_builder.themes_list_modal: _title: 'Get Themes List' _controller: '\Drupal\noahs_page_builder\Controller\NoahsThemesController::modalThemes' requirements: - _permission: 'administer noahs_page_builder' + _permission: 'administer noahs_page_builder' noahs_page_builder.themes_get_default: path: '/noahs-admin/noahs-template/get-default' @@ -252,4 +246,4 @@ noahs_page_builder.themes_get_default: _title: 'Get Theme from Id' _controller: '\Drupal\noahs_page_builder\Controller\NoahsThemesController::getTheme' requirements: - _permission: 'administer noahs_page_builder' \ No newline at end of file + _permission: 'administer noahs_page_builder' -- GitLab From 569defedccbad557cf85869d4ff3cb94f940ffec Mon Sep 17 00:00:00 2001 From: Shahzaib <shahzaib15@gmail.com> Date: Thu, 26 Jun 2025 18:05:59 +0000 Subject: [PATCH 2/7] WEBZONE-05:Refine the Noah module code. --- src/Controller/NoahsController.php | 239 +++++++++++------- src/Controller/NoahsEditWidgetController.php | 41 ++- src/Controller/NoahsFunctionsController.php | 63 +++-- src/Controller/NoahsIconsController.php | 46 +++- src/Controller/NoahsModalMediaController.php | 55 +++- src/Controller/NoahsModalTokensController.php | 46 +++- src/Controller/NoahsSaveStylesController.php | 7 - src/Controller/NoahsSettingsController.php | 50 ++-- src/Controller/NoahsThemesController.php | 85 +++++-- src/Controller/NoahsTrackController.php | 36 ++- src/Form/NoahsRenegerateStylesForm.php | 67 ++++- src/Plugin/Control/ControlBase.php | 30 ++- src/Plugin/Control/ControlNoahsUrl.php | 30 ++- 13 files changed, 587 insertions(+), 208 deletions(-) diff --git a/src/Controller/NoahsController.php b/src/Controller/NoahsController.php index b933896..b418f10 100644 --- a/src/Controller/NoahsController.php +++ b/src/Controller/NoahsController.php @@ -10,7 +10,6 @@ use Drupal\Core\Url; use Drupal\editor\Entity\Editor; use Drupal\noahs_page_builder\ControlsManager; use Drupal\noahs_page_builder\ModalForm; -use Drupal\noahs_page_builder\Controller\NoahsSaveStylesController; use Drupal\noahs_page_builder\Service\WidgetServices; use Drupal\noahs_page_builder_pro\Controller\NoahsWidgetSaveAsDefaultProController; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -22,6 +21,10 @@ use Drupal\Core\Extension\ModuleExtensionList; use Drupal\editor\Plugin\EditorManager; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Access\CsrfTokenGenerator; +use Drupal\Core\Messenger\MessengerInterface; +use Drupal\Core\DependencyInjection\ClassResolverInterface; /** * Provides route responses for Noah's Builder. @@ -98,6 +101,39 @@ class NoahsController extends ControllerBase { */ protected $entityTypeManager; + /** + * The module handler service. + * + * @var \Drupal\Core\Extension\ModuleHandlerInterface + */ + protected $moduleHandler; + /** + * The class resolver service. + * + * @var \Drupal\Core\DependencyInjection\ClassResolverInterface + */ + protected $classResolver; + + /** + * The CSRF token generator. + * + * @var \Drupal\Core\Csrf\CsrfTokenGenerator + */ + protected $csrfToken; + + /** + * The file system service. + * + * @var \Drupal\Core\File\FileSystemInterface + */ + protected $fileSystem; + + /** + * The messenger service. + * + * @var \Drupal\Core\Messenger\MessengerInterface + */ + protected $messenger; /** * NoahsController constructor. * @@ -119,6 +155,14 @@ class NoahsController extends ControllerBase { * The configuration factory. * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager service. + * @param \Drupal\Core\Access\CsrfTokenGenerator $csrf_token + * The csrf token service. + * @param \Drupal\Core\File\FileSystemInterface $file_system + * The file system service. + * @param \Drupal\Core\Messenger\MessengerInterface $messenger + * The messenger service. + * @param \Drupal\Core\DependencyInjection\ClassResolverInterface $class_resolver + * The class resolver service. */ public function __construct( WidgetServices $widget_service, @@ -129,7 +173,11 @@ class NoahsController extends ControllerBase { ModuleExtensionList $extension_list, AccountInterface $current_user, ConfigFactoryInterface $config_factory, - EntityTypeManagerInterface $entity_type_manager + EntityTypeManagerInterface $entity_type_manager, + CsrfTokenGenerator $csrf_token, + FileSystemInterface $file_system, + MessengerInterface $messenger, + ClassResolverInterface $class_resolver, ) { $this->widgetService = $widget_service; $this->languageManager = $language_manager; @@ -140,6 +188,11 @@ class NoahsController extends ControllerBase { $this->currentUser = $current_user; $this->configFactory = $config_factory; $this->config = $this->configFactory->get('noahs_page_builder.settings'); + $this->entityTypeManager = $entity_type_manager; + $this->csrfToken = $csrf_token; + $this->fileSystem = $file_system; + $this->messenger = $messenger; + $this->classResolver = $class_resolver; } /** @@ -160,7 +213,11 @@ class NoahsController extends ControllerBase { $container->get('extension.list.module'), $container->get('current_user'), $container->get('config.factory'), - $container->get('entity_type.manager') + $container->get('entity_type.manager'), + $container->get('csrf_token'), + $container->get('file_system'), + $container->get('messenger'), + $container->get('class_resolver'), ); } @@ -169,7 +226,7 @@ class NoahsController extends ControllerBase { */ public function editor($entity_type, $entity) { - $drupal_languages = \Drupal::languageManager()->getLanguages(); + $drupal_languages = $this->languageManager->getLanguages(); $langcode = $this->languageManager->getCurrentLanguage()->getId(); $default_languagecode = $this->languageManager->getDefaultLanguage()->getId(); $widgets = $this->widgetService->getWidgetsList(); @@ -199,7 +256,7 @@ class NoahsController extends ControllerBase { } $fields = []; - foreach($all_widgets as $k => $el){ + foreach ($all_widgets as $k => $el) { $fields[$k] = $this->widgetService->getWidgetFields($k); } @@ -212,7 +269,7 @@ class NoahsController extends ControllerBase { $page['#attached']['drupalSettings']['all_widgets'] = $all_widgets; $page['#attached']['drupalSettings']['langcode'] = $langcode; $page['#attached']['drupalSettings']['languages'] = $languages; - $token = \Drupal::service('csrf_token')->get(''); + $token = $this->csrfToken->get(''); $page['#attached']['drupalSettings']['csrfToken'] = $token; $page['#attached']['library'][] = 'noahs_page_builder/noahs_page_builder.assets.preview'; $page['#attached']['library'][] = 'noahs_page_builder/noahs_page_builder.media_library_modal'; @@ -278,7 +335,7 @@ class NoahsController extends ControllerBase { $page['#attached']['drupalSettings']['noahs_id'] = $noahs_id; $page['#attached']['drupalSettings']['uid'] = $this->currentUser->id(); $page['#attached']['drupalSettings']['langcode'] = $langcode; - + $page['#attached']['library'][] = 'noahs_page_builder/noahs_page_builder.assets.admin'; $page['#attached']['library'][] = 'noahs_page_builder/noahs_page_builder.assets.frontend'; @@ -353,21 +410,16 @@ class NoahsController extends ControllerBase { if (file_exists('public://noahs/' . $entity_type . '/' . $old_css_file_name)) { $original_uri = 'public://noahs/' . $entity_type . '/' . $old_css_file_name; $new_css_file_name = 'noahs_' . $new_noahs_id . '_' . $new_langcode . '.css'; - $new_uri ='public://noahs/' . $entity_type . '/' . $new_css_file_name; + $new_uri = 'public://noahs/' . $entity_type . '/' . $new_css_file_name; - // Usamos el servicio de FileSystem - $file_system = \Drupal::service('file_system'); + if ($this->fileSystem->copy($original_uri, $new_uri, FileSystemInterface::EXISTS_RENAME)) { - // Clonamos el archivo (copy) - if ($file_system->copy($original_uri, $new_uri, \Drupal\Core\File\FileSystemInterface::EXISTS_RENAME)) { - // Puedes cargar el nuevo archivo como entidad si quieres usarlo después - $new_file = \Drupal\file\Entity\File::create([ + $new_file = $this->entityTypeManager->getStorage('file')->create([ 'uri' => $new_uri, ]); $new_file->save(); - // Opcional: vincular a un campo o hacer otras acciones - \Drupal::messenger()->addMessage('Archivo clonado correctamente.'); + $this->messenger()->addMessage('Archivo clonado correctamente.'); } } return $result; @@ -387,9 +439,10 @@ class NoahsController extends ControllerBase { $page_settings = $data['page_settings'] ?? NULL; $css = $data['css'] ?? ''; - if(!empty($data['language'])){ + if (!empty($data['language'])) { $langcode = ($data['language'] === 'no_language') ? 'no_language' : $data['language']; - }else{ + } + else { $langcode = $this->languageManager->getCurrentLanguage()->getId(); } @@ -467,7 +520,7 @@ class NoahsController extends ControllerBase { } $css = $this->saveCss($entity_type, $entity_id, $langcode, $css); if (is_module_installed('noahs_page_builder_pro')) { - $proClass = \Drupal::classResolver(NoahsWidgetSaveAsDefaultProController::class); + $proClass = $this->classResolver->getInstanceFromDefinition(NoahsWidgetSaveAsDefaultProController::class); $proClass->saveDefaultWidgetCss(); } return new JsonResponse(['noahs_id' => $noahs_id]); @@ -476,41 +529,37 @@ class NoahsController extends ControllerBase { /** * Save CSS. */ - - public function saveCss($entity_type, $entity_id, $langcode, $css) { - - $widgetService = \Drupal::service('noahs_page_builder.widget_service'); - $moduleHandler = \Drupal::service('module_handler'); - + public function saveCss($entity_type, $entity_id, $langcode, $css) { $directory = 'public://noahs/' . $entity_type; - $file_system = \Drupal::service('file_system'); - $file_system->prepareDirectory($directory, FileSystemInterface:: CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS | FileSystemInterface::EXISTS_REPLACE); + $this->fileSystem->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS | FileSystemInterface::EXISTS_REPLACE); // Nombre original del archivo. $prefix_filename = 'noahs_'; if ($entity_type === 'noahs_settings') { $prefix_filename = ''; - if($entity_id === 'noahs_general_settings'){ + if ($entity_id === 'noahs_general_settings') { $entity_id = 'general_settings'; - }else{ + } + else { $entity_id = 'settings'; } } - if($langcode && $langcode != 'no_language'){ + if ($langcode && $langcode != 'no_language') { $filename = $prefix_filename . $entity_id . '_' . $langcode . '.css'; - }else{ + } + else { $filename = $prefix_filename . $entity_id . '.css'; } - - \Drupal::service('file_system')->saveData($css, $directory . '/' . $filename, FileSystemInterface::EXISTS_REPLACE); + + $this->fileSystem->saveData($css, $directory . '/' . $filename, FileSystemInterface::EXISTS_REPLACE); return new JsonResponse(['message' => 'CSS saved!', 'styles' => $css]); } - + /** * Get widget form. */ @@ -519,8 +568,7 @@ class NoahsController extends ControllerBase { $data = json_decode($request->getContent(), TRUE); $fields = $this->widgetService->getWidgetFields($data['widget_id']); $form = ModalForm::renderForm($fields, $data); - return new JsonResponse(['html' => '<form>' . $form[0].'</form>']); - + return new JsonResponse(['html' => '<form>' . $form[0] . '</form>']); } /** @@ -528,48 +576,49 @@ class NoahsController extends ControllerBase { */ public function renderWidget(Request $request) { $data = json_decode($request->getContent(), TRUE); - // Crear settings base - + // Crear settings base. $settings = [ - "type" => $data['widget_id'], - "wid" => uniqid(), - "noahs_id" => $data['nid'], - "settings" => [ - "element" => $data['form_data']['element'], - ] + "type" => $data['widget_id'], + "wid" => uniqid(), + "noahs_id" => $data['nid'], + "settings" => [ + "element" => $data['form_data']['element'], + ] ]; $column_size = !empty($data['extra_data']['width']) ? $data['extra_data']['width'] : FALSE; if ($column_size === 'two_columns') { - return new JsonResponse(['html' => $this->getDinamicColumns('2', $data)]); - } elseif ($column_size === 'three_columns') { - return new JsonResponse(['html' => $this->getDinamicColumns('3', $data)]); - } elseif ($column_size === 'four_columns') { - return new JsonResponse(['html' => $this->getDinamicColumns('4', $data)]); - } else { - // Modificar settings si es "noahs_column" - if ($data['widget_id'] === 'noahs_column') { - $settings['settings']['element'] = [ - "css" => [ - "desktop" => [ - "default" => ["column_width" => $column_size] - ], - "mobile" => [ - "default" => ["column_width" => "100%"] - ] - ] - ]; - } + return new JsonResponse(['html' => $this->getDinamicColumns('2', $data)]); + } + elseif ($column_size === 'three_columns') { + return new JsonResponse(['html' => $this->getDinamicColumns('3', $data)]); + } + elseif ($column_size === 'four_columns') { + return new JsonResponse(['html' => $this->getDinamicColumns('4', $data)]); + } + else { + // Modificar settings si es "noahs_column". + if ($data['widget_id'] === 'noahs_column') { + $settings['settings']['element'] = [ + "css" => [ + "desktop" => [ + "default" => ["column_width" => $column_size] + ], + "mobile" => [ + "default" => ["column_width" => "100%"] + ] + ] + ]; + } - // Convertir todo el array en objeto recursivamente - $settings = json_decode(json_encode($settings), FALSE); + // Convertir todo el array en objeto recursivamente. + $settings = json_decode(json_encode($settings), FALSE); - $widget = noahs_page_builder_render_element($settings, NULL); - return new JsonResponse(['html' => $widget, 'obj' => $settings]); + $widget = noahs_page_builder_render_element($settings, NULL); + return new JsonResponse(['html' => $widget, 'obj' => $settings]); } -} - + } /** * Get Dinamic Columns. @@ -578,35 +627,33 @@ class NoahsController extends ControllerBase { $rendered_columns = []; for ($i = 0; $i < $num_columns; $i++) { - if ($data['widget_id'] === 'noahs_column') { - $width = (100 / $num_columns) . '%'; - - $settings = [ - "type" => $data['widget_id'], - "wid" => uniqid(), - "noahs_id" => $data['nid'], - "settings" => [ - "element" => [ - "css" => [ - 'desktop' => ['default' => ['column_width' => $width]], - 'tablet' => ['default' => ['column_width' => '50%']], - 'mobile' => ['default' => ['column_width' => '100%']] - ] - ] + if ($data['widget_id'] === 'noahs_column') { + $width = (100 / $num_columns) . '%'; + + $settings = [ + "type" => $data['widget_id'], + "wid" => uniqid(), + "noahs_id" => $data['nid'], + "settings" => [ + "element" => [ + "css" => [ + 'desktop' => ['default' => ['column_width' => $width]], + 'tablet' => ['default' => ['column_width' => '50%']], + 'mobile' => ['default' => ['column_width' => '100%']] ] - ]; - - } + ] + ] + ]; + } - $settings = json_decode(json_encode($settings), FALSE); - $widget = noahs_page_builder_render_element($settings, NULL); - $rendered_columns[] = $widget; + $settings = json_decode(json_encode($settings), FALSE); + $widget = noahs_page_builder_render_element($settings, NULL); + $rendered_columns[] = $widget; } return implode('', $rendered_columns); -} + } - /** * Regenerate widget. */ @@ -665,23 +712,23 @@ class NoahsController extends ControllerBase { * Manual get page classes. */ public function getPageClasses($data, $type) { - $classes = null; + $classes = NULL; $obj_class = new ControlsManager(); $page_settings = $data['page_settings']; $page_fields = $data['page_fields']; if (!empty($page_settings['element']['class'])) { $classes = $obj_class->getClasses($page_fields, $page_settings['element']['class'], $page_settings['wid']); - } return $classes; } + /** * Manual get page attributes. */ public function getPageAttributes($data, $type) { - $classes = null; + $classes = NULL; $obj_class = new ControlsManager(); $page_settings = $data['page_settings']; $page_fields = $data['page_fields']; @@ -722,10 +769,8 @@ class NoahsController extends ControllerBase { if (!empty($item['elements'])) { foreach ($item['elements'] as $element) { $classes = array_merge($classes, $this->extractClasses($element, $type)); - } } - } return $classes; diff --git a/src/Controller/NoahsEditWidgetController.php b/src/Controller/NoahsEditWidgetController.php index 1b1ae46..ac9768a 100644 --- a/src/Controller/NoahsEditWidgetController.php +++ b/src/Controller/NoahsEditWidgetController.php @@ -2,21 +2,52 @@ namespace Drupal\noahs_page_builder\Controller; +use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Controller\ControllerBase; use Drupal\noahs_page_builder\ModalForm; +use Drupal\noahs_page_builder\Service\WidgetServices; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Controller routines for domain finder routes. */ class NoahsEditWidgetController extends ControllerBase { + /** + * The constructor. + * + * @param \Drupal\Core\Config\ConfigFactoryInterface $configFactorty + * The config factory. + * @param \Drupal\noahs_page_builder\Service\WidgetServices $widgetService + * The widget service. + */ + public function __construct(protected ConfigFactoryInterface $configFactorty, protected WidgetServices $widgetService) {} + + /** + * Creates an instance of the controller using the service container. + * + * @param \Symfony\Component\DependencyInjection\ContainerInterface $container + * The service container. + * + * @return \Drupal\Core\Controller\ControllerBase + * An instance of the controller with dependencies injected. + */ + public static function create(ContainerInterface $container): ControllerBase { + return new static( + $container->get('config.factory'), + $container->get('noahs_page_builder.widget_service') + ); + } + /** * {@inheritdoc} */ public function edit($nid, $widget, $widget_id) { - $noahs_page_builder_config = \Drupal::config('noahs_page_builder.settings'); - $widgetService = \Drupal::service('noahs_page_builder.widget_service'); + $noahs_page_builder_config = $this->configFactorty->get('noahs_page_builder.settings'); + $widgetService = $this->widgetService; + $langcode = $this->languageManager()->getCurrentLanguage()->getId(); + $uid = $this->currentUser()->id(); $pallete_color = []; @@ -36,11 +67,12 @@ class NoahsEditWidgetController extends ControllerBase { $form = ModalForm::renderForm($fields, $settings); - $langcode = \Drupal::languageManager()->getCurrentLanguage()->getId(); + // $langcode = \Drupal::languageManager()->getCurrentLanguage()->getId(); $output = '<form class="form-widget" id="noahs_page_builder_edit_widget_form">'; $output .= '<input type="hidden" name="wid" value="' . $widget_id . '"/>'; $output .= '<input type="hidden" name="did" value="' . $nid . '"/>'; - $output .= '<input type="hidden" name="uid" value="' . \Drupal::currentUser()->id() . '"/>'; + // $output .= '<input type="hidden" name="uid" value="' . \Drupal::currentUser()->id() . '"/>'; + $output .= '<input type="hidden" name="uid" value="' . $uid . '"/>'; $output .= '<input type="hidden" name="type" value="' . $widget . '"/>'; $output .= '<input type="hidden" name="langcode" value="' . $langcode . '"/>'; $output .= '<div class="form-data-settings" data-settings="' . $escapedJsonData . '"></div>'; @@ -63,7 +95,6 @@ class NoahsEditWidgetController extends ControllerBase { ]; return $page; - } } diff --git a/src/Controller/NoahsFunctionsController.php b/src/Controller/NoahsFunctionsController.php index d5b5bd2..cc20c9a 100644 --- a/src/Controller/NoahsFunctionsController.php +++ b/src/Controller/NoahsFunctionsController.php @@ -5,26 +5,20 @@ namespace Drupal\noahs_page_builder\Controller; use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Routing\RouteMatchInterface; -use Drupal\Core\Url; -use Drupal\editor\Entity\Editor; -use Drupal\noahs_page_builder\ControlsManager; -use Drupal\noahs_page_builder\ModalForm; use Drupal\noahs_page_builder\Service\WidgetServices; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Request; use Drupal\Core\Database\Connection; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Extension\ModuleExtensionList; use Drupal\editor\Plugin\EditorManager; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Symfony\Component\HttpFoundation\Response; -use Drupal\file\Entity\File; use Drupal\image\Entity\ImageStyle; use Drupal\media\Entity\Media; - - +use Drupal\Core\File\FileUrlGeneratorInterface; +use Drupal\Core\Utility\Token; +use Drupal\Core\Routing\CurrentRouteMatch; /** * Provides route responses for Noah's functions. @@ -101,6 +95,27 @@ class NoahsFunctionsController extends ControllerBase { */ protected $entityTypeManager; + /** + * The file URL generator service. + * + * @var \Drupal\Core\File\FileUrlGeneratorInterface + */ + protected $fileUrlGenerator; + + /** + * The token service. + * + * @var \Drupal\Core\Utility\Token + */ + protected $token; + + /** + * The current route match service. + * + * @var \Drupal\Core\Routing\CurrentRouteMatch + */ + protected $currentRouteMatch; + /** * NoahsController constructor. * @@ -122,6 +137,12 @@ class NoahsFunctionsController extends ControllerBase { * The configuration factory. * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager service. + * @param \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator + * The file url generator service. + * @param \Drupal\Core\Utility\Token $token + * The token service. + * @param \Drupal\Core\Routing\CurrentRouteMatch $current_route_match + * The current route matchservice. */ public function __construct( WidgetServices $widget_service, @@ -132,7 +153,10 @@ class NoahsFunctionsController extends ControllerBase { ModuleExtensionList $extension_list, AccountInterface $current_user, ConfigFactoryInterface $config_factory, - EntityTypeManagerInterface $entity_type_manager + EntityTypeManagerInterface $entity_type_manager, // Moved before other services + FileUrlGeneratorInterface $file_url_generator, + Token $token, + CurrentRouteMatch $current_route_match, ) { $this->widgetService = $widget_service; $this->languageManager = $language_manager; @@ -143,6 +167,10 @@ class NoahsFunctionsController extends ControllerBase { $this->currentUser = $current_user; $this->configFactory = $config_factory; $this->config = $this->configFactory->get('noahs_page_builder.settings'); + $this->entityTypeManager = $entity_type_manager; + $this->fileUrlGenerator = $file_url_generator; + $this->token = $token; + $this->currentRouteMatch = $current_route_match; } /** @@ -163,7 +191,10 @@ class NoahsFunctionsController extends ControllerBase { $container->get('extension.list.module'), $container->get('current_user'), $container->get('config.factory'), - $container->get('entity_type.manager') + $container->get('entity_type.manager'), + $container->get('file_url_generator'), + $container->get('token'), + $container->get('current_route_match') ); } @@ -186,12 +217,12 @@ class NoahsFunctionsController extends ControllerBase { $background_image = ImageStyle::load($image_style)->buildUrl($file_uri); } else { - $background_image = \Drupal::service('file_url_generator')->generateString($file_uri); + $background_image = $this->fileUrlGenerator->generateString($file_uri); } } } } - } + } return new JsonResponse($background_image); } @@ -202,7 +233,7 @@ class NoahsFunctionsController extends ControllerBase { $rendered_token = NULL; - $tokenService = \Drupal::token(); + $tokenService = $this->token; if (!empty($token)) { $token_value = $token; @@ -210,9 +241,9 @@ class NoahsFunctionsController extends ControllerBase { if (!empty($token)) { - $route_match = \Drupal::routeMatch(); + $route_match = $this->currentRouteMatch; if (!empty($route_match->getParameter('entity')) && !empty($route_match->getParameter('nid'))) { - $node = \Drupal::entityTypeManager()->getStorage($route_match->getParameter('entity'))->load($route_match->getParameter('nid')); + $node = $this->entityTypeManager->getStorage($route_match->getParameter('entity'))->load($route_match->getParameter('nid')); $rendered_token = ''; if (!empty($node)) { $rendered_token = $tokenService->replace($token_value, [ diff --git a/src/Controller/NoahsIconsController.php b/src/Controller/NoahsIconsController.php index 7bce0f2..37fe52c 100644 --- a/src/Controller/NoahsIconsController.php +++ b/src/Controller/NoahsIconsController.php @@ -5,12 +5,48 @@ namespace Drupal\noahs_page_builder\Controller; use Drupal\Core\Controller\ControllerBase; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Request; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\File\FileUrlGeneratorInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Drupal\file\FileInterface; /** * {@inheritdoc} */ class NoahsIconsController extends ControllerBase { + /** + * The entity type manager. + * + * @var \Drupal\Core\Entity\EntityTypeManagerInterface + */ + protected $entityTypeManager; + + /** + * The file URL generator. + * + * @var \Drupal\Core\File\FileUrlGeneratorInterface + */ + protected $fileUrlGenerator; + + /** + * {@inheritdoc} + */ + public function __construct(EntityTypeManagerInterface $entity_type_manager, FileUrlGeneratorInterface $file_url_generator) { + $this->entityTypeManager = $entity_type_manager; + $this->fileUrlGenerator = $file_url_generator; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('entity_type.manager'), + $container->get('file_url_generator') + ); + } + /** * {@inheritdoc} */ @@ -57,7 +93,7 @@ class NoahsIconsController extends ControllerBase { private function htmlIconsScript() { $icons = $this->getIcons(); $firstIteration = TRUE; - $files = \Drupal::entityTypeManager()->getStorage('file') + $files = $this->entityTypeManager->getStorage('file') ->loadByProperties([ 'filemime' => [ 'image/svg+xml', @@ -107,9 +143,11 @@ class NoahsIconsController extends ControllerBase { $output .= '</div>'; $output .= '<div class="row mb-2 noahs-customs-svg">'; foreach ($files as $file) { - $file_uri = $file->getFileUri(); - $svg_local_url = \Drupal::service('file_url_generator')->generateAbsoluteString($file_uri); - $output .= '<div class="col-2 image-box mb-2" data-fileid="' . $file->id() . '" data-thumbnail="' . $svg_local_url . '"><span><img src="' . $svg_local_url . '" class="w-100" alt="Thumbnail"></span></div>'; + if ($file instanceof FileInterface) { + $file_uri = $file->getFileUri(); + $svg_local_url = $this->fileUrlGenerator->generateAbsoluteString($file_uri); + $output .= '<div class="col-2 image-box mb-2" data-fileid="' . $file->id() . '" data-thumbnail="' . $svg_local_url . '"><span><img src="' . $svg_local_url . '" class="w-100" alt="Thumbnail"></span></div>'; + } } $output .= '</div>'; $output .= '<div class="upload-image">'; diff --git a/src/Controller/NoahsModalMediaController.php b/src/Controller/NoahsModalMediaController.php index 30aef25..823c8a2 100644 --- a/src/Controller/NoahsModalMediaController.php +++ b/src/Controller/NoahsModalMediaController.php @@ -10,12 +10,57 @@ use Drupal\Core\File\FileSystemInterface; use Symfony\Component\HttpFoundation\Request; use Drupal\media\Entity\Media; use Drupal\views\Views; +use Drupal\Core\File\FileUrlGeneratorInterface; +use Drupal\Component\Datetime\TimeInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * {@inheritdoc} */ class NoahsModalMediaController extends ControllerBase { + /** + * The file system service. + * + * @var \Drupal\Core\File\FileSystemInterface + */ + protected $fileSystem; + + /** + * The file URL generator. + * + * @var \Drupal\Core\File\FileUrlGeneratorInterface + */ + protected $fileUrlGenerator; + + /** + * The time service. + * + * @var \Drupal\Component\Datetime\TimeInterface + */ + protected $time; + + public function __construct( + FileSystemInterface $file_system, + FileUrlGeneratorInterface $file_url_generator, + TimeInterface $time, + ) { + $this->fileSystem = $file_system; + $this->fileUrlGenerator = $file_url_generator; + $this->time = $time; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('file_system'), + $container->get('file_url_generator'), + $container->get('datetime.time') + ); + } + /** * {@inheritdoc} */ @@ -64,11 +109,11 @@ class NoahsModalMediaController extends ControllerBase { */ public function uploadMediaModal() { $files = $_FILES['files'] ?? NULL; - $current_date = \Drupal::time()->getCurrentTime(); + $current_date = $this->time->getCurrentTime(); $current_month = date('Y-m', $current_date); $directory = 'public://' . $current_month; - $file_system = \Drupal::service('file_system'); + $file_system = $this->fileSystem; $file_system->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS | FileSystemInterface::EXISTS_RENAME); $uploaded_files = []; @@ -100,7 +145,7 @@ class NoahsModalMediaController extends ControllerBase { // Generar las URLs para el archivo y la imagen. $image_style_url = ''; - $media_url = \Drupal::service('file_url_generator')->generateAbsoluteString($file->getFileUri()); + $media_url = $this->fileUrlGenerator->generateAbsoluteString($file->getFileUri()); // Si no es un SVG, construir la URL de estilo de imagen. if ($file->getMimeType() != "image/svg+xml") { @@ -130,8 +175,8 @@ class NoahsModalMediaController extends ControllerBase { */ public function uploadCkMediaModal(Request $request) { - $file_system = \Drupal::service('file_system'); - $file_url_generator = \Drupal::service('file_url_generator'); + $file_system = $this->fileSystem; + $file_url_generator = $this->fileUrlGenerator; $file = $request->files->get('upload'); if ($file) { diff --git a/src/Controller/NoahsModalTokensController.php b/src/Controller/NoahsModalTokensController.php index 580efac..dbbd358 100644 --- a/src/Controller/NoahsModalTokensController.php +++ b/src/Controller/NoahsModalTokensController.php @@ -3,22 +3,64 @@ namespace Drupal\noahs_page_builder\Controller; use Drupal\Core\Controller\ControllerBase; +use Drupal\token\TokenEntityMapperInterface; +use Drupal\token\TreeBuilderInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * {@inheritdoc} */ class NoahsModalTokensController extends ControllerBase { + /** + * The token entity mapper service. + * + * @var \Drupal\token\TokenEntityMapperInterface + */ + protected $tokenEntityMapper; + + /** + * The token tree builder service. + * + * @var \Drupal\token\TreeBuilderInterface + */ + protected $tokenTreeBuilder; + + /** + * Constructs a new NoahsModalTokensController. + * + * @param \Drupal\token\TokenEntityMapperInterface $token_entity_mapper + * The token entity mapper service. + * @param \Drupal\token\TreeBuilderInterface $token_tree_builder + * The token tree builder service. + */ + public function __construct( + TokenEntityMapperInterface $token_entity_mapper, + TreeBuilderInterface $token_tree_builder, + ) { + $this->tokenEntityMapper = $token_entity_mapper; + $this->tokenTreeBuilder = $token_tree_builder; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('token.entity_mapper'), + $container->get('token.tree_builder') + ); + } /** * {@inheritdoc} */ public function outputTree() { - $token_entity_mapping = \Drupal::service('token.entity_mapper'); + $token_entity_mapping = $this->tokenEntityMapper; // Obtener una lista de tokens disponibles. $all_tokens = $token_entity_mapping->getEntityTypeMappings(); - $tree = \Drupal::service('token.tree_builder')->buildAllRenderable(array_keys($all_tokens)); + $tree = $this->tokenTreeBuilder->buildAllRenderable(array_keys($all_tokens)); $build = $tree; $build['#cache']['contexts'][] = 'url.query_args:options'; $build['#title'] = $this->t('Available tokens'); diff --git a/src/Controller/NoahsSaveStylesController.php b/src/Controller/NoahsSaveStylesController.php index 6b35bd1..2c3621a 100644 --- a/src/Controller/NoahsSaveStylesController.php +++ b/src/Controller/NoahsSaveStylesController.php @@ -3,11 +3,6 @@ namespace Drupal\noahs_page_builder\Controller; use Drupal\Core\Controller\ControllerBase; -use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Request; -use Drupal\noahs_page_builder\ControlsManager; -use Drupal\Core\File\FileSystemInterface; -use Drupal\noahs_page_builder_pro\Controller\NoahsBuildThemeProController; use Drupal\noahs_page_builder\Service\ControlServices; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -48,6 +43,4 @@ class NoahsSaveStylesController extends ControllerBase { ); } - - } diff --git a/src/Controller/NoahsSettingsController.php b/src/Controller/NoahsSettingsController.php index 0e07391..f42728f 100644 --- a/src/Controller/NoahsSettingsController.php +++ b/src/Controller/NoahsSettingsController.php @@ -3,24 +3,18 @@ namespace Drupal\noahs_page_builder\Controller; use Drupal\Core\Controller\ControllerBase; -use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Url; -use Drupal\editor\Entity\Editor; -use Drupal\noahs_page_builder\ControlsManager; use Drupal\noahs_page_builder\ModalForm; -use Drupal\noahs_page_builder\Controller\NoahsSaveStylesController; use Drupal\noahs_page_builder\Service\WidgetServices; use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Request; use Drupal\Core\Database\Connection; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Extension\ModuleExtensionList; use Drupal\editor\Plugin\EditorManager; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Access\CsrfTokenGenerator; /** * Provides route responses for Noah's Builder. @@ -91,11 +85,11 @@ class NoahsSettingsController extends ControllerBase { protected $config; /** - * The entity type manager service. + * The CSRF token generator. * - * @var \Drupal\Core\Entity\EntityTypeManagerInterface + * @var \Drupal\Core\Access\CsrfTokenGenerator */ - protected $entityTypeManager; + protected $csrfToken; /** * NoahsController constructor. @@ -116,8 +110,8 @@ class NoahsSettingsController extends ControllerBase { * The current user service. * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The configuration factory. - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * The entity type manager service. + * @param \Drupal\Core\Access\CsrfTokenGenerator $csrf_token + * The csrf token service. */ public function __construct( WidgetServices $widget_service, @@ -128,7 +122,7 @@ class NoahsSettingsController extends ControllerBase { ModuleExtensionList $extension_list, AccountInterface $current_user, ConfigFactoryInterface $config_factory, - EntityTypeManagerInterface $entity_type_manager + CsrfTokenGenerator $csrf_token, ) { $this->widgetService = $widget_service; $this->languageManager = $language_manager; @@ -139,6 +133,7 @@ class NoahsSettingsController extends ControllerBase { $this->currentUser = $current_user; $this->configFactory = $config_factory; $this->config = $this->configFactory->get('noahs_page_builder.settings'); + $this->csrfToken = $csrf_token; } /** @@ -159,7 +154,7 @@ class NoahsSettingsController extends ControllerBase { $container->get('extension.list.module'), $container->get('current_user'), $container->get('config.factory'), - $container->get('entity_type.manager') + $container->get('csrf_token') ); } @@ -173,20 +168,20 @@ class NoahsSettingsController extends ControllerBase { 'noahs_settings' => $this->widgetService->getWidgetFields($widget) ]; - $data = noahs_page_builder_load('no_language', 'noahs_settings', 'noahs_settings'); $save_page_url = Url::fromRoute('noahs_page_builder.save_page', [], ['absolute' => TRUE])->toString(); $iframe_url = Url::fromRoute('noahs_page_builder.noahs_settings_iframe', [], ['absolute' => TRUE])->toString(); - + $page['#attached']['library'][] = 'noahs_page_builder/noahs_page_builder.assets.preview'; $page['#attached']['drupalSettings']['uid'] = $this->currentUser->id(); - $token = \Drupal::service('csrf_token')->get(''); + $token = $this->csrfToken->get(''); $page['#attached']['drupalSettings']['csrfToken'] = $token; - + if (empty($data->settings)) { $default_settings = '{"wid":"no_id","noahs_id":"noahs_settings","type":"noahs_settings","element":{"css":{"desktop":{"default":{"font_h1":{"font_size":"60px"},"font_h2":{"font_size":"50px"},"font_h3":{"font_size":"40px"},"font_h4":{"font_size":"30px"}}},"tablet":{"default":{"font_h1":{"font_size":"50px"},"font_h2":{"font_size":"40px"},"font_h3":{"font_size":"35px"},"font_h4":{"font_size":"25px"}}},"mobile":{"default":{"font_h1":{"font_size":"40px"},"font_h2":{"font_size":"35px"},"font_h3":{"font_size":"30px"},"font_h4":{"font_size":"22px"},"body":{"color":"#4a4a4a"}}}},"button_style":"default","attribute":{"parallax_when":"view"}}}'; $form_settings = json_decode($default_settings, TRUE); - }else{ + } + else { $form_settings = json_decode($data->settings, TRUE); } @@ -208,7 +203,7 @@ class NoahsSettingsController extends ControllerBase { foreach ($form as $item) { $output .= $item; } - $output .= '</div>'; + $output .= '</div>'; $output .= '<div class="w-100 d-flex justify-content-between noahs-settings-styles-actions">'; $output .= '<a class="btn btn-outline-dark btn-sm btn-admin me-4" href="/admin/structure/noahs" target="_blank">' . $this->t('Noahs page') . '</a>'; $output .= '<a class="btn btn-outline-dark btn-sm btn-admin me-auto" href="/" target="_blank">' . $this->t('Home page') . '</a>'; @@ -217,7 +212,7 @@ class NoahsSettingsController extends ControllerBase { $output .= '</form>'; $output .= '</div>'; $output .= '</div>'; - + $page['#attached']['drupalSettings']['noahs_items_fields'] = $fields; $page['#attached']['drupalSettings']['savePage'] = $save_page_url; $page['noahs-settings-form'] = [ @@ -238,7 +233,7 @@ class NoahsSettingsController extends ControllerBase { $fields = [ 'noahs_settings' => $this->widgetService->getWidgetFields($widget) ]; - + $default_settings = '{ "wid":"no_id", "type":"noahs_settings", @@ -250,22 +245,22 @@ class NoahsSettingsController extends ControllerBase { "noahs_id": null, "type": "noahs_settings" } - }'; + }'; $data = noahs_page_builder_load('no_language', 'noahs_settings', $widget); if (empty($data->settings)) { - $data = json_decode($default_settings); - }else{ + $data = json_decode($default_settings); + } + else { $data->wid = 'no_id'; $data->type = $widget; $data->settings = json_decode($data->settings); } - $widget_details = $this->widgetService->loadWidgetById($widget); $render_widget = $widget_details->renderContent($data); - + $page['#attached']['library'][] = 'noahs_page_builder/noahs_page_builder.assets.admin'; $page['#attached']['library'][] = 'noahs_page_builder/noahs_page_builder.assets.frontend'; $page['noahs-settings-iframe'] = [ @@ -276,5 +271,4 @@ class NoahsSettingsController extends ControllerBase { return $page; } - } diff --git a/src/Controller/NoahsThemesController.php b/src/Controller/NoahsThemesController.php index 2adfcca..54158e9 100644 --- a/src/Controller/NoahsThemesController.php +++ b/src/Controller/NoahsThemesController.php @@ -1,29 +1,62 @@ <?php -/** - * @file - * Contains \Drupal\noahs_page_builder\Controller\NoahsThemesController. - */ - namespace Drupal\noahs_page_builder\Controller; use Drupal\Core\Controller\ControllerBase; -use Symfony\Component\HttpFoundation\Response; use Drupal\Core\File\FileSystemInterface; -use Drupal\file\Entity\File; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\BinaryFileResponse; -use Symfony\Component\HttpFoundation\ResponseHeaderBag; +use Drupal\Core\Database\Connection; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * Provides Themes for Noah's Builder. + */ +class NoahsThemesController extends ControllerBase { + /** + * The database connection. + * + * @var \Drupal\Core\Database\Connection + */ + protected $database; + + /** + * The file system service. + * + * @var \Drupal\Core\File\FileSystemInterface + */ + protected $fileSystem; -class NoahsThemesController extends ControllerBase{ + /** + * Constructs a new NoahsThemesController. + * + * @param \Drupal\Core\Database\Connection $database + * The database service. + * @param \Drupal\Core\File\FileSystemInterface $file_system + * The file system service. + */ + public function __construct( + Connection $database, + FileSystemInterface $file_system, + ) { + $this->database = $database; + $this->fileSystem = $file_system; + } - + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('database'), + $container->get('file_system'), + ); + } /** - * {@inheritdoc} - */ + * {@inheritdoc} + */ public function getTheme(Request $request){ $data = json_decode($request->getContent(),); // $data['url'] = 'https://page-builder.ddev.site/modules/custom/noahs_page_builder/assets/noahs-themes/test_template.json'; @@ -36,19 +69,19 @@ class NoahsThemesController extends ControllerBase{ /** * {@inheritdoc} */ - public function modalThemes(){ + public function modalThemes() { return new JsonResponse(['html' => $this->listOfThemes()]); } /** * {@inheritdoc} */ - private function listOfThemes(){ + private function listOfThemes() { - $schema = \Drupal::database()->schema(); - $builder = null; + $schema = $this->database->schema(); + $builder = NULL; if ($schema->tableExists('noahs_page_builder_pro_theme')) { - $builder = \Drupal::database()->select('noahs_page_builder_pro_theme', 'mt') + $builder = $this->database->select('noahs_page_builder_pro_theme', 'mt') ->fields('mt', ['id', 'title']) ->execute() ->fetchAll(); @@ -60,24 +93,21 @@ class NoahsThemesController extends ControllerBase{ $module_path = NOAHS_PAGE_BUILDER_PATH; $themes_folder_path = $module_path . '/assets/noahs-themes/'; - $file_system = \Drupal::service('file_system'); + $files = $this->fileSystem->scanDirectory($themes_folder_path, '/\.json$/'); - $files = $file_system->scanDirectory($themes_folder_path, '/\.json$/'); - global $base_root; foreach ($files as $index => $file) { $json_string = file_get_contents($base_root . '/' . $file->uri); - $data = json_decode($json_string, true); + $data = json_decode($json_string, TRUE); $data['url'] = $base_root . '/' . $file->uri; $noahs_themes[] = $data; $noahs_themes_categories[$data['category']] = $data['category']; } - $output = '<div class="modal fade modal-type-themes" id="noahsSectionThemeModal" tabindex="-1">'; $output .= '<div class="modal-dialog modal-xl">'; $output .= '<div class="modal-content">'; - $output .= '<div class="modal-header"> + $output .= '<div class="modal-header"> <h5 class="modal-title">'.t('Themes').'</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div>'; @@ -120,7 +150,7 @@ class NoahsThemesController extends ControllerBase{ <h5 class="card-title">'.$item['title'].'</h5> </div> </div>'; - + $output .= '</div>'; } $output .= '</div>'; @@ -133,9 +163,10 @@ class NoahsThemesController extends ControllerBase{ $output .= '<div class="p-3 border d-flex justify-content-center noahs_paste_saved_theme" data-id="' . $item->id . '">' . $item->title . '</div>'; $output .= '</div>'; } - }else{ + } + else { $link = '<a href="https://noahs-creator.com" target="_blank">Noahs PRO</a>'; - $output .= '<div class="col-12"><h4>' . sprintf('You need to install %s to use this feature.', $link) . '</h4></div>'; + $output .= '<div class="col-12"><h4>' . sprintf('You need to install %s to use this feature.', $link) . '</h4></div>'; } $output .= '</div>'; diff --git a/src/Controller/NoahsTrackController.php b/src/Controller/NoahsTrackController.php index 4cc0aa5..9bf5f0a 100644 --- a/src/Controller/NoahsTrackController.php +++ b/src/Controller/NoahsTrackController.php @@ -5,12 +5,30 @@ namespace Drupal\noahs_page_builder\Controller; use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Database\Database; use Symfony\Component\HttpFoundation\RequestStack; +use Drupal\Core\Messenger\MessengerInterface; +use Drupal\Core\Session\AccountProxyInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Track user. */ class NoahsTrackController extends ControllerBase { + /** + * The current user service. + * + * @var \Drupal\Core\Session\AccountProxyInterface + */ + protected $currentUser; + + /** + * The messenger service. + * + * @var \Drupal\Core\Messenger\MessengerInterface + */ + protected $messenger; + + /** * RequestStack. * @@ -18,22 +36,32 @@ class NoahsTrackController extends ControllerBase { */ protected $requestStack; - public function __construct(RequestStack $request_stack) { + public function __construct( + RequestStack $request_stack, + AccountProxyInterface $current_user, + MessengerInterface $messenger, + ) { $this->requestStack = $request_stack; + $this->currentUser = $current_user; + $this->messenger = $messenger; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { - return new static($container->get('request_stack')); + return new static( + $container->get('request_stack'), + $container->get('current_user'), + $container->get('messenger') + ); } /** * {@inheritdoc} */ public function trackUser($eid) { - $current_user = \Drupal::currentUser(); + $current_user = $this->currentUser; $connection = Database::getConnection(); $query = $connection->select('noahs_user_track', 'n') @@ -44,7 +72,7 @@ class NoahsTrackController extends ControllerBase { if (!empty($query)) { if (!in_array($current_user->id(), array_column($query, 'uid'))) { - \Drupal::messenger()->addWarning('Otro usuario está editando este contenido.'); + $this->messenger->addWarning('Otro usuario está editando este contenido.'); } } else { diff --git a/src/Form/NoahsRenegerateStylesForm.php b/src/Form/NoahsRenegerateStylesForm.php index f818f41..bc0a8e7 100644 --- a/src/Form/NoahsRenegerateStylesForm.php +++ b/src/Form/NoahsRenegerateStylesForm.php @@ -5,12 +5,58 @@ namespace Drupal\noahs_page_builder\Form; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\noahs_page_builder\Controller\NoahsSaveStylesController; +use Drupal\Core\Database\Connection; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\DependencyInjection\ClassResolverInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Defines a form that configures noahs_page_builder settings. */ class NoahsRenegerateStylesForm extends ConfigFormBase { + /** + * @var \Drupal\Core\Database\Connection + */ + protected $database; + + /** + * @var \Drupal\Core\Entity\EntityTypeManagerInterface + */ + protected $entityTypeManager; + + /** + * @var \Drupal\Core\DependencyInjection\ClassResolverInterface + */ + protected $classResolver; + + /** + * Constructs a new NoahsRenegerateStylesForm. + * + * @param \Drupal\Core\Database\Connection $database + * The database connection. + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager + * The entity type manager. + * @param \Drupal\Core\DependencyInjection\ClassResolverInterface $class_resolver + * The class resolver. + */ + public function __construct(Connection $database, EntityTypeManagerInterface $entity_type_manager, ClassResolverInterface $class_resolver) { + $this->database = $database; + $this->entityTypeManager = $entity_type_manager; + $this->classResolver = $class_resolver; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('database'), + $container->get('entity_type.manager'), + $container->get('class_resolver') + ); + } + /** * {@inheritdoc} */ @@ -36,7 +82,7 @@ class NoahsRenegerateStylesForm extends ConfigFormBase { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { - $elements = \Drupal::database()->select('noahs_page_builder_page', 'd') + $elements = $this->database->select('noahs_page_builder_page', 'd') ->fields('d', ['entity_id', 'entity_type']) ->execute() ->fetchAll(); @@ -46,8 +92,8 @@ class NoahsRenegerateStylesForm extends ConfigFormBase { if (strpos($element->entity_id, 'product_') !== FALSE) { $entity_id = str_replace('product_', '', $element->entity_id); - $entity = \Drupal::entityTypeManager()->getStorage('commerce_product')->load($entity_id); - \Drupal::database()->update("noahs_page_builder_page") + $entity = $this->entityTypeManager->getStorage('commerce_product')->load($entity_id); + $this->database->update("noahs_page_builder_page") ->fields([ 'noahs_id' => $entity->id(), 'entity_type' => $entity->getEntityTypeId(), @@ -58,8 +104,8 @@ class NoahsRenegerateStylesForm extends ConfigFormBase { } else { - $entity = \Drupal::entityTypeManager()->getStorage('node')->load($element->entity_id); - \Drupal::database()->update("noahs_page_builder_page") + $entity = $this->entityTypeManager->getStorage('node')->load($element->entity_id); + $this->database->update("noahs_page_builder_page") ->fields([ 'noahs_id' => $entity->id(), 'entity_type' => $entity->getEntityTypeId(), @@ -71,23 +117,24 @@ class NoahsRenegerateStylesForm extends ConfigFormBase { } } - $new_elements = \Drupal::database()->select('noahs_page_builder_page', 'd') + $new_elements = $this->database->select('noahs_page_builder_page', 'd') ->fields('d', ['entity_id', 'entity_type']) ->execute() ->fetchAll(); foreach ($new_elements as $element) { - \Drupal::classResolver(NoahsSaveStylesController::class)->save($element->entity_type, $element->entity_id); + $this->classResolver->getInstanceFromDefinition(NoahsSaveStylesController::class) + ->save($element->entity_type, $element->entity_id); } - $pro_elements = \Drupal::database()->select('noahs_page_builder_pro_themes', 'd') + $pro_elements = $this->database->select('noahs_page_builder_pro_themes', 'd') ->fields('d') ->execute() ->fetchAll(); foreach ($pro_elements as $element) { - - \Drupal::classResolver(NoahsSaveStylesController::class)->save('pro_theme', $element->type); + $this->classResolver->getInstanceFromDefinition(NoahsSaveStylesController::class) + ->save('pro_theme', $element->type); } } diff --git a/src/Plugin/Control/ControlBase.php b/src/Plugin/Control/ControlBase.php index 50cdcdd..56b04e9 100644 --- a/src/Plugin/Control/ControlBase.php +++ b/src/Plugin/Control/ControlBase.php @@ -3,18 +3,44 @@ namespace Drupal\noahs_page_builder\Plugin\Control; use Drupal\Component\Plugin\PluginBase; +use Drupal\noahs_page_builder\Service\WidgetServices; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Clase base para los plugins de Control. */ abstract class ControlBase extends PluginBase implements ControlInterface { + /** + * The widget service. + * + * @var \Drupal\noahs_page_builder\Service\WidgetServices + */ + protected $widgetServices; + + /** + * Constructs the control plugin. + * + * @param \Drupal\noahs_page_builder\Service\WidgetServices $widget_services + * The widget service. + */ + public function __construct(WidgetServices $widget_services) { + $this->widgetServices = $widget_services; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('noahs_page_builder.widget_service') + ); + } /** * {@inheritdoc} */ public function getImageStyles() { - $widgetServices = \Drupal::service('noahs_page_builder.widget_service'); - return $widgetServices->getImageStyle(); + return $this->widgetServices->getImageStyle(); } } diff --git a/src/Plugin/Control/ControlNoahsUrl.php b/src/Plugin/Control/ControlNoahsUrl.php index 10c6364..80ef6a3 100644 --- a/src/Plugin/Control/ControlNoahsUrl.php +++ b/src/Plugin/Control/ControlNoahsUrl.php @@ -2,7 +2,12 @@ namespace Drupal\noahs_page_builder\Plugin\Control; +use Drupal\path_alias\AliasManagerInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + /** + * Provides a URL control plugin for Noah's Page Builder. + * * @ControlPlugin( * id = "noahs_url", * label = @Translation("Url") @@ -10,6 +15,29 @@ namespace Drupal\noahs_page_builder\Plugin\Control; */ class ControlNoahsUrl extends ControlBase { + /** + * The path alias manager service. + * + * @var \Drupal\path_alias\AliasManagerInterface + */ + protected $pathAliasManager; + + /** + * Constructs a new ControlNoahsUrl object. + */ + public function __construct(AliasManagerInterface $path_alias_manager) { + $this->pathAliasManager = $path_alias_manager; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('path_alias.manager') + ); + } + /** * {@inheritdoc} */ @@ -54,7 +82,7 @@ class ControlNoahsUrl extends ControlBase { $url = ''; $text = !empty($value['text']) ? $value['text'] : ''; if (!empty($value['node_id'])) { - $url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $value['node_id']); + $url = $this->pathAliasManager->getAliasByPath('/node/' . $value['node_id']); } elseif (filter_var($value, FILTER_VALIDATE_URL)) { $url = $value['text']; -- GitLab From a6e61bea1e01c80b62d3b23df404ad9ef61b408d Mon Sep 17 00:00:00 2001 From: Shahzaib <shahzaib15@gmail.com> Date: Thu, 26 Jun 2025 18:22:49 +0000 Subject: [PATCH 3/7] WEBZONE-05:Refine the Noah module code use the dependency injection. --- .../NoahsUrlAutocompleteController.php | 44 ++++++++++++++++--- src/Form/NoahsSettingsForm.php | 32 +++++++------- .../Control/ControlNoahsVideoUpload.php | 24 +++++++++- 3 files changed, 78 insertions(+), 22 deletions(-) diff --git a/src/Controller/NoahsUrlAutocompleteController.php b/src/Controller/NoahsUrlAutocompleteController.php index 72b79ab..60cd66b 100644 --- a/src/Controller/NoahsUrlAutocompleteController.php +++ b/src/Controller/NoahsUrlAutocompleteController.php @@ -7,11 +7,40 @@ use Drupal\Core\Controller\ControllerBase; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Drupal\Component\Utility\Xss; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * {@inheritdoc} */ -class NoahsUrlAutocompleteController extends ControllerBase { +class NoahsUrlAutocompleteController extends ControllerBase +{ + + /** + * The entity type manager service. + * + * @var \Drupal\Core\Entity\EntityTypeManagerInterface + */ + protected $entityTypeManager; + + /** + * Constructs a new controller object. + * + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager + * The entity type manager. + */ + public function __construct(EntityTypeManagerInterface $entity_type_manager) { + $this->entityTypeManager = $entity_type_manager; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container): self { + return new static( + $container->get('entity_type.manager') + ); + } /** * {@inheritdoc} @@ -19,18 +48,23 @@ class NoahsUrlAutocompleteController extends ControllerBase { public function autocomplete(Request $request) { $results = []; $input = $request->query->get('q'); + if (!$input) { return new JsonResponse($results); } + $input = Xss::filter($input); - $query = \Drupal::entityQuery('node') + + $query = $this->entityTypeManager->getStorage('node') + ->getQuery() ->condition('title', $input, 'CONTAINS') - ->groupBy('nid') ->sort('created', 'DESC') ->range(0, 10) - ->accessCheck(FALSE); + ->accessCheck(TRUE); + $ids = $query->execute(); - $nodes = $ids ? Node::loadMultiple($ids) : []; + $nodes = Node::loadMultiple($ids); + foreach ($nodes as $node) { $results[] = [ 'id' => $node->id(), diff --git a/src/Form/NoahsSettingsForm.php b/src/Form/NoahsSettingsForm.php index d2b474c..74618d9 100644 --- a/src/Form/NoahsSettingsForm.php +++ b/src/Form/NoahsSettingsForm.php @@ -117,7 +117,7 @@ class NoahsSettingsForm extends ConfigFormBase { foreach ($editors as $k => $editor_type) { $editors_options[$k] = $k; } - + $form['custom_link'] = [ '#type' => 'markup', '#markup' => $this->t('<a href=":url" class="button button--primary">Start creating general styles</a>', [ @@ -165,7 +165,7 @@ class NoahsSettingsForm extends ConfigFormBase { '#options' => $vbo_options, '#default_value' => $settings->get('use_in_vtype') ?? [], ]; - + $form['general']['use_in_products'] = [ '#type' => 'checkboxes', '#title' => $this->t('Use in Products type'), @@ -246,19 +246,19 @@ class NoahsSettingsForm extends ConfigFormBase { /* ========================= Colors ========================= */ - + $form['colors'] = [ '#type' => 'details', '#title' => $this->t('Default Colors'), '#group' => 'tabs', ]; - + $form['colors']['palette'] = [ '#type' => 'fieldset', '#title' => $this->t('Colors'), '#group' => 'colors', ]; - + $form['colors']['palette']['principal_color'] = [ '#type' => 'textfield', '#title' => 'Principal Color', @@ -266,7 +266,7 @@ class NoahsSettingsForm extends ConfigFormBase { '#description' => $this->t("Set Principal color"), '#attributes' => ['class' => ['form-control-color']], ]; - + $form['colors']['palette']['secondary_color'] = [ '#type' => 'textfield', '#title' => 'Secondary Color', @@ -274,7 +274,7 @@ class NoahsSettingsForm extends ConfigFormBase { '#description' => $this->t("Set Secondary color"), '#attributes' => ['class' => ['form-control-color']], ]; - + // Contenedor para los colores dinámicos. $form['colors']['custom_color'] = [ '#type' => 'fieldset', @@ -283,7 +283,7 @@ class NoahsSettingsForm extends ConfigFormBase { '#suffix' => '</div>', '#tree' => TRUE, ]; - + // Obtener colores desde el estado del formulario o configuración. @@ -300,14 +300,14 @@ class NoahsSettingsForm extends ConfigFormBase { '#type' => 'fieldset', '#attributes' => ['class' => ['noahs-custom-colors']], ]; - + $form['colors']['custom_color'][$key]['name'] = [ '#type' => 'textfield', '#title' => $this->t('Color Name'), '#default_value' => $color['name'] ?? '', '#required' => TRUE, ]; - + $form['colors']['custom_color'][$key]['hex'] = [ '#type' => 'textfield', '#title' => $this->t('Color'), @@ -315,7 +315,7 @@ class NoahsSettingsForm extends ConfigFormBase { '#required' => TRUE, '#attributes' => ['class' => ['form-control-color']], ]; - + $form['colors']['custom_color'][$key]['remove'] = [ '#type' => 'submit', '#value' => $this->t('Remove'), @@ -328,7 +328,7 @@ class NoahsSettingsForm extends ConfigFormBase { ], ]; } - + // Botón para agregar más colores $form['colors']['custom_color']['add_color'] = [ '#type' => 'submit', @@ -361,7 +361,7 @@ class NoahsSettingsForm extends ConfigFormBase { ]; return parent::buildForm($form, $form_state); } - + /** * Callback para añadir un nuevo color. */ @@ -385,7 +385,7 @@ class NoahsSettingsForm extends ConfigFormBase { public function removeColorCallback(array &$form, FormStateInterface $form_state) { // Obtener el botón que fue presionado. $triggering_element = $form_state->getTriggeringElement(); - + // Extraer el índice del color a eliminar. if (preg_match('/remove_(\d+)/', $triggering_element['#name'], $matches)) { $index = (int) $matches[1]; @@ -401,7 +401,7 @@ class NoahsSettingsForm extends ConfigFormBase { // Guardar la lista actualizada de colores en el estado del formulario. $form_state->set('custom_color', $colors); - + // Marcar el formulario para ser reconstruido. $form_state->setRebuild(TRUE); } @@ -464,7 +464,7 @@ class NoahsSettingsForm extends ConfigFormBase { $styles .= 'font-family:"' . $form_state->getValue('heading_font') . '";' ?? $form_state->getValue('general_font') . '";'; } - $styles .= '}'; + $styles .= '}'; $styles .= $form_state->getValue('noahs_page_builder_custom_css'); diff --git a/src/Plugin/Control/ControlNoahsVideoUpload.php b/src/Plugin/Control/ControlNoahsVideoUpload.php index 2762e57..0353374 100644 --- a/src/Plugin/Control/ControlNoahsVideoUpload.php +++ b/src/Plugin/Control/ControlNoahsVideoUpload.php @@ -4,6 +4,8 @@ namespace Drupal\noahs_page_builder\Plugin\Control; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\file\Entity\File; +use Drupal\Core\File\FileUrlGeneratorInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * @ControlPlugin( @@ -15,6 +17,26 @@ class ControlNoahsVideoUpload extends ControlBase { use StringTranslationTrait; + /** + * The file URL generator service. + * + * @var \Drupal\Core\File\FileUrlGeneratorInterface + */ + protected $fileUrlGenerator; + + public function __construct(FileUrlGeneratorInterface $file_url_generator) { + $this->fileUrlGenerator = $file_url_generator; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('file_url_generator') + ); + } + /** * {@inheritdoc} */ @@ -36,7 +58,7 @@ class ControlNoahsVideoUpload extends ControlBase { $video_file = File::load($value['fid']); $video_file_uri = $video_file->getFileUri(); $file_name = $video_file->filemime->value; - $video_local_url = \Drupal::service('file_url_generator')->generateAbsoluteString($video_file_uri); + $video_local_url = $this->fileUrlGenerator->generateAbsoluteString($video_file_uri); } $output = ''; -- GitLab From 5a8d81b92f41779c12ff4fc55192c582a26b43ad Mon Sep 17 00:00:00 2001 From: Shahzaib <shahzaib15@gmail.com> Date: Fri, 27 Jun 2025 18:31:41 +0000 Subject: [PATCH 4/7] WEBZONE:Latest files to refine the Noah module code. --- noahs_page_builder.services.yml | 4 +- src/ControlsManager.php | 4 +- src/Plugin/Control/ControlBase.php | 17 ++- src/Plugin/Control/ControlNoahsDivider.php | 46 +++++- src/Plugin/Control/ControlNoahsUrl.php | 24 ++- src/Plugin/Widget/WidgetBase.php | 166 +++++++++++++++++---- src/Plugin/Widget/WidgetNoahsBars.php | 4 +- src/Service/ControlServices.php | 52 +++++-- src/Service/WidgetServices.php | 2 - 9 files changed, 253 insertions(+), 66 deletions(-) diff --git a/noahs_page_builder.services.yml b/noahs_page_builder.services.yml index cdf45d6..1858174 100644 --- a/noahs_page_builder.services.yml +++ b/noahs_page_builder.services.yml @@ -10,7 +10,7 @@ services: parent: default_plugin_manager noahs_page_builder.control_service: class: Drupal\noahs_page_builder\Service\ControlServices - arguments: ['@plugin.manager.control'] + arguments: ['@plugin.manager.control', '@module_handler'] controller.noahs_save_styles: class: Drupal\noahs_page_builder\Controller\NoahsSaveStylesController - arguments: ['@noahs_page_builder.control_service'] \ No newline at end of file + arguments: ['@noahs_page_builder.control_service'] diff --git a/src/ControlsManager.php b/src/ControlsManager.php index a987e44..d4b6dec 100644 --- a/src/ControlsManager.php +++ b/src/ControlsManager.php @@ -141,14 +141,14 @@ class ControlsManager { $class['#widget-id-' . $wid][] = $element; } else if (!empty($items[$item_id]['style_selector'])) { - + if ($wid === 'no_id') { $class[$items[$item_id]['style_selector']][] = $element; }else{ $class['#widget-id-' . $wid . ' ' . $items[$item_id]['style_selector']][] = $element; } } - + } } diff --git a/src/Plugin/Control/ControlBase.php b/src/Plugin/Control/ControlBase.php index 56b04e9..66d15e7 100644 --- a/src/Plugin/Control/ControlBase.php +++ b/src/Plugin/Control/ControlBase.php @@ -5,11 +5,12 @@ namespace Drupal\noahs_page_builder\Plugin\Control; use Drupal\Component\Plugin\PluginBase; use Drupal\noahs_page_builder\Service\WidgetServices; use Symfony\Component\DependencyInjection\ContainerInterface; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; /** * Clase base para los plugins de Control. */ -abstract class ControlBase extends PluginBase implements ControlInterface { +abstract class ControlBase extends PluginBase implements ControlInterface, ContainerFactoryPluginInterface { /** * The widget service. * @@ -20,18 +21,28 @@ abstract class ControlBase extends PluginBase implements ControlInterface { /** * Constructs the control plugin. * + * @param array $configuration + * Plugin configuration. + * @param string $plugin_id + * Plugin ID. + * @param mixed $plugin_definition + * Plugin definition. * @param \Drupal\noahs_page_builder\Service\WidgetServices $widget_services * The widget service. */ - public function __construct(WidgetServices $widget_services) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, WidgetServices $widget_services) { + parent::__construct($configuration, $plugin_id, $plugin_definition); $this->widgetServices = $widget_services; } /** * {@inheritdoc} */ - public static function create(ContainerInterface $container) { + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static( + $configuration, + $plugin_id, + $plugin_definition, $container->get('noahs_page_builder.widget_service') ); } diff --git a/src/Plugin/Control/ControlNoahsDivider.php b/src/Plugin/Control/ControlNoahsDivider.php index 31b90a6..c596474 100644 --- a/src/Plugin/Control/ControlNoahsDivider.php +++ b/src/Plugin/Control/ControlNoahsDivider.php @@ -3,7 +3,10 @@ namespace Drupal\noahs_page_builder\Plugin\Control; use Drupal\Core\StringTranslation\StringTranslationTrait; - +use Drupal\Core\File\FileSystemInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\noahs_page_builder\Service\WidgetServices; /** * @ControlPlugin( @@ -11,9 +14,39 @@ use Drupal\Core\StringTranslation\StringTranslationTrait; * label = @Translation("Divider") * ) */ -class ControlNoahsDivider extends ControlBase { +class ControlNoahsDivider extends ControlBase implements ContainerFactoryPluginInterface { use StringTranslationTrait; + /** + * The file system service. + * + * @var \Drupal\Core\File\FileSystemInterface + */ + protected $fileSystem; + + /** + * Constructs a new ControlNoahsDivider object. + * + * @param \Drupal\Core\File\FileSystemInterface $file_system + * The file system service. + */ + public function __construct(array $configuration, $plugin_id, $plugin_definition, WidgetServices $widget_services, FileSystemInterface $file_system) { + parent::__construct($configuration, $plugin_id, $plugin_definition, $widget_services); + $this->fileSystem = $file_system; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static( + $configuration, + $plugin_id, + $plugin_definition, + $container->get('noahs_page_builder.widget_service'), + $container->get('file_system') + ); + } /** * {@inheritdoc} @@ -47,7 +80,7 @@ class ControlNoahsDivider extends ControlBase { $value['top'] = $value['top'] ?? []; $value['bottom'] = $value['bottom'] ?? []; - $items = self::list($name); + $items = $this->list($name); $optionsAlign = [ 'center' => $this->t('Center'), @@ -158,12 +191,11 @@ class ControlNoahsDivider extends ControlBase { /** * {@inheritdoc} */ - private static function list($name = NULL) { + private function list($name = NULL) + { $module_path = NOAHS_PAGE_BUILDER_PATH; $icon_folder_path = $module_path . '/assets/svg-divider-kit/'; - $file_system = \Drupal::service('file_system'); - - $files = $file_system->scanDirectory($icon_folder_path, '/\.svg$/'); + $files = $this->fileSystem->scanDirectory($icon_folder_path, '/\.svg$/'); $svg_data = []; diff --git a/src/Plugin/Control/ControlNoahsUrl.php b/src/Plugin/Control/ControlNoahsUrl.php index 80ef6a3..838e0aa 100644 --- a/src/Plugin/Control/ControlNoahsUrl.php +++ b/src/Plugin/Control/ControlNoahsUrl.php @@ -4,6 +4,8 @@ namespace Drupal\noahs_page_builder\Plugin\Control; use Drupal\path_alias\AliasManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +use Drupal\noahs_page_builder\Service\WidgetServices; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; /** * Provides a URL control plugin for Noah's Page Builder. @@ -13,7 +15,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * label = @Translation("Url") * ) */ -class ControlNoahsUrl extends ControlBase { +class ControlNoahsUrl extends ControlBase implements ContainerFactoryPluginInterface { /** * The path alias manager service. @@ -25,15 +27,31 @@ class ControlNoahsUrl extends ControlBase { /** * Constructs a new ControlNoahsUrl object. */ - public function __construct(AliasManagerInterface $path_alias_manager) { + public function __construct( + array $configuration, + $plugin_id, + $plugin_definition, + WidgetServices $widget_services, + AliasManagerInterface $path_alias_manager, + ) { + parent::__construct($configuration, $plugin_id, $plugin_definition, $widget_services); $this->pathAliasManager = $path_alias_manager; } /** * {@inheritdoc} */ - public static function create(ContainerInterface $container) { + public static function create( + ContainerInterface $container, + array $configuration, + $plugin_id, + $plugin_definition, + ) { return new static( + $configuration, + $plugin_id, + $plugin_definition, + $container->get('noahs_page_builder.widget_service'), $container->get('path_alias.manager') ); } diff --git a/src/Plugin/Widget/WidgetBase.php b/src/Plugin/Widget/WidgetBase.php index 8f81b83..0086a04 100644 --- a/src/Plugin/Widget/WidgetBase.php +++ b/src/Plugin/Widget/WidgetBase.php @@ -2,27 +2,132 @@ namespace Drupal\noahs_page_builder\Plugin\Widget; -use Drupal\noahs_page_builder\Controller\NoahsSaveStylesController; use Drupal\Component\Plugin\PluginBase; use Drupal\Core\Url; +use Twig\Environment; +use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Render\RendererInterface; +use Drupal\Core\Session\AccountProxyInterface; +use Drupal\Core\Routing\RouteMatchInterface; +use Drupal\Core\File\FileUrlGeneratorInterface; +use Drupal\noahs_page_builder\Service\WidgetServices; +use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; /** * Clase base para los plugins de Widget. */ -abstract class WidgetBase extends PluginBase implements WidgetInterface { +abstract class WidgetBase extends PluginBase implements WidgetInterface, ContainerFactoryPluginInterface { + /** + * The Twig service for rendering templates. + * + * @var \Twig\Environment + */ + protected $twig; + + /** + * The widget service for accessing widget-related logic. + * + * @var \Drupal\noahs_page_builder\Service\WidgetServices + */ + protected $widgetService; + + /** + * The renderer service for rendering render arrays. + * + * @var \Drupal\Core\Render\RendererInterface + */ + protected $renderer; + + /** + * The current user. + * + * @var \Drupal\Core\Session\AccountProxyInterface + */ + protected $currentUser; + + /** + * The config factory service. + * + * @var \Drupal\Core\Config\ConfigFactoryInterface + */ + protected $configFactory; + + /** + * The entity type manager service. + * + * @var \Drupal\Core\Entity\EntityTypeManagerInterface + */ + protected $entityTypeManager; + + /** + * The file URL generator service. + * + * @var \Drupal\Core\File\FileUrlGeneratorInterface + */ + protected $fileUrlGenerator; + + /** + * The route match service for getting the current route information. + * + * @var \Drupal\Core\Routing\RouteMatchInterface + */ + protected $routeMatch; + + /** + * The request stack service. + * + * @var \Symfony\Component\HttpFoundation\RequestStack + */ + protected $requestStack; + + public function __construct(array $configuration, $plugin_id, $plugin_definition, Environment $twig, WidgetServices $widget_service, RendererInterface $renderer, AccountProxyInterface $current_user, ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, FileUrlGeneratorInterface $file_url_generator, RouteMatchInterface $route_match, RequestStack $request_stack) { + parent::__construct($configuration, $plugin_id, $plugin_definition); + $this->twig = $twig; + $this->widgetService = $widget_service; + $this->renderer = $renderer; + $this->currentUser = $current_user; + $this->configFactory = $config_factory; + $this->entityTypeManager = $entity_type_manager; + $this->fileUrlGenerator = $file_url_generator; + $this->routeMatch = $route_match; + $this->requestStack = $request_stack; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static( + $configuration, + $plugin_id, + $plugin_definition, + $container->get('twig'), + $container->get('noahs_page_builder.widget_service'), + $container->get('renderer'), + $container->get('current_user'), + $container->get('config.factory'), + $container->get('entity_type.manager'), + $container->get('file_url_generator'), + $container->get('current_route_match'), + $container->get('request_stack') + ); + } /** * {@inheritdoc} */ public function twig() { - return \Drupal::service('twig'); + return $this->twig; } /** * {@inheritdoc} */ public function getImageStyles() { - $widgetServices = \Drupal::service('noahs_page_builder.widget_service'); + $widgetServices = $this->widgetService; return $widgetServices->getImageStyle(); } @@ -31,8 +136,8 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface { */ public function wrapper($data, $content) { - $widgetService = \Drupal::service('noahs_page_builder.widget_service'); - $config = \Drupal::config('noahs_page_builder.settings'); + $widgetService = $this->widgetService; + $config = $this->configFactory->get('noahs_page_builder.settings'); $divider_declaration = ''; @@ -69,7 +174,7 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface { $global_class = !empty($data->settings->global) ? 'widget-global' : ''; $tabs = "<ul class='noahs_page_builder-widget-action-tabs tab-{$data->type} $global_class'>"; $id = !empty($data->wid) ? $data->wid : uniqid(); - $uid = \Drupal::currentUser()->id(); + $uid = $this->currentUser->id(); $fields = $widgetService->getWidgetFields($data->type); $widgetData = $widgetService->getWidgetData($data->type); @@ -146,7 +251,7 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface { $widget_class = ''; $subclass = implode(' ', $subclass); - $route = \Drupal::routeMatch()->getRouteName(); + $route = $this->routeMatch->getRouteName(); // Default object when add new widget. if (empty($data->settings->wid)) { @@ -189,7 +294,7 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface { else { $tabs = ''; $cookie = NULL; - $current_request = \Drupal::request(); + $current_request = $this->requestStack->getCurrentRequest(); if (!empty($data->settings->element->cookie_control->text)) { $cookie = $data->settings->element->cookie_control->text; @@ -203,7 +308,7 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface { $param = $data->settings->element->param_controls->text; $expected_value = $data->settings->element->param_controls_value->text; $query_param_value = $current_request->query->get($param); - + if ($query_param_value != $expected_value) { return; } @@ -211,7 +316,7 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface { if (!empty($data->settings->element->param_controls_default)){ if ($current_request->query->has($data->settings->element->param_controls_default->text)){ - + return; } } @@ -231,14 +336,14 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface { $class = implode(' ', $class); return ' - <' . $element . ' - class="' . $class . '" - data-widget-type="' . $widget_default . '" - id="widget-id-' . $id . '" - data-widget-id="' . $id . '" - data-widget-selector="' . 'widget-' . str_replace('_', '-', $data->type) . '" + <' . $element . ' + class="' . $class . '" + data-widget-type="' . $widget_default . '" + id="widget-id-' . $id . '" + data-widget-id="' . $id . '" + data-widget-selector="' . 'widget-' . str_replace('_', '-', $data->type) . '" ' . ($column_size ? 'data-column-size="' . $column_size . '"' : '') . ' - data-type="' . $data->type . '" + data-type="' . $data->type . '" ' . $data_setting . ' ' . $data_global . ' > @@ -256,17 +361,16 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface { * */ public function getMediaImage($mid, $style = NULL) { $style = $style ?? 'original'; - $site_name = \Drupal::config('system.site')->get('name'); + $site_name = $this->configFactory->get('system.site')->get('name'); $image = '/' . NOAHS_PAGE_BUILDER_PATH . '/assets/img/widget-image.jpg'; $alt = NULL; $title = NULL; $html = ''; - $current_user = \Drupal::currentUser(); + $current_user = $this->currentUser; $has_permission = $current_user->hasPermission('administer noahs_page_builder'); if ($mid) { - $media = \Drupal::entityTypeManager()->getStorage('media')->load($mid); - + $media = $this->entityTypeManager->getStorage('media')->load($mid); if ($media && $media->bundle() === 'image') { $media_field_name = 'field_media_image'; @@ -277,8 +381,8 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface { $file_uri = $file->getFileUri(); $image = ($style === 'original') - ? \Drupal::service('file_url_generator')->generateString($file_uri) - : \Drupal::entityTypeManager()->getStorage('image_style')->load($style)->buildUrl($file_uri); + ? $this->fileUrlGenerator->generateString($file_uri) + : $this->entityTypeManager->getStorage('image_style')->load($style); $alt = $media->get($media_field_name)->alt ?? $site_name; $title = $media->get($media_field_name)->title ?? $site_name; @@ -302,18 +406,20 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface { $render['#prefix'] = t('<a href="@link" class="noahs-contextual--link" title="' . t('Edit edia') . '" target="_blank"><i class="fas fa-edit"></i></a>', ['@link' => $url->toString()]); } - $html .= \Drupal::service('renderer')->render($render); - + $html .= $this->renderer->render($render); return $html; } - public function getEntityUrl($data){ + /** + * {@inheritdoc} + */ + public function getEntityUrl($data) { - $url = null; + $url = NULL; $entity_type = !empty($data->entity_type) ? $settings->entity_type : 'node'; - $entity = \Drupal::entityTypeManager()->getStorage('node')->load($entity_id); - + $entity = $this->entityTypeManager->getStorage('node')->load($entity_id); + if ($entity) { $url = $entity->toUrl('canonical', ['relative' => TRUE])->toString(); } diff --git a/src/Plugin/Widget/WidgetNoahsBars.php b/src/Plugin/Widget/WidgetNoahsBars.php index c03cf3f..ebbf32e 100644 --- a/src/Plugin/Widget/WidgetNoahsBars.php +++ b/src/Plugin/Widget/WidgetNoahsBars.php @@ -108,10 +108,10 @@ class WidgetNoahsBars extends WidgetBase { return $element_content; - + } - + /** * {@inheritdoc} */ diff --git a/src/Service/ControlServices.php b/src/Service/ControlServices.php index 9f3a7a5..6157c21 100644 --- a/src/Service/ControlServices.php +++ b/src/Service/ControlServices.php @@ -4,16 +4,38 @@ namespace Drupal\noahs_page_builder\Service; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Plugin\DefaultPluginManager; +use Drupal\Core\Extension\ModuleHandlerInterface; /** * */ class ControlServices { + /** + * The control plugin manager. + * + * @var \Drupal\Core\Plugin\DefaultPluginManager + */ protected $controlManager; - public function __construct(DefaultPluginManager $control_manager) { + /** + * The module handler service. + * + * @var \Drupal\Core\Extension\ModuleHandlerInterface + */ + protected $moduleHandler; + + /** + * Constructs a new ControlServices object. + * + * @param \Drupal\Core\Plugin\DefaultPluginManager $control_manager + * The control plugin manager. + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler service. + */ + public function __construct(DefaultPluginManager $control_manager, ModuleHandlerInterface $module_handler) { $this->controlManager = $control_manager; + $this->moduleHandler = $module_handler; } /** @@ -21,7 +43,8 @@ class ControlServices { */ public static function create(ContainerInterface $container) { return new static( - $container->get('plugin.manager.control') + $container->get('plugin.manager.control'), + $container->get('module_handler'), ); } @@ -43,7 +66,7 @@ class ControlServices { public function generateHtml($data, $values, $name, $value, $wrapper, $delta = NULL) { if ($data) { $state = !empty($data['item']['state']) ? htmlspecialchars(json_encode($data['item']['state']), ENT_QUOTES, 'UTF-8') : NULL; - + $content = $this->getContent($data, $name, $value, $delta); $open = !empty($data['item']['open']) ? 'show' : ''; $output = ''; @@ -221,7 +244,7 @@ class ControlServices { } /** - * + * */ public function tabsHoverHtml($data, $hover_status){ @@ -246,9 +269,9 @@ class ControlServices { $control_id = $data['item']['type']; $control = $this->getControlById($control_id); $hover_status = [ - 'default' => t('Default'), - 'hover' => t('Hover'), - // 'focus' => t('Focus'), + 'default' => t('Default'), + 'hover' => t('Hover'), + // 'focus' => t('Focus'), // 'active' => t('Active') ]; $state = !empty($data['item']['state']) ? htmlspecialchars(json_encode($data['item']['state']), ENT_QUOTES, 'UTF-8') : NULL; @@ -258,8 +281,8 @@ class ControlServices { $responsive_class = 'contain-responsive-tabs'; } $html_hover = ''; - $html_hover .= '<div class="field__hover noahs_page_builder_field '.$responsive_class.'" - data-field-state="' . $state . '" + $html_hover .= '<div class="field__hover noahs_page_builder_field '.$responsive_class.'" + data-field-state="' . $state . '" data-field-name="' . $data['item_id'] . '">'; $html_hover .= '<h5 class="d-flex justify-content-between expand-field" data-bs-toggle="collapse" href="#' . $data['item_id'] . '" role="button" aria-expanded="false" aria-controls="' . $data['item_id'] . '">' . $data['item']['title'] . '<i class="fa-solid fa-caret-down"></i></h5>'; $html_hover .= '<div class="collapse ' . $open . '" id="' . $data['item_id'] . '">'; @@ -326,7 +349,7 @@ class ControlServices { $state = !empty($data['item']['state']) ? htmlspecialchars(json_encode($data['item']['state']), ENT_QUOTES, 'UTF-8') : NULL; $responsive = ''; $hover_class = ($hover) ? 'hover' : null; - $responsive .= '<div class="noahs_page_builder_field noahs_page_builder_field__responsive '.$hover_class.' '.$active_class.' field__group field__' . $data['item']['type'] . '" + $responsive .= '<div class="noahs_page_builder_field noahs_page_builder_field__responsive '.$hover_class.' '.$active_class.' field__group field__' . $data['item']['type'] . '" data-field-state="' . $state . '" data-field-name="' . $data['item_id'] . '">'; @@ -365,12 +388,12 @@ class ControlServices { if ($k === 'desktop' && !empty($value)) { $data['item']['placeholder'] = $value; - + } // If tablet version if ($k === 'tablet' && !empty($value)) { $data['item']['placeholder'] = $value; - + } switch ($k) { case 'desktop': @@ -379,7 +402,7 @@ class ControlServices { case 'tablet': $icon = '<i class="las la-tablet-alt"></i>'; break; - + default: $icon = '<i class="las la-mobile-alt"></i>'; break; @@ -640,8 +663,7 @@ class ControlServices { 'style_type' => 'style', ]; - $moduleHandler = \Drupal::service('module_handler'); - $moduleHandler->alter('default_fileds', $form); + $this->moduleHandler->alter('default_fileds', $form); return $form; } diff --git a/src/Service/WidgetServices.php b/src/Service/WidgetServices.php index 84d35f1..6db556c 100644 --- a/src/Service/WidgetServices.php +++ b/src/Service/WidgetServices.php @@ -134,7 +134,6 @@ class WidgetServices { $default_fields = $this->controlManager->defaultFields(); $widget = $this->loadWidgetById($widgetId); - $route_match = \Drupal::routeMatch(); if ($widget) { $el_fields = $widget->renderForm(); $el_fields = array_merge($el_fields, $default_fields); @@ -168,4 +167,3 @@ class WidgetServices { } } - \ No newline at end of file -- GitLab From d456836c3ba091bea8459317badb921cd312f96e Mon Sep 17 00:00:00 2001 From: asghar <mr.asghar.khan@gmail.com> Date: Sun, 29 Jun 2025 13:37:32 +0500 Subject: [PATCH 5/7] WEBZONE-05: Fix the formatting issues. --- assets/css/banners.css | 1 + assets/css/codemirror.css | 304 +- assets/css/material-darker.css | 36 +- assets/css/noahs-fonts/inter copia.css | 2 +- assets/css/noahs-fonts/lato copia.css | 2 +- assets/line-awesome/LICENSE.txt | 2 +- assets/line-awesome/css/line-awesome.css | 6170 +++++++++++------ modules/noahs_ai/noahs_ai.links.menu.yml | 1 - modules/noahs_ai/noahs_ai.module | 8 +- .../noahs_ai/src/Form/NoahsAiSettingsForm.php | 10 +- modules/noahs_gallery/noahs_gallery.module | 15 +- .../noahs_gallery/src/Entity/NoahSGallery.php | 11 +- .../src/Plugin/Widget/WidgetNoahsGallery.php | 16 +- noahs_page_builder.install | 21 +- noahs_page_builder.libraries.yml | 1 - noahs_page_builder.module | 1168 ++-- src/ControlManager.php | 12 +- src/Controller/NoahsCloneWidgetController.php | 12 +- src/Controller/NoahsController.php | 169 +- src/Controller/NoahsEditWidgetController.php | 14 +- src/Controller/NoahsFinalWidgetController.php | 14 +- src/Controller/NoahsFunctionsController.php | 17 +- src/Controller/NoahsIconsController.php | 25 +- src/Controller/NoahsModalController.php | 21 +- src/Controller/NoahsModalMediaController.php | 42 +- src/Controller/NoahsModalTokensController.php | 7 +- src/Controller/NoahsPageController.php | 33 +- src/Controller/NoahsSaveStylesController.php | 4 +- src/Controller/NoahsSettingsController.php | 16 +- src/Controller/NoahsThemesController.php | 50 +- src/Controller/NoahsTrackController.php | 25 +- .../NoahsUrlAutocompleteController.php | 13 +- src/ControlsManager.php | 77 +- src/Fonts.php | 16 +- src/Form/NoahsConfigForm.php | 5 +- src/Form/NoahsRenegerateStylesForm.php | 8 +- src/Form/NoahsSettingsForm.php | 65 +- src/ModalForm.php | 37 +- src/Plugin/Control/ControlBase.php | 3 +- src/Plugin/Control/ControlCheckbox.php | 18 +- src/Plugin/Control/ControlHtml.php | 2 +- src/Plugin/Control/ControlInterface.php | 17 +- .../ControlNoahsBackgroundGradient.php | 2 +- .../Control/ControlNoahsBackgroundImage.php | 76 +- src/Plugin/Control/ControlNoahsDivider.php | 44 +- src/Plugin/Control/ControlNoahsFont.php | 22 +- src/Plugin/Control/ControlNoahsImage.php | 1 + src/Plugin/Control/ControlNoahsMargin.php | 2 - src/Plugin/Control/ControlNoahsShadows.php | 8 +- src/Plugin/Control/ControlNoahsUrl.php | 2 - .../Control/ControlNoahsVideoUpload.php | 8 +- src/Plugin/Control/ControlNumber.php | 2 +- src/Plugin/Control/ControlText.php | 3 +- src/Plugin/Control/ControlTextarea.php | 4 +- src/Plugin/Widget/WidgetBase.php | 72 +- src/Plugin/Widget/WidgetNoahsAccordion.php | 23 +- src/Plugin/Widget/WidgetNoahsBars.php | 7 +- src/Plugin/Widget/WidgetNoahsButton.php | 13 +- src/Plugin/Widget/WidgetNoahsCard.php | 14 +- src/Plugin/Widget/WidgetNoahsCardGrid.php | 40 +- src/Plugin/Widget/WidgetNoahsCarousel.php | 19 +- src/Plugin/Widget/WidgetNoahsColumn.php | 4 +- src/Plugin/Widget/WidgetNoahsDrupalBlock.php | 2 +- src/Plugin/Widget/WidgetNoahsHeading.php | 15 +- src/Plugin/Widget/WidgetNoahsIconlist.php | 6 +- src/Plugin/Widget/WidgetNoahsImage.php | 2 +- src/Plugin/Widget/WidgetNoahsNetworkIcons.php | 6 + src/Plugin/Widget/WidgetNoahsPlainText.php | 2 +- src/Plugin/Widget/WidgetNoahsRow.php | 8 +- src/Plugin/Widget/WidgetNoahsSeparator.php | 4 +- .../Widget/WidgetNoahsServicesSlide.php | 10 +- src/Plugin/Widget/WidgetNoahsSettings.php | 69 +- src/Plugin/Widget/WidgetNoahsSlideshow.php | 17 +- src/Plugin/Widget/WidgetNoahsText.php | 2 +- src/Service/ControlServices.php | 170 +- src/Service/WidgetServices.php | 37 +- 76 files changed, 6042 insertions(+), 3164 deletions(-) diff --git a/assets/css/banners.css b/assets/css/banners.css index e69de29..8b13789 100644 --- a/assets/css/banners.css +++ b/assets/css/banners.css @@ -0,0 +1 @@ + diff --git a/assets/css/codemirror.css b/assets/css/codemirror.css index f4d5718..9edf442 100644 --- a/assets/css/codemirror.css +++ b/assets/css/codemirror.css @@ -18,7 +18,8 @@ padding: 0 4px; /* Horizontal padding of content */ } -.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { +.CodeMirror-scrollbar-filler, +.CodeMirror-gutter-filler { background-color: white; /* The little square between H and V scrollbars */ } @@ -29,7 +30,8 @@ background-color: #f7f7f7; white-space: nowrap; } -.CodeMirror-linenumbers {} +.CodeMirror-linenumbers { +} .CodeMirror-linenumber { padding: 0 3px 0 5px; min-width: 20px; @@ -38,8 +40,12 @@ white-space: nowrap; } -.CodeMirror-guttermarker { color: black; } -.CodeMirror-guttermarker-subtle { color: #999; } +.CodeMirror-guttermarker { + color: black; +} +.CodeMirror-guttermarker-subtle { + color: #999; +} /* CURSOR */ @@ -61,88 +67,181 @@ z-index: 1; } .cm-fat-cursor .CodeMirror-line::selection, -.cm-fat-cursor .CodeMirror-line > span::selection, -.cm-fat-cursor .CodeMirror-line > span > span::selection { background: transparent; } +.cm-fat-cursor .CodeMirror-line > span::selection, +.cm-fat-cursor .CodeMirror-line > span > span::selection { + background: transparent; +} .cm-fat-cursor .CodeMirror-line::-moz-selection, .cm-fat-cursor .CodeMirror-line > span::-moz-selection, -.cm-fat-cursor .CodeMirror-line > span > span::-moz-selection { background: transparent; } -.cm-fat-cursor { caret-color: transparent; } +.cm-fat-cursor .CodeMirror-line > span > span::-moz-selection { + background: transparent; +} +.cm-fat-cursor { + caret-color: transparent; +} @-moz-keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} + 0% { +} + 50% { + background-color: transparent; +} + 100% { +} } @-webkit-keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} + 0% { +} + 50% { + background-color: transparent; +} + 100% { +} } @keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} + 0% { +} + 50% { + background-color: transparent; +} + 100% { +} } /* Can style cursor different in overwrite (non-insert) mode */ -.CodeMirror-overwrite .CodeMirror-cursor {} +.CodeMirror-overwrite .CodeMirror-cursor { +} -.cm-tab { display: inline-block; text-decoration: inherit; } +.cm-tab { + display: inline-block; + text-decoration: inherit; +} .CodeMirror-rulers { position: absolute; - left: 0; right: 0; top: -50px; bottom: 0; + left: 0; + right: 0; + top: -50px; + bottom: 0; overflow: hidden; } .CodeMirror-ruler { border-left: 1px solid #ccc; - top: 0; bottom: 0; + top: 0; + bottom: 0; position: absolute; } /* DEFAULT THEME */ -.cm-s-default .cm-header {color: blue;} -.cm-s-default .cm-quote {color: #090;} -.cm-negative {color: #d44;} -.cm-positive {color: #292;} -.cm-header, .cm-strong {font-weight: bold;} -.cm-em {font-style: italic;} -.cm-link {text-decoration: underline;} -.cm-strikethrough {text-decoration: line-through;} - -.cm-s-default .cm-keyword {color: #708;} -.cm-s-default .cm-atom {color: #219;} -.cm-s-default .cm-number {color: #164;} -.cm-s-default .cm-def {color: #00f;} +.cm-s-default .cm-header { + color: blue; +} +.cm-s-default .cm-quote { + color: #090; +} +.cm-negative { + color: #d44; +} +.cm-positive { + color: #292; +} +.cm-header, +.cm-strong { + font-weight: bold; +} +.cm-em { + font-style: italic; +} +.cm-link { + text-decoration: underline; +} +.cm-strikethrough { + text-decoration: line-through; +} + +.cm-s-default .cm-keyword { + color: #708; +} +.cm-s-default .cm-atom { + color: #219; +} +.cm-s-default .cm-number { + color: #164; +} +.cm-s-default .cm-def { + color: #00f; +} .cm-s-default .cm-variable, .cm-s-default .cm-punctuation, .cm-s-default .cm-property, -.cm-s-default .cm-operator {} -.cm-s-default .cm-variable-2 {color: #05a;} -.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;} -.cm-s-default .cm-comment {color: #a50;} -.cm-s-default .cm-string {color: #a11;} -.cm-s-default .cm-string-2 {color: #f50;} -.cm-s-default .cm-meta {color: #555;} -.cm-s-default .cm-qualifier {color: #555;} -.cm-s-default .cm-builtin {color: #30a;} -.cm-s-default .cm-bracket {color: #997;} -.cm-s-default .cm-tag {color: #170;} -.cm-s-default .cm-attribute {color: #00c;} -.cm-s-default .cm-hr {color: #999;} -.cm-s-default .cm-link {color: #00c;} - -.cm-s-default .cm-error {color: #f00;} -.cm-invalidchar {color: #f00;} - -.CodeMirror-composing { border-bottom: 2px solid; } +.cm-s-default .cm-operator { +} +.cm-s-default .cm-variable-2 { + color: #05a; +} +.cm-s-default .cm-variable-3, +.cm-s-default .cm-type { + color: #085; +} +.cm-s-default .cm-comment { + color: #a50; +} +.cm-s-default .cm-string { + color: #a11; +} +.cm-s-default .cm-string-2 { + color: #f50; +} +.cm-s-default .cm-meta { + color: #555; +} +.cm-s-default .cm-qualifier { + color: #555; +} +.cm-s-default .cm-builtin { + color: #30a; +} +.cm-s-default .cm-bracket { + color: #997; +} +.cm-s-default .cm-tag { + color: #170; +} +.cm-s-default .cm-attribute { + color: #00c; +} +.cm-s-default .cm-hr { + color: #999; +} +.cm-s-default .cm-link { + color: #00c; +} + +.cm-s-default .cm-error { + color: #f00; +} +.cm-invalidchar { + color: #f00; +} + +.CodeMirror-composing { + border-bottom: 2px solid; +} /* Default styles for common addons */ -div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;} -div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} -.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } -.CodeMirror-activeline-background {background: #e8f2ff;} +div.CodeMirror span.CodeMirror-matchingbracket { + color: #0b0; +} +div.CodeMirror span.CodeMirror-nonmatchingbracket { + color: #a22; +} +.CodeMirror-matchingtag { + background: rgba(255, 150, 0, .3); +} +.CodeMirror-activeline-background { + background: #e8f2ff; +} /* STOP */ @@ -159,7 +258,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} overflow: scroll !important; /* Things will break if this is overridden */ /* 50px is the magic margin used to hide the element's real scrollbars */ /* See overflow: hidden in .CodeMirror */ - margin-bottom: -50px; margin-right: -50px; + margin-bottom: -50px; + margin-right: -50px; padding-bottom: 50px; height: 100%; outline: none; /* Prevent dragging from highlighting the element */ @@ -174,31 +274,40 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} /* The fake, visible scrollbars. Used to force redraw during scrolling before actual scrolling happens, thus preventing shaking and flickering artifacts. */ -.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { +.CodeMirror-vscrollbar, +.CodeMirror-hscrollbar, +.CodeMirror-scrollbar-filler, +.CodeMirror-gutter-filler { position: absolute; z-index: 6; display: none; outline: none; } .CodeMirror-vscrollbar { - right: 0; top: 0; + right: 0; + top: 0; overflow-x: hidden; overflow-y: scroll; } .CodeMirror-hscrollbar { - bottom: 0; left: 0; + bottom: 0; + left: 0; overflow-y: hidden; overflow-x: scroll; } .CodeMirror-scrollbar-filler { - right: 0; bottom: 0; + right: 0; + bottom: 0; } .CodeMirror-gutter-filler { - left: 0; bottom: 0; + left: 0; + bottom: 0; } .CodeMirror-gutters { - position: absolute; left: 0; top: 0; + position: absolute; + left: 0; + top: 0; min-height: 100%; z-index: 3; } @@ -217,7 +326,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} } .CodeMirror-gutter-background { position: absolute; - top: 0; bottom: 0; + top: 0; + bottom: 0; z-index: 4; } .CodeMirror-gutter-elt { @@ -225,8 +335,12 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} cursor: default; z-index: 4; } -.CodeMirror-gutter-wrapper ::selection { background-color: transparent } -.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent } +.CodeMirror-gutter-wrapper ::selection { + background-color: transparent +} +.CodeMirror-gutter-wrapper ::-moz-selection { + background-color: transparent +} .CodeMirror-lines { cursor: text; @@ -235,7 +349,9 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} .CodeMirror pre.CodeMirror-line, .CodeMirror pre.CodeMirror-line-like { /* Reset some styles that the rest of the page might have set */ - -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; border-width: 0; background: transparent; font-family: inherit; @@ -261,7 +377,10 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} .CodeMirror-linebackground { position: absolute; - left: 0; right: 0; top: 0; bottom: 0; + left: 0; + right: 0; + top: 0; + bottom: 0; z-index: 0; } @@ -271,9 +390,12 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} padding: 0.1px; /* Force widget margins to stay inside of the container */ } -.CodeMirror-widget {} +.CodeMirror-widget { +} -.CodeMirror-rtl pre { direction: rtl; } +.CodeMirror-rtl pre { + direction: rtl; +} .CodeMirror-code { outline: none; @@ -301,7 +423,9 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} position: absolute; pointer-events: none; } -.CodeMirror-measure pre { position: static; } +.CodeMirror-measure pre { + position: static; +} div.CodeMirror-cursors { visibility: hidden; @@ -316,11 +440,25 @@ div.CodeMirror-dragcursors { visibility: visible; } -.CodeMirror-selected { background: #d9d9d9; } -.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } -.CodeMirror-crosshair { cursor: crosshair; } -.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; } -.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; } +.CodeMirror-selected { + background: #d9d9d9; +} +.CodeMirror-focused .CodeMirror-selected { + background: #d7d4f0; +} +.CodeMirror-crosshair { + cursor: crosshair; +} +.CodeMirror-line::selection, +.CodeMirror-line > span::selection, +.CodeMirror-line > span > span::selection { + background: #d7d4f0; +} +.CodeMirror-line::-moz-selection, +.CodeMirror-line > span::-moz-selection, +.CodeMirror-line > span > span::-moz-selection { + background: #d7d4f0; +} .cm-searching { background-color: #ffa; @@ -328,7 +466,9 @@ div.CodeMirror-dragcursors { } /* Used to force a border model for a node */ -.cm-force-border { padding-right: .1px; } +.cm-force-border { + padding-right: .1px; +} @media print { /* Hide the cursor when printing */ @@ -338,7 +478,11 @@ div.CodeMirror-dragcursors { } /* See issue #2901 */ -.cm-tab-wrap-hack:after { content: ''; } +.cm-tab-wrap-hack:after { + content: ''; +} /* Help users use markselection to safely style text background */ -span.CodeMirror-selectedtext { background: none; } +span.CodeMirror-selectedtext { + background: none; +} diff --git a/assets/css/material-darker.css b/assets/css/material-darker.css index 45b64ef..ddaa74f 100644 --- a/assets/css/material-darker.css +++ b/assets/css/material-darker.css @@ -6,7 +6,7 @@ .cm-s-material-darker.CodeMirror { background-color: #212121; - color: #EEFFFF; + color: #eeffff; } .cm-s-material-darker .CodeMirror-gutters { @@ -22,7 +22,7 @@ } .cm-s-material-darker .CodeMirror-cursor { - border-left: 1px solid #FFCC00; + border-left: 1px solid #ffcc00; } .cm-s-material-darker div.CodeMirror-selected { @@ -50,15 +50,15 @@ } .cm-s-material-darker .cm-keyword { - color: #C792EA; + color: #c792ea; } .cm-s-material-darker .cm-operator { - color: #89DDFF; + color: #89ddff; } .cm-s-material-darker .cm-variable-2 { - color: #EEFFFF; + color: #eeffff; } .cm-s-material-darker .cm-variable-3, @@ -67,23 +67,23 @@ } .cm-s-material-darker .cm-builtin { - color: #FFCB6B; + color: #ffcb6b; } .cm-s-material-darker .cm-atom { - color: #F78C6C; + color: #f78c6c; } .cm-s-material-darker .cm-number { - color: #FF5370; + color: #ff5370; } .cm-s-material-darker .cm-def { - color: #82AAFF; + color: #82aaff; } .cm-s-material-darker .cm-string { - color: #C3E88D; + color: #c3e88d; } .cm-s-material-darker .cm-string-2 { @@ -99,37 +99,37 @@ } .cm-s-material-darker .cm-tag { - color: #FF5370; + color: #ff5370; } .cm-s-material-darker .cm-meta { - color: #FFCB6B; + color: #ffcb6b; } .cm-s-material-darker .cm-attribute { - color: #C792EA; + color: #c792ea; } .cm-s-material-darker .cm-property { - color: #C792EA; + color: #c792ea; } .cm-s-material-darker .cm-qualifier { - color: #DECB6B; + color: #decb6b; } .cm-s-material-darker .cm-variable-3, .cm-s-material-darker .cm-type { - color: #DECB6B; + color: #decb6b; } .cm-s-material-darker .cm-error { color: rgba(255, 255, 255, 1.0); - background-color: #FF5370; + background-color: #ff5370; } .cm-s-material-darker .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; -} \ No newline at end of file +} diff --git a/assets/css/noahs-fonts/inter copia.css b/assets/css/noahs-fonts/inter copia.css index c603420..86de36f 100644 --- a/assets/css/noahs-fonts/inter copia.css +++ b/assets/css/noahs-fonts/inter copia.css @@ -37,4 +37,4 @@ font-style: normal; font-weight: 900; src: url("../../noahs-fonts/inter-v18-latin/inter-v18-latin-900.woff2") format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ -} \ No newline at end of file +} diff --git a/assets/css/noahs-fonts/lato copia.css b/assets/css/noahs-fonts/lato copia.css index a160202..70255fa 100644 --- a/assets/css/noahs-fonts/lato copia.css +++ b/assets/css/noahs-fonts/lato copia.css @@ -61,4 +61,4 @@ font-style: italic; font-weight: 900; src: url("../../noahs-fonts/lato-v24-latin/lato-v24-latin-900italic.woff2") format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ -} \ No newline at end of file +} diff --git a/assets/line-awesome/LICENSE.txt b/assets/line-awesome/LICENSE.txt index 263df3d..8389e26 100755 --- a/assets/line-awesome/LICENSE.txt +++ b/assets/line-awesome/LICENSE.txt @@ -1 +1 @@ -If you use the icons publicly, please link to https://icons8.com/line-awesome somewhere on your page or artwork, so that more creators could know about it and use it for free. \ No newline at end of file +If you use the icons publicly, please link to https://icons8.com/line-awesome somewhere on your page or artwork, so that more creators could know about it and use it for free. diff --git a/assets/line-awesome/css/line-awesome.css b/assets/line-awesome/css/line-awesome.css index 3e9d858..5625058 100644 --- a/assets/line-awesome/css/line-awesome.css +++ b/assets/line-awesome/css/line-awesome.css @@ -10,145 +10,181 @@ font-style: normal; font-variant: normal; text-rendering: auto; - line-height: 1; } + line-height: 1; +} .la-lg { font-size: 1.33333em; line-height: 0.75em; - vertical-align: -.0667em; } + vertical-align: -.0667em; +} .la-xs { - font-size: .75em; } + font-size: .75em; +} .la-sm { - font-size: .875em; } + font-size: .875em; +} .la-1x { - font-size: 1em; } + font-size: 1em; +} .la-2x { - font-size: 2em; } + font-size: 2em; +} .la-3x { - font-size: 3em; } + font-size: 3em; +} .la-4x { - font-size: 4em; } + font-size: 4em; +} .la-5x { - font-size: 5em; } + font-size: 5em; +} .la-6x { - font-size: 6em; } + font-size: 6em; +} .la-7x { - font-size: 7em; } + font-size: 7em; +} .la-8x { - font-size: 8em; } + font-size: 8em; +} .la-9x { - font-size: 9em; } + font-size: 9em; +} .la-10x { - font-size: 10em; } + font-size: 10em; +} .la-fw { text-align: center; - width: 1.25em; } + width: 1.25em; +} .la-ul { list-style-type: none; margin-left: 2.5em; - padding-left: 0; } - .la-ul > li { - position: relative; } + padding-left: 0; +} +.la-ul > li { + position: relative; +} .la-li { left: -2em; position: absolute; text-align: center; width: 2em; - line-height: inherit; } + line-height: inherit; +} .la-border { border: solid 0.08em #eee; border-radius: .1em; - padding: .2em .25em .15em; } + padding: .2em .25em .15em; +} .la-pull-left { - float: left; } + float: left; +} .la-pull-right { - float: right; } + float: right; +} .la.la-pull-left, .las.la-pull-left, .lar.la-pull-left, .lal.la-pull-left, .lab.la-pull-left { - margin-right: .3em; } + margin-right: .3em; +} .la.la-pull-right, .las.la-pull-right, .lar.la-pull-right, .lal.la-pull-right, .lab.la-pull-right { - margin-left: .3em; } + margin-left: .3em; +} .la-spin { -webkit-animation: la-spin 2s infinite linear; - animation: la-spin 2s infinite linear; } + animation: la-spin 2s infinite linear; +} .la-pulse { -webkit-animation: la-spin 1s infinite steps(8); - animation: la-spin 1s infinite steps(8); } + animation: la-spin 1s infinite steps(8); +} @-webkit-keyframes la-spin { 0% { -webkit-transform: rotate(0deg); - transform: rotate(0deg); } + transform: rotate(0deg); +} 100% { -webkit-transform: rotate(360deg); - transform: rotate(360deg); } } + transform: rotate(360deg); +} } @keyframes la-spin { 0% { -webkit-transform: rotate(0deg); - transform: rotate(0deg); } + transform: rotate(0deg); +} 100% { -webkit-transform: rotate(360deg); - transform: rotate(360deg); } } + transform: rotate(360deg); +} } .la-rotate-90 { -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)"; -webkit-transform: rotate(90deg); - transform: rotate(90deg); } + transform: rotate(90deg); +} .la-rotate-180 { -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)"; -webkit-transform: rotate(180deg); - transform: rotate(180deg); } + transform: rotate(180deg); +} .la-rotate-270 { -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"; -webkit-transform: rotate(270deg); - transform: rotate(270deg); } + transform: rotate(270deg); +} .la-flip-horizontal { -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)"; -webkit-transform: scale(-1, 1); - transform: scale(-1, 1); } + transform: scale(-1, 1); +} .la-flip-vertical { -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"; -webkit-transform: scale(1, -1); - transform: scale(1, -1); } + transform: scale(1, -1); +} -.la-flip-both, .la-flip-horizontal.la-flip-vertical { +.la-flip-both, +.la-flip-horizontal.la-flip-vertical { -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"; -webkit-transform: scale(-1, -1); - transform: scale(-1, -1); } + transform: scale(-1, -1); +} :root .la-rotate-90, :root .la-rotate-180, @@ -157,7 +193,8 @@ :root .la-flip-vertical, :root .la-flip-both { -webkit-filter: none; - filter: none; } + filter: none; +} .la-stack { display: inline-block; @@ -165,4207 +202,5606 @@ line-height: 2em; position: relative; vertical-align: middle; - width: 2.5em; } + width: 2.5em; +} .la-stack-1x, .la-stack-2x { left: 0; position: absolute; text-align: center; - width: 100%; } + width: 100%; +} .la-stack-1x { - line-height: inherit; } + line-height: inherit; +} .la-stack-2x { - font-size: 2em; } + font-size: 2em; +} .la-inverse { - color: #fff; } + color: #fff; +} /* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen readers do not read off random characters that represent icons */ .la-500px:before { - content: "\f26e"; } + content: "\f26e"; +} .la-accessible-icon:before { - content: "\f368"; } + content: "\f368"; +} .la-accusoft:before { - content: "\f369"; } + content: "\f369"; +} .la-acquisitions-incorporated:before { - content: "\f6af"; } + content: "\f6af"; +} .la-ad:before { - content: "\f641"; } + content: "\f641"; +} .la-address-book:before { - content: "\f2b9"; } + content: "\f2b9"; +} .la-address-card:before { - content: "\f2bb"; } + content: "\f2bb"; +} .la-adjust:before { - content: "\f042"; } + content: "\f042"; +} .la-adn:before { - content: "\f170"; } + content: "\f170"; +} .la-adobe:before { - content: "\f778"; } + content: "\f778"; +} .la-adversal:before { - content: "\f36a"; } + content: "\f36a"; +} .la-affiliatetheme:before { - content: "\f36b"; } + content: "\f36b"; +} .la-air-freshener:before { - content: "\f5d0"; } + content: "\f5d0"; +} .la-airbnb:before { - content: "\f834"; } + content: "\f834"; +} .la-algolia:before { - content: "\f36c"; } + content: "\f36c"; +} .la-align-center:before { - content: "\f037"; } + content: "\f037"; +} .la-align-justify:before { - content: "\f039"; } + content: "\f039"; +} .la-align-left:before { - content: "\f036"; } + content: "\f036"; +} .la-align-right:before { - content: "\f038"; } + content: "\f038"; +} .la-alipay:before { - content: "\f642"; } + content: "\f642"; +} .la-allergies:before { - content: "\f461"; } + content: "\f461"; +} .la-amazon:before { - content: "\f270"; } + content: "\f270"; +} .la-amazon-pay:before { - content: "\f42c"; } + content: "\f42c"; +} .la-ambulance:before { - content: "\f0f9"; } + content: "\f0f9"; +} .la-american-sign-language-interpreting:before { - content: "\f2a3"; } + content: "\f2a3"; +} .la-amilia:before { - content: "\f36d"; } + content: "\f36d"; +} .la-anchor:before { - content: "\f13d"; } + content: "\f13d"; +} .la-android:before { - content: "\f17b"; } + content: "\f17b"; +} .la-angellist:before { - content: "\f209"; } + content: "\f209"; +} .la-angle-double-down:before { - content: "\f103"; } + content: "\f103"; +} .la-angle-double-left:before { - content: "\f100"; } + content: "\f100"; +} .la-angle-double-right:before { - content: "\f101"; } + content: "\f101"; +} .la-angle-double-up:before { - content: "\f102"; } + content: "\f102"; +} .la-angle-down:before { - content: "\f107"; } + content: "\f107"; +} .la-angle-left:before { - content: "\f104"; } + content: "\f104"; +} .la-angle-right:before { - content: "\f105"; } + content: "\f105"; +} .la-angle-up:before { - content: "\f106"; } + content: "\f106"; +} .la-angry:before { - content: "\f556"; } + content: "\f556"; +} .la-angrycreative:before { - content: "\f36e"; } + content: "\f36e"; +} .la-angular:before { - content: "\f420"; } + content: "\f420"; +} .la-ankh:before { - content: "\f644"; } + content: "\f644"; +} .la-app-store:before { - content: "\f36f"; } + content: "\f36f"; +} .la-app-store-ios:before { - content: "\f370"; } + content: "\f370"; +} .la-apper:before { - content: "\f371"; } + content: "\f371"; +} .la-apple:before { - content: "\f179"; } + content: "\f179"; +} .la-apple-alt:before { - content: "\f5d1"; } + content: "\f5d1"; +} .la-apple-pay:before { - content: "\f415"; } + content: "\f415"; +} .la-archive:before { - content: "\f187"; } + content: "\f187"; +} .la-archway:before { - content: "\f557"; } + content: "\f557"; +} .la-arrow-alt-circle-down:before { - content: "\f358"; } + content: "\f358"; +} .la-arrow-alt-circle-left:before { - content: "\f359"; } + content: "\f359"; +} .la-arrow-alt-circle-right:before { - content: "\f35a"; } + content: "\f35a"; +} .la-arrow-alt-circle-up:before { - content: "\f35b"; } + content: "\f35b"; +} .la-arrow-circle-down:before { - content: "\f0ab"; } + content: "\f0ab"; +} .la-arrow-circle-left:before { - content: "\f0a8"; } + content: "\f0a8"; +} .la-arrow-circle-right:before { - content: "\f0a9"; } + content: "\f0a9"; +} .la-arrow-circle-up:before { - content: "\f0aa"; } + content: "\f0aa"; +} .la-arrow-down:before { - content: "\f063"; } + content: "\f063"; +} .la-arrow-left:before { - content: "\f060"; } + content: "\f060"; +} .la-arrow-right:before { - content: "\f061"; } + content: "\f061"; +} .la-arrow-up:before { - content: "\f062"; } + content: "\f062"; +} .la-arrows-alt:before { - content: "\f0b2"; } + content: "\f0b2"; +} .la-arrows-alt-h:before { - content: "\f337"; } + content: "\f337"; +} .la-arrows-alt-v:before { - content: "\f338"; } + content: "\f338"; +} .la-artstation:before { - content: "\f77a"; } + content: "\f77a"; +} .la-assistive-listening-systems:before { - content: "\f2a2"; } + content: "\f2a2"; +} .la-asterisk:before { - content: "\f069"; } + content: "\f069"; +} .la-asymmetrik:before { - content: "\f372"; } + content: "\f372"; +} .la-at:before { - content: "\f1fa"; } + content: "\f1fa"; +} .la-atlas:before { - content: "\f558"; } + content: "\f558"; +} .la-atlassian:before { - content: "\f77b"; } + content: "\f77b"; +} .la-atom:before { - content: "\f5d2"; } + content: "\f5d2"; +} .la-audible:before { - content: "\f373"; } + content: "\f373"; +} .la-audio-description:before { - content: "\f29e"; } + content: "\f29e"; +} .la-autoprefixer:before { - content: "\f41c"; } + content: "\f41c"; +} .la-avianex:before { - content: "\f374"; } + content: "\f374"; +} .la-aviato:before { - content: "\f421"; } + content: "\f421"; +} .la-award:before { - content: "\f559"; } + content: "\f559"; +} .la-aws:before { - content: "\f375"; } + content: "\f375"; +} .la-baby:before { - content: "\f77c"; } + content: "\f77c"; +} .la-baby-carriage:before { - content: "\f77d"; } + content: "\f77d"; +} .la-backspace:before { - content: "\f55a"; } + content: "\f55a"; +} .la-backward:before { - content: "\f04a"; } + content: "\f04a"; +} .la-bacon:before { - content: "\f7e5"; } + content: "\f7e5"; +} .la-balance-scale:before { - content: "\f24e"; } + content: "\f24e"; +} .la-balance-scale-left:before { - content: "\f515"; } + content: "\f515"; +} .la-balance-scale-right:before { - content: "\f516"; } + content: "\f516"; +} .la-ban:before { - content: "\f05e"; } + content: "\f05e"; +} .la-band-aid:before { - content: "\f462"; } + content: "\f462"; +} .la-bandcamp:before { - content: "\f2d5"; } + content: "\f2d5"; +} .la-barcode:before { - content: "\f02a"; } + content: "\f02a"; +} .la-bars:before { - content: "\f0c9"; } + content: "\f0c9"; +} .la-baseball-ball:before { - content: "\f433"; } + content: "\f433"; +} .la-basketball-ball:before { - content: "\f434"; } + content: "\f434"; +} .la-bath:before { - content: "\f2cd"; } + content: "\f2cd"; +} .la-battery-empty:before { - content: "\f244"; } + content: "\f244"; +} .la-battery-full:before { - content: "\f240"; } + content: "\f240"; +} .la-battery-half:before { - content: "\f242"; } + content: "\f242"; +} .la-battery-quarter:before { - content: "\f243"; } + content: "\f243"; +} .la-battery-three-quarters:before { - content: "\f241"; } + content: "\f241"; +} .la-battle-net:before { - content: "\f835"; } + content: "\f835"; +} .la-bed:before { - content: "\f236"; } + content: "\f236"; +} .la-beer:before { - content: "\f0fc"; } + content: "\f0fc"; +} .la-behance:before { - content: "\f1b4"; } + content: "\f1b4"; +} .la-behance-square:before { - content: "\f1b5"; } + content: "\f1b5"; +} .la-bell:before { - content: "\f0f3"; } + content: "\f0f3"; +} .la-bell-slash:before { - content: "\f1f6"; } + content: "\f1f6"; +} .la-bezier-curve:before { - content: "\f55b"; } + content: "\f55b"; +} .la-bible:before { - content: "\f647"; } + content: "\f647"; +} .la-bicycle:before { - content: "\f206"; } + content: "\f206"; +} .la-biking:before { - content: "\f84a"; } + content: "\f84a"; +} .la-bimobject:before { - content: "\f378"; } + content: "\f378"; +} .la-binoculars:before { - content: "\f1e5"; } + content: "\f1e5"; +} .la-biohazard:before { - content: "\f780"; } + content: "\f780"; +} .la-birthday-cake:before { - content: "\f1fd"; } + content: "\f1fd"; +} .la-bitbucket:before { - content: "\f171"; } + content: "\f171"; +} .la-bitcoin:before { - content: "\f379"; } + content: "\f379"; +} .la-bity:before { - content: "\f37a"; } + content: "\f37a"; +} .la-black-tie:before { - content: "\f27e"; } + content: "\f27e"; +} .la-blackberry:before { - content: "\f37b"; } + content: "\f37b"; +} .la-blender:before { - content: "\f517"; } + content: "\f517"; +} .la-blender-phone:before { - content: "\f6b6"; } + content: "\f6b6"; +} .la-blind:before { - content: "\f29d"; } + content: "\f29d"; +} .la-blog:before { - content: "\f781"; } + content: "\f781"; +} .la-blogger:before { - content: "\f37c"; } + content: "\f37c"; +} .la-blogger-b:before { - content: "\f37d"; } + content: "\f37d"; +} .la-bluetooth:before { - content: "\f293"; } + content: "\f293"; +} .la-bluetooth-b:before { - content: "\f294"; } + content: "\f294"; +} .la-bold:before { - content: "\f032"; } + content: "\f032"; +} .la-bolt:before { - content: "\f0e7"; } + content: "\f0e7"; +} .la-bomb:before { - content: "\f1e2"; } + content: "\f1e2"; +} .la-bone:before { - content: "\f5d7"; } + content: "\f5d7"; +} .la-bong:before { - content: "\f55c"; } + content: "\f55c"; +} .la-book:before { - content: "\f02d"; } + content: "\f02d"; +} .la-book-dead:before { - content: "\f6b7"; } + content: "\f6b7"; +} .la-book-medical:before { - content: "\f7e6"; } + content: "\f7e6"; +} .la-book-open:before { - content: "\f518"; } + content: "\f518"; +} .la-book-reader:before { - content: "\f5da"; } + content: "\f5da"; +} .la-bookmark:before { - content: "\f02e"; } + content: "\f02e"; +} .la-bootstrap:before { - content: "\f836"; } + content: "\f836"; +} .la-border-all:before { - content: "\f84c"; } + content: "\f84c"; +} .la-border-none:before { - content: "\f850"; } + content: "\f850"; +} .la-border-style:before { - content: "\f853"; } + content: "\f853"; +} .la-bowling-ball:before { - content: "\f436"; } + content: "\f436"; +} .la-box:before { - content: "\f466"; } + content: "\f466"; +} .la-box-open:before { - content: "\f49e"; } + content: "\f49e"; +} .la-boxes:before { - content: "\f468"; } + content: "\f468"; +} .la-braille:before { - content: "\f2a1"; } + content: "\f2a1"; +} .la-brain:before { - content: "\f5dc"; } + content: "\f5dc"; +} .la-bread-slice:before { - content: "\f7ec"; } + content: "\f7ec"; +} .la-briefcase:before { - content: "\f0b1"; } + content: "\f0b1"; +} .la-briefcase-medical:before { - content: "\f469"; } + content: "\f469"; +} .la-broadcast-tower:before { - content: "\f519"; } + content: "\f519"; +} .la-broom:before { - content: "\f51a"; } + content: "\f51a"; +} .la-brush:before { - content: "\f55d"; } + content: "\f55d"; +} .la-btc:before { - content: "\f15a"; } + content: "\f15a"; +} .la-buffer:before { - content: "\f837"; } + content: "\f837"; +} .la-bug:before { - content: "\f188"; } + content: "\f188"; +} .la-building:before { - content: "\f1ad"; } + content: "\f1ad"; +} .la-bullhorn:before { - content: "\f0a1"; } + content: "\f0a1"; +} .la-bullseye:before { - content: "\f140"; } + content: "\f140"; +} .la-burn:before { - content: "\f46a"; } + content: "\f46a"; +} .la-buromobelexperte:before { - content: "\f37f"; } + content: "\f37f"; +} .la-bus:before { - content: "\f207"; } + content: "\f207"; +} .la-bus-alt:before { - content: "\f55e"; } + content: "\f55e"; +} .la-business-time:before { - content: "\f64a"; } + content: "\f64a"; +} .la-buy-n-large:before { - content: "\f8a6"; } + content: "\f8a6"; +} .la-buysellads:before { - content: "\f20d"; } + content: "\f20d"; +} .la-calculator:before { - content: "\f1ec"; } + content: "\f1ec"; +} .la-calendar:before { - content: "\f133"; } + content: "\f133"; +} .la-calendar-alt:before { - content: "\f073"; } + content: "\f073"; +} .la-calendar-check:before { - content: "\f274"; } + content: "\f274"; +} .la-calendar-day:before { - content: "\f783"; } + content: "\f783"; +} .la-calendar-minus:before { - content: "\f272"; } + content: "\f272"; +} .la-calendar-plus:before { - content: "\f271"; } + content: "\f271"; +} .la-calendar-times:before { - content: "\f273"; } + content: "\f273"; +} .la-calendar-week:before { - content: "\f784"; } + content: "\f784"; +} .la-camera:before { - content: "\f030"; } + content: "\f030"; +} .la-camera-retro:before { - content: "\f083"; } + content: "\f083"; +} .la-campground:before { - content: "\f6bb"; } + content: "\f6bb"; +} .la-canadian-maple-leaf:before { - content: "\f785"; } + content: "\f785"; +} .la-candy-cane:before { - content: "\f786"; } + content: "\f786"; +} .la-cannabis:before { - content: "\f55f"; } + content: "\f55f"; +} .la-capsules:before { - content: "\f46b"; } + content: "\f46b"; +} .la-car:before { - content: "\f1b9"; } + content: "\f1b9"; +} .la-car-alt:before { - content: "\f5de"; } + content: "\f5de"; +} .la-car-battery:before { - content: "\f5df"; } + content: "\f5df"; +} .la-car-crash:before { - content: "\f5e1"; } + content: "\f5e1"; +} .la-car-side:before { - content: "\f5e4"; } + content: "\f5e4"; +} .la-caret-down:before { - content: "\f0d7"; } + content: "\f0d7"; +} .la-caret-left:before { - content: "\f0d9"; } + content: "\f0d9"; +} .la-caret-right:before { - content: "\f0da"; } + content: "\f0da"; +} .la-caret-square-down:before { - content: "\f150"; } + content: "\f150"; +} .la-caret-square-left:before { - content: "\f191"; } + content: "\f191"; +} .la-caret-square-right:before { - content: "\f152"; } + content: "\f152"; +} .la-caret-square-up:before { - content: "\f151"; } + content: "\f151"; +} .la-caret-up:before { - content: "\f0d8"; } + content: "\f0d8"; +} .la-carrot:before { - content: "\f787"; } + content: "\f787"; +} .la-cart-arrow-down:before { - content: "\f218"; } + content: "\f218"; +} .la-cart-plus:before { - content: "\f217"; } + content: "\f217"; +} .la-cash-register:before { - content: "\f788"; } + content: "\f788"; +} .la-cat:before { - content: "\f6be"; } + content: "\f6be"; +} .la-cc-amazon-pay:before { - content: "\f42d"; } + content: "\f42d"; +} .la-cc-amex:before { - content: "\f1f3"; } + content: "\f1f3"; +} .la-cc-apple-pay:before { - content: "\f416"; } + content: "\f416"; +} .la-cc-diners-club:before { - content: "\f24c"; } + content: "\f24c"; +} .la-cc-discover:before { - content: "\f1f2"; } + content: "\f1f2"; +} .la-cc-jcb:before { - content: "\f24b"; } + content: "\f24b"; +} .la-cc-mastercard:before { - content: "\f1f1"; } + content: "\f1f1"; +} .la-cc-paypal:before { - content: "\f1f4"; } + content: "\f1f4"; +} .la-cc-stripe:before { - content: "\f1f5"; } + content: "\f1f5"; +} .la-cc-visa:before { - content: "\f1f0"; } + content: "\f1f0"; +} .la-centercode:before { - content: "\f380"; } + content: "\f380"; +} .la-centos:before { - content: "\f789"; } + content: "\f789"; +} .la-certificate:before { - content: "\f0a3"; } + content: "\f0a3"; +} .la-chair:before { - content: "\f6c0"; } + content: "\f6c0"; +} .la-chalkboard:before { - content: "\f51b"; } + content: "\f51b"; +} .la-chalkboard-teacher:before { - content: "\f51c"; } + content: "\f51c"; +} .la-charging-station:before { - content: "\f5e7"; } + content: "\f5e7"; +} .la-chart-area:before { - content: "\f1fe"; } + content: "\f1fe"; +} .la-chart-bar:before { - content: "\f080"; } + content: "\f080"; +} .la-chart-line:before { - content: "\f201"; } + content: "\f201"; +} .la-chart-pie:before { - content: "\f200"; } + content: "\f200"; +} .la-check:before { - content: "\f00c"; } + content: "\f00c"; +} .la-check-circle:before { - content: "\f058"; } + content: "\f058"; +} .la-check-double:before { - content: "\f560"; } + content: "\f560"; +} .la-check-square:before { - content: "\f14a"; } + content: "\f14a"; +} .la-cheese:before { - content: "\f7ef"; } + content: "\f7ef"; +} .la-chess:before { - content: "\f439"; } + content: "\f439"; +} .la-chess-bishop:before { - content: "\f43a"; } + content: "\f43a"; +} .la-chess-board:before { - content: "\f43c"; } + content: "\f43c"; +} .la-chess-king:before { - content: "\f43f"; } + content: "\f43f"; +} .la-chess-knight:before { - content: "\f441"; } + content: "\f441"; +} .la-chess-pawn:before { - content: "\f443"; } + content: "\f443"; +} .la-chess-queen:before { - content: "\f445"; } + content: "\f445"; +} .la-chess-rook:before { - content: "\f447"; } + content: "\f447"; +} .la-chevron-circle-down:before { - content: "\f13a"; } + content: "\f13a"; +} .la-chevron-circle-left:before { - content: "\f137"; } + content: "\f137"; +} .la-chevron-circle-right:before { - content: "\f138"; } + content: "\f138"; +} .la-chevron-circle-up:before { - content: "\f139"; } + content: "\f139"; +} .la-chevron-down:before { - content: "\f078"; } + content: "\f078"; +} .la-chevron-left:before { - content: "\f053"; } + content: "\f053"; +} .la-chevron-right:before { - content: "\f054"; } + content: "\f054"; +} .la-chevron-up:before { - content: "\f077"; } + content: "\f077"; +} .la-child:before { - content: "\f1ae"; } + content: "\f1ae"; +} .la-chrome:before { - content: "\f268"; } + content: "\f268"; +} .la-chromecast:before { - content: "\f838"; } + content: "\f838"; +} .la-church:before { - content: "\f51d"; } + content: "\f51d"; +} .la-circle:before { - content: "\f111"; } + content: "\f111"; +} .la-circle-notch:before { - content: "\f1ce"; } + content: "\f1ce"; +} .la-city:before { - content: "\f64f"; } + content: "\f64f"; +} .la-clinic-medical:before { - content: "\f7f2"; } + content: "\f7f2"; +} .la-clipboard:before { - content: "\f328"; } + content: "\f328"; +} .la-clipboard-check:before { - content: "\f46c"; } + content: "\f46c"; +} .la-clipboard-list:before { - content: "\f46d"; } + content: "\f46d"; +} .la-clock:before { - content: "\f017"; } + content: "\f017"; +} .la-clone:before { - content: "\f24d"; } + content: "\f24d"; +} .la-closed-captioning:before { - content: "\f20a"; } + content: "\f20a"; +} .la-cloud:before { - content: "\f0c2"; } + content: "\f0c2"; +} .la-cloud-download-alt:before { - content: "\f381"; } + content: "\f381"; +} .la-cloud-meatball:before { - content: "\f73b"; } + content: "\f73b"; +} .la-cloud-moon:before { - content: "\f6c3"; } + content: "\f6c3"; +} .la-cloud-moon-rain:before { - content: "\f73c"; } + content: "\f73c"; +} .la-cloud-rain:before { - content: "\f73d"; } + content: "\f73d"; +} .la-cloud-showers-heavy:before { - content: "\f740"; } + content: "\f740"; +} .la-cloud-sun:before { - content: "\f6c4"; } + content: "\f6c4"; +} .la-cloud-sun-rain:before { - content: "\f743"; } + content: "\f743"; +} .la-cloud-upload-alt:before { - content: "\f382"; } + content: "\f382"; +} .la-cloudscale:before { - content: "\f383"; } + content: "\f383"; +} .la-cloudsmith:before { - content: "\f384"; } + content: "\f384"; +} .la-cloudversify:before { - content: "\f385"; } + content: "\f385"; +} .la-cocktail:before { - content: "\f561"; } + content: "\f561"; +} .la-code:before { - content: "\f121"; } + content: "\f121"; +} .la-code-branch:before { - content: "\f126"; } + content: "\f126"; +} .la-codepen:before { - content: "\f1cb"; } + content: "\f1cb"; +} .la-codiepie:before { - content: "\f284"; } + content: "\f284"; +} .la-coffee:before { - content: "\f0f4"; } + content: "\f0f4"; +} .la-cog:before { - content: "\f013"; } + content: "\f013"; +} .la-cogs:before { - content: "\f085"; } + content: "\f085"; +} .la-coins:before { - content: "\f51e"; } + content: "\f51e"; +} .la-columns:before { - content: "\f0db"; } + content: "\f0db"; +} .la-comment:before { - content: "\f075"; } + content: "\f075"; +} .la-comment-alt:before { - content: "\f27a"; } + content: "\f27a"; +} .la-comment-dollar:before { - content: "\f651"; } + content: "\f651"; +} .la-comment-dots:before { - content: "\f4ad"; } + content: "\f4ad"; +} .la-comment-medical:before { - content: "\f7f5"; } + content: "\f7f5"; +} .la-comment-slash:before { - content: "\f4b3"; } + content: "\f4b3"; +} .la-comments:before { - content: "\f086"; } + content: "\f086"; +} .la-comments-dollar:before { - content: "\f653"; } + content: "\f653"; +} .la-compact-disc:before { - content: "\f51f"; } + content: "\f51f"; +} .la-compass:before { - content: "\f14e"; } + content: "\f14e"; +} .la-compress:before { - content: "\f066"; } + content: "\f066"; +} .la-compress-arrows-alt:before { - content: "\f78c"; } + content: "\f78c"; +} .la-concierge-bell:before { - content: "\f562"; } + content: "\f562"; +} .la-confluence:before { - content: "\f78d"; } + content: "\f78d"; +} .la-connectdevelop:before { - content: "\f20e"; } + content: "\f20e"; +} .la-contao:before { - content: "\f26d"; } + content: "\f26d"; +} .la-cookie:before { - content: "\f563"; } + content: "\f563"; +} .la-cookie-bite:before { - content: "\f564"; } + content: "\f564"; +} .la-copy:before { - content: "\f0c5"; } + content: "\f0c5"; +} .la-copyright:before { - content: "\f1f9"; } + content: "\f1f9"; +} .la-cotton-bureau:before { - content: "\f89e"; } + content: "\f89e"; +} .la-couch:before { - content: "\f4b8"; } + content: "\f4b8"; +} .la-cpanel:before { - content: "\f388"; } + content: "\f388"; +} .la-creative-commons:before { - content: "\f25e"; } + content: "\f25e"; +} .la-creative-commons-by:before { - content: "\f4e7"; } + content: "\f4e7"; +} .la-creative-commons-nc:before { - content: "\f4e8"; } + content: "\f4e8"; +} .la-creative-commons-nc-eu:before { - content: "\f4e9"; } + content: "\f4e9"; +} .la-creative-commons-nc-jp:before { - content: "\f4ea"; } + content: "\f4ea"; +} .la-creative-commons-nd:before { - content: "\f4eb"; } + content: "\f4eb"; +} .la-creative-commons-pd:before { - content: "\f4ec"; } + content: "\f4ec"; +} .la-creative-commons-pd-alt:before { - content: "\f4ed"; } + content: "\f4ed"; +} .la-creative-commons-remix:before { - content: "\f4ee"; } + content: "\f4ee"; +} .la-creative-commons-sa:before { - content: "\f4ef"; } + content: "\f4ef"; +} .la-creative-commons-sampling:before { - content: "\f4f0"; } + content: "\f4f0"; +} .la-creative-commons-sampling-plus:before { - content: "\f4f1"; } + content: "\f4f1"; +} .la-creative-commons-share:before { - content: "\f4f2"; } + content: "\f4f2"; +} .la-creative-commons-zero:before { - content: "\f4f3"; } + content: "\f4f3"; +} .la-credit-card:before { - content: "\f09d"; } + content: "\f09d"; +} .la-critical-role:before { - content: "\f6c9"; } + content: "\f6c9"; +} .la-crop:before { - content: "\f125"; } + content: "\f125"; +} .la-crop-alt:before { - content: "\f565"; } + content: "\f565"; +} .la-cross:before { - content: "\f654"; } + content: "\f654"; +} .la-crosshairs:before { - content: "\f05b"; } + content: "\f05b"; +} .la-crow:before { - content: "\f520"; } + content: "\f520"; +} .la-crown:before { - content: "\f521"; } + content: "\f521"; +} .la-crutch:before { - content: "\f7f7"; } + content: "\f7f7"; +} .la-css3:before { - content: "\f13c"; } + content: "\f13c"; +} .la-css3-alt:before { - content: "\f38b"; } + content: "\f38b"; +} .la-cube:before { - content: "\f1b2"; } + content: "\f1b2"; +} .la-cubes:before { - content: "\f1b3"; } + content: "\f1b3"; +} .la-cut:before { - content: "\f0c4"; } + content: "\f0c4"; +} .la-cuttlefish:before { - content: "\f38c"; } + content: "\f38c"; +} .la-d-and-d:before { - content: "\f38d"; } + content: "\f38d"; +} .la-d-and-d-beyond:before { - content: "\f6ca"; } + content: "\f6ca"; +} .la-dashcube:before { - content: "\f210"; } + content: "\f210"; +} .la-database:before { - content: "\f1c0"; } + content: "\f1c0"; +} .la-deaf:before { - content: "\f2a4"; } + content: "\f2a4"; +} .la-delicious:before { - content: "\f1a5"; } + content: "\f1a5"; +} .la-democrat:before { - content: "\f747"; } + content: "\f747"; +} .la-deploydog:before { - content: "\f38e"; } + content: "\f38e"; +} .la-deskpro:before { - content: "\f38f"; } + content: "\f38f"; +} .la-desktop:before { - content: "\f108"; } + content: "\f108"; +} .la-dev:before { - content: "\f6cc"; } + content: "\f6cc"; +} .la-deviantart:before { - content: "\f1bd"; } + content: "\f1bd"; +} .la-dharmachakra:before { - content: "\f655"; } + content: "\f655"; +} .la-dhl:before { - content: "\f790"; } + content: "\f790"; +} .la-diagnoses:before { - content: "\f470"; } + content: "\f470"; +} .la-diaspora:before { - content: "\f791"; } + content: "\f791"; +} .la-dice:before { - content: "\f522"; } + content: "\f522"; +} .la-dice-d20:before { - content: "\f6cf"; } + content: "\f6cf"; +} .la-dice-d6:before { - content: "\f6d1"; } + content: "\f6d1"; +} .la-dice-five:before { - content: "\f523"; } + content: "\f523"; +} .la-dice-four:before { - content: "\f524"; } + content: "\f524"; +} .la-dice-one:before { - content: "\f525"; } + content: "\f525"; +} .la-dice-six:before { - content: "\f526"; } + content: "\f526"; +} .la-dice-three:before { - content: "\f527"; } + content: "\f527"; +} .la-dice-two:before { - content: "\f528"; } + content: "\f528"; +} .la-digg:before { - content: "\f1a6"; } + content: "\f1a6"; +} .la-digital-ocean:before { - content: "\f391"; } + content: "\f391"; +} .la-digital-tachograph:before { - content: "\f566"; } + content: "\f566"; +} .la-directions:before { - content: "\f5eb"; } + content: "\f5eb"; +} .la-discord:before { - content: "\f392"; } + content: "\f392"; +} .la-discourse:before { - content: "\f393"; } + content: "\f393"; +} .la-divide:before { - content: "\f529"; } + content: "\f529"; +} .la-dizzy:before { - content: "\f567"; } + content: "\f567"; +} .la-dna:before { - content: "\f471"; } + content: "\f471"; +} .la-dochub:before { - content: "\f394"; } + content: "\f394"; +} .la-docker:before { - content: "\f395"; } + content: "\f395"; +} .la-dog:before { - content: "\f6d3"; } + content: "\f6d3"; +} .la-dollar-sign:before { - content: "\f155"; } + content: "\f155"; +} .la-dolly:before { - content: "\f472"; } + content: "\f472"; +} .la-dolly-flatbed:before { - content: "\f474"; } + content: "\f474"; +} .la-donate:before { - content: "\f4b9"; } + content: "\f4b9"; +} .la-door-closed:before { - content: "\f52a"; } + content: "\f52a"; +} .la-door-open:before { - content: "\f52b"; } + content: "\f52b"; +} .la-dot-circle:before { - content: "\f192"; } + content: "\f192"; +} .la-dove:before { - content: "\f4ba"; } + content: "\f4ba"; +} .la-download:before { - content: "\f019"; } + content: "\f019"; +} .la-draft2digital:before { - content: "\f396"; } + content: "\f396"; +} .la-drafting-compass:before { - content: "\f568"; } + content: "\f568"; +} .la-dragon:before { - content: "\f6d5"; } + content: "\f6d5"; +} .la-draw-polygon:before { - content: "\f5ee"; } + content: "\f5ee"; +} .la-dribbble:before { - content: "\f17d"; } + content: "\f17d"; +} .la-dribbble-square:before { - content: "\f397"; } + content: "\f397"; +} .la-dropbox:before { - content: "\f16b"; } + content: "\f16b"; +} .la-drum:before { - content: "\f569"; } + content: "\f569"; +} .la-drum-steelpan:before { - content: "\f56a"; } + content: "\f56a"; +} .la-drumstick-bite:before { - content: "\f6d7"; } + content: "\f6d7"; +} .la-drupal:before { - content: "\f1a9"; } + content: "\f1a9"; +} .la-dumbbell:before { - content: "\f44b"; } + content: "\f44b"; +} .la-dumpster:before { - content: "\f793"; } + content: "\f793"; +} .la-dumpster-fire:before { - content: "\f794"; } + content: "\f794"; +} .la-dungeon:before { - content: "\f6d9"; } + content: "\f6d9"; +} .la-dyalog:before { - content: "\f399"; } + content: "\f399"; +} .la-earlybirds:before { - content: "\f39a"; } + content: "\f39a"; +} .la-ebay:before { - content: "\f4f4"; } + content: "\f4f4"; +} .la-edge:before { - content: "\f282"; } + content: "\f282"; +} .la-edit:before { - content: "\f044"; } + content: "\f044"; +} .la-egg:before { - content: "\f7fb"; } + content: "\f7fb"; +} .la-eject:before { - content: "\f052"; } + content: "\f052"; +} .la-elementor:before { - content: "\f430"; } + content: "\f430"; +} .la-ellipsis-h:before { - content: "\f141"; } + content: "\f141"; +} .la-ellipsis-v:before { - content: "\f142"; } + content: "\f142"; +} .la-ello:before { - content: "\f5f1"; } + content: "\f5f1"; +} .la-ember:before { - content: "\f423"; } + content: "\f423"; +} .la-empire:before { - content: "\f1d1"; } + content: "\f1d1"; +} .la-envelope:before { - content: "\f0e0"; } + content: "\f0e0"; +} .la-envelope-open:before { - content: "\f2b6"; } + content: "\f2b6"; +} .la-envelope-open-text:before { - content: "\f658"; } + content: "\f658"; +} .la-envelope-square:before { - content: "\f199"; } + content: "\f199"; +} .la-envira:before { - content: "\f299"; } + content: "\f299"; +} .la-equals:before { - content: "\f52c"; } + content: "\f52c"; +} .la-eraser:before { - content: "\f12d"; } + content: "\f12d"; +} .la-erlang:before { - content: "\f39d"; } + content: "\f39d"; +} .la-ethereum:before { - content: "\f42e"; } + content: "\f42e"; +} .la-ethernet:before { - content: "\f796"; } + content: "\f796"; +} .la-etsy:before { - content: "\f2d7"; } + content: "\f2d7"; +} .la-euro-sign:before { - content: "\f153"; } + content: "\f153"; +} .la-evernote:before { - content: "\f839"; } + content: "\f839"; +} .la-exchange-alt:before { - content: "\f362"; } + content: "\f362"; +} .la-exclamation:before { - content: "\f12a"; } + content: "\f12a"; +} .la-exclamation-circle:before { - content: "\f06a"; } + content: "\f06a"; +} .la-exclamation-triangle:before { - content: "\f071"; } + content: "\f071"; +} .la-expand:before { - content: "\f065"; } + content: "\f065"; +} .la-expand-arrows-alt:before { - content: "\f31e"; } + content: "\f31e"; +} .la-expeditedssl:before { - content: "\f23e"; } + content: "\f23e"; +} .la-external-link-alt:before { - content: "\f35d"; } + content: "\f35d"; +} .la-external-link-square-alt:before { - content: "\f360"; } + content: "\f360"; +} .la-eye:before { - content: "\f06e"; } + content: "\f06e"; +} .la-eye-dropper:before { - content: "\f1fb"; } + content: "\f1fb"; +} .la-eye-slash:before { - content: "\f070"; } + content: "\f070"; +} .la-facebook:before { - content: "\f09a"; } + content: "\f09a"; +} .la-facebook-f:before { - content: "\f39e"; } + content: "\f39e"; +} .la-facebook-messenger:before { - content: "\f39f"; } + content: "\f39f"; +} .la-facebook-square:before { - content: "\f082"; } + content: "\f082"; +} .la-fan:before { - content: "\f863"; } + content: "\f863"; +} .la-fantasy-flight-games:before { - content: "\f6dc"; } + content: "\f6dc"; +} .la-fast-backward:before { - content: "\f049"; } + content: "\f049"; +} .la-fast-forward:before { - content: "\f050"; } + content: "\f050"; +} .la-fax:before { - content: "\f1ac"; } + content: "\f1ac"; +} .la-feather:before { - content: "\f52d"; } + content: "\f52d"; +} .la-feather-alt:before { - content: "\f56b"; } + content: "\f56b"; +} .la-fedex:before { - content: "\f797"; } + content: "\f797"; +} .la-fedora:before { - content: "\f798"; } + content: "\f798"; +} .la-female:before { - content: "\f182"; } + content: "\f182"; +} .la-fighter-jet:before { - content: "\f0fb"; } + content: "\f0fb"; +} .la-figma:before { - content: "\f799"; } + content: "\f799"; +} .la-file:before { - content: "\f15b"; } + content: "\f15b"; +} .la-file-alt:before { - content: "\f15c"; } + content: "\f15c"; +} .la-file-archive:before { - content: "\f1c6"; } + content: "\f1c6"; +} .la-file-audio:before { - content: "\f1c7"; } + content: "\f1c7"; +} .la-file-code:before { - content: "\f1c9"; } + content: "\f1c9"; +} .la-file-contract:before { - content: "\f56c"; } + content: "\f56c"; +} .la-file-csv:before { - content: "\f6dd"; } + content: "\f6dd"; +} .la-file-download:before { - content: "\f56d"; } + content: "\f56d"; +} .la-file-excel:before { - content: "\f1c3"; } + content: "\f1c3"; +} .la-file-export:before { - content: "\f56e"; } + content: "\f56e"; +} .la-file-image:before { - content: "\f1c5"; } + content: "\f1c5"; +} .la-file-import:before { - content: "\f56f"; } + content: "\f56f"; +} .la-file-invoice:before { - content: "\f570"; } + content: "\f570"; +} .la-file-invoice-dollar:before { - content: "\f571"; } + content: "\f571"; +} .la-file-medical:before { - content: "\f477"; } + content: "\f477"; +} .la-file-medical-alt:before { - content: "\f478"; } + content: "\f478"; +} .la-file-pdf:before { - content: "\f1c1"; } + content: "\f1c1"; +} .la-file-powerpoint:before { - content: "\f1c4"; } + content: "\f1c4"; +} .la-file-prescription:before { - content: "\f572"; } + content: "\f572"; +} .la-file-signature:before { - content: "\f573"; } + content: "\f573"; +} .la-file-upload:before { - content: "\f574"; } + content: "\f574"; +} .la-file-video:before { - content: "\f1c8"; } + content: "\f1c8"; +} .la-file-word:before { - content: "\f1c2"; } + content: "\f1c2"; +} .la-fill:before { - content: "\f575"; } + content: "\f575"; +} .la-fill-drip:before { - content: "\f576"; } + content: "\f576"; +} .la-film:before { - content: "\f008"; } + content: "\f008"; +} .la-filter:before { - content: "\f0b0"; } + content: "\f0b0"; +} .la-fingerprint:before { - content: "\f577"; } + content: "\f577"; +} .la-fire:before { - content: "\f06d"; } + content: "\f06d"; +} .la-fire-alt:before { - content: "\f7e4"; } + content: "\f7e4"; +} .la-fire-extinguisher:before { - content: "\f134"; } + content: "\f134"; +} .la-firefox:before { - content: "\f269"; } + content: "\f269"; +} .la-first-aid:before { - content: "\f479"; } + content: "\f479"; +} .la-first-order:before { - content: "\f2b0"; } + content: "\f2b0"; +} .la-first-order-alt:before { - content: "\f50a"; } + content: "\f50a"; +} .la-firstdraft:before { - content: "\f3a1"; } + content: "\f3a1"; +} .la-fish:before { - content: "\f578"; } + content: "\f578"; +} .la-fist-raised:before { - content: "\f6de"; } + content: "\f6de"; +} .la-flag:before { - content: "\f024"; } + content: "\f024"; +} .la-flag-checkered:before { - content: "\f11e"; } + content: "\f11e"; +} .la-flag-usa:before { - content: "\f74d"; } + content: "\f74d"; +} .la-flask:before { - content: "\f0c3"; } + content: "\f0c3"; +} .la-flickr:before { - content: "\f16e"; } + content: "\f16e"; +} .la-flipboard:before { - content: "\f44d"; } + content: "\f44d"; +} .la-flushed:before { - content: "\f579"; } + content: "\f579"; +} .la-fly:before { - content: "\f417"; } + content: "\f417"; +} .la-folder:before { - content: "\f07b"; } + content: "\f07b"; +} .la-folder-minus:before { - content: "\f65d"; } + content: "\f65d"; +} .la-folder-open:before { - content: "\f07c"; } + content: "\f07c"; +} .la-folder-plus:before { - content: "\f65e"; } + content: "\f65e"; +} .la-font:before { - content: "\f031"; } + content: "\f031"; +} .la-font-awesome:before { - content: "\f2b4"; } + content: "\f2b4"; +} .la-font-awesome-alt:before { - content: "\f35c"; } + content: "\f35c"; +} .la-font-awesome-flag:before { - content: "\f425"; } + content: "\f425"; +} .la-font-awesome-logo-full:before { - content: "\f4e6"; } + content: "\f4e6"; +} .la-fonticons:before { - content: "\f280"; } + content: "\f280"; +} .la-fonticons-fi:before { - content: "\f3a2"; } + content: "\f3a2"; +} .la-football-ball:before { - content: "\f44e"; } + content: "\f44e"; +} .la-fort-awesome:before { - content: "\f286"; } + content: "\f286"; +} .la-fort-awesome-alt:before { - content: "\f3a3"; } + content: "\f3a3"; +} .la-forumbee:before { - content: "\f211"; } + content: "\f211"; +} .la-forward:before { - content: "\f04e"; } + content: "\f04e"; +} .la-foursquare:before { - content: "\f180"; } + content: "\f180"; +} .la-free-code-camp:before { - content: "\f2c5"; } + content: "\f2c5"; +} .la-freebsd:before { - content: "\f3a4"; } + content: "\f3a4"; +} .la-frog:before { - content: "\f52e"; } + content: "\f52e"; +} .la-frown:before { - content: "\f119"; } + content: "\f119"; +} .la-frown-open:before { - content: "\f57a"; } + content: "\f57a"; +} .la-fulcrum:before { - content: "\f50b"; } + content: "\f50b"; +} .la-funnel-dollar:before { - content: "\f662"; } + content: "\f662"; +} .la-futbol:before { - content: "\f1e3"; } + content: "\f1e3"; +} .la-galactic-republic:before { - content: "\f50c"; } + content: "\f50c"; +} .la-galactic-senate:before { - content: "\f50d"; } + content: "\f50d"; +} .la-gamepad:before { - content: "\f11b"; } + content: "\f11b"; +} .la-gas-pump:before { - content: "\f52f"; } + content: "\f52f"; +} .la-gavel:before { - content: "\f0e3"; } + content: "\f0e3"; +} .la-gem:before { - content: "\f3a5"; } + content: "\f3a5"; +} .la-genderless:before { - content: "\f22d"; } + content: "\f22d"; +} .la-get-pocket:before { - content: "\f265"; } + content: "\f265"; +} .la-gg:before { - content: "\f260"; } + content: "\f260"; +} .la-gg-circle:before { - content: "\f261"; } + content: "\f261"; +} .la-ghost:before { - content: "\f6e2"; } + content: "\f6e2"; +} .la-gift:before { - content: "\f06b"; } + content: "\f06b"; +} .la-gifts:before { - content: "\f79c"; } + content: "\f79c"; +} .la-git:before { - content: "\f1d3"; } + content: "\f1d3"; +} .la-git-alt:before { - content: "\f841"; } + content: "\f841"; +} .la-git-square:before { - content: "\f1d2"; } + content: "\f1d2"; +} .la-github:before { - content: "\f09b"; } + content: "\f09b"; +} .la-github-alt:before { - content: "\f113"; } + content: "\f113"; +} .la-github-square:before { - content: "\f092"; } + content: "\f092"; +} .la-gitkraken:before { - content: "\f3a6"; } + content: "\f3a6"; +} .la-gitlab:before { - content: "\f296"; } + content: "\f296"; +} .la-gitter:before { - content: "\f426"; } + content: "\f426"; +} .la-glass-cheers:before { - content: "\f79f"; } + content: "\f79f"; +} .la-glass-martini:before { - content: "\f000"; } + content: "\f000"; +} .la-glass-martini-alt:before { - content: "\f57b"; } + content: "\f57b"; +} .la-glass-whiskey:before { - content: "\f7a0"; } + content: "\f7a0"; +} .la-glasses:before { - content: "\f530"; } + content: "\f530"; +} .la-glide:before { - content: "\f2a5"; } + content: "\f2a5"; +} .la-glide-g:before { - content: "\f2a6"; } + content: "\f2a6"; +} .la-globe:before { - content: "\f0ac"; } + content: "\f0ac"; +} .la-globe-africa:before { - content: "\f57c"; } + content: "\f57c"; +} .la-globe-americas:before { - content: "\f57d"; } + content: "\f57d"; +} .la-globe-asia:before { - content: "\f57e"; } + content: "\f57e"; +} .la-globe-europe:before { - content: "\f7a2"; } + content: "\f7a2"; +} .la-gofore:before { - content: "\f3a7"; } + content: "\f3a7"; +} .la-golf-ball:before { - content: "\f450"; } + content: "\f450"; +} .la-goodreads:before { - content: "\f3a8"; } + content: "\f3a8"; +} .la-goodreads-g:before { - content: "\f3a9"; } + content: "\f3a9"; +} .la-google:before { - content: "\f1a0"; } + content: "\f1a0"; +} .la-google-drive:before { - content: "\f3aa"; } + content: "\f3aa"; +} .la-google-play:before { - content: "\f3ab"; } + content: "\f3ab"; +} .la-google-plus:before { - content: "\f2b3"; } + content: "\f2b3"; +} .la-google-plus-g:before { - content: "\f0d5"; } + content: "\f0d5"; +} .la-google-plus-square:before { - content: "\f0d4"; } + content: "\f0d4"; +} .la-google-wallet:before { - content: "\f1ee"; } + content: "\f1ee"; +} .la-gopuram:before { - content: "\f664"; } + content: "\f664"; +} .la-graduation-cap:before { - content: "\f19d"; } + content: "\f19d"; +} .la-gratipay:before { - content: "\f184"; } + content: "\f184"; +} .la-grav:before { - content: "\f2d6"; } + content: "\f2d6"; +} .la-greater-than:before { - content: "\f531"; } + content: "\f531"; +} .la-greater-than-equal:before { - content: "\f532"; } + content: "\f532"; +} .la-grimace:before { - content: "\f57f"; } + content: "\f57f"; +} .la-grin:before { - content: "\f580"; } + content: "\f580"; +} .la-grin-alt:before { - content: "\f581"; } + content: "\f581"; +} .la-grin-beam:before { - content: "\f582"; } + content: "\f582"; +} .la-grin-beam-sweat:before { - content: "\f583"; } + content: "\f583"; +} .la-grin-hearts:before { - content: "\f584"; } + content: "\f584"; +} .la-grin-squint:before { - content: "\f585"; } + content: "\f585"; +} .la-grin-squint-tears:before { - content: "\f586"; } + content: "\f586"; +} .la-grin-stars:before { - content: "\f587"; } + content: "\f587"; +} .la-grin-tears:before { - content: "\f588"; } + content: "\f588"; +} .la-grin-tongue:before { - content: "\f589"; } + content: "\f589"; +} .la-grin-tongue-squint:before { - content: "\f58a"; } + content: "\f58a"; +} .la-grin-tongue-wink:before { - content: "\f58b"; } + content: "\f58b"; +} .la-grin-wink:before { - content: "\f58c"; } + content: "\f58c"; +} .la-grip-horizontal:before { - content: "\f58d"; } + content: "\f58d"; +} .la-grip-lines:before { - content: "\f7a4"; } + content: "\f7a4"; +} .la-grip-lines-vertical:before { - content: "\f7a5"; } + content: "\f7a5"; +} .la-grip-vertical:before { - content: "\f58e"; } + content: "\f58e"; +} .la-gripfire:before { - content: "\f3ac"; } + content: "\f3ac"; +} .la-grunt:before { - content: "\f3ad"; } + content: "\f3ad"; +} .la-guitar:before { - content: "\f7a6"; } + content: "\f7a6"; +} .la-gulp:before { - content: "\f3ae"; } + content: "\f3ae"; +} .la-h-square:before { - content: "\f0fd"; } + content: "\f0fd"; +} .la-hacker-news:before { - content: "\f1d4"; } + content: "\f1d4"; +} .la-hacker-news-square:before { - content: "\f3af"; } + content: "\f3af"; +} .la-hackerrank:before { - content: "\f5f7"; } + content: "\f5f7"; +} .la-hamburger:before { - content: "\f805"; } + content: "\f805"; +} .la-hammer:before { - content: "\f6e3"; } + content: "\f6e3"; +} .la-hamsa:before { - content: "\f665"; } + content: "\f665"; +} .la-hand-holding:before { - content: "\f4bd"; } + content: "\f4bd"; +} .la-hand-holding-heart:before { - content: "\f4be"; } + content: "\f4be"; +} .la-hand-holding-usd:before { - content: "\f4c0"; } + content: "\f4c0"; +} .la-hand-lizard:before { - content: "\f258"; } + content: "\f258"; +} .la-hand-middle-finger:before { - content: "\f806"; } + content: "\f806"; +} .la-hand-paper:before { - content: "\f256"; } + content: "\f256"; +} .la-hand-peace:before { - content: "\f25b"; } + content: "\f25b"; +} .la-hand-point-down:before { - content: "\f0a7"; } + content: "\f0a7"; +} .la-hand-point-left:before { - content: "\f0a5"; } + content: "\f0a5"; +} .la-hand-point-right:before { - content: "\f0a4"; } + content: "\f0a4"; +} .la-hand-point-up:before { - content: "\f0a6"; } + content: "\f0a6"; +} .la-hand-pointer:before { - content: "\f25a"; } + content: "\f25a"; +} .la-hand-rock:before { - content: "\f255"; } + content: "\f255"; +} .la-hand-scissors:before { - content: "\f257"; } + content: "\f257"; +} .la-hand-spock:before { - content: "\f259"; } + content: "\f259"; +} .la-hands:before { - content: "\f4c2"; } + content: "\f4c2"; +} .la-hands-helping:before { - content: "\f4c4"; } + content: "\f4c4"; +} .la-handshake:before { - content: "\f2b5"; } + content: "\f2b5"; +} .la-hanukiah:before { - content: "\f6e6"; } + content: "\f6e6"; +} .la-hard-hat:before { - content: "\f807"; } + content: "\f807"; +} .la-hashtag:before { - content: "\f292"; } + content: "\f292"; +} .la-hat-cowboy:before { - content: "\f8c0"; } + content: "\f8c0"; +} .la-hat-cowboy-side:before { - content: "\f8c1"; } + content: "\f8c1"; +} .la-hat-wizard:before { - content: "\f6e8"; } + content: "\f6e8"; +} .la-haykal:before { - content: "\f666"; } + content: "\f666"; +} .la-hdd:before { - content: "\f0a0"; } + content: "\f0a0"; +} .la-heading:before { - content: "\f1dc"; } + content: "\f1dc"; +} .la-headphones:before { - content: "\f025"; } + content: "\f025"; +} .la-headphones-alt:before { - content: "\f58f"; } + content: "\f58f"; +} .la-headset:before { - content: "\f590"; } + content: "\f590"; +} .la-heart:before { - content: "\f004"; } + content: "\f004"; +} .la-heart-broken:before { - content: "\f7a9"; } + content: "\f7a9"; +} .la-heartbeat:before { - content: "\f21e"; } + content: "\f21e"; +} .la-helicopter:before { - content: "\f533"; } + content: "\f533"; +} .la-highlighter:before { - content: "\f591"; } + content: "\f591"; +} .la-hiking:before { - content: "\f6ec"; } + content: "\f6ec"; +} .la-hippo:before { - content: "\f6ed"; } + content: "\f6ed"; +} .la-hips:before { - content: "\f452"; } + content: "\f452"; +} .la-hire-a-helper:before { - content: "\f3b0"; } + content: "\f3b0"; +} .la-history:before { - content: "\f1da"; } + content: "\f1da"; +} .la-hockey-puck:before { - content: "\f453"; } + content: "\f453"; +} .la-holly-berry:before { - content: "\f7aa"; } + content: "\f7aa"; +} .la-home:before { - content: "\f015"; } + content: "\f015"; +} .la-hooli:before { - content: "\f427"; } + content: "\f427"; +} .la-hornbill:before { - content: "\f592"; } + content: "\f592"; +} .la-horse:before { - content: "\f6f0"; } + content: "\f6f0"; +} .la-horse-head:before { - content: "\f7ab"; } + content: "\f7ab"; +} .la-hospital:before { - content: "\f0f8"; } + content: "\f0f8"; +} .la-hospital-alt:before { - content: "\f47d"; } + content: "\f47d"; +} .la-hospital-symbol:before { - content: "\f47e"; } + content: "\f47e"; +} .la-hot-tub:before { - content: "\f593"; } + content: "\f593"; +} .la-hotdog:before { - content: "\f80f"; } + content: "\f80f"; +} .la-hotel:before { - content: "\f594"; } + content: "\f594"; +} .la-hotjar:before { - content: "\f3b1"; } + content: "\f3b1"; +} .la-hourglass:before { - content: "\f254"; } + content: "\f254"; +} .la-hourglass-end:before { - content: "\f253"; } + content: "\f253"; +} .la-hourglass-half:before { - content: "\f252"; } + content: "\f252"; +} .la-hourglass-start:before { - content: "\f251"; } + content: "\f251"; +} .la-house-damage:before { - content: "\f6f1"; } + content: "\f6f1"; +} .la-houzz:before { - content: "\f27c"; } + content: "\f27c"; +} .la-hryvnia:before { - content: "\f6f2"; } + content: "\f6f2"; +} .la-html5:before { - content: "\f13b"; } + content: "\f13b"; +} .la-hubspot:before { - content: "\f3b2"; } + content: "\f3b2"; +} .la-i-cursor:before { - content: "\f246"; } + content: "\f246"; +} .la-ice-cream:before { - content: "\f810"; } + content: "\f810"; +} .la-icicles:before { - content: "\f7ad"; } + content: "\f7ad"; +} .la-icons:before { - content: "\f86d"; } + content: "\f86d"; +} .la-id-badge:before { - content: "\f2c1"; } + content: "\f2c1"; +} .la-id-card:before { - content: "\f2c2"; } + content: "\f2c2"; +} .la-id-card-alt:before { - content: "\f47f"; } + content: "\f47f"; +} .la-igloo:before { - content: "\f7ae"; } + content: "\f7ae"; +} .la-image:before { - content: "\f03e"; } + content: "\f03e"; +} .la-images:before { - content: "\f302"; } + content: "\f302"; +} .la-imdb:before { - content: "\f2d8"; } + content: "\f2d8"; +} .la-inbox:before { - content: "\f01c"; } + content: "\f01c"; +} .la-indent:before { - content: "\f03c"; } + content: "\f03c"; +} .la-industry:before { - content: "\f275"; } + content: "\f275"; +} .la-infinity:before { - content: "\f534"; } + content: "\f534"; +} .la-info:before { - content: "\f129"; } + content: "\f129"; +} .la-info-circle:before { - content: "\f05a"; } + content: "\f05a"; +} .la-instagram:before { - content: "\f16d"; } + content: "\f16d"; +} .la-intercom:before { - content: "\f7af"; } + content: "\f7af"; +} .la-internet-explorer:before { - content: "\f26b"; } + content: "\f26b"; +} .la-invision:before { - content: "\f7b0"; } + content: "\f7b0"; +} .la-ioxhost:before { - content: "\f208"; } + content: "\f208"; +} .la-italic:before { - content: "\f033"; } + content: "\f033"; +} .la-itch-io:before { - content: "\f83a"; } + content: "\f83a"; +} .la-itunes:before { - content: "\f3b4"; } + content: "\f3b4"; +} .la-itunes-note:before { - content: "\f3b5"; } + content: "\f3b5"; +} .la-java:before { - content: "\f4e4"; } + content: "\f4e4"; +} .la-jedi:before { - content: "\f669"; } + content: "\f669"; +} .la-jedi-order:before { - content: "\f50e"; } + content: "\f50e"; +} .la-jenkins:before { - content: "\f3b6"; } + content: "\f3b6"; +} .la-jira:before { - content: "\f7b1"; } + content: "\f7b1"; +} .la-joget:before { - content: "\f3b7"; } + content: "\f3b7"; +} .la-joint:before { - content: "\f595"; } + content: "\f595"; +} .la-joomla:before { - content: "\f1aa"; } + content: "\f1aa"; +} .la-journal-whills:before { - content: "\f66a"; } + content: "\f66a"; +} .la-js:before { - content: "\f3b8"; } + content: "\f3b8"; +} .la-js-square:before { - content: "\f3b9"; } + content: "\f3b9"; +} .la-jsfiddle:before { - content: "\f1cc"; } + content: "\f1cc"; +} .la-kaaba:before { - content: "\f66b"; } + content: "\f66b"; +} .la-kaggle:before { - content: "\f5fa"; } + content: "\f5fa"; +} .la-key:before { - content: "\f084"; } + content: "\f084"; +} .la-keybase:before { - content: "\f4f5"; } + content: "\f4f5"; +} .la-keyboard:before { - content: "\f11c"; } + content: "\f11c"; +} .la-keycdn:before { - content: "\f3ba"; } + content: "\f3ba"; +} .la-khanda:before { - content: "\f66d"; } + content: "\f66d"; +} .la-kickstarter:before { - content: "\f3bb"; } + content: "\f3bb"; +} .la-kickstarter-k:before { - content: "\f3bc"; } + content: "\f3bc"; +} .la-kiss:before { - content: "\f596"; } + content: "\f596"; +} .la-kiss-beam:before { - content: "\f597"; } + content: "\f597"; +} .la-kiss-wink-heart:before { - content: "\f598"; } + content: "\f598"; +} .la-kiwi-bird:before { - content: "\f535"; } + content: "\f535"; +} .la-korvue:before { - content: "\f42f"; } + content: "\f42f"; +} .la-landmark:before { - content: "\f66f"; } + content: "\f66f"; +} .la-language:before { - content: "\f1ab"; } + content: "\f1ab"; +} .la-laptop:before { - content: "\f109"; } + content: "\f109"; +} .la-laptop-code:before { - content: "\f5fc"; } + content: "\f5fc"; +} .la-laptop-medical:before { - content: "\f812"; } + content: "\f812"; +} .la-laravel:before { - content: "\f3bd"; } + content: "\f3bd"; +} .la-lastfm:before { - content: "\f202"; } + content: "\f202"; +} .la-lastfm-square:before { - content: "\f203"; } + content: "\f203"; +} .la-laugh:before { - content: "\f599"; } + content: "\f599"; +} .la-laugh-beam:before { - content: "\f59a"; } + content: "\f59a"; +} .la-laugh-squint:before { - content: "\f59b"; } + content: "\f59b"; +} .la-laugh-wink:before { - content: "\f59c"; } + content: "\f59c"; +} .la-layer-group:before { - content: "\f5fd"; } + content: "\f5fd"; +} .la-leaf:before { - content: "\f06c"; } + content: "\f06c"; +} .la-leanpub:before { - content: "\f212"; } + content: "\f212"; +} .la-lemon:before { - content: "\f094"; } + content: "\f094"; +} .la-less:before { - content: "\f41d"; } + content: "\f41d"; +} .la-less-than:before { - content: "\f536"; } + content: "\f536"; +} .la-less-than-equal:before { - content: "\f537"; } + content: "\f537"; +} .la-level-down-alt:before { - content: "\f3be"; } + content: "\f3be"; +} .la-level-up-alt:before { - content: "\f3bf"; } + content: "\f3bf"; +} .la-life-ring:before { - content: "\f1cd"; } + content: "\f1cd"; +} .la-lightbulb:before { - content: "\f0eb"; } + content: "\f0eb"; +} .la-line:before { - content: "\f3c0"; } + content: "\f3c0"; +} .la-link:before { - content: "\f0c1"; } + content: "\f0c1"; +} .la-linkedin:before { - content: "\f08c"; } + content: "\f08c"; +} .la-linkedin-in:before { - content: "\f0e1"; } + content: "\f0e1"; +} .la-linode:before { - content: "\f2b8"; } + content: "\f2b8"; +} .la-linux:before { - content: "\f17c"; } + content: "\f17c"; +} .la-lira-sign:before { - content: "\f195"; } + content: "\f195"; +} .la-list:before { - content: "\f03a"; } + content: "\f03a"; +} .la-list-alt:before { - content: "\f022"; } + content: "\f022"; +} .la-list-ol:before { - content: "\f0cb"; } + content: "\f0cb"; +} .la-list-ul:before { - content: "\f0ca"; } + content: "\f0ca"; +} .la-location-arrow:before { - content: "\f124"; } + content: "\f124"; +} .la-lock:before { - content: "\f023"; } + content: "\f023"; +} .la-lock-open:before { - content: "\f3c1"; } + content: "\f3c1"; +} .la-long-arrow-alt-down:before { - content: "\f309"; } + content: "\f309"; +} .la-long-arrow-alt-left:before { - content: "\f30a"; } + content: "\f30a"; +} .la-long-arrow-alt-right:before { - content: "\f30b"; } + content: "\f30b"; +} .la-long-arrow-alt-up:before { - content: "\f30c"; } + content: "\f30c"; +} .la-low-vision:before { - content: "\f2a8"; } + content: "\f2a8"; +} .la-luggage-cart:before { - content: "\f59d"; } + content: "\f59d"; +} .la-lyft:before { - content: "\f3c3"; } + content: "\f3c3"; +} .la-magento:before { - content: "\f3c4"; } + content: "\f3c4"; +} .la-magic:before { - content: "\f0d0"; } + content: "\f0d0"; +} .la-magnet:before { - content: "\f076"; } + content: "\f076"; +} .la-mail-bulk:before { - content: "\f674"; } + content: "\f674"; +} .la-mailchimp:before { - content: "\f59e"; } + content: "\f59e"; +} .la-male:before { - content: "\f183"; } + content: "\f183"; +} .la-mandalorian:before { - content: "\f50f"; } + content: "\f50f"; +} .la-map:before { - content: "\f279"; } + content: "\f279"; +} .la-map-marked:before { - content: "\f59f"; } + content: "\f59f"; +} .la-map-marked-alt:before { - content: "\f5a0"; } + content: "\f5a0"; +} .la-map-marker:before { - content: "\f041"; } + content: "\f041"; +} .la-map-marker-alt:before { - content: "\f3c5"; } + content: "\f3c5"; +} .la-map-pin:before { - content: "\f276"; } + content: "\f276"; +} .la-map-signs:before { - content: "\f277"; } + content: "\f277"; +} .la-markdown:before { - content: "\f60f"; } + content: "\f60f"; +} .la-marker:before { - content: "\f5a1"; } + content: "\f5a1"; +} .la-mars:before { - content: "\f222"; } + content: "\f222"; +} .la-mars-double:before { - content: "\f227"; } + content: "\f227"; +} .la-mars-stroke:before { - content: "\f229"; } + content: "\f229"; +} .la-mars-stroke-h:before { - content: "\f22b"; } + content: "\f22b"; +} .la-mars-stroke-v:before { - content: "\f22a"; } + content: "\f22a"; +} .la-mask:before { - content: "\f6fa"; } + content: "\f6fa"; +} .la-mastodon:before { - content: "\f4f6"; } + content: "\f4f6"; +} .la-maxcdn:before { - content: "\f136"; } + content: "\f136"; +} .la-mdb:before { - content: "\f8ca"; } + content: "\f8ca"; +} .la-medal:before { - content: "\f5a2"; } + content: "\f5a2"; +} .la-medapps:before { - content: "\f3c6"; } + content: "\f3c6"; +} .la-medium:before { - content: "\f23a"; } + content: "\f23a"; +} .la-medium-m:before { - content: "\f3c7"; } + content: "\f3c7"; +} .la-medkit:before { - content: "\f0fa"; } + content: "\f0fa"; +} .la-medrt:before { - content: "\f3c8"; } + content: "\f3c8"; +} .la-meetup:before { - content: "\f2e0"; } + content: "\f2e0"; +} .la-megaport:before { - content: "\f5a3"; } + content: "\f5a3"; +} .la-meh:before { - content: "\f11a"; } + content: "\f11a"; +} .la-meh-blank:before { - content: "\f5a4"; } + content: "\f5a4"; +} .la-meh-rolling-eyes:before { - content: "\f5a5"; } + content: "\f5a5"; +} .la-memory:before { - content: "\f538"; } + content: "\f538"; +} .la-mendeley:before { - content: "\f7b3"; } + content: "\f7b3"; +} .la-menorah:before { - content: "\f676"; } + content: "\f676"; +} .la-mercury:before { - content: "\f223"; } + content: "\f223"; +} .la-meteor:before { - content: "\f753"; } + content: "\f753"; +} .la-microchip:before { - content: "\f2db"; } + content: "\f2db"; +} .la-microphone:before { - content: "\f130"; } + content: "\f130"; +} .la-microphone-alt:before { - content: "\f3c9"; } + content: "\f3c9"; +} .la-microphone-alt-slash:before { - content: "\f539"; } + content: "\f539"; +} .la-microphone-slash:before { - content: "\f131"; } + content: "\f131"; +} .la-microscope:before { - content: "\f610"; } + content: "\f610"; +} .la-microsoft:before { - content: "\f3ca"; } + content: "\f3ca"; +} .la-minus:before { - content: "\f068"; } + content: "\f068"; +} .la-minus-circle:before { - content: "\f056"; } + content: "\f056"; +} .la-minus-square:before { - content: "\f146"; } + content: "\f146"; +} .la-mitten:before { - content: "\f7b5"; } + content: "\f7b5"; +} .la-mix:before { - content: "\f3cb"; } + content: "\f3cb"; +} .la-mixcloud:before { - content: "\f289"; } + content: "\f289"; +} .la-mizuni:before { - content: "\f3cc"; } + content: "\f3cc"; +} .la-mobile:before { - content: "\f10b"; } + content: "\f10b"; +} .la-mobile-alt:before { - content: "\f3cd"; } + content: "\f3cd"; +} .la-modx:before { - content: "\f285"; } + content: "\f285"; +} .la-monero:before { - content: "\f3d0"; } + content: "\f3d0"; +} .la-money-bill:before { - content: "\f0d6"; } + content: "\f0d6"; +} .la-money-bill-alt:before { - content: "\f3d1"; } + content: "\f3d1"; +} .la-money-bill-wave:before { - content: "\f53a"; } + content: "\f53a"; +} .la-money-bill-wave-alt:before { - content: "\f53b"; } + content: "\f53b"; +} .la-money-check:before { - content: "\f53c"; } + content: "\f53c"; +} .la-money-check-alt:before { - content: "\f53d"; } + content: "\f53d"; +} .la-monument:before { - content: "\f5a6"; } + content: "\f5a6"; +} .la-moon:before { - content: "\f186"; } + content: "\f186"; +} .la-mortar-pestle:before { - content: "\f5a7"; } + content: "\f5a7"; +} .la-mosque:before { - content: "\f678"; } + content: "\f678"; +} .la-motorcycle:before { - content: "\f21c"; } + content: "\f21c"; +} .la-mountain:before { - content: "\f6fc"; } + content: "\f6fc"; +} .la-mouse:before { - content: "\f8cc"; } + content: "\f8cc"; +} .la-mouse-pointer:before { - content: "\f245"; } + content: "\f245"; +} .la-mug-hot:before { - content: "\f7b6"; } + content: "\f7b6"; +} .la-music:before { - content: "\f001"; } + content: "\f001"; +} .la-napster:before { - content: "\f3d2"; } + content: "\f3d2"; +} .la-neos:before { - content: "\f612"; } + content: "\f612"; +} .la-network-wired:before { - content: "\f6ff"; } + content: "\f6ff"; +} .la-neuter:before { - content: "\f22c"; } + content: "\f22c"; +} .la-newspaper:before { - content: "\f1ea"; } + content: "\f1ea"; +} .la-nimblr:before { - content: "\f5a8"; } + content: "\f5a8"; +} .la-node:before { - content: "\f419"; } + content: "\f419"; +} .la-node-js:before { - content: "\f3d3"; } + content: "\f3d3"; +} .la-not-equal:before { - content: "\f53e"; } + content: "\f53e"; +} .la-notes-medical:before { - content: "\f481"; } + content: "\f481"; +} .la-npm:before { - content: "\f3d4"; } + content: "\f3d4"; +} .la-ns8:before { - content: "\f3d5"; } + content: "\f3d5"; +} .la-nutritionix:before { - content: "\f3d6"; } + content: "\f3d6"; +} .la-object-group:before { - content: "\f247"; } + content: "\f247"; +} .la-object-ungroup:before { - content: "\f248"; } + content: "\f248"; +} .la-odnoklassniki:before { - content: "\f263"; } + content: "\f263"; +} .la-odnoklassniki-square:before { - content: "\f264"; } + content: "\f264"; +} .la-oil-can:before { - content: "\f613"; } + content: "\f613"; +} .la-old-republic:before { - content: "\f510"; } + content: "\f510"; +} .la-om:before { - content: "\f679"; } + content: "\f679"; +} .la-opencart:before { - content: "\f23d"; } + content: "\f23d"; +} .la-openid:before { - content: "\f19b"; } + content: "\f19b"; +} .la-opera:before { - content: "\f26a"; } + content: "\f26a"; +} .la-optin-monster:before { - content: "\f23c"; } + content: "\f23c"; +} .la-orcid:before { - content: "\f8d2"; } + content: "\f8d2"; +} .la-osi:before { - content: "\f41a"; } + content: "\f41a"; +} .la-otter:before { - content: "\f700"; } + content: "\f700"; +} .la-outdent:before { - content: "\f03b"; } + content: "\f03b"; +} .la-page4:before { - content: "\f3d7"; } + content: "\f3d7"; +} .la-pagelines:before { - content: "\f18c"; } + content: "\f18c"; +} .la-pager:before { - content: "\f815"; } + content: "\f815"; +} .la-paint-brush:before { - content: "\f1fc"; } + content: "\f1fc"; +} .la-paint-roller:before { - content: "\f5aa"; } + content: "\f5aa"; +} .la-palette:before { - content: "\f53f"; } + content: "\f53f"; +} .la-palfed:before { - content: "\f3d8"; } + content: "\f3d8"; +} .la-pallet:before { - content: "\f482"; } + content: "\f482"; +} .la-paper-plane:before { - content: "\f1d8"; } + content: "\f1d8"; +} .la-paperclip:before { - content: "\f0c6"; } + content: "\f0c6"; +} .la-parachute-box:before { - content: "\f4cd"; } + content: "\f4cd"; +} .la-paragraph:before { - content: "\f1dd"; } + content: "\f1dd"; +} .la-parking:before { - content: "\f540"; } + content: "\f540"; +} .la-passport:before { - content: "\f5ab"; } + content: "\f5ab"; +} .la-pastafarianism:before { - content: "\f67b"; } + content: "\f67b"; +} .la-paste:before { - content: "\f0ea"; } + content: "\f0ea"; +} .la-patreon:before { - content: "\f3d9"; } + content: "\f3d9"; +} .la-pause:before { - content: "\f04c"; } + content: "\f04c"; +} .la-pause-circle:before { - content: "\f28b"; } + content: "\f28b"; +} .la-paw:before { - content: "\f1b0"; } + content: "\f1b0"; +} .la-paypal:before { - content: "\f1ed"; } + content: "\f1ed"; +} .la-peace:before { - content: "\f67c"; } + content: "\f67c"; +} .la-pen:before { - content: "\f304"; } + content: "\f304"; +} .la-pen-alt:before { - content: "\f305"; } + content: "\f305"; +} .la-pen-fancy:before { - content: "\f5ac"; } + content: "\f5ac"; +} .la-pen-nib:before { - content: "\f5ad"; } + content: "\f5ad"; +} .la-pen-square:before { - content: "\f14b"; } + content: "\f14b"; +} .la-pencil-alt:before { - content: "\f303"; } + content: "\f303"; +} .la-pencil-ruler:before { - content: "\f5ae"; } + content: "\f5ae"; +} .la-penny-arcade:before { - content: "\f704"; } + content: "\f704"; +} .la-people-carry:before { - content: "\f4ce"; } + content: "\f4ce"; +} .la-pepper-hot:before { - content: "\f816"; } + content: "\f816"; +} .la-percent:before { - content: "\f295"; } + content: "\f295"; +} .la-percentage:before { - content: "\f541"; } + content: "\f541"; +} .la-periscope:before { - content: "\f3da"; } + content: "\f3da"; +} .la-person-booth:before { - content: "\f756"; } + content: "\f756"; +} .la-phabricator:before { - content: "\f3db"; } + content: "\f3db"; +} .la-phoenix-framework:before { - content: "\f3dc"; } + content: "\f3dc"; +} .la-phoenix-squadron:before { - content: "\f511"; } + content: "\f511"; +} .la-phone:before { - content: "\f095"; } + content: "\f095"; +} .la-phone-alt:before { - content: "\f879"; } + content: "\f879"; +} .la-phone-slash:before { - content: "\f3dd"; } + content: "\f3dd"; +} .la-phone-square:before { - content: "\f098"; } + content: "\f098"; +} .la-phone-square-alt:before { - content: "\f87b"; } + content: "\f87b"; +} .la-phone-volume:before { - content: "\f2a0"; } + content: "\f2a0"; +} .la-photo-video:before { - content: "\f87c"; } + content: "\f87c"; +} .la-php:before { - content: "\f457"; } + content: "\f457"; +} .la-pied-piper:before { - content: "\f2ae"; } + content: "\f2ae"; +} .la-pied-piper-alt:before { - content: "\f1a8"; } + content: "\f1a8"; +} .la-pied-piper-hat:before { - content: "\f4e5"; } + content: "\f4e5"; +} .la-pied-piper-pp:before { - content: "\f1a7"; } + content: "\f1a7"; +} .la-piggy-bank:before { - content: "\f4d3"; } + content: "\f4d3"; +} .la-pills:before { - content: "\f484"; } + content: "\f484"; +} .la-pinterest:before { - content: "\f0d2"; } + content: "\f0d2"; +} .la-pinterest-p:before { - content: "\f231"; } + content: "\f231"; +} .la-pinterest-square:before { - content: "\f0d3"; } + content: "\f0d3"; +} .la-pizza-slice:before { - content: "\f818"; } + content: "\f818"; +} .la-place-of-worship:before { - content: "\f67f"; } + content: "\f67f"; +} .la-plane:before { - content: "\f072"; } + content: "\f072"; +} .la-plane-arrival:before { - content: "\f5af"; } + content: "\f5af"; +} .la-plane-departure:before { - content: "\f5b0"; } + content: "\f5b0"; +} .la-play:before { - content: "\f04b"; } + content: "\f04b"; +} .la-play-circle:before { - content: "\f144"; } + content: "\f144"; +} .la-playstation:before { - content: "\f3df"; } + content: "\f3df"; +} .la-plug:before { - content: "\f1e6"; } + content: "\f1e6"; +} .la-plus:before { - content: "\f067"; } + content: "\f067"; +} .la-plus-circle:before { - content: "\f055"; } + content: "\f055"; +} .la-plus-square:before { - content: "\f0fe"; } + content: "\f0fe"; +} .la-podcast:before { - content: "\f2ce"; } + content: "\f2ce"; +} .la-poll:before { - content: "\f681"; } + content: "\f681"; +} .la-poll-h:before { - content: "\f682"; } + content: "\f682"; +} .la-poo:before { - content: "\f2fe"; } + content: "\f2fe"; +} .la-poo-storm:before { - content: "\f75a"; } + content: "\f75a"; +} .la-poop:before { - content: "\f619"; } + content: "\f619"; +} .la-portrait:before { - content: "\f3e0"; } + content: "\f3e0"; +} .la-pound-sign:before { - content: "\f154"; } + content: "\f154"; +} .la-power-off:before { - content: "\f011"; } + content: "\f011"; +} .la-pray:before { - content: "\f683"; } + content: "\f683"; +} .la-praying-hands:before { - content: "\f684"; } + content: "\f684"; +} .la-prescription:before { - content: "\f5b1"; } + content: "\f5b1"; +} .la-prescription-bottle:before { - content: "\f485"; } + content: "\f485"; +} .la-prescription-bottle-alt:before { - content: "\f486"; } + content: "\f486"; +} .la-print:before { - content: "\f02f"; } + content: "\f02f"; +} .la-procedures:before { - content: "\f487"; } + content: "\f487"; +} .la-product-hunt:before { - content: "\f288"; } + content: "\f288"; +} .la-project-diagram:before { - content: "\f542"; } + content: "\f542"; +} .la-pushed:before { - content: "\f3e1"; } + content: "\f3e1"; +} .la-puzzle-piece:before { - content: "\f12e"; } + content: "\f12e"; +} .la-python:before { - content: "\f3e2"; } + content: "\f3e2"; +} .la-qq:before { - content: "\f1d6"; } + content: "\f1d6"; +} .la-qrcode:before { - content: "\f029"; } + content: "\f029"; +} .la-question:before { - content: "\f128"; } + content: "\f128"; +} .la-question-circle:before { - content: "\f059"; } + content: "\f059"; +} .la-quidditch:before { - content: "\f458"; } + content: "\f458"; +} .la-quinscape:before { - content: "\f459"; } + content: "\f459"; +} .la-quora:before { - content: "\f2c4"; } + content: "\f2c4"; +} .la-quote-left:before { - content: "\f10d"; } + content: "\f10d"; +} .la-quote-right:before { - content: "\f10e"; } + content: "\f10e"; +} .la-quran:before { - content: "\f687"; } + content: "\f687"; +} .la-r-project:before { - content: "\f4f7"; } + content: "\f4f7"; +} .la-radiation:before { - content: "\f7b9"; } + content: "\f7b9"; +} .la-radiation-alt:before { - content: "\f7ba"; } + content: "\f7ba"; +} .la-rainbow:before { - content: "\f75b"; } + content: "\f75b"; +} .la-random:before { - content: "\f074"; } + content: "\f074"; +} .la-raspberry-pi:before { - content: "\f7bb"; } + content: "\f7bb"; +} .la-ravelry:before { - content: "\f2d9"; } + content: "\f2d9"; +} .la-react:before { - content: "\f41b"; } + content: "\f41b"; +} .la-reacteurope:before { - content: "\f75d"; } + content: "\f75d"; +} .la-readme:before { - content: "\f4d5"; } + content: "\f4d5"; +} .la-rebel:before { - content: "\f1d0"; } + content: "\f1d0"; +} .la-receipt:before { - content: "\f543"; } + content: "\f543"; +} .la-record-vinyl:before { - content: "\f8d9"; } + content: "\f8d9"; +} .la-recycle:before { - content: "\f1b8"; } + content: "\f1b8"; +} .la-red-river:before { - content: "\f3e3"; } + content: "\f3e3"; +} .la-reddit:before { - content: "\f1a1"; } + content: "\f1a1"; +} .la-reddit-alien:before { - content: "\f281"; } + content: "\f281"; +} .la-reddit-square:before { - content: "\f1a2"; } + content: "\f1a2"; +} .la-redhat:before { - content: "\f7bc"; } + content: "\f7bc"; +} .la-redo:before { - content: "\f01e"; } + content: "\f01e"; +} .la-redo-alt:before { - content: "\f2f9"; } + content: "\f2f9"; +} .la-registered:before { - content: "\f25d"; } + content: "\f25d"; +} .la-remove-format:before { - content: "\f87d"; } + content: "\f87d"; +} .la-renren:before { - content: "\f18b"; } + content: "\f18b"; +} .la-reply:before { - content: "\f3e5"; } + content: "\f3e5"; +} .la-reply-all:before { - content: "\f122"; } + content: "\f122"; +} .la-replyd:before { - content: "\f3e6"; } + content: "\f3e6"; +} .la-republican:before { - content: "\f75e"; } + content: "\f75e"; +} .la-researchgate:before { - content: "\f4f8"; } + content: "\f4f8"; +} .la-resolving:before { - content: "\f3e7"; } + content: "\f3e7"; +} .la-restroom:before { - content: "\f7bd"; } + content: "\f7bd"; +} .la-retweet:before { - content: "\f079"; } + content: "\f079"; +} .la-rev:before { - content: "\f5b2"; } + content: "\f5b2"; +} .la-ribbon:before { - content: "\f4d6"; } + content: "\f4d6"; +} .la-ring:before { - content: "\f70b"; } + content: "\f70b"; +} .la-road:before { - content: "\f018"; } + content: "\f018"; +} .la-robot:before { - content: "\f544"; } + content: "\f544"; +} .la-rocket:before { - content: "\f135"; } + content: "\f135"; +} .la-rocketchat:before { - content: "\f3e8"; } + content: "\f3e8"; +} .la-rockrms:before { - content: "\f3e9"; } + content: "\f3e9"; +} .la-route:before { - content: "\f4d7"; } + content: "\f4d7"; +} .la-rss:before { - content: "\f09e"; } + content: "\f09e"; +} .la-rss-square:before { - content: "\f143"; } + content: "\f143"; +} .la-ruble-sign:before { - content: "\f158"; } + content: "\f158"; +} .la-ruler:before { - content: "\f545"; } + content: "\f545"; +} .la-ruler-combined:before { - content: "\f546"; } + content: "\f546"; +} .la-ruler-horizontal:before { - content: "\f547"; } + content: "\f547"; +} .la-ruler-vertical:before { - content: "\f548"; } + content: "\f548"; +} .la-running:before { - content: "\f70c"; } + content: "\f70c"; +} .la-rupee-sign:before { - content: "\f156"; } + content: "\f156"; +} .la-sad-cry:before { - content: "\f5b3"; } + content: "\f5b3"; +} .la-sad-tear:before { - content: "\f5b4"; } + content: "\f5b4"; +} .la-safari:before { - content: "\f267"; } + content: "\f267"; +} .la-salesforce:before { - content: "\f83b"; } + content: "\f83b"; +} .la-sass:before { - content: "\f41e"; } + content: "\f41e"; +} .la-satellite:before { - content: "\f7bf"; } + content: "\f7bf"; +} .la-satellite-dish:before { - content: "\f7c0"; } + content: "\f7c0"; +} .la-save:before { - content: "\f0c7"; } + content: "\f0c7"; +} .la-schlix:before { - content: "\f3ea"; } + content: "\f3ea"; +} .la-school:before { - content: "\f549"; } + content: "\f549"; +} .la-screwdriver:before { - content: "\f54a"; } + content: "\f54a"; +} .la-scribd:before { - content: "\f28a"; } + content: "\f28a"; +} .la-scroll:before { - content: "\f70e"; } + content: "\f70e"; +} .la-sd-card:before { - content: "\f7c2"; } + content: "\f7c2"; +} .la-search:before { - content: "\f002"; } + content: "\f002"; +} .la-search-dollar:before { - content: "\f688"; } + content: "\f688"; +} .la-search-location:before { - content: "\f689"; } + content: "\f689"; +} .la-search-minus:before { - content: "\f010"; } + content: "\f010"; +} .la-search-plus:before { - content: "\f00e"; } + content: "\f00e"; +} .la-searchengin:before { - content: "\f3eb"; } + content: "\f3eb"; +} .la-seedling:before { - content: "\f4d8"; } + content: "\f4d8"; +} .la-sellcast:before { - content: "\f2da"; } + content: "\f2da"; +} .la-sellsy:before { - content: "\f213"; } + content: "\f213"; +} .la-server:before { - content: "\f233"; } + content: "\f233"; +} .la-servicestack:before { - content: "\f3ec"; } + content: "\f3ec"; +} .la-shapes:before { - content: "\f61f"; } + content: "\f61f"; +} .la-share:before { - content: "\f064"; } + content: "\f064"; +} .la-share-alt:before { - content: "\f1e0"; } + content: "\f1e0"; +} .la-share-alt-square:before { - content: "\f1e1"; } + content: "\f1e1"; +} .la-share-square:before { - content: "\f14d"; } + content: "\f14d"; +} .la-shekel-sign:before { - content: "\f20b"; } + content: "\f20b"; +} .la-shield-alt:before { - content: "\f3ed"; } + content: "\f3ed"; +} .la-ship:before { - content: "\f21a"; } + content: "\f21a"; +} .la-shipping-fast:before { - content: "\f48b"; } + content: "\f48b"; +} .la-shirtsinbulk:before { - content: "\f214"; } + content: "\f214"; +} .la-shoe-prints:before { - content: "\f54b"; } + content: "\f54b"; +} .la-shopping-bag:before { - content: "\f290"; } + content: "\f290"; +} .la-shopping-basket:before { - content: "\f291"; } + content: "\f291"; +} .la-shopping-cart:before { - content: "\f07a"; } + content: "\f07a"; +} .la-shopware:before { - content: "\f5b5"; } + content: "\f5b5"; +} .la-shower:before { - content: "\f2cc"; } + content: "\f2cc"; +} .la-shuttle-van:before { - content: "\f5b6"; } + content: "\f5b6"; +} .la-sign:before { - content: "\f4d9"; } + content: "\f4d9"; +} .la-sign-in-alt:before { - content: "\f2f6"; } + content: "\f2f6"; +} .la-sign-language:before { - content: "\f2a7"; } + content: "\f2a7"; +} .la-sign-out-alt:before { - content: "\f2f5"; } + content: "\f2f5"; +} .la-signal:before { - content: "\f012"; } + content: "\f012"; +} .la-signature:before { - content: "\f5b7"; } + content: "\f5b7"; +} .la-sim-card:before { - content: "\f7c4"; } + content: "\f7c4"; +} .la-simplybuilt:before { - content: "\f215"; } + content: "\f215"; +} .la-sistrix:before { - content: "\f3ee"; } + content: "\f3ee"; +} .la-sitemap:before { - content: "\f0e8"; } + content: "\f0e8"; +} .la-sith:before { - content: "\f512"; } + content: "\f512"; +} .la-skating:before { - content: "\f7c5"; } + content: "\f7c5"; +} .la-sketch:before { - content: "\f7c6"; } + content: "\f7c6"; +} .la-skiing:before { - content: "\f7c9"; } + content: "\f7c9"; +} .la-skiing-nordic:before { - content: "\f7ca"; } + content: "\f7ca"; +} .la-skull:before { - content: "\f54c"; } + content: "\f54c"; +} .la-skull-crossbones:before { - content: "\f714"; } + content: "\f714"; +} .la-skyatlas:before { - content: "\f216"; } + content: "\f216"; +} .la-skype:before { - content: "\f17e"; } + content: "\f17e"; +} .la-slack:before { - content: "\f198"; } + content: "\f198"; +} .la-slack-hash:before { - content: "\f3ef"; } + content: "\f3ef"; +} .la-slash:before { - content: "\f715"; } + content: "\f715"; +} .la-sleigh:before { - content: "\f7cc"; } + content: "\f7cc"; +} .la-sliders-h:before { - content: "\f1de"; } + content: "\f1de"; +} .la-slideshare:before { - content: "\f1e7"; } + content: "\f1e7"; +} .la-smile:before { - content: "\f118"; } + content: "\f118"; +} .la-smile-beam:before { - content: "\f5b8"; } + content: "\f5b8"; +} .la-smile-wink:before { - content: "\f4da"; } + content: "\f4da"; +} .la-smog:before { - content: "\f75f"; } + content: "\f75f"; +} .la-smoking:before { - content: "\f48d"; } + content: "\f48d"; +} .la-smoking-ban:before { - content: "\f54d"; } + content: "\f54d"; +} .la-sms:before { - content: "\f7cd"; } + content: "\f7cd"; +} .la-snapchat:before { - content: "\f2ab"; } + content: "\f2ab"; +} .la-snapchat-ghost:before { - content: "\f2ac"; } + content: "\f2ac"; +} .la-snapchat-square:before { - content: "\f2ad"; } + content: "\f2ad"; +} .la-snowboarding:before { - content: "\f7ce"; } + content: "\f7ce"; +} .la-snowflake:before { - content: "\f2dc"; } + content: "\f2dc"; +} .la-snowman:before { - content: "\f7d0"; } + content: "\f7d0"; +} .la-snowplow:before { - content: "\f7d2"; } + content: "\f7d2"; +} .la-socks:before { - content: "\f696"; } + content: "\f696"; +} .la-solar-panel:before { - content: "\f5ba"; } + content: "\f5ba"; +} .la-sort:before { - content: "\f0dc"; } + content: "\f0dc"; +} .la-sort-alpha-down:before { - content: "\f15d"; } + content: "\f15d"; +} .la-sort-alpha-down-alt:before { - content: "\f881"; } + content: "\f881"; +} .la-sort-alpha-up:before { - content: "\f15e"; } + content: "\f15e"; +} .la-sort-alpha-up-alt:before { - content: "\f882"; } + content: "\f882"; +} .la-sort-amount-down:before { - content: "\f160"; } + content: "\f160"; +} .la-sort-amount-down-alt:before { - content: "\f884"; } + content: "\f884"; +} .la-sort-amount-up:before { - content: "\f161"; } + content: "\f161"; +} .la-sort-amount-up-alt:before { - content: "\f885"; } + content: "\f885"; +} .la-sort-down:before { - content: "\f0dd"; } + content: "\f0dd"; +} .la-sort-numeric-down:before { - content: "\f162"; } + content: "\f162"; +} .la-sort-numeric-down-alt:before { - content: "\f886"; } + content: "\f886"; +} .la-sort-numeric-up:before { - content: "\f163"; } + content: "\f163"; +} .la-sort-numeric-up-alt:before { - content: "\f887"; } + content: "\f887"; +} .la-sort-up:before { - content: "\f0de"; } + content: "\f0de"; +} .la-soundcloud:before { - content: "\f1be"; } + content: "\f1be"; +} .la-sourcetree:before { - content: "\f7d3"; } + content: "\f7d3"; +} .la-spa:before { - content: "\f5bb"; } + content: "\f5bb"; +} .la-space-shuttle:before { - content: "\f197"; } + content: "\f197"; +} .la-speakap:before { - content: "\f3f3"; } + content: "\f3f3"; +} .la-speaker-deck:before { - content: "\f83c"; } + content: "\f83c"; +} .la-spell-check:before { - content: "\f891"; } + content: "\f891"; +} .la-spider:before { - content: "\f717"; } + content: "\f717"; +} .la-spinner:before { - content: "\f110"; } + content: "\f110"; +} .la-splotch:before { - content: "\f5bc"; } + content: "\f5bc"; +} .la-spotify:before { - content: "\f1bc"; } + content: "\f1bc"; +} .la-spray-can:before { - content: "\f5bd"; } + content: "\f5bd"; +} .la-square:before { - content: "\f0c8"; } + content: "\f0c8"; +} .la-square-full:before { - content: "\f45c"; } + content: "\f45c"; +} .la-square-root-alt:before { - content: "\f698"; } + content: "\f698"; +} .la-squarespace:before { - content: "\f5be"; } + content: "\f5be"; +} .la-stack-exchange:before { - content: "\f18d"; } + content: "\f18d"; +} .la-stack-overflow:before { - content: "\f16c"; } + content: "\f16c"; +} .la-stackpath:before { - content: "\f842"; } + content: "\f842"; +} .la-stamp:before { - content: "\f5bf"; } + content: "\f5bf"; +} .la-star:before { - content: "\f005"; } + content: "\f005"; +} .la-star-and-crescent:before { - content: "\f699"; } + content: "\f699"; +} .la-star-half:before { - content: "\f089"; } + content: "\f089"; +} .la-star-half-alt:before { - content: "\f5c0"; } + content: "\f5c0"; +} .la-star-of-david:before { - content: "\f69a"; } + content: "\f69a"; +} .la-star-of-life:before { - content: "\f621"; } + content: "\f621"; +} .la-staylinked:before { - content: "\f3f5"; } + content: "\f3f5"; +} .la-steam:before { - content: "\f1b6"; } + content: "\f1b6"; +} .la-steam-square:before { - content: "\f1b7"; } + content: "\f1b7"; +} .la-steam-symbol:before { - content: "\f3f6"; } + content: "\f3f6"; +} .la-step-backward:before { - content: "\f048"; } + content: "\f048"; +} .la-step-forward:before { - content: "\f051"; } + content: "\f051"; +} .la-stethoscope:before { - content: "\f0f1"; } + content: "\f0f1"; +} .la-sticker-mule:before { - content: "\f3f7"; } + content: "\f3f7"; +} .la-sticky-note:before { - content: "\f249"; } + content: "\f249"; +} .la-stop:before { - content: "\f04d"; } + content: "\f04d"; +} .la-stop-circle:before { - content: "\f28d"; } + content: "\f28d"; +} .la-stopwatch:before { - content: "\f2f2"; } + content: "\f2f2"; +} .la-store:before { - content: "\f54e"; } + content: "\f54e"; +} .la-store-alt:before { - content: "\f54f"; } + content: "\f54f"; +} .la-strava:before { - content: "\f428"; } + content: "\f428"; +} .la-stream:before { - content: "\f550"; } + content: "\f550"; +} .la-street-view:before { - content: "\f21d"; } + content: "\f21d"; +} .la-strikethrough:before { - content: "\f0cc"; } + content: "\f0cc"; +} .la-stripe:before { - content: "\f429"; } + content: "\f429"; +} .la-stripe-s:before { - content: "\f42a"; } + content: "\f42a"; +} .la-stroopwafel:before { - content: "\f551"; } + content: "\f551"; +} .la-studiovinari:before { - content: "\f3f8"; } + content: "\f3f8"; +} .la-stumbleupon:before { - content: "\f1a4"; } + content: "\f1a4"; +} .la-stumbleupon-circle:before { - content: "\f1a3"; } + content: "\f1a3"; +} .la-subscript:before { - content: "\f12c"; } + content: "\f12c"; +} .la-subway:before { - content: "\f239"; } + content: "\f239"; +} .la-suitcase:before { - content: "\f0f2"; } + content: "\f0f2"; +} .la-suitcase-rolling:before { - content: "\f5c1"; } + content: "\f5c1"; +} .la-sun:before { - content: "\f185"; } + content: "\f185"; +} .la-superpowers:before { - content: "\f2dd"; } + content: "\f2dd"; +} .la-superscript:before { - content: "\f12b"; } + content: "\f12b"; +} .la-supple:before { - content: "\f3f9"; } + content: "\f3f9"; +} .la-surprise:before { - content: "\f5c2"; } + content: "\f5c2"; +} .la-suse:before { - content: "\f7d6"; } + content: "\f7d6"; +} .la-swatchbook:before { - content: "\f5c3"; } + content: "\f5c3"; +} .la-swift:before { - content: "\f8e1"; } + content: "\f8e1"; +} .la-swimmer:before { - content: "\f5c4"; } + content: "\f5c4"; +} .la-swimming-pool:before { - content: "\f5c5"; } + content: "\f5c5"; +} .la-symfony:before { - content: "\f83d"; } + content: "\f83d"; +} .la-synagogue:before { - content: "\f69b"; } + content: "\f69b"; +} .la-sync:before { - content: "\f021"; } + content: "\f021"; +} .la-sync-alt:before { - content: "\f2f1"; } + content: "\f2f1"; +} .la-syringe:before { - content: "\f48e"; } + content: "\f48e"; +} .la-table:before { - content: "\f0ce"; } + content: "\f0ce"; +} .la-table-tennis:before { - content: "\f45d"; } + content: "\f45d"; +} .la-tablet:before { - content: "\f10a"; } + content: "\f10a"; +} .la-tablet-alt:before { - content: "\f3fa"; } + content: "\f3fa"; +} .la-tablets:before { - content: "\f490"; } + content: "\f490"; +} .la-tachometer-alt:before { - content: "\f3fd"; } + content: "\f3fd"; +} .la-tag:before { - content: "\f02b"; } + content: "\f02b"; +} .la-tags:before { - content: "\f02c"; } + content: "\f02c"; +} .la-tape:before { - content: "\f4db"; } + content: "\f4db"; +} .la-tasks:before { - content: "\f0ae"; } + content: "\f0ae"; +} .la-taxi:before { - content: "\f1ba"; } + content: "\f1ba"; +} .la-teamspeak:before { - content: "\f4f9"; } + content: "\f4f9"; +} .la-teeth:before { - content: "\f62e"; } + content: "\f62e"; +} .la-teeth-open:before { - content: "\f62f"; } + content: "\f62f"; +} .la-telegram:before { - content: "\f2c6"; } + content: "\f2c6"; +} .la-telegram-plane:before { - content: "\f3fe"; } + content: "\f3fe"; +} .la-temperature-high:before { - content: "\f769"; } + content: "\f769"; +} .la-temperature-low:before { - content: "\f76b"; } + content: "\f76b"; +} .la-tencent-weibo:before { - content: "\f1d5"; } + content: "\f1d5"; +} .la-tenge:before { - content: "\f7d7"; } + content: "\f7d7"; +} .la-terminal:before { - content: "\f120"; } + content: "\f120"; +} .la-text-height:before { - content: "\f034"; } + content: "\f034"; +} .la-text-width:before { - content: "\f035"; } + content: "\f035"; +} .la-th:before { - content: "\f00a"; } + content: "\f00a"; +} .la-th-large:before { - content: "\f009"; } + content: "\f009"; +} .la-th-list:before { - content: "\f00b"; } + content: "\f00b"; +} .la-the-red-yeti:before { - content: "\f69d"; } + content: "\f69d"; +} .la-theater-masks:before { - content: "\f630"; } + content: "\f630"; +} .la-themeco:before { - content: "\f5c6"; } + content: "\f5c6"; +} .la-themeisle:before { - content: "\f2b2"; } + content: "\f2b2"; +} .la-thermometer:before { - content: "\f491"; } + content: "\f491"; +} .la-thermometer-empty:before { - content: "\f2cb"; } + content: "\f2cb"; +} .la-thermometer-full:before { - content: "\f2c7"; } + content: "\f2c7"; +} .la-thermometer-half:before { - content: "\f2c9"; } + content: "\f2c9"; +} .la-thermometer-quarter:before { - content: "\f2ca"; } + content: "\f2ca"; +} .la-thermometer-three-quarters:before { - content: "\f2c8"; } + content: "\f2c8"; +} .la-think-peaks:before { - content: "\f731"; } + content: "\f731"; +} .la-thumbs-down:before { - content: "\f165"; } + content: "\f165"; +} .la-thumbs-up:before { - content: "\f164"; } + content: "\f164"; +} .la-thumbtack:before { - content: "\f08d"; } + content: "\f08d"; +} .la-ticket-alt:before { - content: "\f3ff"; } + content: "\f3ff"; +} .la-times:before { - content: "\f00d"; } + content: "\f00d"; +} .la-times-circle:before { - content: "\f057"; } + content: "\f057"; +} .la-tint:before { - content: "\f043"; } + content: "\f043"; +} .la-tint-slash:before { - content: "\f5c7"; } + content: "\f5c7"; +} .la-tired:before { - content: "\f5c8"; } + content: "\f5c8"; +} .la-toggle-off:before { - content: "\f204"; } + content: "\f204"; +} .la-toggle-on:before { - content: "\f205"; } + content: "\f205"; +} .la-toilet:before { - content: "\f7d8"; } + content: "\f7d8"; +} .la-toilet-paper:before { - content: "\f71e"; } + content: "\f71e"; +} .la-toolbox:before { - content: "\f552"; } + content: "\f552"; +} .la-tools:before { - content: "\f7d9"; } + content: "\f7d9"; +} .la-tooth:before { - content: "\f5c9"; } + content: "\f5c9"; +} .la-torah:before { - content: "\f6a0"; } + content: "\f6a0"; +} .la-torii-gate:before { - content: "\f6a1"; } + content: "\f6a1"; +} .la-tractor:before { - content: "\f722"; } + content: "\f722"; +} .la-trade-federation:before { - content: "\f513"; } + content: "\f513"; +} .la-trademark:before { - content: "\f25c"; } + content: "\f25c"; +} .la-traffic-light:before { - content: "\f637"; } + content: "\f637"; +} .la-train:before { - content: "\f238"; } + content: "\f238"; +} .la-tram:before { - content: "\f7da"; } + content: "\f7da"; +} .la-transgender:before { - content: "\f224"; } + content: "\f224"; +} .la-transgender-alt:before { - content: "\f225"; } + content: "\f225"; +} .la-trash:before { - content: "\f1f8"; } + content: "\f1f8"; +} .la-trash-alt:before { - content: "\f2ed"; } + content: "\f2ed"; +} .la-trash-restore:before { - content: "\f829"; } + content: "\f829"; +} .la-trash-restore-alt:before { - content: "\f82a"; } + content: "\f82a"; +} .la-tree:before { - content: "\f1bb"; } + content: "\f1bb"; +} .la-trello:before { - content: "\f181"; } + content: "\f181"; +} .la-tripadvisor:before { - content: "\f262"; } + content: "\f262"; +} .la-trophy:before { - content: "\f091"; } + content: "\f091"; +} .la-truck:before { - content: "\f0d1"; } + content: "\f0d1"; +} .la-truck-loading:before { - content: "\f4de"; } + content: "\f4de"; +} .la-truck-monster:before { - content: "\f63b"; } + content: "\f63b"; +} .la-truck-moving:before { - content: "\f4df"; } + content: "\f4df"; +} .la-truck-pickup:before { - content: "\f63c"; } + content: "\f63c"; +} .la-tshirt:before { - content: "\f553"; } + content: "\f553"; +} .la-tty:before { - content: "\f1e4"; } + content: "\f1e4"; +} .la-tumblr:before { - content: "\f173"; } + content: "\f173"; +} .la-tumblr-square:before { - content: "\f174"; } + content: "\f174"; +} .la-tv:before { - content: "\f26c"; } + content: "\f26c"; +} .la-twitch:before { - content: "\f1e8"; } + content: "\f1e8"; +} .la-twitter:before { - content: "\f099"; } + content: "\f099"; +} .la-twitter-square:before { - content: "\f081"; } + content: "\f081"; +} .la-typo3:before { - content: "\f42b"; } + content: "\f42b"; +} .la-uber:before { - content: "\f402"; } + content: "\f402"; +} .la-ubuntu:before { - content: "\f7df"; } + content: "\f7df"; +} .la-uikit:before { - content: "\f403"; } + content: "\f403"; +} .la-umbraco:before { - content: "\f8e8"; } + content: "\f8e8"; +} .la-umbrella:before { - content: "\f0e9"; } + content: "\f0e9"; +} .la-umbrella-beach:before { - content: "\f5ca"; } + content: "\f5ca"; +} .la-underline:before { - content: "\f0cd"; } + content: "\f0cd"; +} .la-undo:before { - content: "\f0e2"; } + content: "\f0e2"; +} .la-undo-alt:before { - content: "\f2ea"; } + content: "\f2ea"; +} .la-uniregistry:before { - content: "\f404"; } + content: "\f404"; +} .la-universal-access:before { - content: "\f29a"; } + content: "\f29a"; +} .la-university:before { - content: "\f19c"; } + content: "\f19c"; +} .la-unlink:before { - content: "\f127"; } + content: "\f127"; +} .la-unlock:before { - content: "\f09c"; } + content: "\f09c"; +} .la-unlock-alt:before { - content: "\f13e"; } + content: "\f13e"; +} .la-untappd:before { - content: "\f405"; } + content: "\f405"; +} .la-upload:before { - content: "\f093"; } + content: "\f093"; +} .la-ups:before { - content: "\f7e0"; } + content: "\f7e0"; +} .la-usb:before { - content: "\f287"; } + content: "\f287"; +} .la-user:before { - content: "\f007"; } + content: "\f007"; +} .la-user-alt:before { - content: "\f406"; } + content: "\f406"; +} .la-user-alt-slash:before { - content: "\f4fa"; } + content: "\f4fa"; +} .la-user-astronaut:before { - content: "\f4fb"; } + content: "\f4fb"; +} .la-user-check:before { - content: "\f4fc"; } + content: "\f4fc"; +} .la-user-circle:before { - content: "\f2bd"; } + content: "\f2bd"; +} .la-user-clock:before { - content: "\f4fd"; } + content: "\f4fd"; +} .la-user-cog:before { - content: "\f4fe"; } + content: "\f4fe"; +} .la-user-edit:before { - content: "\f4ff"; } + content: "\f4ff"; +} .la-user-friends:before { - content: "\f500"; } + content: "\f500"; +} .la-user-graduate:before { - content: "\f501"; } + content: "\f501"; +} .la-user-injured:before { - content: "\f728"; } + content: "\f728"; +} .la-user-lock:before { - content: "\f502"; } + content: "\f502"; +} .la-user-md:before { - content: "\f0f0"; } + content: "\f0f0"; +} .la-user-minus:before { - content: "\f503"; } + content: "\f503"; +} .la-user-ninja:before { - content: "\f504"; } + content: "\f504"; +} .la-user-nurse:before { - content: "\f82f"; } + content: "\f82f"; +} .la-user-plus:before { - content: "\f234"; } + content: "\f234"; +} .la-user-secret:before { - content: "\f21b"; } + content: "\f21b"; +} .la-user-shield:before { - content: "\f505"; } + content: "\f505"; +} .la-user-slash:before { - content: "\f506"; } + content: "\f506"; +} .la-user-tag:before { - content: "\f507"; } + content: "\f507"; +} .la-user-tie:before { - content: "\f508"; } + content: "\f508"; +} .la-user-times:before { - content: "\f235"; } + content: "\f235"; +} .la-users:before { - content: "\f0c0"; } + content: "\f0c0"; +} .la-users-cog:before { - content: "\f509"; } + content: "\f509"; +} .la-usps:before { - content: "\f7e1"; } + content: "\f7e1"; +} .la-ussunnah:before { - content: "\f407"; } + content: "\f407"; +} .la-utensil-spoon:before { - content: "\f2e5"; } + content: "\f2e5"; +} .la-utensils:before { - content: "\f2e7"; } + content: "\f2e7"; +} .la-vaadin:before { - content: "\f408"; } + content: "\f408"; +} .la-vector-square:before { - content: "\f5cb"; } + content: "\f5cb"; +} .la-venus:before { - content: "\f221"; } + content: "\f221"; +} .la-venus-double:before { - content: "\f226"; } + content: "\f226"; +} .la-venus-mars:before { - content: "\f228"; } + content: "\f228"; +} .la-viacoin:before { - content: "\f237"; } + content: "\f237"; +} .la-viadeo:before { - content: "\f2a9"; } + content: "\f2a9"; +} .la-viadeo-square:before { - content: "\f2aa"; } + content: "\f2aa"; +} .la-vial:before { - content: "\f492"; } + content: "\f492"; +} .la-vials:before { - content: "\f493"; } + content: "\f493"; +} .la-viber:before { - content: "\f409"; } + content: "\f409"; +} .la-video:before { - content: "\f03d"; } + content: "\f03d"; +} .la-video-slash:before { - content: "\f4e2"; } + content: "\f4e2"; +} .la-vihara:before { - content: "\f6a7"; } + content: "\f6a7"; +} .la-vimeo:before { - content: "\f40a"; } + content: "\f40a"; +} .la-vimeo-square:before { - content: "\f194"; } + content: "\f194"; +} .la-vimeo-v:before { - content: "\f27d"; } + content: "\f27d"; +} .la-vine:before { - content: "\f1ca"; } + content: "\f1ca"; +} .la-vk:before { - content: "\f189"; } + content: "\f189"; +} .la-vnv:before { - content: "\f40b"; } + content: "\f40b"; +} .la-voicemail:before { - content: "\f897"; } + content: "\f897"; +} .la-volleyball-ball:before { - content: "\f45f"; } + content: "\f45f"; +} .la-volume-down:before { - content: "\f027"; } + content: "\f027"; +} .la-volume-mute:before { - content: "\f6a9"; } + content: "\f6a9"; +} .la-volume-off:before { - content: "\f026"; } + content: "\f026"; +} .la-volume-up:before { - content: "\f028"; } + content: "\f028"; +} .la-vote-yea:before { - content: "\f772"; } + content: "\f772"; +} .la-vr-cardboard:before { - content: "\f729"; } + content: "\f729"; +} .la-vuejs:before { - content: "\f41f"; } + content: "\f41f"; +} .la-walking:before { - content: "\f554"; } + content: "\f554"; +} .la-wallet:before { - content: "\f555"; } + content: "\f555"; +} .la-warehouse:before { - content: "\f494"; } + content: "\f494"; +} .la-water:before { - content: "\f773"; } + content: "\f773"; +} .la-wave-square:before { - content: "\f83e"; } + content: "\f83e"; +} .la-waze:before { - content: "\f83f"; } + content: "\f83f"; +} .la-weebly:before { - content: "\f5cc"; } + content: "\f5cc"; +} .la-weibo:before { - content: "\f18a"; } + content: "\f18a"; +} .la-weight:before { - content: "\f496"; } + content: "\f496"; +} .la-weight-hanging:before { - content: "\f5cd"; } + content: "\f5cd"; +} .la-weixin:before { - content: "\f1d7"; } + content: "\f1d7"; +} .la-whatsapp:before { - content: "\f232"; } + content: "\f232"; +} .la-whatsapp-square:before { - content: "\f40c"; } + content: "\f40c"; +} .la-wheelchair:before { - content: "\f193"; } + content: "\f193"; +} .la-whmcs:before { - content: "\f40d"; } + content: "\f40d"; +} .la-wifi:before { - content: "\f1eb"; } + content: "\f1eb"; +} .la-wikipedia-w:before { - content: "\f266"; } + content: "\f266"; +} .la-wind:before { - content: "\f72e"; } + content: "\f72e"; +} .la-window-close:before { - content: "\f410"; } + content: "\f410"; +} .la-window-maximize:before { - content: "\f2d0"; } + content: "\f2d0"; +} .la-window-minimize:before { - content: "\f2d1"; } + content: "\f2d1"; +} .la-window-restore:before { - content: "\f2d2"; } + content: "\f2d2"; +} .la-windows:before { - content: "\f17a"; } + content: "\f17a"; +} .la-wine-bottle:before { - content: "\f72f"; } + content: "\f72f"; +} .la-wine-glass:before { - content: "\f4e3"; } + content: "\f4e3"; +} .la-wine-glass-alt:before { - content: "\f5ce"; } + content: "\f5ce"; +} .la-wix:before { - content: "\f5cf"; } + content: "\f5cf"; +} .la-wizards-of-the-coast:before { - content: "\f730"; } + content: "\f730"; +} .la-wolf-pack-battalion:before { - content: "\f514"; } + content: "\f514"; +} .la-won-sign:before { - content: "\f159"; } + content: "\f159"; +} .la-wordpress:before { - content: "\f19a"; } + content: "\f19a"; +} .la-wordpress-simple:before { - content: "\f411"; } + content: "\f411"; +} .la-wpbeginner:before { - content: "\f297"; } + content: "\f297"; +} .la-wpexplorer:before { - content: "\f2de"; } + content: "\f2de"; +} .la-wpforms:before { - content: "\f298"; } + content: "\f298"; +} .la-wpressr:before { - content: "\f3e4"; } + content: "\f3e4"; +} .la-wrench:before { - content: "\f0ad"; } + content: "\f0ad"; +} .la-x-ray:before { - content: "\f497"; } + content: "\f497"; +} .la-xbox:before { - content: "\f412"; } + content: "\f412"; +} .la-xing:before { - content: "\f168"; } + content: "\f168"; +} .la-xing-square:before { - content: "\f169"; } + content: "\f169"; +} .la-y-combinator:before { - content: "\f23b"; } + content: "\f23b"; +} .la-yahoo:before { - content: "\f19e"; } + content: "\f19e"; +} .la-yammer:before { - content: "\f840"; } + content: "\f840"; +} .la-yandex:before { - content: "\f413"; } + content: "\f413"; +} .la-yandex-international:before { - content: "\f414"; } + content: "\f414"; +} .la-yarn:before { - content: "\f7e3"; } + content: "\f7e3"; +} .la-yelp:before { - content: "\f1e9"; } + content: "\f1e9"; +} .la-yen-sign:before { - content: "\f157"; } + content: "\f157"; +} .la-yin-yang:before { - content: "\f6ad"; } + content: "\f6ad"; +} .la-yoast:before { - content: "\f2b1"; } + content: "\f2b1"; +} .la-youtube:before { - content: "\f167"; } + content: "\f167"; +} .la-youtube-square:before { - content: "\f431"; } + content: "\f431"; +} .la-zhihu:before { - content: "\f63f"; } + content: "\f63f"; +} .sr-only { border: 0; @@ -4375,2208 +5811,2828 @@ readers do not read off random characters that represent icons */ overflow: hidden; padding: 0; position: absolute; - width: 1px; } + width: 1px; +} -.sr-only-focusable:active, .sr-only-focusable:focus { +.sr-only-focusable:active, +.sr-only-focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; - width: auto; } + width: auto; +} @font-face { font-family: 'Line Awesome Brands'; font-style: normal; font-weight: normal; font-display: auto; src: url("../fonts/la-brands-400.eot"); - src: url("../fonts/la-brands-400.eot?#iefix") format("embedded-opentype"), url("../fonts/la-brands-400.woff2") format("woff2"), url("../fonts/la-brands-400.woff") format("woff"), url("../fonts/la-brands-400.ttf") format("truetype"), url("../fonts/la-brands-400.svg#lineawesome") format("svg"); } + src: url("../fonts/la-brands-400.eot?#iefix") format("embedded-opentype"), url("../fonts/la-brands-400.woff2") format("woff2"), url("../fonts/la-brands-400.woff") format("woff"), url("../fonts/la-brands-400.ttf") format("truetype"), url("../fonts/la-brands-400.svg#lineawesome") format("svg"); +} .lab { - font-family: 'Line Awesome Brands'; } + font-family: 'Line Awesome Brands'; +} @font-face { font-family: 'Line Awesome Free'; font-style: normal; font-weight: 400; font-display: auto; src: url("../fonts/la-regular-400.eot"); - src: url("../fonts/la-regular-400.eot?#iefix") format("embedded-opentype"), url("../fonts/la-regular-400.woff2") format("woff2"), url("../fonts/la-regular-400.woff") format("woff"), url("../fonts/la-regular-400.ttf") format("truetype"), url("../fonts/la-regular-400.svg#lineawesome") format("svg"); } + src: url("../fonts/la-regular-400.eot?#iefix") format("embedded-opentype"), url("../fonts/la-regular-400.woff2") format("woff2"), url("../fonts/la-regular-400.woff") format("woff"), url("../fonts/la-regular-400.ttf") format("truetype"), url("../fonts/la-regular-400.svg#lineawesome") format("svg"); +} .lar { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} @font-face { font-family: 'Line Awesome Free'; font-style: normal; font-weight: 900; font-display: auto; src: url("../fonts/la-solid-900.eot"); - src: url("../fonts/la-solid-900.eot?#iefix") format("embedded-opentype"), url("../fonts/la-solid-900.woff2") format("woff2"), url("../fonts/la-solid-900.woff") format("woff"), url("../fonts/la-solid-900.ttf") format("truetype"), url("../fonts/la-solid-900.svg#lineawesome") format("svg"); } + src: url("../fonts/la-solid-900.eot?#iefix") format("embedded-opentype"), url("../fonts/la-solid-900.woff2") format("woff2"), url("../fonts/la-solid-900.woff") format("woff"), url("../fonts/la-solid-900.ttf") format("truetype"), url("../fonts/la-solid-900.svg#lineawesome") format("svg"); +} .la, .las { font-family: 'Line Awesome Free'; - font-weight: 900; } + font-weight: 900; +} .la.la-glass:before { - content: "\f000"; } + content: "\f000"; +} .la.la-meetup { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-star-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-star-o:before { - content: "\f005"; } + content: "\f005"; +} .la.la-remove:before { - content: "\f00d"; } + content: "\f00d"; +} .la.la-close:before { - content: "\f00d"; } + content: "\f00d"; +} .la.la-gear:before { - content: "\f013"; } + content: "\f013"; +} .la.la-trash-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-trash-o:before { - content: "\f2ed"; } + content: "\f2ed"; +} .la.la-file-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-o:before { - content: "\f15b"; } + content: "\f15b"; +} .la.la-clock-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-clock-o:before { - content: "\f017"; } + content: "\f017"; +} .la.la-arrow-circle-o-down { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-arrow-circle-o-down:before { - content: "\f358"; } + content: "\f358"; +} .la.la-arrow-circle-o-up { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-arrow-circle-o-up:before { - content: "\f35b"; } + content: "\f35b"; +} .la.la-play-circle-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-play-circle-o:before { - content: "\f144"; } + content: "\f144"; +} .la.la-repeat:before { - content: "\f01e"; } + content: "\f01e"; +} .la.la-rotate-right:before { - content: "\f01e"; } + content: "\f01e"; +} .la.la-refresh:before { - content: "\f021"; } + content: "\f021"; +} .la.la-list-alt { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-dedent:before { - content: "\f03b"; } + content: "\f03b"; +} .la.la-video-camera:before { - content: "\f03d"; } + content: "\f03d"; +} .la.la-picture-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-picture-o:before { - content: "\f03e"; } + content: "\f03e"; +} .la.la-photo { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-photo:before { - content: "\f03e"; } + content: "\f03e"; +} .la.la-image { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-image:before { - content: "\f03e"; } + content: "\f03e"; +} .la.la-pencil:before { - content: "\f303"; } + content: "\f303"; +} .la.la-map-marker:before { - content: "\f3c5"; } + content: "\f3c5"; +} .la.la-pencil-square-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-pencil-square-o:before { - content: "\f044"; } + content: "\f044"; +} .la.la-share-square-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-share-square-o:before { - content: "\f14d"; } + content: "\f14d"; +} .la.la-check-square-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-check-square-o:before { - content: "\f14a"; } + content: "\f14a"; +} .la.la-arrows:before { - content: "\f0b2"; } + content: "\f0b2"; +} .la.la-times-circle-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-times-circle-o:before { - content: "\f057"; } + content: "\f057"; +} .la.la-check-circle-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-check-circle-o:before { - content: "\f058"; } + content: "\f058"; +} .la.la-mail-forward:before { - content: "\f064"; } + content: "\f064"; +} .la.la-eye { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-eye-slash { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-warning:before { - content: "\f071"; } + content: "\f071"; +} .la.la-calendar:before { - content: "\f073"; } + content: "\f073"; +} .la.la-arrows-v:before { - content: "\f338"; } + content: "\f338"; +} .la.la-arrows-h:before { - content: "\f337"; } + content: "\f337"; +} .la.la-bar-chart { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-bar-chart:before { - content: "\f080"; } + content: "\f080"; +} .la.la-bar-chart-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-bar-chart-o:before { - content: "\f080"; } + content: "\f080"; +} .la.la-twitter-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-facebook-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-gears:before { - content: "\f085"; } + content: "\f085"; +} .la.la-thumbs-o-up { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-thumbs-o-up:before { - content: "\f164"; } + content: "\f164"; +} .la.la-thumbs-o-down { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-thumbs-o-down:before { - content: "\f165"; } + content: "\f165"; +} .la.la-heart-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-heart-o:before { - content: "\f004"; } + content: "\f004"; +} .la.la-sign-out:before { - content: "\f2f5"; } + content: "\f2f5"; +} .la.la-linkedin-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-linkedin-square:before { - content: "\f08c"; } + content: "\f08c"; +} .la.la-thumb-tack:before { - content: "\f08d"; } + content: "\f08d"; +} .la.la-external-link:before { - content: "\f35d"; } + content: "\f35d"; +} .la.la-sign-in:before { - content: "\f2f6"; } + content: "\f2f6"; +} .la.la-github-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-lemon-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-lemon-o:before { - content: "\f094"; } + content: "\f094"; +} .la.la-square-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-square-o:before { - content: "\f0c8"; } + content: "\f0c8"; +} .la.la-bookmark-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-bookmark-o:before { - content: "\f02e"; } + content: "\f02e"; +} .la.la-twitter { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-facebook { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-facebook:before { - content: "\f39e"; } + content: "\f39e"; +} .la.la-facebook-f { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-facebook-f:before { - content: "\f39e"; } + content: "\f39e"; +} .la.la-github { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-credit-card { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-feed:before { - content: "\f09e"; } + content: "\f09e"; +} .la.la-hdd-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hdd-o:before { - content: "\f0a0"; } + content: "\f0a0"; +} .la.la-hand-o-right { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hand-o-right:before { - content: "\f0a4"; } + content: "\f0a4"; +} .la.la-hand-o-left { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hand-o-left:before { - content: "\f0a5"; } + content: "\f0a5"; +} .la.la-hand-o-up { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hand-o-up:before { - content: "\f0a6"; } + content: "\f0a6"; +} .la.la-hand-o-down { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hand-o-down:before { - content: "\f0a7"; } + content: "\f0a7"; +} .la.la-arrows-alt:before { - content: "\f31e"; } + content: "\f31e"; +} .la.la-group:before { - content: "\f0c0"; } + content: "\f0c0"; +} .la.la-chain:before { - content: "\f0c1"; } + content: "\f0c1"; +} .la.la-scissors:before { - content: "\f0c4"; } + content: "\f0c4"; +} .la.la-files-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-files-o:before { - content: "\f0c5"; } + content: "\f0c5"; +} .la.la-floppy-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-floppy-o:before { - content: "\f0c7"; } + content: "\f0c7"; +} .la.la-navicon:before { - content: "\f0c9"; } + content: "\f0c9"; +} .la.la-reorder:before { - content: "\f0c9"; } + content: "\f0c9"; +} .la.la-pinterest { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-pinterest-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-google-plus-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-google-plus { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-google-plus:before { - content: "\f0d5"; } + content: "\f0d5"; +} .la.la-money { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-money:before { - content: "\f3d1"; } + content: "\f3d1"; +} .la.la-unsorted:before { - content: "\f0dc"; } + content: "\f0dc"; +} .la.la-sort-desc:before { - content: "\f0dd"; } + content: "\f0dd"; +} .la.la-sort-asc:before { - content: "\f0de"; } + content: "\f0de"; +} .la.la-linkedin { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-linkedin:before { - content: "\f0e1"; } + content: "\f0e1"; +} .la.la-rotate-left:before { - content: "\f0e2"; } + content: "\f0e2"; +} .la.la-legal:before { - content: "\f0e3"; } + content: "\f0e3"; +} .la.la-tachometer:before { - content: "\f3fd"; } + content: "\f3fd"; +} .la.la-dashboard:before { - content: "\f3fd"; } + content: "\f3fd"; +} .la.la-comment-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-comment-o:before { - content: "\f075"; } + content: "\f075"; +} .la.la-comments-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-comments-o:before { - content: "\f086"; } + content: "\f086"; +} .la.la-flash:before { - content: "\f0e7"; } + content: "\f0e7"; +} .la.la-clipboard { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-paste { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-paste:before { - content: "\f328"; } + content: "\f328"; +} .la.la-lightbulb-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-lightbulb-o:before { - content: "\f0eb"; } + content: "\f0eb"; +} .la.la-exchange:before { - content: "\f362"; } + content: "\f362"; +} .la.la-cloud-download:before { - content: "\f381"; } + content: "\f381"; +} .la.la-cloud-upload:before { - content: "\f382"; } + content: "\f382"; +} .la.la-bell-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-bell-o:before { - content: "\f0f3"; } + content: "\f0f3"; +} .la.la-cutlery:before { - content: "\f2e7"; } + content: "\f2e7"; +} .la.la-file-text-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-text-o:before { - content: "\f15c"; } + content: "\f15c"; +} .la.la-building-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-building-o:before { - content: "\f1ad"; } + content: "\f1ad"; +} .la.la-hospital-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hospital-o:before { - content: "\f0f8"; } + content: "\f0f8"; +} .la.la-tablet:before { - content: "\f3fa"; } + content: "\f3fa"; +} .la.la-mobile:before { - content: "\f3cd"; } + content: "\f3cd"; +} .la.la-mobile-phone:before { - content: "\f3cd"; } + content: "\f3cd"; +} .la.la-circle-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-circle-o:before { - content: "\f111"; } + content: "\f111"; +} .la.la-mail-reply:before { - content: "\f3e5"; } + content: "\f3e5"; +} .la.la-github-alt { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-folder-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-folder-o:before { - content: "\f07b"; } + content: "\f07b"; +} .la.la-folder-open-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-folder-open-o:before { - content: "\f07c"; } + content: "\f07c"; +} .la.la-smile-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-smile-o:before { - content: "\f118"; } + content: "\f118"; +} .la.la-frown-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-frown-o:before { - content: "\f119"; } + content: "\f119"; +} .la.la-meh-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-meh-o:before { - content: "\f11a"; } + content: "\f11a"; +} .la.la-keyboard-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-keyboard-o:before { - content: "\f11c"; } + content: "\f11c"; +} .la.la-flag-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-flag-o:before { - content: "\f024"; } + content: "\f024"; +} .la.la-mail-reply-all:before { - content: "\f122"; } + content: "\f122"; +} .la.la-star-half-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-star-half-o:before { - content: "\f089"; } + content: "\f089"; +} .la.la-star-half-empty { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-star-half-empty:before { - content: "\f089"; } + content: "\f089"; +} .la.la-star-half-full { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-star-half-full:before { - content: "\f089"; } + content: "\f089"; +} .la.la-code-fork:before { - content: "\f126"; } + content: "\f126"; +} .la.la-chain-broken:before { - content: "\f127"; } + content: "\f127"; +} .la.la-shield:before { - content: "\f3ed"; } + content: "\f3ed"; +} .la.la-calendar-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-calendar-o:before { - content: "\f133"; } + content: "\f133"; +} .la.la-maxcdn { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-html5 { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-css3 { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-ticket:before { - content: "\f3ff"; } + content: "\f3ff"; +} .la.la-minus-square-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-minus-square-o:before { - content: "\f146"; } + content: "\f146"; +} .la.la-level-up:before { - content: "\f3bf"; } + content: "\f3bf"; +} .la.la-level-down:before { - content: "\f3be"; } + content: "\f3be"; +} .la.la-pencil-square:before { - content: "\f14b"; } + content: "\f14b"; +} .la.la-external-link-square:before { - content: "\f360"; } + content: "\f360"; +} .la.la-compass { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-caret-square-o-down { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-caret-square-o-down:before { - content: "\f150"; } + content: "\f150"; +} .la.la-toggle-down { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-toggle-down:before { - content: "\f150"; } + content: "\f150"; +} .la.la-caret-square-o-up { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-caret-square-o-up:before { - content: "\f151"; } + content: "\f151"; +} .la.la-toggle-up { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-toggle-up:before { - content: "\f151"; } + content: "\f151"; +} .la.la-caret-square-o-right { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-caret-square-o-right:before { - content: "\f152"; } + content: "\f152"; +} .la.la-toggle-right { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-toggle-right:before { - content: "\f152"; } + content: "\f152"; +} .la.la-eur:before { - content: "\f153"; } + content: "\f153"; +} .la.la-euro:before { - content: "\f153"; } + content: "\f153"; +} .la.la-gbp:before { - content: "\f154"; } + content: "\f154"; +} .la.la-usd:before { - content: "\f155"; } + content: "\f155"; +} .la.la-dollar:before { - content: "\f155"; } + content: "\f155"; +} .la.la-inr:before { - content: "\f156"; } + content: "\f156"; +} .la.la-rupee:before { - content: "\f156"; } + content: "\f156"; +} .la.la-jpy:before { - content: "\f157"; } + content: "\f157"; +} .la.la-cny:before { - content: "\f157"; } + content: "\f157"; +} .la.la-rmb:before { - content: "\f157"; } + content: "\f157"; +} .la.la-yen:before { - content: "\f157"; } + content: "\f157"; +} .la.la-rub:before { - content: "\f158"; } + content: "\f158"; +} .la.la-ruble:before { - content: "\f158"; } + content: "\f158"; +} .la.la-rouble:before { - content: "\f158"; } + content: "\f158"; +} .la.la-krw:before { - content: "\f159"; } + content: "\f159"; +} .la.la-won:before { - content: "\f159"; } + content: "\f159"; +} .la.la-btc { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-bitcoin { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-bitcoin:before { - content: "\f15a"; } + content: "\f15a"; +} .la.la-file-text:before { - content: "\f15c"; } + content: "\f15c"; +} .la.la-sort-alpha-asc:before { - content: "\f15d"; } + content: "\f15d"; +} .la.la-sort-alpha-desc:before { - content: "\f881"; } + content: "\f881"; +} .la.la-sort-amount-asc:before { - content: "\f160"; } + content: "\f160"; +} .la.la-sort-amount-desc:before { - content: "\f884"; } + content: "\f884"; +} .la.la-sort-numeric-asc:before { - content: "\f162"; } + content: "\f162"; +} .la.la-sort-numeric-desc:before { - content: "\f886"; } + content: "\f886"; +} .la.la-youtube-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-youtube { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-xing { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-xing-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-youtube-play { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-youtube-play:before { - content: "\f167"; } + content: "\f167"; +} .la.la-dropbox { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-stack-overflow { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-instagram { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-flickr { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-adn { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-bitbucket { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-bitbucket-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-bitbucket-square:before { - content: "\f171"; } + content: "\f171"; +} .la.la-tumblr { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-tumblr-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-long-arrow-down:before { - content: "\f309"; } + content: "\f309"; +} .la.la-long-arrow-up:before { - content: "\f30c"; } + content: "\f30c"; +} .la.la-long-arrow-left:before { - content: "\f30a"; } + content: "\f30a"; +} .la.la-long-arrow-right:before { - content: "\f30b"; } + content: "\f30b"; +} .la.la-apple { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-windows { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-android { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-linux { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-dribbble { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-skype { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-foursquare { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-trello { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-gratipay { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-gittip { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-gittip:before { - content: "\f184"; } + content: "\f184"; +} .la.la-sun-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-sun-o:before { - content: "\f185"; } + content: "\f185"; +} .la.la-moon-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-moon-o:before { - content: "\f186"; } + content: "\f186"; +} .la.la-vk { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-weibo { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-renren { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-pagelines { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-stack-exchange { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-arrow-circle-o-right { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-arrow-circle-o-right:before { - content: "\f35a"; } + content: "\f35a"; +} .la.la-arrow-circle-o-left { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-arrow-circle-o-left:before { - content: "\f359"; } + content: "\f359"; +} .la.la-caret-square-o-left { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-caret-square-o-left:before { - content: "\f191"; } + content: "\f191"; +} .la.la-toggle-left { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-toggle-left:before { - content: "\f191"; } + content: "\f191"; +} .la.la-dot-circle-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-dot-circle-o:before { - content: "\f192"; } + content: "\f192"; +} .la.la-vimeo-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-try:before { - content: "\f195"; } + content: "\f195"; +} .la.la-turkish-lira:before { - content: "\f195"; } + content: "\f195"; +} .la.la-plus-square-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-plus-square-o:before { - content: "\f0fe"; } + content: "\f0fe"; +} .la.la-slack { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-wordpress { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-openid { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-institution:before { - content: "\f19c"; } + content: "\f19c"; +} .la.la-bank:before { - content: "\f19c"; } + content: "\f19c"; +} .la.la-mortar-board:before { - content: "\f19d"; } + content: "\f19d"; +} .la.la-yahoo { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-google { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-reddit { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-reddit-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-stumbleupon-circle { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-stumbleupon { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-delicious { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-digg { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-pied-piper-pp { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-pied-piper-alt { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-drupal { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-joomla { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-spoon:before { - content: "\f2e5"; } + content: "\f2e5"; +} .la.la-behance { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-behance-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-steam { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-steam-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-automobile:before { - content: "\f1b9"; } + content: "\f1b9"; +} .la.la-cab:before { - content: "\f1ba"; } + content: "\f1ba"; +} .la.la-envelope-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-envelope-o:before { - content: "\f0e0"; } + content: "\f0e0"; +} .la.la-deviantart { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-soundcloud { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-pdf-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-pdf-o:before { - content: "\f1c1"; } + content: "\f1c1"; +} .la.la-file-word-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-word-o:before { - content: "\f1c2"; } + content: "\f1c2"; +} .la.la-file-excel-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-excel-o:before { - content: "\f1c3"; } + content: "\f1c3"; +} .la.la-file-powerpoint-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-powerpoint-o:before { - content: "\f1c4"; } + content: "\f1c4"; +} .la.la-file-image-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-image-o:before { - content: "\f1c5"; } + content: "\f1c5"; +} .la.la-file-photo-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-photo-o:before { - content: "\f1c5"; } + content: "\f1c5"; +} .la.la-file-picture-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-picture-o:before { - content: "\f1c5"; } + content: "\f1c5"; +} .la.la-file-archive-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-archive-o:before { - content: "\f1c6"; } + content: "\f1c6"; +} .la.la-file-zip-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-zip-o:before { - content: "\f1c6"; } + content: "\f1c6"; +} .la.la-file-audio-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-audio-o:before { - content: "\f1c7"; } + content: "\f1c7"; +} .la.la-file-sound-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-sound-o:before { - content: "\f1c7"; } + content: "\f1c7"; +} .la.la-file-video-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-video-o:before { - content: "\f1c8"; } + content: "\f1c8"; +} .la.la-file-movie-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-movie-o:before { - content: "\f1c8"; } + content: "\f1c8"; +} .la.la-file-code-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-file-code-o:before { - content: "\f1c9"; } + content: "\f1c9"; +} .la.la-vine { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-codepen { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-jsfiddle { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-life-ring { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-life-bouy { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-life-bouy:before { - content: "\f1cd"; } + content: "\f1cd"; +} .la.la-life-buoy { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-life-buoy:before { - content: "\f1cd"; } + content: "\f1cd"; +} .la.la-life-saver { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-life-saver:before { - content: "\f1cd"; } + content: "\f1cd"; +} .la.la-support { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-support:before { - content: "\f1cd"; } + content: "\f1cd"; +} .la.la-circle-o-notch:before { - content: "\f1ce"; } + content: "\f1ce"; +} .la.la-rebel { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-ra { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-ra:before { - content: "\f1d0"; } + content: "\f1d0"; +} .la.la-resistance { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-resistance:before { - content: "\f1d0"; } + content: "\f1d0"; +} .la.la-empire { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-ge { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-ge:before { - content: "\f1d1"; } + content: "\f1d1"; +} .la.la-git-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-git { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-hacker-news { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-y-combinator-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-y-combinator-square:before { - content: "\f1d4"; } + content: "\f1d4"; +} .la.la-yc-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-yc-square:before { - content: "\f1d4"; } + content: "\f1d4"; +} .la.la-tencent-weibo { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-qq { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-weixin { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-wechat { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-wechat:before { - content: "\f1d7"; } + content: "\f1d7"; +} .la.la-send:before { - content: "\f1d8"; } + content: "\f1d8"; +} .la.la-paper-plane-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-paper-plane-o:before { - content: "\f1d8"; } + content: "\f1d8"; +} .la.la-send-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-send-o:before { - content: "\f1d8"; } + content: "\f1d8"; +} .la.la-circle-thin { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-circle-thin:before { - content: "\f111"; } + content: "\f111"; +} .la.la-header:before { - content: "\f1dc"; } + content: "\f1dc"; +} .la.la-sliders:before { - content: "\f1de"; } + content: "\f1de"; +} .la.la-futbol-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-futbol-o:before { - content: "\f1e3"; } + content: "\f1e3"; +} .la.la-soccer-ball-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-soccer-ball-o:before { - content: "\f1e3"; } + content: "\f1e3"; +} .la.la-slideshare { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-twitch { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-yelp { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-newspaper-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-newspaper-o:before { - content: "\f1ea"; } + content: "\f1ea"; +} .la.la-paypal { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-google-wallet { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-cc-visa { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-cc-mastercard { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-cc-discover { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-cc-amex { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-cc-paypal { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-cc-stripe { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-bell-slash-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-bell-slash-o:before { - content: "\f1f6"; } + content: "\f1f6"; +} .la.la-trash:before { - content: "\f2ed"; } + content: "\f2ed"; +} .la.la-copyright { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-eyedropper:before { - content: "\f1fb"; } + content: "\f1fb"; +} .la.la-area-chart:before { - content: "\f1fe"; } + content: "\f1fe"; +} .la.la-pie-chart:before { - content: "\f200"; } + content: "\f200"; +} .la.la-line-chart:before { - content: "\f201"; } + content: "\f201"; +} .la.la-lastfm { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-lastfm-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-ioxhost { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-angellist { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-cc { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-cc:before { - content: "\f20a"; } + content: "\f20a"; +} .la.la-ils:before { - content: "\f20b"; } + content: "\f20b"; +} .la.la-shekel:before { - content: "\f20b"; } + content: "\f20b"; +} .la.la-sheqel:before { - content: "\f20b"; } + content: "\f20b"; +} .la.la-meanpath { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-meanpath:before { - content: "\f2b4"; } + content: "\f2b4"; +} .la.la-buysellads { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-connectdevelop { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-dashcube { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-forumbee { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-leanpub { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-sellsy { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-shirtsinbulk { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-simplybuilt { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-skyatlas { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-diamond { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-diamond:before { - content: "\f3a5"; } + content: "\f3a5"; +} .la.la-intersex:before { - content: "\f224"; } + content: "\f224"; +} .la.la-facebook-official { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-facebook-official:before { - content: "\f09a"; } + content: "\f09a"; +} .la.la-pinterest-p { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-whatsapp { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-hotel:before { - content: "\f236"; } + content: "\f236"; +} .la.la-viacoin { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-medium { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-y-combinator { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-yc { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-yc:before { - content: "\f23b"; } + content: "\f23b"; +} .la.la-optin-monster { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-opencart { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-expeditedssl { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-battery-4:before { - content: "\f240"; } + content: "\f240"; +} .la.la-battery:before { - content: "\f240"; } + content: "\f240"; +} .la.la-battery-3:before { - content: "\f241"; } + content: "\f241"; +} .la.la-battery-2:before { - content: "\f242"; } + content: "\f242"; +} .la.la-battery-1:before { - content: "\f243"; } + content: "\f243"; +} .la.la-battery-0:before { - content: "\f244"; } + content: "\f244"; +} .la.la-object-group { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-object-ungroup { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-sticky-note-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-sticky-note-o:before { - content: "\f249"; } + content: "\f249"; +} .la.la-cc-jcb { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-cc-diners-club { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-clone { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hourglass-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hourglass-o:before { - content: "\f254"; } + content: "\f254"; +} .la.la-hourglass-1:before { - content: "\f251"; } + content: "\f251"; +} .la.la-hourglass-2:before { - content: "\f252"; } + content: "\f252"; +} .la.la-hourglass-3:before { - content: "\f253"; } + content: "\f253"; +} .la.la-hand-rock-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hand-rock-o:before { - content: "\f255"; } + content: "\f255"; +} .la.la-hand-grab-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hand-grab-o:before { - content: "\f255"; } + content: "\f255"; +} .la.la-hand-paper-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hand-paper-o:before { - content: "\f256"; } + content: "\f256"; +} .la.la-hand-stop-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hand-stop-o:before { - content: "\f256"; } + content: "\f256"; +} .la.la-hand-scissors-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hand-scissors-o:before { - content: "\f257"; } + content: "\f257"; +} .la.la-hand-lizard-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hand-lizard-o:before { - content: "\f258"; } + content: "\f258"; +} .la.la-hand-spock-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hand-spock-o:before { - content: "\f259"; } + content: "\f259"; +} .la.la-hand-pointer-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hand-pointer-o:before { - content: "\f25a"; } + content: "\f25a"; +} .la.la-hand-peace-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-hand-peace-o:before { - content: "\f25b"; } + content: "\f25b"; +} .la.la-registered { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-creative-commons { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-gg { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-gg-circle { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-tripadvisor { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-odnoklassniki { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-odnoklassniki-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-get-pocket { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-wikipedia-w { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-safari { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-chrome { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-firefox { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-opera { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-internet-explorer { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-television:before { - content: "\f26c"; } + content: "\f26c"; +} .la.la-contao { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-500px { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-amazon { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-calendar-plus-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-calendar-plus-o:before { - content: "\f271"; } + content: "\f271"; +} .la.la-calendar-minus-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-calendar-minus-o:before { - content: "\f272"; } + content: "\f272"; +} .la.la-calendar-times-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-calendar-times-o:before { - content: "\f273"; } + content: "\f273"; +} .la.la-calendar-check-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-calendar-check-o:before { - content: "\f274"; } + content: "\f274"; +} .la.la-map-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-map-o:before { - content: "\f279"; } + content: "\f279"; +} .la.la-commenting:before { - content: "\f4ad"; } + content: "\f4ad"; +} .la.la-commenting-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-commenting-o:before { - content: "\f4ad"; } + content: "\f4ad"; +} .la.la-houzz { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-vimeo { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-vimeo:before { - content: "\f27d"; } + content: "\f27d"; +} .la.la-black-tie { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-fonticons { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-reddit-alien { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-edge { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-credit-card-alt:before { - content: "\f09d"; } + content: "\f09d"; +} .la.la-codiepie { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-modx { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-fort-awesome { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-usb { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-product-hunt { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-mixcloud { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-scribd { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-pause-circle-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-pause-circle-o:before { - content: "\f28b"; } + content: "\f28b"; +} .la.la-stop-circle-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-stop-circle-o:before { - content: "\f28d"; } + content: "\f28d"; +} .la.la-bluetooth { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-bluetooth-b { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-gitlab { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-wpbeginner { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-wpforms { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-envira { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-wheelchair-alt { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-wheelchair-alt:before { - content: "\f368"; } + content: "\f368"; +} .la.la-question-circle-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-question-circle-o:before { - content: "\f059"; } + content: "\f059"; +} .la.la-volume-control-phone:before { - content: "\f2a0"; } + content: "\f2a0"; +} .la.la-asl-interpreting:before { - content: "\f2a3"; } + content: "\f2a3"; +} .la.la-deafness:before { - content: "\f2a4"; } + content: "\f2a4"; +} .la.la-hard-of-hearing:before { - content: "\f2a4"; } + content: "\f2a4"; +} .la.la-glide { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-glide-g { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-signing:before { - content: "\f2a7"; } + content: "\f2a7"; +} .la.la-viadeo { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-viadeo-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-snapchat { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-snapchat-ghost { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-snapchat-square { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-pied-piper { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-first-order { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-yoast { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-themeisle { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-google-plus-official { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-google-plus-official:before { - content: "\f2b3"; } + content: "\f2b3"; +} .la.la-google-plus-circle { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-google-plus-circle:before { - content: "\f2b3"; } + content: "\f2b3"; +} .la.la-font-awesome { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-fa { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-fa:before { - content: "\f2b4"; } + content: "\f2b4"; +} .la.la-handshake-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-handshake-o:before { - content: "\f2b5"; } + content: "\f2b5"; +} .la.la-envelope-open-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-envelope-open-o:before { - content: "\f2b6"; } + content: "\f2b6"; +} .la.la-linode { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-address-book-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-address-book-o:before { - content: "\f2b9"; } + content: "\f2b9"; +} .la.la-vcard:before { - content: "\f2bb"; } + content: "\f2bb"; +} .la.la-address-card-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-address-card-o:before { - content: "\f2bb"; } + content: "\f2bb"; +} .la.la-vcard-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-vcard-o:before { - content: "\f2bb"; } + content: "\f2bb"; +} .la.la-user-circle-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-user-circle-o:before { - content: "\f2bd"; } + content: "\f2bd"; +} .la.la-user-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-user-o:before { - content: "\f007"; } + content: "\f007"; +} .la.la-id-badge { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-drivers-license:before { - content: "\f2c2"; } + content: "\f2c2"; +} .la.la-id-card-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-id-card-o:before { - content: "\f2c2"; } + content: "\f2c2"; +} .la.la-drivers-license-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-drivers-license-o:before { - content: "\f2c2"; } + content: "\f2c2"; +} .la.la-quora { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-free-code-camp { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-telegram { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-thermometer-4:before { - content: "\f2c7"; } + content: "\f2c7"; +} .la.la-thermometer:before { - content: "\f2c7"; } + content: "\f2c7"; +} .la.la-thermometer-3:before { - content: "\f2c8"; } + content: "\f2c8"; +} .la.la-thermometer-2:before { - content: "\f2c9"; } + content: "\f2c9"; +} .la.la-thermometer-1:before { - content: "\f2ca"; } + content: "\f2ca"; +} .la.la-thermometer-0:before { - content: "\f2cb"; } + content: "\f2cb"; +} .la.la-bathtub:before { - content: "\f2cd"; } + content: "\f2cd"; +} .la.la-s15:before { - content: "\f2cd"; } + content: "\f2cd"; +} .la.la-window-maximize { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-window-restore { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-times-rectangle:before { - content: "\f410"; } + content: "\f410"; +} .la.la-window-close-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-window-close-o:before { - content: "\f410"; } + content: "\f410"; +} .la.la-times-rectangle-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-times-rectangle-o:before { - content: "\f410"; } + content: "\f410"; +} .la.la-bandcamp { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-grav { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-etsy { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-imdb { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-ravelry { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-eercast { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-eercast:before { - content: "\f2da"; } + content: "\f2da"; +} .la.la-snowflake-o { font-family: 'Line Awesome Free'; - font-weight: 400; } + font-weight: 400; +} .la.la-snowflake-o:before { - content: "\f2dc"; } + content: "\f2dc"; +} .la.la-superpowers { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-wpexplorer { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} .la.la-spotify { font-family: 'Line Awesome Brands'; - font-weight: 400; } + font-weight: 400; +} diff --git a/modules/noahs_ai/noahs_ai.links.menu.yml b/modules/noahs_ai/noahs_ai.links.menu.yml index b2168eb..2df7b02 100644 --- a/modules/noahs_ai/noahs_ai.links.menu.yml +++ b/modules/noahs_ai/noahs_ai.links.menu.yml @@ -3,4 +3,3 @@ noahs_ai.settings: description: Settings to use Noahs AI. route_name: noahs_ai.settings parent: noahs_page_builder.admin - diff --git a/modules/noahs_ai/noahs_ai.module b/modules/noahs_ai/noahs_ai.module index 6aa0121..2a8e11c 100644 --- a/modules/noahs_ai/noahs_ai.module +++ b/modules/noahs_ai/noahs_ai.module @@ -1,11 +1,17 @@ <?php -use Drupal\Core\Render\AttachmentsInterface; +/** + * @file + */ /** * @file * Primary module hooks for noahs_ai module. */ + +/** + * Implements hook_preprocess_page(). + */ function noahs_ai_preprocess_page(&$variables) { // Add the CSS file to the page. $route_name = \Drupal::routeMatch()->getRouteName(); diff --git a/modules/noahs_ai/src/Form/NoahsAiSettingsForm.php b/modules/noahs_ai/src/Form/NoahsAiSettingsForm.php index cbd9bcf..d76d640 100644 --- a/modules/noahs_ai/src/Form/NoahsAiSettingsForm.php +++ b/modules/noahs_ai/src/Form/NoahsAiSettingsForm.php @@ -32,12 +32,13 @@ final class NoahsAiSettingsForm extends ConfigFormBase { public function buildForm(array $form, FormStateInterface $form_state): array { $config = $this->config('noahs_ai.settings'); - //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 + // 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. $form['openai_api_key'] = [ '#type' => 'textfield', '#title' => $this->t('OpenAI API Key'), '#default_value' => $config->get('openai_api_key'), - '#maxlength' => 512, // Puedes ajustar este valor si es necesario + // Puedes ajustar este valor si es necesario. + '#maxlength' => 512, '#description' => $this->t('To use this feature, you need an OpenAI API key. You can obtain your API key by creating an account at <a href=":link" target="_blank">OpenAI</a>. Once logged in, go to your account settings → <strong>API keys</strong>, and click on <strong>Create new secret key</strong>. Copy the key and paste it here. Make sure to keep it safe and do not share it publicly.', [ ':link' => 'https://platform.openai.com/signup', ]), @@ -57,7 +58,6 @@ final class NoahsAiSettingsForm extends ConfigFormBase { '#required' => TRUE, ]; - return parent::buildForm($form, $form_state); } @@ -101,9 +101,9 @@ final class NoahsAiSettingsForm extends ConfigFormBase { $config->save(); - // Call the parent method without returning it + // Call the parent method without returning it. parent::submitForm($form, $form_state); - + } } diff --git a/modules/noahs_gallery/noahs_gallery.module b/modules/noahs_gallery/noahs_gallery.module index 65fc268..44ae6bc 100644 --- a/modules/noahs_gallery/noahs_gallery.module +++ b/modules/noahs_gallery/noahs_gallery.module @@ -1,5 +1,9 @@ <?php +/** + * @file + */ + declare(strict_types=1); /** @@ -85,19 +89,18 @@ function noahs_gallery_user_predelete(UserInterface $account): void { } /** - * (Optional) + * Implements hook_noahs_page_builder_widget_info_alter(). */ - function noahs_gallery_noahs_page_builder_widget_info_alter(array &$info) { if (isset($info['noahs_gallery'])) { - + $info['noahs_gallery'] = [ - 'id' => 'noahs_gallery', - 'class' => 'Drupal\noahs_gallery\Plugin\Widget\WidgetNoahsGallery', + 'id' => 'noahs_gallery', + 'class' => 'Drupal\noahs_gallery\Plugin\Widget\WidgetNoahsGallery', 'provider' => 'noahs_gallery', 'label' => t('Noahs Gallery'), ]; } -} \ No newline at end of file +} diff --git a/modules/noahs_gallery/src/Entity/NoahSGallery.php b/modules/noahs_gallery/src/Entity/NoahSGallery.php index bdf43e2..660e4e2 100644 --- a/modules/noahs_gallery/src/Entity/NoahSGallery.php +++ b/modules/noahs_gallery/src/Entity/NoahSGallery.php @@ -100,7 +100,7 @@ final class NoahSGallery extends ContentEntityBase implements NoahSGalleryInterf ]) ->setDisplayConfigurable('view', TRUE); - $fields['images'] = BaseFieldDefinition::create('entity_reference') + $fields['images'] = BaseFieldDefinition::create('entity_reference') ->setLabel(t('Images')) ->setDescription(t('Select multiple images for the gallery.')) ->setSetting('target_type', 'media') @@ -110,7 +110,7 @@ final class NoahSGallery extends ContentEntityBase implements NoahSGalleryInterf ]) ->setCardinality(BaseFieldDefinition::CARDINALITY_UNLIMITED) ->setDisplayOptions('form', [ - 'type' => 'media_library_widget', + 'type' => 'media_library_widget', 'weight' => 5, 'settings' => [ 'field_widget_media_library_view' => 'grid', @@ -118,13 +118,12 @@ final class NoahSGallery extends ContentEntityBase implements NoahSGalleryInterf ]) ->setDisplayConfigurable('form', TRUE) ->setDisplayOptions('view', [ - 'type' => 'media_thumbnail', + 'type' => 'media_thumbnail', 'label' => 'hidden', 'weight' => 5, ]) ->setDisplayConfigurable('view', TRUE); - $fields['description'] = BaseFieldDefinition::create('text_long') ->setTranslatable(TRUE) ->setLabel(t('Description')) @@ -177,8 +176,8 @@ final class NoahSGallery extends ContentEntityBase implements NoahSGalleryInterf 'weight' => 20, ]) ->setDisplayConfigurable('view', TRUE); - - $fields['status'] = BaseFieldDefinition::create('boolean') + + $fields['status'] = BaseFieldDefinition::create('boolean') ->setLabel(t('Status')) ->setDefaultValue(TRUE) ->setSetting('on_label', 'Enabled') diff --git a/modules/noahs_gallery/src/Plugin/Widget/WidgetNoahsGallery.php b/modules/noahs_gallery/src/Plugin/Widget/WidgetNoahsGallery.php index 673024f..0a185fa 100644 --- a/modules/noahs_gallery/src/Plugin/Widget/WidgetNoahsGallery.php +++ b/modules/noahs_gallery/src/Plugin/Widget/WidgetNoahsGallery.php @@ -12,7 +12,6 @@ use Drupal\noahs_page_builder\Plugin\Widget\WidgetBase; * label = @Translation("Gallery") * ) */ - class WidgetNoahsGallery extends WidgetBase { /** @@ -33,8 +32,8 @@ class WidgetNoahsGallery extends WidgetBase { public function renderForm() { $form = []; - $galleries = \Drupal::entityTypeManager()->getStorage('noahs_gallery_type')->loadByProperties(['status' => true]); - + $galleries = \Drupal::entityTypeManager()->getStorage('noahs_gallery_type')->loadByProperties(['status' => TRUE]); + $opciones = []; $opciones[''] = t('Select a gallery'); foreach ($galleries as $gallery) { @@ -224,15 +223,14 @@ class WidgetNoahsGallery extends WidgetBase { $gallery_columns = !empty($settings->element->gallery_type_columns) ? $settings->element->gallery_type_columns : 'row-cols-1 row-cols-sm-2 row-cols-md-4'; $remove_fancybox = !empty($settings->element->remove_fancybox) ? $settings->element->remove_fancybox : FALSE; - if(!empty($settings->element->gallery_items)) { + if (!empty($settings->element->gallery_items)) { $items = $settings->element->gallery_items; } - else if(!empty($settings->element->noahs_gallery_entity)) { + elseif (!empty($settings->element->noahs_gallery_entity)) { $gallery = \Drupal::entityTypeManager()->getStorage('noahs_gallery_type')->load($settings->element->noahs_gallery_entity); $items = $gallery->get('images')->referencedEntities(); } - $output = ''; $output .= '<div class="noahs_page_builder-gallery ' . $gallery_type . '">'; @@ -244,11 +242,11 @@ class WidgetNoahsGallery extends WidgetBase { if (isset($item->fid)) { $mid = $item->fid; } - if(!empty($settings->element->noahs_gallery_entity)) { + if (!empty($settings->element->noahs_gallery_entity)) { $mid = $item->mid->value; } - if($mid) { + if ($mid) { $media = Media::load($mid); if ($media && $media->bundle() === 'image') { $media_field_name = 'field_media_image'; @@ -262,7 +260,7 @@ class WidgetNoahsGallery extends WidgetBase { } } } - + $description = !empty($item->description) ? $item->description : NULL; $url = ''; if (isset($item->url)) { diff --git a/noahs_page_builder.install b/noahs_page_builder.install index 5a17111..c851c7b 100755 --- a/noahs_page_builder.install +++ b/noahs_page_builder.install @@ -1,13 +1,14 @@ <?php -use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Entity\EntityStorageInterface; -use Drupal\Core\Messenger\MessengerInterface; -use Drupal\Core\Database\Database; -use Drupal\Core\Database\SchemaObjectExistsException; +/** + * @file + */ +/** + * Implements hook_schema(). + */ function noahs_page_builder_schema() { - + $schema['noahs_page_builder_page'] = [ 'description' => 'Store data from Noahs', 'fields' => [ @@ -68,20 +69,18 @@ function noahs_page_builder_schema() { 'primary key' => ['page_id'], ]; - return $schema; } - /** - * Instala el esquema de la entidad 'noahs_gallery' si no existe. + * Installs the 'noahs_gallery' entity type if it doesn't exist. */ function noahs_page_builder_update_9011() { $schema = \Drupal::database()->schema(); - if($schema->tableExists('noahs_gallery_type')) { + if ($schema->tableExists('noahs_gallery_type')) { \Drupal::entityTypeManager()->clearCachedDefinitions(); \Drupal::entityDefinitionUpdateManager() ->installEntityType(\Drupal::entityTypeManager()->getDefinition('noahs_gallery_type')); } -} \ No newline at end of file +} diff --git a/noahs_page_builder.libraries.yml b/noahs_page_builder.libraries.yml index 247f78e..7dd4d9a 100644 --- a/noahs_page_builder.libraries.yml +++ b/noahs_page_builder.libraries.yml @@ -129,4 +129,3 @@ noahs_page_builder.jquery_ui: https://code.jquery.com/ui/1.14.1/themes/base/jquery-ui.css: { type: external } dependencies: - core/jquery - \ No newline at end of file diff --git a/noahs_page_builder.module b/noahs_page_builder.module index 4268046..9a0b7bf 100644 --- a/noahs_page_builder.module +++ b/noahs_page_builder.module @@ -1,34 +1,36 @@ <?php -use Drupal\Core\File\FileSystemInterface; +/** + * @file + */ + +use Drupal\Core\Cache\RefinableCacheableDependencyInterface; +use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\views\Views; use Drupal\Core\Url; -use Drupal\noahs_page_builder\Plugin\Widget\WidgetBase; use Drupal\noahs_page_builder\Controller\NoahsController; -use Drupal\noahs_page_builder\Controller\NoahsSaveStylesController; use Drupal\block\Entity\Block; -use Drupal\Core\File\FileSystem; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Access\AccessResult; - $moduleHandler = \Drupal::service('module_handler'); -define( 'NOAHS_PAGE_BUILDER_PATH', \Drupal::service('extension.list.module')->getPath('noahs_page_builder') ); +define('NOAHS_PAGE_BUILDER_PATH', \Drupal::service('extension.list.module')->getPath('noahs_page_builder')); if ($moduleHandler->moduleExists('noahs_page_builder_pro')) { -define( 'NOAHS_PAGE_BUILDER_PRO_PATH', \Drupal::service('extension.list.module')->getPath('noahs_page_builder_pro') ); -}else{ - define( 'NOAHS_PAGE_BUILDER_PRO_PATH', '' ); + define('NOAHS_PAGE_BUILDER_PRO_PATH', \Drupal::service('extension.list.module')->getPath('noahs_page_builder_pro')); } -define( 'NOAHS_PAGE_BUILDER_CSS_PATH', 'public://noahs/noahs_settings'); - +else { + define('NOAHS_PAGE_BUILDER_PRO_PATH', ''); +} +define('NOAHS_PAGE_BUILDER_CSS_PATH', 'public://noahs/noahs_settings'); /** - * Alter form + * Implements hook_form_alter(). */ -function noahs_page_builder_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { +function noahs_page_builder_form_alter(&$form, FormStateInterface $form_state, $form_id) { $noahs_page_builder_config = \Drupal::config('noahs_page_builder.settings'); $route = \Drupal::routeMatch()->getRouteName(); @@ -36,12 +38,12 @@ function noahs_page_builder_form_alter(&$form, \Drupal\Core\Form\FormStateInterf $node = $route_match->getParameter('node'); $use_in_ctype = $noahs_page_builder_config->get('use_in_ctype'); - if($route === 'quick_node_clone.node.quick_clone' || - $route === 'entity.node.content_translation_add'){ - foreach($use_in_ctype as $type){ - if(!is_numeric($type)){ - if($form_id === 'node_'.$type.'_quick_node_clone_form' - || $form_id === 'node_'.$type.'_form' ){ + if ($route === 'quick_node_clone.node.quick_clone' || + $route === 'entity.node.content_translation_add') { + foreach ($use_in_ctype as $type) { + if (!is_numeric($type)) { + if ($form_id === 'node_' . $type . '_quick_node_clone_form' + || $form_id === 'node_' . $type . '_form') { $form_state->set('noahs_page_builder_original_nid', $node->id()); $form_state->set('noahs_page_builder_lancgode', $node->get('langcode')->value); @@ -54,211 +56,214 @@ function noahs_page_builder_form_alter(&$form, \Drupal\Core\Form\FormStateInterf } /** - * Clone functions + * Clone functions. + * + * @param array $form + * The form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The form state. */ -function noahs_page_builder_clone_submit($form, \Drupal\Core\Form\FormStateInterface $form_state) { - +function noahs_page_builder_clone_submit($form, FormStateInterface $form_state) { + $clone_page = \Drupal::classResolver(NoahsController::class)->clonePage( - $form_state->get('noahs_page_builder_original_nid'), - $form_state->get('nid'), + $form_state->get('noahs_page_builder_original_nid'), + $form_state->get('nid'), $form_state->get('noahs_page_builder_lancgode'), $form_state->get('langcode'), $form_state->get('noahs_page_builder_type'), ); - \Drupal::messenger()->addMessage('New Noahs Page Added'); } /** - * Suggestion page + * Implements hook_theme_suggestions_page_alter(). */ function noahs_page_builder_theme_suggestions_page_alter(array &$suggestions, array $variables) { - $route = \Drupal::routeMatch()->getRouteName(); - if (strpos($route, ".canonical") !== false) { - $suggestions[] = 'page__noahs__front'; - } + $route = \Drupal::routeMatch()->getRouteName(); + if (strpos($route, ".canonical") !== FALSE) { + $suggestions[] = 'page__noahs__front'; + } } /** - * Suggestion messages + * Implements hook_theme_suggestions_status_messages_alter(). */ function noahs_page_builder_theme_suggestions_status_messages_alter(array &$suggestions, array $variables) { - $route = \Drupal::routeMatch(); - $suggestions[] = 'status_messages__noahs'; + $route = \Drupal::routeMatch(); + $suggestions[] = 'status_messages__noahs'; } /** - * Preprocess html + * Implements hook_preprocess_html_alter(). */ -function noahs_page_builder_preprocess_html(array &$vars) { - +function noahs_page_builder_preprocess_html_alter(array &$vars) { - $route = \Drupal::routeMatch()->getRouteName(); - $route_match = \Drupal::routeMatch(); + $route = \Drupal::routeMatch()->getRouteName(); + $route_match = \Drupal::routeMatch(); - $quote_menu_paths = [ - 'noahs_page_builder.editor', - 'noahs_page_builder_pro.iframe', - 'noahs_page_builder_pro.build', - ]; + $quote_menu_paths = [ + 'noahs_page_builder.editor', + 'noahs_page_builder_pro.iframe', + 'noahs_page_builder_pro.build', + ]; - if (in_array($route, $quote_menu_paths)) { - $vars['attributes']['class'][] = 'noahs_page_builder-editor-active'; - } - // Get the current path - $current_path = \Drupal::service('path.current')->getPath(); - $internal = \Drupal::service('path_alias.manager')->getAliasByPath($current_path); + if (in_array($route, $quote_menu_paths)) { + $vars['attributes']['class'][] = 'noahs_page_builder-editor-active'; + } + // Get the current path. + $current_path = \Drupal::service('path.current')->getPath(); + $internal = \Drupal::service('path_alias.manager')->getAliasByPath($current_path); - // Assign it to body class - $vars['attributes']['class'][] = str_replace("/", "", $internal); + // Assign it to body class. + $vars['attributes']['class'][] = str_replace("/", "", $internal); } /** - * Theme + * Implements hook_theme(). */ function noahs_page_builder_theme($existing, $type, $theme, $path) { - return array( - 'noahs-settings-form' => array( - 'variables' => array( - 'content' => '', - 'iframe_url' => '', - ), - 'path' => $path . '/templates/backend', - ), - 'noahs-settings-iframe' => array( - 'variables' => array( - 'widget' => '', - ), - 'path' => $path . '/templates/backend', - ), - 'noahs-admin-form' => array( - 'variables' => array( - 'page' => '', - 'content' => '', - 'noahs_id' => '', - 'langcode' => '', - 'entity_type' => '', - 'url' => '', - 'widgets' => [], - 'globlal_widgets' => [], - 'defaults_widgets' => [], - 'page_settings' => [], - 'iframe_url' => '', - 'noahs_pro' => '', - 'noahs_ai' => '', - ), - 'path' => $path . '/templates/backend', - ), - 'noahs-admin-preview' => array( - 'variables' => array( - 'page' => '', - 'content' => '', - 'page_settings' => [], - 'generated_html' => '', - 'noahs_id' => '', - 'type' => '', - 'entity_type' => '', - 'langcode' => '', - 'widgets' => '', - 'noahs_pro' => '', - 'noahs_ai' => '', - 'logo' => '/' . NOAHS_PAGE_BUILDER_PATH . '/assets/img/logo.svg', - ), - 'path' => $path . '/templates/backend', - ), - 'html__product_preview__noahs_page_builder' => array( - 'template' => 'html--preview--noahs', - 'base hook' => 'html', - 'path' => $path . '/templates/backend', - ), - 'html__admin__structure__noahs__settings_styles' => array( - 'template' => 'html--noahs-settings-styles', - 'base hook' => 'html', - 'path' => $path . '/templates/backend', - ), - 'html__admin__structure__noahs__settings_iframe' => array( - 'template' => 'html--noahs-settings-iframe', - 'base hook' => 'html', - 'path' => $path . '/templates/backend', - ), - 'html__preview__noahs_page_builder' => array( - 'template' => 'html--preview--noahs', - 'base hook' => 'html', - 'path' => $path . '/templates/backend', - ), - 'html__noahs_edit' => array( - 'template' => 'html--noahs-edit', - 'base hook' => 'html', - 'path' => $path . '/templates/backend', - ), - 'page__admin__structure__noahs__settings_styles' => array( - 'template' => 'page--noahs-settings-styles', - 'base hook' => 'page', - 'path' => $path . '/templates/backend', - ), - 'page__admin__structure__noahs__settings_iframe' => array( - 'template' => 'page--noahs-settings-iframe', - 'base hook' => 'page', - 'path' => $path . '/templates/backend', - ), - 'page__preview__noahs_page_builder' => array( - 'template' => 'page--preview--noahs', - 'base hook' => 'page', - 'path' => $path . '/templates/backend', - ), - 'page__noahs_edit' => array( - 'template' => 'page--noahs-edit', - 'base hook' => 'page', - 'path' => $path . '/templates/backend', - ), - 'page__noahs_edit__preview' => array( - 'template' => 'page--noahs-edit-preview', - 'base hook' => 'page', - 'path' => $path . '/templates/backend', - ), - 'noahs-admin-edit-widget' => array( - 'variables' => array( - 'page' => '', - 'content' => '', - ), - 'path' => $path . '/templates/backend', - ), - 'noahs_icons_list' => array( - 'variables' => array( - 'content' => '', - 'icons' => '', - ), - 'path' => $path . '/templates/backend', - ), - 'noahs_media_modal_page' => array( - 'template' => 'noahs--media-modal-page', - 'variables' => array( - 'data' => [], - 'element_id' => '', - 'view_render' => '', - 'type' => '', - 'wid' => '', - 'source' => '', - ), - 'path' => $path . '/templates/backend', - ), + return [ + 'noahs-settings-form' => [ + 'variables' => [ + 'content' => '', + 'iframe_url' => '', + ], + 'path' => $path . '/templates/backend', + ], + 'noahs-settings-iframe' => [ + 'variables' => [ + 'widget' => '', + ], + 'path' => $path . '/templates/backend', + ], + 'noahs-admin-form' => [ + 'variables' => [ + 'page' => '', + 'content' => '', + 'noahs_id' => '', + 'langcode' => '', + 'entity_type' => '', + 'url' => '', + 'widgets' => [], + 'globlal_widgets' => [], + 'defaults_widgets' => [], + 'page_settings' => [], + 'iframe_url' => '', + 'noahs_pro' => '', + 'noahs_ai' => '', + ], + 'path' => $path . '/templates/backend', + ], + 'noahs-admin-preview' => [ + 'variables' => [ + 'page' => '', + 'content' => '', + 'page_settings' => [], + 'generated_html' => '', + 'noahs_id' => '', + 'type' => '', + 'entity_type' => '', + 'langcode' => '', + 'widgets' => '', + 'noahs_pro' => '', + 'noahs_ai' => '', + 'logo' => '/' . NOAHS_PAGE_BUILDER_PATH . '/assets/img/logo.svg', + ], + 'path' => $path . '/templates/backend', + ], + 'html__product_preview__noahs_page_builder' => [ + 'template' => 'html--preview--noahs', + 'base hook' => 'html', + 'path' => $path . '/templates/backend', + ], + 'html__admin__structure__noahs__settings_styles' => [ + 'template' => 'html--noahs-settings-styles', + 'base hook' => 'html', + 'path' => $path . '/templates/backend', + ], + 'html__admin__structure__noahs__settings_iframe' => [ + 'template' => 'html--noahs-settings-iframe', + 'base hook' => 'html', + 'path' => $path . '/templates/backend', + ], + 'html__preview__noahs_page_builder' => [ + 'template' => 'html--preview--noahs', + 'base hook' => 'html', + 'path' => $path . '/templates/backend', + ], + 'html__noahs_edit' => [ + 'template' => 'html--noahs-edit', + 'base hook' => 'html', + 'path' => $path . '/templates/backend', + ], + 'page__admin__structure__noahs__settings_styles' => [ + 'template' => 'page--noahs-settings-styles', + 'base hook' => 'page', + 'path' => $path . '/templates/backend', + ], + 'page__admin__structure__noahs__settings_iframe' => [ + 'template' => 'page--noahs-settings-iframe', + 'base hook' => 'page', + 'path' => $path . '/templates/backend', + ], + 'page__preview__noahs_page_builder' => [ + 'template' => 'page--preview--noahs', + 'base hook' => 'page', + 'path' => $path . '/templates/backend', + ], + 'page__noahs_edit' => [ + 'template' => 'page--noahs-edit', + 'base hook' => 'page', + 'path' => $path . '/templates/backend', + ], + 'page__noahs_edit__preview' => [ + 'template' => 'page--noahs-edit-preview', + 'base hook' => 'page', + 'path' => $path . '/templates/backend', + ], + 'noahs-admin-edit-widget' => [ + 'variables' => [ + 'page' => '', + 'content' => '', + ], + 'path' => $path . '/templates/backend', + ], + 'noahs_icons_list' => [ + 'variables' => [ + 'content' => '', + 'icons' => '', + ], + 'path' => $path . '/templates/backend', + ], + 'noahs_media_modal_page' => [ + 'template' => 'noahs--media-modal-page', + 'variables' => [ + 'data' => [], + 'element_id' => '', + 'view_render' => '', + 'type' => '', + 'wid' => '', + 'source' => '', + ], + 'path' => $path . '/templates/backend', + ], 'noahs_menu_local_tasks' => [ - 'variables' => ['primary' => [], 'secondary' => []], + 'variables' => ['primary' => [], 'secondary' => []], ], - ); + ]; } /** - * Entity delete + * Implements hook_entity_delete(). */ -function noahs_page_builder_entity_delete(\Drupal\Core\Entity\EntityInterface $entity) { +function noahs_page_builder_entity_delete(EntityInterface $entity) { $langcode = \Drupal::languageManager()->getCurrentLanguage()->getId(); $entity_type = $entity->getEntityTypeId(); $entity_id = $entity->id(); - // Usar correctamente \Drupal::database() si estás fuera de clase + // Usar correctamente \Drupal::database() si estás fuera de clase. $builder = \Drupal::database()->select('noahs_page_builder_page', 'd') ->fields('d', ['entity_id']) ->condition('entity_id', $entity_id) @@ -279,193 +284,197 @@ function noahs_page_builder_entity_delete(\Drupal\Core\Entity\EntityInterface $e } /** - * Share variables + * Share variables. + * + * @return array + * The variables. */ -function sharePageVariables(){ - $variables = \Drupal::request()->attributes->get('_noahs_page_builder_preprocessed_variables', []); - return $variables; +function sharePageVariables() { + $variables = \Drupal::request()->attributes->get('_noahs_page_builder_preprocessed_variables', []); + return $variables; } /** - * Check user in route + * Check user in route. + * + * @return bool + * The user. */ function noahsCheckUser() { - $current_user = \Drupal::currentUser(); - if ($current_user->isAuthenticated()) { - return true; - } + $current_user = \Drupal::currentUser(); + if ($current_user->isAuthenticated()) { + return TRUE; + } } /** - * Preprocess page + * Implements hook_preprocess_page(). */ function noahs_page_builder_preprocess_page(&$variables) { - \Drupal::request()->attributes->set('_noahs_page_builder_preprocessed_variables', $variables); - $noahs_page_builder_config = \Drupal::config('noahs_page_builder.settings'); - $langcode = \Drupal::languageManager()->getCurrentLanguage()->getId(); - $pallete_color = []; - - $viewPortTablet = !empty($noahs_page_builder_config->get('viewport_tablet')) ? $noahs_page_builder_config->get('viewport_tablet') : '959'; - $viewPortMobile = !empty($noahs_page_builder_config->get('viewport_mobile')) ? $noahs_page_builder_config->get('viewport_mobile') : '767'; + \Drupal::request()->attributes->set('_noahs_page_builder_preprocessed_variables', $variables); + $noahs_page_builder_config = \Drupal::config('noahs_page_builder.settings'); + $langcode = \Drupal::languageManager()->getCurrentLanguage()->getId(); + $pallete_color = []; - $pallete_color[] = !empty($noahs_page_builder_config->get('principal_color')) ? $noahs_page_builder_config->get('principal_color') : '#2389ab'; - $pallete_color[] = !empty($noahs_page_builder_config->get('secondary_color')) ? $noahs_page_builder_config->get('secondary_color') : '#4a4a4a'; - $pallete_color[] = !empty($noahs_page_builder_config->get('heading_color')) ? $noahs_page_builder_config->get('heading_color') : '#4a4a4a'; - $pallete_color[] = !empty($noahs_page_builder_config->get('text_color')) ? $noahs_page_builder_config->get('text_color') : '#000000'; + $viewPortTablet = !empty($noahs_page_builder_config->get('viewport_tablet')) ? $noahs_page_builder_config->get('viewport_tablet') : '959'; + $viewPortMobile = !empty($noahs_page_builder_config->get('viewport_mobile')) ? $noahs_page_builder_config->get('viewport_mobile') : '767'; - $custom_colors = $noahs_page_builder_config->get('custom_color') ?? []; + $pallete_color[] = !empty($noahs_page_builder_config->get('principal_color')) ? $noahs_page_builder_config->get('principal_color') : '#2389ab'; + $pallete_color[] = !empty($noahs_page_builder_config->get('secondary_color')) ? $noahs_page_builder_config->get('secondary_color') : '#4a4a4a'; + $pallete_color[] = !empty($noahs_page_builder_config->get('heading_color')) ? $noahs_page_builder_config->get('heading_color') : '#4a4a4a'; + $pallete_color[] = !empty($noahs_page_builder_config->get('text_color')) ? $noahs_page_builder_config->get('text_color') : '#000000'; - foreach ($custom_colors as $color) { - if (!empty($color['hex'])) { - $pallete_color[] = $color['hex']; - } - } - - $variables['#attached']['drupalSettings']['noahs_page_builder']['pallete_color'] = $pallete_color; - $variables['#attached']['drupalSettings']['noahs_page_builder']['viewport_tablet'] = $viewPortTablet; - $variables['#attached']['drupalSettings']['noahs_page_builder']['viewport_mobile'] = $viewPortMobile; - - $route = \Drupal::routeMatch()->getRouteName(); - $route_match = \Drupal::routeMatch(); - $classes = []; - $attributes = []; - $moduleHandler = \Drupal::service('module_handler'); - - $variables['#attached']['drupalSettings']['noahs_page_builder']['check_user'] = noahsCheckUser(); - $variables['#attached']['library'][] = 'noahs_page_builder/noahs_page_builder.noahs_admin'; - $active_theme = \Drupal::theme()->getActiveTheme()->getName(); - $defaultThemeName = \Drupal::config('system.theme')->get('default'); - - - $rutas_para_mostrar = [ - 'noahs_page_builder.editor', - 'noahs_page_builder_pro.build', - 'noahs_page_builder.noahs_settings_styles', - ]; - if (in_array($route, $rutas_para_mostrar)) { - $variables['#attached']['library'][] = 'noahs_page_builder/noahs_page_builder.jquery_ui'; + $custom_colors = $noahs_page_builder_config->get('custom_color') ?? []; + + foreach ($custom_colors as $color) { + if (!empty($color['hex'])) { + $pallete_color[] = $color['hex']; } + } - if($active_theme === $defaultThemeName && + $variables['#attached']['drupalSettings']['noahs_page_builder']['pallete_color'] = $pallete_color; + $variables['#attached']['drupalSettings']['noahs_page_builder']['viewport_tablet'] = $viewPortTablet; + $variables['#attached']['drupalSettings']['noahs_page_builder']['viewport_mobile'] = $viewPortMobile; + + $route = \Drupal::routeMatch()->getRouteName(); + $route_match = \Drupal::routeMatch(); + $classes = []; + $attributes = []; + $moduleHandler = \Drupal::service('module_handler'); + + $variables['#attached']['drupalSettings']['noahs_page_builder']['check_user'] = noahsCheckUser(); + $variables['#attached']['library'][] = 'noahs_page_builder/noahs_page_builder.noahs_admin'; + $active_theme = \Drupal::theme()->getActiveTheme()->getName(); + $defaultThemeName = \Drupal::config('system.theme')->get('default'); + + $rutas_para_mostrar = [ + 'noahs_page_builder.editor', + 'noahs_page_builder_pro.build', + 'noahs_page_builder.noahs_settings_styles', + ]; + if (in_array($route, $rutas_para_mostrar)) { + $variables['#attached']['library'][] = 'noahs_page_builder/noahs_page_builder.jquery_ui'; + } + + if ($active_theme === $defaultThemeName && $route != 'noahs_page_builder.editor' && $route != 'noahs_page_builder_pro.build' && $route != 'noahs_page_builder.noahs_settings_styles' - ) - { - $variables['#attached']['library'][] = 'noahs_page_builder/noahs_page_builder.assets.frontend'; + ) { + $variables['#attached']['library'][] = 'noahs_page_builder/noahs_page_builder.assets.frontend'; - } - - if ( - $route === 'entity.node.canonical' || - $route === 'entity.taxonomy_term.canonical' || + } + + if ( + $route === 'entity.node.canonical' || + $route === 'entity.taxonomy_term.canonical' || $route === 'entity.commerce_product.canonical') { - if($route === 'entity.commerce_product.canonical'){ - $entity = $route_match->getParameter('commerce_product'); - $entity_id = 'product_' . $entity->id(); - } else if ($route === 'entity.taxonomy_term.canonical') { - $entity = $route_match->getParameter('taxonomy_term'); - $entity_id = $entity->id(); - } else { - $entity = $route_match->getParameter('node'); - $entity_id = $entity->id(); - } + if ($route === 'entity.commerce_product.canonical') { + $entity = $route_match->getParameter('commerce_product'); + $entity_id = 'product_' . $entity->id(); + } + elseif ($route === 'entity.taxonomy_term.canonical') { + $entity = $route_match->getParameter('taxonomy_term'); + $entity_id = $entity->id(); + } + else { + $entity = $route_match->getParameter('node'); + $entity_id = $entity->id(); + } - $data = noahs_page_builder_load($langcode, $entity_id, $entity->getEntityTypeId()) ?? NULL; - $sections = noahs_page_builder_get_sections($data->settings); - $page_settings = !empty($data->page_settings) ? json_decode($data->page_settings, true) : []; - $classes[] = \Drupal::classResolver(NoahsController::class)->getClasses($data, 'class'); - $attributes[] = \Drupal::classResolver(NoahsController::class)->getClasses($data, 'attributes'); - $variables['#attached']['drupalSettings']['noahs_page_builder']['classes'] = $classes; - $variables['#attached']['drupalSettings']['noahs_page_builder']['attributes'] = $attributes; - $variables['noahs_entity_html'] = noahs_page_builder_html_generated($sections); + $data = noahs_page_builder_load($langcode, $entity_id, $entity->getEntityTypeId()) ?? NULL; + $sections = noahs_page_builder_get_sections($data->settings); + $page_settings = !empty($data->page_settings) ? json_decode($data->page_settings, TRUE) : []; + $classes[] = \Drupal::classResolver(NoahsController::class)->getClasses($data, 'class'); + $attributes[] = \Drupal::classResolver(NoahsController::class)->getClasses($data, 'attributes'); + $variables['#attached']['drupalSettings']['noahs_page_builder']['classes'] = $classes; + $variables['#attached']['drupalSettings']['noahs_page_builder']['attributes'] = $attributes; + $variables['noahs_entity_html'] = noahs_page_builder_html_generated($sections); - } + } } /** - * Alter menu task + * Implements hook_menu_local_tasks_alter(). */ -function noahs_page_builder_menu_local_tasks_alter(&$data, $route_name, \Drupal\Core\Cache\RefinableCacheableDependencyInterface &$cacheability) { - $route_match = \Drupal::routeMatch(); - - $config = \Drupal::config('noahs_page_builder.settings'); - $use_in_ctype = $config->get('use_in_ctype') ?: []; - $use_in_vtype = $config->get('use_in_vtype') ?: []; - $use_in_products = $config->get('use_in_products') ?: []; - - if( in_array($route_name, ['entity.node.canonical', 'entity.node.edit_form']) ){ - $node = $route_match->getParameter('node'); - if (array_key_exists($node->bundle(), $use_in_ctype) && $node->bundle() === $use_in_ctype[$node->bundle()]) { - - $data['tabs'][0]['node.edit_noahs'] = [ - '#theme' => 'menu_local_task', - '#link' => [ - 'title' => t('Edit With Noahs'), - 'url' => Url::fromRoute('noahs_page_builder.editor', ['entity_type' => 'node', 'entity' => $node->id()]), - 'weight' => 10, - 'localized_options' => [ - 'attributes' => [ - 'title' => t('Add content'), - ], +function noahs_page_builder_menu_local_tasks_alter(&$data, $route_name, RefinableCacheableDependencyInterface &$cacheability) { + $route_match = \Drupal::routeMatch(); + + $config = \Drupal::config('noahs_page_builder.settings'); + $use_in_ctype = $config->get('use_in_ctype') ?: []; + $use_in_vtype = $config->get('use_in_vtype') ?: []; + $use_in_products = $config->get('use_in_products') ?: []; + + if (in_array($route_name, ['entity.node.canonical', 'entity.node.edit_form'])) { + $node = $route_match->getParameter('node'); + if (array_key_exists($node->bundle(), $use_in_ctype) && $node->bundle() === $use_in_ctype[$node->bundle()]) { + + $data['tabs'][0]['node.edit_noahs'] = [ + '#theme' => 'menu_local_task', + '#link' => [ + 'title' => t('Edit With Noahs'), + 'url' => Url::fromRoute('noahs_page_builder.editor', ['entity_type' => 'node', 'entity' => $node->id()]), + 'weight' => 10, + 'localized_options' => [ + 'attributes' => [ + 'title' => t('Add content'), ], ], - ]; + ], + ]; - } } + } - if( in_array($route_name, ['entity.taxonomy_term.edit_form', 'entity.taxonomy_term.canonical']) ){ - $term = $route_match->getParameter('taxonomy_term'); - if (array_key_exists($term->bundle(), $use_in_vtype) && $term->bundle() === $use_in_vtype[$term->bundle()]) { - - $data['tabs'][0]['term.edit_noahs'] = [ - '#theme' => 'menu_local_task', - '#link' => [ - 'title' => t('Edit With Noahs'), - 'url' => Url::fromRoute('noahs_page_builder.editor', ['entity_type' => 'taxonomy_term', 'entity' => $term->id()]), - 'weight' => 10, - 'localized_options' => [ - 'attributes' => [ - 'title' => t('Add content'), - ], + if (in_array($route_name, ['entity.taxonomy_term.edit_form', 'entity.taxonomy_term.canonical'])) { + $term = $route_match->getParameter('taxonomy_term'); + if (array_key_exists($term->bundle(), $use_in_vtype) && $term->bundle() === $use_in_vtype[$term->bundle()]) { + + $data['tabs'][0]['term.edit_noahs'] = [ + '#theme' => 'menu_local_task', + '#link' => [ + 'title' => t('Edit With Noahs'), + 'url' => Url::fromRoute('noahs_page_builder.editor', ['entity_type' => 'taxonomy_term', 'entity' => $term->id()]), + 'weight' => 10, + 'localized_options' => [ + 'attributes' => [ + 'title' => t('Add content'), ], ], - ]; + ], + ]; - } } + } + + $product = $route_match->getParameter('commerce_product'); + if (!empty($product)) { - - $product = $route_match->getParameter('commerce_product'); - if(!empty($product)){ - - - if (array_key_exists($product->bundle(), $use_in_products) && $product->bundle() === $use_in_products[$product->bundle()]) { - - $data['tabs'][0]['term.edit_noahs'] = [ - '#theme' => 'menu_local_task', - '#link' => [ - 'title' => t('Edit With Noahs'), - 'url' => Url::fromRoute('noahs_page_builder.editor', ['entity_type' => 'commerce_product', 'entity' => $product->id()]), - 'weight' => 10, - 'localized_options' => [ - 'attributes' => [ - 'title' => t('Add content'), - ], + if (array_key_exists($product->bundle(), $use_in_products) && $product->bundle() === $use_in_products[$product->bundle()]) { + + $data['tabs'][0]['term.edit_noahs'] = [ + '#theme' => 'menu_local_task', + '#link' => [ + 'title' => t('Edit With Noahs'), + 'url' => Url::fromRoute('noahs_page_builder.editor', ['entity_type' => 'commerce_product', 'entity' => $product->id()]), + 'weight' => 10, + 'localized_options' => [ + 'attributes' => [ + 'title' => t('Add content'), ], ], - ]; - } + ], + ]; } + } } /** - * Help + * Implements hook_help(). */ function noahs_page_builder_help($route_name, RouteMatchInterface $route_match) { switch ($route_name) { @@ -477,27 +486,40 @@ function noahs_page_builder_help($route_name, RouteMatchInterface $route_match) } } - /** - * Get noahs sections + * Get noahs sections. + * + * @param string $html + * The html. + * + * @return array + * The sections. */ -function noahs_page_builder_get_sections($html){ +function noahs_page_builder_get_sections($html) { - if($html){ - $content = json_decode($html); - return $content; - } + if ($html) { + $content = json_decode($html); + return $content; + } } /** - * Render noahs elements + * Render noahs elements. + * + * @param object $el_settings + * The element settings. + * @param string $content + * The content. + * + * @return string + * The rendered element. */ -function noahs_page_builder_render_element($el_settings, $content =''){ +function noahs_page_builder_render_element($el_settings, $content = '') { $widgetService = \Drupal::service('noahs_page_builder.widget_service'); $type = $el_settings->type; $widget = $widgetService->loadWidgetById($type); - + if ($widget) { return $widget->renderContent($el_settings, $content); } @@ -505,9 +527,15 @@ function noahs_page_builder_render_element($el_settings, $content =''){ } /** - * Generate noahs html + * Generate noahs html. + * + * @param array $sections + * The sections. + * + * @return string + * The html. */ -function noahs_page_builder_html_generated($sections){ +function noahs_page_builder_html_generated($sections) { $html = ''; if ($sections) { foreach ($sections as $key => $section) { @@ -520,9 +548,15 @@ function noahs_page_builder_html_generated($sections){ } /** - * Generate noahs structure + * Generate noahs structure. + * + * @param object $widget + * The widget. + * + * @return string + * The html. */ -function print_widgets($widget){ +function print_widgets($widget) { $content = ''; $columns = $widget->columns; @@ -530,26 +564,28 @@ function print_widgets($widget){ if (!empty($columns)) { foreach ($columns as $ckey => $column) { $elements = $column->elements; - $element_content = ''; // Reset $element_content for each column + // Reset $element_content for each column. + $element_content = ''; if (!empty($elements)) { foreach ($elements as $ekey => $element) { - if($element->type === 'noahs_row'){ + if ($element->type === 'noahs_row') { $output_element = print_widgets($element); $element_content .= $output_element; - }else{ - - if(!empty($element->global)){ + } + else { + + if (!empty($element->global)) { if (is_module_installed('noahs_page_builder_pro')) { $global_widget = noahs_page_builder_pro_load_global_widget($element->wid); - $element->settings = json_decode($global_widget->settings); + $element->settings = json_decode($global_widget->settings); } } $html_element = noahs_page_builder_render_element($element); - if(!empty($html_element)){ + if (!empty($html_element)) { $html_element_sin_tabs = preg_replace('/\t/', '', $html_element); $output_element = $html_element_sin_tabs; $element_content .= $output_element; @@ -557,7 +593,7 @@ function print_widgets($widget){ } } } - + $column_settings_json = $column->settings; $html = noahs_page_builder_render_element($column, $element_content); $html_sin_tabs = preg_replace('/\t/', '', $html); @@ -569,48 +605,60 @@ function print_widgets($widget){ $html = noahs_page_builder_render_element($widget, $content); $html_sin_tabs = preg_replace('/\t/', '', $html); $output = $html_sin_tabs; - + return $output; } - /** - * Load Noahs Builder + * Load Noahs Builder. + * + * @param string $langcode + * The language code. + * @param int $noahs_id + * The noahs id. + * @param string $entity_type + * + * @return object + * The page. */ function noahs_page_builder_load($langcode, $noahs_id, $entity_type) { $result = \Drupal::database()->select('{noahs_page_builder_page}', 'd') - ->fields('d') - ->condition('noahs_id', $noahs_id, '=') - ->condition('entity_type', $entity_type) - ->condition('langcode', $langcode) - ->execute() - ->fetchObject(); + ->fields('d') + ->condition('noahs_id', $noahs_id, '=') + ->condition('entity_type', $entity_type) + ->condition('langcode', $langcode) + ->execute() + ->fetchObject(); $page = new stdClass(); - if($result){ - $page->entity_id = $result->entity_id; - $page->noahs_id = $result->noahs_id; - $page->uid = $result->uid; - $page->settings = $result->settings; - $page->page_settings = $result->page_settings; - $page->langcode = $result->langcode; - $page->entity_type = $result->entity_type; - $page->modified_date = $result->modified_date; - $page->page_id = $result->page_id; - }else{ - $page->settings = array(); + if ($result) { + $page->entity_id = $result->entity_id; + $page->noahs_id = $result->noahs_id; + $page->uid = $result->uid; + $page->settings = $result->settings; + $page->page_settings = $result->page_settings; + $page->langcode = $result->langcode; + $page->entity_type = $result->entity_type; + $page->modified_date = $result->modified_date; + $page->page_id = $result->page_id; + } + else { + $page->settings = []; } return $page; } /** - * Get Drupal Blocks + * Get Drupal Blocks. + * + * @return array + * The blocks. */ function noahs_page_builder_load_blocks() { $block_manager = \Drupal::service('plugin.manager.block'); - $blocks = Drupal\block\Entity\Block::loadMultiple(); + $blocks = Block::loadMultiple(); $definitions = $block_manager->getDefinitionsForContexts(); $block_options = []; @@ -627,114 +675,114 @@ function noahs_page_builder_load_blocks() { } /** - * Get drupal views + * Get drupal views. + * + * @return array + * The views. */ function noahs_page_builder_load_views() { - $getViews = Views::getViewsAsOptions(TRUE, 'all', NULL, FALSE, TRUE); - - $viewsData = \Drupal::service('views.views_data'); - $views = []; - foreach ($getViews as $key => $view_name_master) { - $view = Views::getView($key); - - foreach ($view->storage->get('display') as $name_id => $display_id) { - - if( $display_id['display_plugin'] == 'block'){ - $views[$key][] = [ - 'view_id' => $key, - 'block_id' => htmlspecialchars(json_encode(array($key, $name_id)), ENT_QUOTES, 'UTF-8'), - 'text' => $display_id['display_title'], - 'master' => $view_name_master, - ]; - } - } - } + $getViews = Views::getViewsAsOptions(TRUE, 'all', NULL, FALSE, TRUE); - return $views; -} + $viewsData = \Drupal::service('views.views_data'); + $views = []; + foreach ($getViews as $key => $view_name_master) { + $view = Views::getView($key); + + foreach ($view->storage->get('display') as $name_id => $display_id) { + + if ($display_id['display_plugin'] == 'block') { + $views[$key][] = [ + 'view_id' => $key, + 'block_id' => htmlspecialchars(json_encode([$key, $name_id]), ENT_QUOTES, 'UTF-8'), + 'text' => $display_id['display_title'], + 'master' => $view_name_master, + ]; + } + } + } + return $views; +} /** - * Alter libraries + * Implements hook_library_info_alter(). */ function noahs_page_builder_library_info_alter(&$libraries, $extension) { - $route_match = \Drupal::routeMatch(); - $route = \Drupal::routeMatch()->getRouteName(); - - $active_theme = \Drupal::theme()->getActiveTheme()->getName(); - $defaultThemeName = \Drupal::config('system.theme')->get('default'); + $route_match = \Drupal::routeMatch(); + $route = \Drupal::routeMatch()->getRouteName(); - // Noahs Builder CSS + $active_theme = \Drupal::theme()->getActiveTheme()->getName(); + $defaultThemeName = \Drupal::config('system.theme')->get('default'); - if ( - $route === 'noahs_page_builder.preview___' + // Noahs Builder CSS. + if ( + $route === 'noahs_page_builder.preview___' || $route === 'entity.node.canonical' || $route === 'noahs_page_builder.product_preview' ) { - - $node = $route_match->getParameter('node'); - if (!empty($node)) { - $css_element = noahs_page_builder_add_node_css($node->getEntityTypeId(), $node->id()); - if(!empty($css_element)){ - $libraries['noahs_page_builder_node_css']['css']['theme'][$css_element]['weight'] = 9999; - } - } + $node = $route_match->getParameter('node'); + if (!empty($node)) { + $css_element = noahs_page_builder_add_node_css($node->getEntityTypeId(), $node->id()); + if (!empty($css_element)) { + $libraries['noahs_page_builder_node_css']['css']['theme'][$css_element]['weight'] = 9999; + } } - if ($active_theme === $defaultThemeName) { - if($route != 'noahs_page_builder.noahs_settings_styles'){ - $general_css = noahs_page_builder_add_node_css('noahs_settings', 'noahs_settings'); - if(!empty($general_css)){ - $libraries['noahs_page_builder_node_css']['css']['theme'][$general_css]['weight'] = 9999; - } - } + } - $noahs_settings_css = NOAHS_PAGE_BUILDER_CSS_PATH . '/general_settings.css'; - if (file_exists($noahs_settings_css)) { - $css_path = \Drupal::service('file_url_generator')->generateAbsoluteString($noahs_settings_css); - $libraries['noahs_page_builder_node_css']['css']['theme'][$css_path]['weight'] = 9999; - } + if ($active_theme === $defaultThemeName) { + if ($route != 'noahs_page_builder.noahs_settings_styles') { + $general_css = noahs_page_builder_add_node_css('noahs_settings', 'noahs_settings'); + if (!empty($general_css)) { + $libraries['noahs_page_builder_node_css']['css']['theme'][$general_css]['weight'] = 9999; + } } -} + $noahs_settings_css = NOAHS_PAGE_BUILDER_CSS_PATH . '/general_settings.css'; + if (file_exists($noahs_settings_css)) { + $css_path = \Drupal::service('file_url_generator')->generateAbsoluteString($noahs_settings_css); + $libraries['noahs_page_builder_node_css']['css']['theme'][$css_path]['weight'] = 9999; + } + } +} /** - * Page attachmets + * Implements hook_page_attachments(). */ function noahs_page_builder_page_attachments(array &$page) { $route_match = \Drupal::routeMatch(); $route = \Drupal::routeMatch()->getRouteName(); - if ($route != 'noahs_page_builder.editor'){ + if ($route != 'noahs_page_builder.editor') { $page['#attached']['library'][] = 'noahs_page_builder/noahs_page_builder_node_css'; } } /** - * Page attachments alter + * Implements hook_page_attachments_alter(). */ function noahs_page_builder_page_attachments_alter(array &$attachments) { - $route_match = \Drupal::routeMatch(); - $route = \Drupal::routeMatch()->getRouteName(); - $fonts_css = noahs_page_builder_add_font_css(); + $route_match = \Drupal::routeMatch(); + $route = \Drupal::routeMatch()->getRouteName(); + $fonts_css = noahs_page_builder_add_font_css(); - if(!empty($fonts_css['primary'])){ - $attachments['#attached']['html_head'][] = [$fonts_css['primary'], 'noahs_page_builder_font_primary_css']; - } - if(!empty($fonts_css['secondary'])){ - $attachments['#attached']['html_head'][] = [$fonts_css['secondary'], 'noahs_page_builder_font_general_css']; - } + if (!empty($fonts_css['primary'])) { + $attachments['#attached']['html_head'][] = [$fonts_css['primary'], 'noahs_page_builder_font_primary_css']; + } + if (!empty($fonts_css['secondary'])) { + $attachments['#attached']['html_head'][] = [$fonts_css['secondary'], 'noahs_page_builder_font_general_css']; + } } - /** - * Sdd fonts css +/** + * Add fonts css. */ function noahs_page_builder_add_font_css() { @@ -743,175 +791,192 @@ function noahs_page_builder_add_font_css() { $primaryFont = $noahs_page_builder_config->get('heading_font'); $secondaryFont = $noahs_page_builder_config->get('general_font'); - if(!empty($primaryFont)){ + if (!empty($primaryFont)) { $primary_folder = '/' . NOAHS_PAGE_BUILDER_PATH . '/assets/css/noahs-fonts/' . str_replace(' ', '_', strtolower($primaryFont)) . '.css'; $primary_file_url = \Drupal::service('file_url_generator')->transformRelative($primary_folder); } - if(!empty($secondaryFont)){ + if (!empty($secondaryFont)) { $secondary_folder = '/' . NOAHS_PAGE_BUILDER_PATH . '/assets/css/noahs-fonts/' . str_replace(' ', '_', strtolower($secondaryFont)) . '.css'; $secondary_file_url = \Drupal::service('file_url_generator')->transformRelative($secondary_folder); } - $element = []; - if(!empty($primaryFont) && $primaryFont === $secondaryFont){ - $element['secondary'] = [ - '#type' => 'html_tag', - '#tag' => 'link', - '#attributes' => [ - 'rel' => 'stylesheet', - 'href' => $primary_file_url, - ], - ]; - }else if(!empty($primaryFont) || !empty($secondaryFont)){ - $element['primary'] = [ - '#type' => 'html_tag', - '#tag' => 'link', - '#attributes' => [ - 'rel' => 'stylesheet', - 'href' => $primary_file_url, - ], - ]; - $element['secondary'] = [ - '#type' => 'html_tag', - '#tag' => 'link', - '#attributes' => [ - 'rel' => 'stylesheet', - 'href' => $secondary_file_url, - ], - ]; + if (!empty($primaryFont) && $primaryFont === $secondaryFont) { + $element['secondary'] = [ + '#type' => 'html_tag', + '#tag' => 'link', + '#attributes' => [ + 'rel' => 'stylesheet', + 'href' => $primary_file_url, + ], + ]; + } + elseif (!empty($primaryFont) || !empty($secondaryFont)) { + $element['primary'] = [ + '#type' => 'html_tag', + '#tag' => 'link', + '#attributes' => [ + 'rel' => 'stylesheet', + 'href' => $primary_file_url, + ], + ]; + $element['secondary'] = [ + '#type' => 'html_tag', + '#tag' => 'link', + '#attributes' => [ + 'rel' => 'stylesheet', + 'href' => $secondary_file_url, + ], + ]; } - return $element; } - /** - * Add page css + * Add page css. + * + * @param string $entity_type + * The entity type. + * @param int $id + * The id. + * + * @return string + * The css. */ function noahs_page_builder_add_node_css($entity_type, $id) { - $langcode = \Drupal::languageManager()->getCurrentLanguage()->getId(); - $default_language = \Drupal::languageManager()->getDefaultLanguage(); - $default_language_code = $default_language->getId(); - $config = \Drupal::config('noahs_page_builder.settings'); + $langcode = \Drupal::languageManager()->getCurrentLanguage()->getId(); + $default_language = \Drupal::languageManager()->getDefaultLanguage(); + $default_language_code = $default_language->getId(); + $config = \Drupal::config('noahs_page_builder.settings'); + if (!empty($id)) { + if ($entity_type === 'noahs_settings') { + $css_file_name = 'settings.css'; + } + else { + $css_file_name = 'noahs_' . $id . '_' . $langcode . '.css'; + } - if (!empty($id)) { - if($entity_type === 'noahs_settings'){ - $css_file_name = 'settings.css'; - }else{ - $css_file_name = 'noahs_' . $id . '_' . $langcode . '.css'; - } - - if ($entity_type === 'pro_theme') { - $css_file_name = 'noahs_' . $id . '_' . $default_language_code . '.css'; - } + if ($entity_type === 'pro_theme') { + $css_file_name = 'noahs_' . $id . '_' . $default_language_code . '.css'; + } - if (file_exists('public://noahs/' . $entity_type . '/' . $css_file_name)) { + if (file_exists('public://noahs/' . $entity_type . '/' . $css_file_name)) { - $file_uri = 'public://noahs/' . $entity_type . '/' . $css_file_name; - $file_url = \Drupal::service('file_url_generator')->generateAbsoluteString($file_uri); + $file_uri = 'public://noahs/' . $entity_type . '/' . $css_file_name; + $file_url = \Drupal::service('file_url_generator')->generateAbsoluteString($file_uri); - if (!empty($config->get('develop_mode'))) { - $file_url .= '?' . time(); - } - return $file_url; - } + if (!empty($config->get('develop_mode'))) { + $file_url .= '?' . time(); + } + return $file_url; } + } } /** - * Get entity ID from context + * Get entity ID from context. + * + * @param string $parameter + * The parameter. + * + * @return string + * The entity id. */ function getEntityid($parameter) { - $route_match = \Drupal::routeMatch(); - if (!empty($route_match->getParameter($parameter))) { - return $route_match->getParameter($parameter); - }else{ - return 'noEntityId'; - } + $route_match = \Drupal::routeMatch(); + if (!empty($route_match->getParameter($parameter))) { + return $route_match->getParameter($parameter); + } + else { + return 'noEntityId'; + } } - /** * Implements hook_preprocess_HOOK() for block templates. */ function noahs_page_builder_preprocess_block(array &$variables) { - // Obtiene el bloque. - $block = $variables['elements']['#configuration']; - - // Verifica si es el bloque de "Título de la página". - if ($block['id'] === 'page_title_block') { - // Obtiene la ruta actual. - $current_path = \Drupal::service('path.current')->getPath(); - $route_match = \Drupal::service('current_route_match'); - $route_name = $route_match->getRouteName(); - - // Rutas donde quieres ocultar el bloque. - $rutas_para_ocultar = [ - 'noahs_page_builder.editor', - 'noahs_page_builder.preview', - 'noahs_page_builder_pro.iframe', - 'noahs_page_builder_pro.build', - ]; - // Oculta el bloque si la ruta actual está en la lista. - if (in_array($route_name, $rutas_para_ocultar)) { - - $variables['elements']['#access'] = FALSE; - $variables['#access'] = FALSE; + // Obtiene el bloque. + $block = $variables['elements']['#configuration']; + + // Verifica si es el bloque de "Título de la página". + if ($block['id'] === 'page_title_block') { + // Obtiene la ruta actual. + $current_path = \Drupal::service('path.current')->getPath(); + $route_match = \Drupal::service('current_route_match'); + $route_name = $route_match->getRouteName(); + + // Rutas donde quieres ocultar el bloque. + $rutas_para_ocultar = [ + 'noahs_page_builder.editor', + 'noahs_page_builder.preview', + 'noahs_page_builder_pro.iframe', + 'noahs_page_builder_pro.build', + ]; + // Oculta el bloque si la ruta actual está en la lista. + if (in_array($route_name, $rutas_para_ocultar)) { + + $variables['elements']['#access'] = FALSE; + $variables['#access'] = FALSE; - } } } +} - /** +/** * Implements hook_block_access(). */ function noahs_page_builder_block_access(Block $block, $operation, AccountInterface $account) { - $blockAccess = TRUE; - - if ($block->getPluginId() === 'page_title_block') { - // Obtiene la ruta actual. - $current_path = \Drupal::service('path.current')->getPath(); - $route_match = \Drupal::service('current_route_match'); - $route_name = $route_match->getRouteName(); - - // Rutas donde quieres ocultar el bloque. - $rutas_para_ocultar = [ - 'noahs_page_builder.editor', - 'noahs_page_builder.preview', - 'noahs_page_builder_pro.iframe', - 'noahs_page_builder_pro.build', - ]; - // Oculta el bloque si la ruta actual está en la lista. - if (in_array($route_name, $rutas_para_ocultar)) { - - $blockAccess = FALSE; - return AccessResult::forbiddenIf($blockAccess == FALSE)->addCacheableDependency($block); - } - } + $blockAccess = TRUE; + + if ($block->getPluginId() === 'page_title_block') { + // Obtiene la ruta actual. + $current_path = \Drupal::service('path.current')->getPath(); + $route_match = \Drupal::service('current_route_match'); + $route_name = $route_match->getRouteName(); - return AccessResult::neutral(); + // Rutas donde quieres ocultar el bloque. + $rutas_para_ocultar = [ + 'noahs_page_builder.editor', + 'noahs_page_builder.preview', + 'noahs_page_builder_pro.iframe', + 'noahs_page_builder_pro.build', + ]; + // Oculta el bloque si la ruta actual está en la lista. + if (in_array($route_name, $rutas_para_ocultar)) { + $blockAccess = FALSE; + return AccessResult::forbiddenIf($blockAccess == FALSE)->addCacheableDependency($block); + } } + return AccessResult::neutral(); + +} /** - * check if module is installer + * Check if module is installer. + * + * @param string $module + * The module. + * + * @return bool + * The module installed. */ - function is_module_installed($module) { - // Obtener el servicio del manejador de módulos. - $module_handler = \Drupal::service('module_handler'); - - // Verificar si el módulo Commerce está instalado. - return $module_handler->moduleExists($module); - } - +function is_module_installed($module) { + // Obtener el servicio del manejador de módulos. + $module_handler = \Drupal::service('module_handler'); + + // Verificar si el módulo Commerce está instalado. + return $module_handler->moduleExists($module); +} + /** * Implements hook_uninstall(). */ @@ -922,4 +987,3 @@ function noahs_page_builder_uninstall() { $config_factory->getEditable('image.style.noahs_800_600')->delete(); $config_factory->getEditable('views.view.noahs_media_modal')->delete(); } - diff --git a/src/ControlManager.php b/src/ControlManager.php index c2b7a06..6b3cc44 100644 --- a/src/ControlManager.php +++ b/src/ControlManager.php @@ -7,10 +7,20 @@ use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Extension\ModuleHandlerInterface; /** - * {@inheritdoc} + * Control manager. */ class ControlManager extends DefaultPluginManager { + /** + * Constructor. + * + * @param \Traversable $namespaces + * The namespaces. + * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend + * The cache backend. + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler. + */ public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) { // Passing plugin details to parent class. parent::__construct('Plugin/Control', $namespaces, $module_handler, 'Drupal\noahs_page_builder\Plugin\Control\ControlInterface', 'Drupal\noahs_page_builder\Annotation\ControlPlugin'); diff --git a/src/Controller/NoahsCloneWidgetController.php b/src/Controller/NoahsCloneWidgetController.php index 1c932d7..01246ce 100644 --- a/src/Controller/NoahsCloneWidgetController.php +++ b/src/Controller/NoahsCloneWidgetController.php @@ -12,9 +12,17 @@ use Drupal\noahs_page_builder\ControlsManager; class NoahsCloneWidgetController extends ControllerBase { /** - * {@inheritdoc} + * Clone widget. + * + * @param string $old_id + * The old id. + * @param string $new_id + * The new id. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ - public function clone($old_id, $new_id) { + public function cloneWidget($old_id, $new_id): JsonResponse { $widgetService = \Drupal::service('noahs_page_builder.widget_service'); $settings = []; diff --git a/src/Controller/NoahsController.php b/src/Controller/NoahsController.php index b418f10..6ef9c1f 100644 --- a/src/Controller/NoahsController.php +++ b/src/Controller/NoahsController.php @@ -21,7 +21,6 @@ use Drupal\Core\Extension\ModuleExtensionList; use Drupal\editor\Plugin\EditorManager; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Access\CsrfTokenGenerator; use Drupal\Core\Messenger\MessengerInterface; use Drupal\Core\DependencyInjection\ClassResolverInterface; @@ -134,6 +133,7 @@ class NoahsController extends ControllerBase { * @var \Drupal\Core\Messenger\MessengerInterface */ protected $messenger; + /** * NoahsController constructor. * @@ -223,8 +223,16 @@ class NoahsController extends ControllerBase { /** * Editor builder. + * + * @param string $entity_type + * The entity type. + * @param \Drupal\Core\Entity\EntityInterface $entity + * The entity. + * + * @return array + * The page. */ - public function editor($entity_type, $entity) { + public function editor($entity_type, $entity): array { $drupal_languages = $this->languageManager->getLanguages(); $langcode = $this->languageManager->getCurrentLanguage()->getId(); @@ -307,6 +315,14 @@ class NoahsController extends ControllerBase { /** * Preview (iframe) builder. + * + * @param string $entity_type + * The entity type. + * @param \Drupal\Core\Entity\EntityInterface $entity + * The entity. + * + * @return array + * The page. */ public function preview($entity_type, $entity) { @@ -356,8 +372,16 @@ class NoahsController extends ControllerBase { /** * Get Widgets ids. + * + * @param array $array + * The array. + * @param array $ids + * The ids. + * + * @return array + * The ids. */ - private function getAllIds($array, &$ids) { + protected function getAllIds(array $array, array &$ids): array { foreach ($array as $key => $value) { if ($key === 'id') { @@ -376,8 +400,22 @@ class NoahsController extends ControllerBase { /** * Clone Page Function. + * + * @param string $noahs_id + * The noahs id. + * @param string $new_noahs_id + * The new noahs id. + * @param string $original_langcode + * The original langcode. + * @param string $new_langcode + * The new langcode. + * @param string $entity_type + * The entity type. + * + * @return string + * The result. */ - public function clonePage($noahs_id, $new_noahs_id, $original_langcode, $new_langcode, $entity_type) { + public function clonePage($noahs_id, $new_noahs_id, $original_langcode, $new_langcode, $entity_type): string { $result = ''; $original = $this->database->select('noahs_page_builder_page', 'd') @@ -427,8 +465,14 @@ class NoahsController extends ControllerBase { /** * Save Page Function. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * The request. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ - public function savePage(Request $request) { + public function savePage(Request $request): JsonResponse { $data = json_decode($request->getContent(), TRUE); $uid = $data['uid'] ?? $this->currentUser->id(); @@ -528,8 +572,20 @@ class NoahsController extends ControllerBase { /** * Save CSS. + * + * @param string $entity_type + * The entity type. + * @param string $entity_id + * The entity id. + * @param string $langcode + * The langcode. + * @param string $css + * The css. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ - public function saveCss($entity_type, $entity_id, $langcode, $css) { + public function saveCss($entity_type, $entity_id, $langcode, $css): JsonResponse { $directory = 'public://noahs/' . $entity_type; $this->fileSystem->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS | FileSystemInterface::EXISTS_REPLACE); @@ -562,8 +618,14 @@ class NoahsController extends ControllerBase { /** * Get widget form. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * The request. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ - public function getWidgetForm(Request $request) { + public function getWidgetForm(Request $request): JsonResponse { $data = json_decode($request->getContent(), TRUE); $fields = $this->widgetService->getWidgetFields($data['widget_id']); @@ -573,8 +635,14 @@ class NoahsController extends ControllerBase { /** * Get rendered widget. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * The request. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ - public function renderWidget(Request $request) { + public function renderWidget(Request $request): JsonResponse { $data = json_decode($request->getContent(), TRUE); // Crear settings base. $settings = [ @@ -583,7 +651,7 @@ class NoahsController extends ControllerBase { "noahs_id" => $data['nid'], "settings" => [ "element" => $data['form_data']['element'], - ] + ], ]; $column_size = !empty($data['extra_data']['width']) ? $data['extra_data']['width'] : FALSE; @@ -603,12 +671,12 @@ class NoahsController extends ControllerBase { $settings['settings']['element'] = [ "css" => [ "desktop" => [ - "default" => ["column_width" => $column_size] + "default" => ["column_width" => $column_size], ], "mobile" => [ - "default" => ["column_width" => "100%"] - ] - ] + "default" => ["column_width" => "100%"], + ], + ], ]; } @@ -622,8 +690,16 @@ class NoahsController extends ControllerBase { /** * Get Dinamic Columns. + * + * @param string $num_columns + * The num columns. + * @param array $data + * The data. + * + * @return string + * The rendered columns. */ - public function getDinamicColumns($num_columns, $data) { + public function getDinamicColumns($num_columns, $data): string { $rendered_columns = []; for ($i = 0; $i < $num_columns; $i++) { @@ -639,10 +715,10 @@ class NoahsController extends ControllerBase { "css" => [ 'desktop' => ['default' => ['column_width' => $width]], 'tablet' => ['default' => ['column_width' => '50%']], - 'mobile' => ['default' => ['column_width' => '100%']] - ] - ] - ] + 'mobile' => ['default' => ['column_width' => '100%']], + ], + ], + ], ]; } @@ -656,8 +732,14 @@ class NoahsController extends ControllerBase { /** * Regenerate widget. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * The request. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ - public function regenerateWidget(Request $request) { + public function regenerateWidget(Request $request): JsonResponse { $data = json_decode($request->getContent()); $obj = new \stdClass(); @@ -673,8 +755,14 @@ class NoahsController extends ControllerBase { /** * Get default data widget. + * + * @param string $type + * The type. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ - public function renderDefaultTemplateWidget($type) { + public function renderDefaultTemplateWidget($type): JsonResponse { $widget = noahs_page_builder_render_default_template($type); @@ -683,9 +771,16 @@ class NoahsController extends ControllerBase { /** * Get Css Classes. + * + * @param string $data + * The data. + * @param string $type + * The type. + * + * @return array + * The classes. */ - public function getClasses($data, $type) { - + public function getClasses($data, $type): array { $settings = !empty($data->settings) ? json_decode($data->settings, TRUE) : []; $classes = []; @@ -710,8 +805,16 @@ class NoahsController extends ControllerBase { /** * Manual get page classes. + * + * @param string $data + * The data. + * @param string $type + * The type. + * + * @return string|null + * The classes. */ - public function getPageClasses($data, $type) { + public function getPageClasses($data, $type): ?string { $classes = NULL; $obj_class = new ControlsManager(); $page_settings = $data['page_settings']; @@ -726,8 +829,16 @@ class NoahsController extends ControllerBase { /** * Manual get page attributes. + * + * @param string $data + * The data. + * @param string $type + * The type. + * + * @return string|null + * The attributes. */ - public function getPageAttributes($data, $type) { + public function getPageAttributes($data, $type): ?string { $classes = NULL; $obj_class = new ControlsManager(); $page_settings = $data['page_settings']; @@ -741,8 +852,16 @@ class NoahsController extends ControllerBase { /** * Get Extra classes. + * + * @param string $item + * The item. + * @param string $type + * The type. + * + * @return array + * The classes. */ - private function extractClasses($item, $type) { + private function extractClasses($item, $type): array { $classes = []; $obj_class = new ControlsManager(); diff --git a/src/Controller/NoahsEditWidgetController.php b/src/Controller/NoahsEditWidgetController.php index ac9768a..6fa0c76 100644 --- a/src/Controller/NoahsEditWidgetController.php +++ b/src/Controller/NoahsEditWidgetController.php @@ -40,9 +40,19 @@ class NoahsEditWidgetController extends ControllerBase { } /** - * {@inheritdoc} + * Edit widget. + * + * @param string $nid + * The nid. + * @param string $widget + * The widget. + * @param string $widget_id + * The widget id. + * + * @return array + * The page. */ - public function edit($nid, $widget, $widget_id) { + public function edit($nid, $widget, $widget_id): array { $noahs_page_builder_config = $this->configFactorty->get('noahs_page_builder.settings'); $widgetService = $this->widgetService; diff --git a/src/Controller/NoahsFinalWidgetController.php b/src/Controller/NoahsFinalWidgetController.php index bcfc2a1..83d8a65 100644 --- a/src/Controller/NoahsFinalWidgetController.php +++ b/src/Controller/NoahsFinalWidgetController.php @@ -11,9 +11,19 @@ use Symfony\Component\HttpFoundation\JsonResponse; class NoahsFinalWidgetController extends ControllerBase { /** - * {@inheritdoc} + * Load widget. + * + * @param string $nid + * The nid. + * @param string $widget + * The widget. + * @param string $widget_id + * The widget id. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ - public function load($nid, $widget, $widget_id) { + public function load($nid, $widget, $widget_id): JsonResponse { $section = [ 'type' => $widget, diff --git a/src/Controller/NoahsFunctionsController.php b/src/Controller/NoahsFunctionsController.php index cc20c9a..457049d 100644 --- a/src/Controller/NoahsFunctionsController.php +++ b/src/Controller/NoahsFunctionsController.php @@ -153,7 +153,8 @@ class NoahsFunctionsController extends ControllerBase { ModuleExtensionList $extension_list, AccountInterface $current_user, ConfigFactoryInterface $config_factory, - EntityTypeManagerInterface $entity_type_manager, // Moved before other services + // Moved before other services. + EntityTypeManagerInterface $entity_type_manager, FileUrlGeneratorInterface $file_url_generator, Token $token, CurrentRouteMatch $current_route_match, @@ -200,6 +201,14 @@ class NoahsFunctionsController extends ControllerBase { /** * Get Media Image. + * + * @param string $fid + * The fid. + * @param string $image_style + * The image style. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ public function getMediaImage($fid, $image_style) { @@ -228,6 +237,12 @@ class NoahsFunctionsController extends ControllerBase { /** * Get Media Image Token. + * + * @param string $token + * The token. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ public function getMediaImageToken($token) { diff --git a/src/Controller/NoahsIconsController.php b/src/Controller/NoahsIconsController.php index 37fe52c..c85b122 100644 --- a/src/Controller/NoahsIconsController.php +++ b/src/Controller/NoahsIconsController.php @@ -11,7 +11,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\file\FileInterface; /** - * {@inheritdoc} + * Icons controller. */ class NoahsIconsController extends ControllerBase { @@ -48,7 +48,10 @@ class NoahsIconsController extends ControllerBase { } /** - * {@inheritdoc} + * List of icons. + * + * @return array + * The page. */ public function listOfIcons() { @@ -67,7 +70,10 @@ class NoahsIconsController extends ControllerBase { } /** - * {@inheritdoc} + * Get icons. + * + * @return array + * The icons. */ private function getIcons() { @@ -88,7 +94,10 @@ class NoahsIconsController extends ControllerBase { } /** - * {@inheritdoc} + * Html icons script. + * + * @return string + * The html. */ private function htmlIconsScript() { $icons = $this->getIcons(); @@ -165,7 +174,13 @@ class NoahsIconsController extends ControllerBase { } /** - * {@inheritdoc} + * The modal. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * The request. + * + * @return \Symfony\Component\HttpFoundation\Response + * The response. */ public function modal(Request $request) { $data = json_decode($request->getContent(), TRUE); diff --git a/src/Controller/NoahsModalController.php b/src/Controller/NoahsModalController.php index b3d0495..ae9d522 100644 --- a/src/Controller/NoahsModalController.php +++ b/src/Controller/NoahsModalController.php @@ -10,7 +10,7 @@ use Drupal\noahs_page_builder\Service\WidgetServices; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Controller routines for domain finder routes. + * Modal controller. */ class NoahsModalController extends ControllerBase { @@ -47,8 +47,15 @@ class NoahsModalController extends ControllerBase { $container->get('noahs_page_builder.widget_service') ); } + /** - * {@inheritdoc} + * The modal. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * The request. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ public function modal(Request $request) { $data = json_decode($request->getContent(), TRUE); @@ -66,10 +73,10 @@ class NoahsModalController extends ControllerBase { $form = ModalForm::renderForm($fields, $settings); - $output = '<div class="noahs_page_builder-modal '. $global_class .'">'; + $output = '<div class="noahs_page_builder-modal ' . $global_class . '">'; $output .= '<div class="noahs_page_builder-modal_container">'; $output .= '<div class="noahs_page_builder-modal-topbar">'; - $output .= '<div class="noahs-widget-title">'. $widget_title .'</div>'; + $output .= '<div class="noahs-widget-title">' . $widget_title . '</div>'; $output .= '<a href="#" class="move-modal"> <svg width="51px" height="51px" viewBox="0 0 51 51" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> @@ -94,14 +101,14 @@ class NoahsModalController extends ControllerBase { $output .= $item; } $output .= '</div>'; - + // $output .= '<button class="btn btn-danger btn-labeled noahs_page_builder-close-modal"><span class="btn-label"><i class="fa-solid fa-xmark"></i></span>' . $this->t('Close') . '</button>'; - if($global) { + if ($global) { $output .= '<div class="p-3 w-100 d-flex justify-content-end shadow-lg bg-white">'; $output .= '<button type="submit" class="btn btn-outline-success save-global-widget">' . $this->t('Save Global') . '</button>'; $output .= '</div>'; } - + $output .= '<div class="noahs-input--control-css"><input type="hidden" class="update_data_form" name="element[update_form_data]"></div>'; $output .= '</form>'; $output .= '</div>'; diff --git a/src/Controller/NoahsModalMediaController.php b/src/Controller/NoahsModalMediaController.php index 823c8a2..aeac839 100644 --- a/src/Controller/NoahsModalMediaController.php +++ b/src/Controller/NoahsModalMediaController.php @@ -15,7 +15,7 @@ use Drupal\Component\Datetime\TimeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * {@inheritdoc} + * Modal media controller. */ class NoahsModalMediaController extends ControllerBase { @@ -40,6 +40,16 @@ class NoahsModalMediaController extends ControllerBase { */ protected $time; + /** + * Constructor. + * + * @param \Drupal\Core\File\FileSystemInterface $file_system + * The file system service. + * @param \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator + * The file URL generator service. + * @param \Drupal\Component\Datetime\TimeInterface $time + * The time service. + */ public function __construct( FileSystemInterface $file_system, FileUrlGeneratorInterface $file_url_generator, @@ -62,7 +72,13 @@ class NoahsModalMediaController extends ControllerBase { } /** - * {@inheritdoc} + * The media modal. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * The request. + * + * @return array + * The page. */ public function mediaModal(Request $request) { $element_id = $request->query->get('element_id'); @@ -105,7 +121,10 @@ class NoahsModalMediaController extends ControllerBase { } /** - * {@inheritdoc} + * Upload media modal. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ public function uploadMediaModal() { $files = $_FILES['files'] ?? NULL; @@ -164,16 +183,25 @@ class NoahsModalMediaController extends ControllerBase { } if (empty($uploaded_files)) { - return new JsonResponse(['message' => 'No se ha enviado ningún archivo.'], 400); + return new JsonResponse(['message' => 'No file has been sent.'], 400); } - return new JsonResponse(['message' => 'Archivos subidos correctamente.', 'files' => $uploaded_files]); + return new JsonResponse([ + 'message' => 'Files uploaded successfully.', + 'files' => $uploaded_files, + ]); } /** - * {@inheritdoc} + * Upload ck media modal. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * The request. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ - public function uploadCkMediaModal(Request $request) { + public function uploadCkMediaModal(Request $request): JsonResponse { $file_system = $this->fileSystem; $file_url_generator = $this->fileUrlGenerator; diff --git a/src/Controller/NoahsModalTokensController.php b/src/Controller/NoahsModalTokensController.php index dbbd358..a84e656 100644 --- a/src/Controller/NoahsModalTokensController.php +++ b/src/Controller/NoahsModalTokensController.php @@ -8,7 +8,7 @@ use Drupal\token\TreeBuilderInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * {@inheritdoc} + * Modal tokens controller. */ class NoahsModalTokensController extends ControllerBase { /** @@ -52,7 +52,10 @@ class NoahsModalTokensController extends ControllerBase { } /** - * {@inheritdoc} + * Output tree. + * + * @return array + * The page. */ public function outputTree() { diff --git a/src/Controller/NoahsPageController.php b/src/Controller/NoahsPageController.php index 00f894b..7a109c4 100644 --- a/src/Controller/NoahsPageController.php +++ b/src/Controller/NoahsPageController.php @@ -6,33 +6,62 @@ use Drupal\Core\Controller\ControllerBase; use Drupal\system\SystemManager; use Symfony\Component\DependencyInjection\ContainerInterface; +/** + * Noahs page controller. + */ class NoahsPageController extends ControllerBase { + /** + * System manager. + * + * @var \Drupal\system\SystemManager + */ protected $systemManager; + /** + * Constructor. + * + * @param \Drupal\system\SystemManager $system_manager + * The system manager. + */ public function __construct(SystemManager $system_manager) { $this->systemManager = $system_manager; } + /** + * Create. + * + * @param \Symfony\Component\DependencyInjection\ContainerInterface $container + * The container. + * + * @return static + */ public static function create(ContainerInterface $container) { return new static( $container->get('system.manager') ); } + /** + * Admin page. + * + * @return array + * The page. + */ public function adminPage() { $blocks = $this->systemManager->getBlockContents(); - + // HTML personalizado que quieres añadir, por ejemplo un encabezado o instrucciones. $custom_html = [ '#type' => 'markup', '#markup' => '<div class="admin-header"><h2>Panel de configuración de Noah</h2><p>Desde aquí puedes acceder a las herramientas de administración del builder.</p></div>', '#allowed_tags' => ['div', 'h2', 'p'], ]; - + return [ $custom_html, $blocks, ]; } + } diff --git a/src/Controller/NoahsSaveStylesController.php b/src/Controller/NoahsSaveStylesController.php index 2c3621a..a860548 100644 --- a/src/Controller/NoahsSaveStylesController.php +++ b/src/Controller/NoahsSaveStylesController.php @@ -7,7 +7,7 @@ use Drupal\noahs_page_builder\Service\ControlServices; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Controller routines for domain finder routes. + * Save styles controller. */ class NoahsSaveStylesController extends ControllerBase { @@ -20,7 +20,7 @@ class NoahsSaveStylesController extends ControllerBase { protected $controlService; /** - * NoahsSaveStylesController constructor. + * Constructor. * * @param \Drupal\noahs_page_builder\Service\ControlServices $control_service * The control service used for managing styles. diff --git a/src/Controller/NoahsSettingsController.php b/src/Controller/NoahsSettingsController.php index f42728f..2d19350 100644 --- a/src/Controller/NoahsSettingsController.php +++ b/src/Controller/NoahsSettingsController.php @@ -17,7 +17,7 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Access\CsrfTokenGenerator; /** - * Provides route responses for Noah's Builder. + * Noahs settings controller. */ class NoahsSettingsController extends ControllerBase { @@ -160,12 +160,15 @@ class NoahsSettingsController extends ControllerBase { /** * Editor builder. + * + * @return array + * The page. */ - public function editor() { + public function editor(): array { $widget = 'noahs_settings'; $fields = [ - 'noahs_settings' => $this->widgetService->getWidgetFields($widget) + 'noahs_settings' => $this->widgetService->getWidgetFields($widget), ]; $data = noahs_page_builder_load('no_language', 'noahs_settings', 'noahs_settings'); @@ -226,12 +229,15 @@ class NoahsSettingsController extends ControllerBase { /** * Editor iframe. + * + * @return array + * The page. */ - public function iframe() { + public function iframe(): array { $widget = 'noahs_settings'; $fields = [ - 'noahs_settings' => $this->widgetService->getWidgetFields($widget) + 'noahs_settings' => $this->widgetService->getWidgetFields($widget), ]; $default_settings = '{ diff --git a/src/Controller/NoahsThemesController.php b/src/Controller/NoahsThemesController.php index 54158e9..403fa86 100644 --- a/src/Controller/NoahsThemesController.php +++ b/src/Controller/NoahsThemesController.php @@ -55,9 +55,15 @@ class NoahsThemesController extends ControllerBase { } /** - * {@inheritdoc} + * Get theme. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * The request. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ - public function getTheme(Request $request){ + public function getTheme(Request $request) { $data = json_decode($request->getContent(),); // $data['url'] = 'https://page-builder.ddev.site/modules/custom/noahs_page_builder/assets/noahs-themes/test_template.json'; $json_string = file_get_contents($data->url); @@ -67,16 +73,22 @@ class NoahsThemesController extends ControllerBase { } /** - * {@inheritdoc} + * Modal themes. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ - public function modalThemes() { + public function modalThemes(): JsonResponse { return new JsonResponse(['html' => $this->listOfThemes()]); } /** - * {@inheritdoc} + * List of themes. + * + * @return string + * The html. */ - private function listOfThemes() { + private function listOfThemes(): string { $schema = $this->database->schema(); $builder = NULL; @@ -87,7 +99,6 @@ class NoahsThemesController extends ControllerBase { ->fetchAll(); } - $noahs_themes = []; $noahs_themes_categories = []; $module_path = NOAHS_PAGE_BUILDER_PATH; @@ -108,20 +119,20 @@ class NoahsThemesController extends ControllerBase { $output .= '<div class="modal-dialog modal-xl">'; $output .= '<div class="modal-content">'; $output .= '<div class="modal-header"> - <h5 class="modal-title">'.t('Themes').'</h5> + <h5 class="modal-title">' . t('Themes') . '</h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div>'; $output .= '<div class="modal-body">'; $output .= '<nav>'; $output .= '<div class="nav nav-tabs" id="nav-tab" role="tablist">'; - $output .= '<button class="nav-link active" id="nav-noahs-theme-tab" data-bs-toggle="tab" data-bs-target="#nav-noahs-theme" type="button" role="tab" aria-controls="nav-noahs-theme" aria-selected="true">' .t('Noahs themes') .'</button>'; - $output .= '<button class="nav-link" id="nav-user-noahs-theme-tab" data-bs-toggle="tab" data-bs-target="#nav-user-noahs-theme" type="button" role="tab" aria-controls="nav-user-noahs-theme" aria-selected="true">' .t('My themes') .'</button>'; + $output .= '<button class="nav-link active" id="nav-noahs-theme-tab" data-bs-toggle="tab" data-bs-target="#nav-noahs-theme" type="button" role="tab" aria-controls="nav-noahs-theme" aria-selected="true">' . t('Noahs themes') . '</button>'; + $output .= '<button class="nav-link" id="nav-user-noahs-theme-tab" data-bs-toggle="tab" data-bs-target="#nav-user-noahs-theme" type="button" role="tab" aria-controls="nav-user-noahs-theme" aria-selected="true">' . t('My themes') . '</button>'; $output .= '</div>'; $output .= '</nav>'; $output .= '<div class="tab-content p-3 border bg-light" id="nav-tabContent">'; $output .= '<form>'; $output .= '<div class="mb-3">'; - $output .= '<label for="searchThemes" class="form-label">' .t('Search theme') .'</label>'; + $output .= '<label for="searchThemes" class="form-label">' . t('Search theme') . '</label>'; $output .= '<input type="text" class="form-control element-admin" id="searchThemes">'; $output .= '</div>'; $output .= '</form>'; @@ -130,10 +141,10 @@ class NoahsThemesController extends ControllerBase { $output .= '<div class="d-flex justify-content-center mb-4">'; $output .= '<div class="btn-group" role="group" aria-label="Filter by category">'; $output .= '<input name="filterThemeCheck" type="radio" class="btn-check filter-theme-check" id="all_themes" autocomplete="off" checked>'; - $output .= '<label class="btn btn-admin btn-outline-primary" for="all_themes">'.t('All').'</label>'; + $output .= '<label class="btn btn-admin btn-outline-primary" for="all_themes">' . t('All') . '</label>'; foreach ($noahs_themes_categories as $k => $item) { - $output .= '<input type="radio" name="filterThemeCheck" class="btn-check filter-theme-check" id="btncheck_'.$k.'" autocomplete="off">'; - $output .= '<label class="btn btn-outline-primary btn-admin" for="btncheck_'.$k.'">'.t($item).'</label>'; + $output .= '<input type="radio" name="filterThemeCheck" class="btn-check filter-theme-check" id="btncheck_' . $k . '" autocomplete="off">'; + $output .= '<label class="btn btn-outline-primary btn-admin" for="btncheck_' . $k . '">' . t($item) . '</label>'; } $output .= '</div>'; @@ -143,11 +154,11 @@ class NoahsThemesController extends ControllerBase { foreach ($noahs_themes as $k => $item) { - $output .= '<div class="col" data-bs-toggle="tooltip" data-bs-placement="top" data-category="'.$item['category'].'" data-title="'.$item['title'].'">'; - $output .= '<div class="card noahs_paste_default_theme h-100" data-url="'.$item['url'].'" data-group="noahs-theme"> - <img src="'.$item['thumbnail'].'" class="card-img-top" alt="..."> + $output .= '<div class="col" data-bs-toggle="tooltip" data-bs-placement="top" data-category="' . $item['category'] . '" data-title="' . $item['title'] . '">'; + $output .= '<div class="card noahs_paste_default_theme h-100" data-url="' . $item['url'] . '" data-group="noahs-theme"> + <img src="' . $item['thumbnail'] . '" class="card-img-top" alt="..."> <div class="card-body"> - <h5 class="card-title">'.$item['title'].'</h5> + <h5 class="card-title">' . $item['title'] . '</h5> </div> </div>'; @@ -173,7 +184,7 @@ class NoahsThemesController extends ControllerBase { $output .= '</div>'; $output .= '</div>'; $output .= '<div class="modal-footer px-0 pb-0 justify-content-end"> - <button type="button" class="btn btn-danger btn-admin" data-bs-dismiss="modal">'. t('Cancel') . '</button>'; + <button type="button" class="btn btn-danger btn-admin" data-bs-dismiss="modal">' . t('Cancel') . '</button>'; $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; @@ -185,4 +196,3 @@ class NoahsThemesController extends ControllerBase { } } - diff --git a/src/Controller/NoahsTrackController.php b/src/Controller/NoahsTrackController.php index 9bf5f0a..d330ec3 100644 --- a/src/Controller/NoahsTrackController.php +++ b/src/Controller/NoahsTrackController.php @@ -36,6 +36,16 @@ class NoahsTrackController extends ControllerBase { */ protected $requestStack; + /** + * Constructor. + * + * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack + * The request stack. + * @param \Drupal\Core\Session\AccountProxyInterface $current_user + * The current user. + * @param \Drupal\Core\Messenger\MessengerInterface $messenger + * The messenger. + */ public function __construct( RequestStack $request_stack, AccountProxyInterface $current_user, @@ -47,7 +57,12 @@ class NoahsTrackController extends ControllerBase { } /** - * {@inheritdoc} + * Create. + * + * @param \Symfony\Component\DependencyInjection\ContainerInterface $container + * The container. + * + * @return static */ public static function create(ContainerInterface $container) { return new static( @@ -58,7 +73,13 @@ class NoahsTrackController extends ControllerBase { } /** - * {@inheritdoc} + * Track user. + * + * @param string $eid + * The eid. + * + * @return array + * The page. */ public function trackUser($eid) { $current_user = $this->currentUser; diff --git a/src/Controller/NoahsUrlAutocompleteController.php b/src/Controller/NoahsUrlAutocompleteController.php index 60cd66b..d8881cc 100644 --- a/src/Controller/NoahsUrlAutocompleteController.php +++ b/src/Controller/NoahsUrlAutocompleteController.php @@ -11,10 +11,9 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * {@inheritdoc} + * Url autocomplete controller. */ -class NoahsUrlAutocompleteController extends ControllerBase -{ +class NoahsUrlAutocompleteController extends ControllerBase { /** * The entity type manager service. @@ -43,7 +42,13 @@ class NoahsUrlAutocompleteController extends ControllerBase } /** - * {@inheritdoc} + * Autocomplete. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * The request. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * The json response. */ public function autocomplete(Request $request) { $results = []; diff --git a/src/ControlsManager.php b/src/ControlsManager.php index d4b6dec..2b6c068 100644 --- a/src/ControlsManager.php +++ b/src/ControlsManager.php @@ -2,16 +2,27 @@ namespace Drupal\noahs_page_builder; -use Drupal\image\Entity\ImageStyle; -use Drupal\media\Entity\Media; - /** - * {@inheritdoc} + * Controls manager. */ class ControlsManager { /** - * Render tabs with inputs iside. + * Render tabs with inputs inside. + * + * @param array $tabs + * The tabs. + * @param array $values + * The values. + * @param bool $multiple + * The multiple. + * @param int $delta + * The delta. + * @param string $parent + * The parent. + * + * @return array + * The form. */ public function renderTabs($tabs, $values, $multiple = NULL, $delta = NULL, $parent = NULL) { @@ -123,28 +134,51 @@ class ControlsManager { } /** - * Render controls (inputs) + * Render controls (inputs). + * + * @param array $data + * The data. + * @param array $values + * The values. + * @param string $wrapper + * The wrapper. + * @param int $delta + * The delta. + * + * @return string + * The html. */ - public function renderControls($data, $values, $wrapper = NULL, $delta = NULL) { + public function renderControls($data, $values, $wrapper = NULL, $delta = NULL): string { $controlService = \Drupal::service('noahs_page_builder.control_service'); return $controlService->extractHtml($data, $values, $wrapper, $delta); } /** * Get Classes from selector. + * + * @param array $items + * The items. + * @param array $values + * The values. + * @param string $wid + * The wid. + * + * @return array + * The classes. */ - public function getClasses($items, $values, $wid) { + public function getClasses($items, $values, $wid): array { foreach ($values as $item_id => $element) { if (!empty($element)) { if (!empty($items[$item_id]['style_selector']) && $items[$item_id]['style_selector'] === 'widget') { $class['#widget-id-' . $wid][] = $element; } - else if (!empty($items[$item_id]['style_selector'])) { + elseif (!empty($items[$item_id]['style_selector'])) { if ($wid === 'no_id') { $class[$items[$item_id]['style_selector']][] = $element; - }else{ + } + else { $class['#widget-id-' . $wid . ' ' . $items[$item_id]['style_selector']][] = $element; } } @@ -155,12 +189,24 @@ class ControlsManager { if (!empty($class)) { return $this->transformArray($class); } + + return []; } /** * Get Attributes from selector. + * + * @param array $items + * The items. + * @param array $values + * The values. + * @param string $wid + * The wid. + * + * @return array + * The attributes. */ - public function getAttributes($items, $values, $wid) { + public function getAttributes($items, $values, $wid): array { $class = []; foreach ($values as $item_id => $element) { @@ -188,8 +234,14 @@ class ControlsManager { /** * Transform Array to implode. + * + * @param array $array + * The array. + * + * @return array + * The new array. */ - public function transformArray($array) { + public function transformArray($array): array { $newArray = []; foreach ($array as $key => $value) { @@ -215,5 +267,4 @@ class ControlsManager { return $newArray; } - } diff --git a/src/Fonts.php b/src/Fonts.php index 8d8461f..4c1a7d5 100644 --- a/src/Fonts.php +++ b/src/Fonts.php @@ -8,9 +8,12 @@ namespace Drupal\noahs_page_builder; class Fonts { /** - * Public function contentTemplate(); + * Get fonts. + * + * @return array + * The fonts. */ - public static function getFonts() { + public static function getFonts(): array { $font_options = [ '' => 'Default', 'Droid Sans' => 'Droid Sans', @@ -38,14 +41,17 @@ class Fonts { 'Ubuntu' => 'Ubuntu', 'Ubuntu Condensed' => 'Ubuntu Condensed', ]; - + return $font_options; } /** - * {@inheritdoc} + * Get fonts weights. + * + * @return array + * The fonts weights. */ - public static function getFontsWeights() { + public static function getFontsWeights(): array { $noahs_page_builder_fonts = [ "" => "Default", "100" => "100", diff --git a/src/Form/NoahsConfigForm.php b/src/Form/NoahsConfigForm.php index c313bec..a0cf8b7 100644 --- a/src/Form/NoahsConfigForm.php +++ b/src/Form/NoahsConfigForm.php @@ -28,15 +28,12 @@ class NoahsConfigForm extends ConfigFormBase { * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { - return parent::buildForm($form, $form_state); } /** * {@inheritdoc} */ - public function submitForm(array &$form, FormStateInterface $form_state) { - - } + public function submitForm(array &$form, FormStateInterface $form_state) {} } diff --git a/src/Form/NoahsRenegerateStylesForm.php b/src/Form/NoahsRenegerateStylesForm.php index bc0a8e7..d1c716c 100644 --- a/src/Form/NoahsRenegerateStylesForm.php +++ b/src/Form/NoahsRenegerateStylesForm.php @@ -16,22 +16,28 @@ use Symfony\Component\DependencyInjection\ContainerInterface; class NoahsRenegerateStylesForm extends ConfigFormBase { /** + * The database. + * * @var \Drupal\Core\Database\Connection */ protected $database; /** + * The entity type manager. + * * @var \Drupal\Core\Entity\EntityTypeManagerInterface */ protected $entityTypeManager; /** + * The class resolver. + * * @var \Drupal\Core\DependencyInjection\ClassResolverInterface */ protected $classResolver; /** - * Constructs a new NoahsRenegerateStylesForm. + * Constructor. * * @param \Drupal\Core\Database\Connection $database * The database connection. diff --git a/src/Form/NoahsSettingsForm.php b/src/Form/NoahsSettingsForm.php index 74618d9..81a3cfd 100644 --- a/src/Form/NoahsSettingsForm.php +++ b/src/Form/NoahsSettingsForm.php @@ -29,15 +29,25 @@ class NoahsSettingsForm extends ConfigFormBase { */ protected $controlService; + /** + * Fonts. + * + * @var bool + */ + protected $fonts = FALSE; + /** * NoahsSaveStylesController constructor. + * + * @param \Drupal\noahs_page_builder\Service\ControlServices $control_service + * The control service. */ public function __construct(ControlServices $control_service) { $this->controlService = $control_service; } /** - * Creates an instance of the controller. + * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( @@ -59,18 +69,11 @@ class NoahsSettingsForm extends ConfigFormBase { return ['noahs_page_builder.settings']; } - /** - * {@inheritdoc} - */ - private $fonts = FALSE; - /** * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { - $settings = $this->config('noahs_page_builder.settings'); - $querys = $this->controlService->getMediaQuery(); $form['#attached']['library'][] = 'noahs_page_builder/noahs_page_builder.assets.settings'; @@ -82,7 +85,8 @@ class NoahsSettingsForm extends ConfigFormBase { foreach ($custom_colors as $color) { if (!empty($color['hex'])) { - $pallete_color[] = $color['hex']; // Solo añadimos el HEX + // Solo añadimos el HEX. + $pallete_color[] = $color['hex']; } } @@ -225,7 +229,6 @@ class NoahsSettingsForm extends ConfigFormBase { // '#default_value' => $google_font_api, // '#description' => $this->t("Paste here your google font api. <a href='https://developers.google.com/fonts/docs/developer_api' target='_blank'>Get your API here</a>"), // ]; - $form['fonts']['heading_font'] = [ '#type' => 'select', '#title' => $this->t('Headings front'), @@ -244,7 +247,6 @@ class NoahsSettingsForm extends ConfigFormBase { '#attributes' => ['class' => ['chosen-select']], ]; - /* ========================= Colors ========================= */ $form['colors'] = [ @@ -285,8 +287,6 @@ class NoahsSettingsForm extends ConfigFormBase { ]; // Obtener colores desde el estado del formulario o configuración. - - $colors = $form_state->get('custom_color'); if ($colors === NULL) { $colors = $settings->get('custom_color') ?? []; @@ -296,7 +296,8 @@ class NoahsSettingsForm extends ConfigFormBase { // Agregar dinámicamente los colores guardados. foreach ($colors as $key => $color) { - $form['colors']['custom_color'][$key] = [ // 👈 El índice debe estar directamente aquí + // 👈 El índice debe estar directamente aquí + $form['colors']['custom_color'][$key] = [ '#type' => 'fieldset', '#attributes' => ['class' => ['noahs-custom-colors']], ]; @@ -329,7 +330,7 @@ class NoahsSettingsForm extends ConfigFormBase { ]; } - // Botón para agregar más colores + // Botón para agregar más colores. $form['colors']['custom_color']['add_color'] = [ '#type' => 'submit', '#value' => $this->t('Add Color'), @@ -341,7 +342,6 @@ class NoahsSettingsForm extends ConfigFormBase { ], ]; - /* ========================= Custom Css ========================= */ $form['custom_css'] = [ @@ -363,7 +363,12 @@ class NoahsSettingsForm extends ConfigFormBase { } /** - * Callback para añadir un nuevo color. + * Add color callback. + * + * @param array $form + * The form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The form state. */ public function addColorCallback(array &$form, FormStateInterface $form_state) { // Obtener los colores actuales desde el estado del formulario. @@ -380,7 +385,12 @@ class NoahsSettingsForm extends ConfigFormBase { } /** - * Callback para eliminar un color específico. + * Remove color callback. + * + * @param array $form + * The form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The form state. */ public function removeColorCallback(array &$form, FormStateInterface $form_state) { // Obtener el botón que fue presionado. @@ -396,7 +406,8 @@ class NoahsSettingsForm extends ConfigFormBase { // Eliminar el color si el índice es válido. if (isset($colors[$index])) { unset($colors[$index]); - $colors = array_values($colors); // Reindexar el array. + // Reindexar el array. + $colors = array_values($colors); } // Guardar la lista actualizada de colores en el estado del formulario. @@ -408,14 +419,25 @@ class NoahsSettingsForm extends ConfigFormBase { } /** - * Callback AJAX para actualizar la paleta de colores. + * Update color palette. + * + * @param array $form + * The form. + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The form state. */ public function updateColorPalette(array &$form, FormStateInterface $form_state) { return $form['colors']['custom_color']; } /** - * {@inheritdoc} + * Get google fonts. + * + * @param string $api + * The api. + * + * @return array + * The options. */ public function getGoogleFonts($api) { $options = []; @@ -447,7 +469,6 @@ class NoahsSettingsForm extends ConfigFormBase { */ public function submitForm(array &$form, FormStateInterface $form_state) { - $container = $form_state->getValue('container_width') . 'px' ?? 'none'; $styles = ''; $styles .= ':root { diff --git a/src/ModalForm.php b/src/ModalForm.php index 18a4231..84d6967 100644 --- a/src/ModalForm.php +++ b/src/ModalForm.php @@ -3,16 +3,26 @@ namespace Drupal\noahs_page_builder; /** - * {@inheritdoc} + * Modal form. */ class ModalForm { /** - * Public function contentTemplate(). + * Render form. + * + * @param array $fields + * The fields. + * @param array $values + * The values. + * @param int $delta + * The delta. + * @param string $parent + * The parent. + * + * @return array + * The form. */ - public static function renderForm($fields, $values, $delta = NULL, $parent = NULL) { - $controlService = \Drupal::service('noahs_page_builder.control_service'); - $form = []; + public static function renderForm(array $fields, array $values, int $delta = NULL, string $parent = NULL): array { $groupFields = $controlService->groupFields($fields); @@ -26,11 +36,22 @@ class ModalForm { } /** - * {@inheritdoc} + * Render sub fields. + * + * @param array $fields + * The fields. + * @param array $values + * The values. + * @param int $delta + * The delta. + * @param string $parent + * The parent. + * + * @return array + * The form. */ - public static function renderSubFields($fields, $values = NULL, $delta = NULL, $parent = NULL) { + public static function renderSubFields(array $fields, array $values = NULL, int $delta = NULL, string $parent = NULL): array { - // Group by tabs. $tabs = []; foreach ($fields as $key => $value) { diff --git a/src/Plugin/Control/ControlBase.php b/src/Plugin/Control/ControlBase.php index 66d15e7..43f8553 100644 --- a/src/Plugin/Control/ControlBase.php +++ b/src/Plugin/Control/ControlBase.php @@ -8,9 +8,10 @@ use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; /** - * Clase base para los plugins de Control. + * Control base. */ abstract class ControlBase extends PluginBase implements ControlInterface, ContainerFactoryPluginInterface { + /** * The widget service. * diff --git a/src/Plugin/Control/ControlCheckbox.php b/src/Plugin/Control/ControlCheckbox.php index 22b3080..0e6362d 100644 --- a/src/Plugin/Control/ControlCheckbox.php +++ b/src/Plugin/Control/ControlCheckbox.php @@ -18,9 +18,15 @@ class ControlCheckbox extends ControlBase { } /** - * {@inheritdoc} + * Content template. + * + * @param array $params + * The params. + * + * @return string + * The content template. */ - public function contentTemplate(array $params = []) { + public function contentTemplate(array $params = []): string { $data = $params['data'] ?? NULL; $name = $params['name'] ?? NULL; @@ -74,7 +80,13 @@ class ControlCheckbox extends ControlBase { } /** - * {@inheritdoc} + * Render control. + * + * @param array $data + * The data. + * + * @return string + * The render control. */ public function renderControl($data) { return $this->base($data, $this->contentTemplate($data)); diff --git a/src/Plugin/Control/ControlHtml.php b/src/Plugin/Control/ControlHtml.php index a7de702..e5a2288 100644 --- a/src/Plugin/Control/ControlHtml.php +++ b/src/Plugin/Control/ControlHtml.php @@ -11,7 +11,7 @@ namespace Drupal\noahs_page_builder\Plugin\Control; class ControlHtml extends ControlBase { /** - * + * {@inheritdoc} */ public function getype() { return 'html'; diff --git a/src/Plugin/Control/ControlInterface.php b/src/Plugin/Control/ControlInterface.php index dcec9c7..791ffef 100644 --- a/src/Plugin/Control/ControlInterface.php +++ b/src/Plugin/Control/ControlInterface.php @@ -10,18 +10,27 @@ interface ControlInterface { /** * Run control. * - * @return array - * Render. + * @return string + * The type. */ public function getype(); /** - * {@inheritdoc} + * Content template. + * + * @param array $params + * The params. + * + * @return string + * The content template. */ public function contentTemplate(array $params = []); /** - * {@inheritdoc} + * Default settings. + * + * @return array + * The default settings. */ public function getDefaultSettings(); diff --git a/src/Plugin/Control/ControlNoahsBackgroundGradient.php b/src/Plugin/Control/ControlNoahsBackgroundGradient.php index 442842a..7dd29f8 100644 --- a/src/Plugin/Control/ControlNoahsBackgroundGradient.php +++ b/src/Plugin/Control/ControlNoahsBackgroundGradient.php @@ -13,7 +13,7 @@ use Drupal\Core\StringTranslation\StringTranslationTrait; class ControlNoahsBackgroundGradient extends ControlBase { use StringTranslationTrait; - + /** * {@inheritdoc} */ diff --git a/src/Plugin/Control/ControlNoahsBackgroundImage.php b/src/Plugin/Control/ControlNoahsBackgroundImage.php index e60a1d2..ff2c470 100644 --- a/src/Plugin/Control/ControlNoahsBackgroundImage.php +++ b/src/Plugin/Control/ControlNoahsBackgroundImage.php @@ -11,7 +11,7 @@ use Drupal\Core\StringTranslation\StringTranslationTrait; * ) */ class ControlNoahsBackgroundImage extends ControlBase { - + use StringTranslationTrait; /** @@ -73,56 +73,54 @@ class ControlNoahsBackgroundImage extends ControlBase { $nameBase = $name . '[background_image]'; $element_id = preg_replace('/[\[\]]+/', '_', $name); - $html = ''; $html .= '<div class="mb-3 background-image-field">'; - $html .= '<div class="media-preview-actions d-flex justify-content-center align-items-center mb-3">'; - $html .= '<img class="background-thumbnail-image" src="' . $image . '" alt="Thumbnail">'; - $html .= '<input type="hidden" name="' . $name . '[background_image][fid]" id="' . $element_id . '" value="' . (!empty($value['background_image']['fid']) ? $value['background_image']['fid'] : '') . '" class="form-control background-fid" field-settings>'; - $html .= '<input type="hidden" name="' . $name . '[background_image][thumbnail]" value="' . (!empty($value['background_image']['thumbnail']) ? $value['background_image']['thumbnail'] : '') . '" class="form-control background-thumbnail" field-settings>'; - $html .= '<input type="hidden" name="' . $name . '[background_image][url]" value="' . (!empty($value['background_image']['url']) ? $value['background_image']['url'] : '') . '" class="form-control background-url" field-settings>'; - $html .= '<div class="btn-actions">'; - $html .= '<button type="button" class="btn btn-light media-uploadbg_image" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="' . $this->t('Add/change Image') . '" data-element-id="' . $element_id . '"><i class="fa-solid fa-circle-plus"></i></button>'; - $html .= '<button type="button" class="btn btn-light media-removebg_image" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="' . $this->t('Remove Image') . '"><i class="fa-solid fa-trash"></i></button>'; - $html .= '</div>'; - $html .= '</div>'; + $html .= '<div class="media-preview-actions d-flex justify-content-center align-items-center mb-3">'; + $html .= '<img class="background-thumbnail-image" src="' . $image . '" alt="Thumbnail">'; + $html .= '<input type="hidden" name="' . $name . '[background_image][fid]" id="' . $element_id . '" value="' . (!empty($value['background_image']['fid']) ? $value['background_image']['fid'] : '') . '" class="form-control background-fid" field-settings>'; + $html .= '<input type="hidden" name="' . $name . '[background_image][thumbnail]" value="' . (!empty($value['background_image']['thumbnail']) ? $value['background_image']['thumbnail'] : '') . '" class="form-control background-thumbnail" field-settings>'; + $html .= '<input type="hidden" name="' . $name . '[background_image][url]" value="' . (!empty($value['background_image']['url']) ? $value['background_image']['url'] : '') . '" class="form-control background-url" field-settings>'; + $html .= '<div class="btn-actions">'; + $html .= '<button type="button" class="btn btn-light media-uploadbg_image" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="' . $this->t('Add/change Image') . '" data-element-id="' . $element_id . '"><i class="fa-solid fa-circle-plus"></i></button>'; + $html .= '<button type="button" class="btn btn-light media-removebg_image" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="' . $this->t('Remove Image') . '"><i class="fa-solid fa-trash"></i></button>'; + $html .= '</div>'; + $html .= '</div>'; $html .= '</div>'; $html .= '<div class="mb-3">'; - $html .= '<label for="">' . $this->t('Use Media Token Field') . '</label>'; - $html .= '<input type="text" name="' . $name . '[token_media]" value="' . (!empty($value['token_media']) ? $value['token_media'] : '') . '" class="form-control" field-settings>'; + $html .= '<label for="">' . $this->t('Use Media Token Field') . '</label>'; + $html .= '<input type="text" name="' . $name . '[token_media]" value="' . (!empty($value['token_media']) ? $value['token_media'] : '') . '" class="form-control" field-settings>'; $html .= '</div>'; $html .= '<div class="nohas-field-description mb-4">' . $this->t('This is not available on token module, copy and replace your entity, field and style: [node:field_featured_image:entity:field_media_image:og_image_1200x630]') . '</div>'; - $html .= '<div class="row row-cols-3">'; - $html .= '<div class="col mb-3">'; - $html .= '<label for="noahs_page_builder_background_image_style">' . $this->t('Image Style') . '</label>'; - $html .= '<select name="' . $name . '[image_style]" class="form-control noahs-select-image-style" field-settings>'; - foreach ($image_styles as $k => $style) { - $selected = (!empty($value['image_style']) && $value['image_style'] === $k) ? 'selected' : ''; - $html .= '<option value="' . $k . '" ' . $selected . '>' . $style . '</option>'; - } - $html .= '</select>'; - $html .= '</div>'; - - foreach ($field_names as $label => $field_name) { - $html .= '<div class="col mb-3">'; - $html .= '<label for="noahs_page_builder_' . $field_name . '">' . $label . '</label>'; - $html .= '<select name="' . $nameBase . '[' . $field_name . ']" data-style-css="' . str_replace('_', '-', $field_name) . '" class="form-control" field-settings>'; - foreach ($options[$field_name] as $k => $title) { - $selected = (!empty($value['background_image'][$field_name]) && $value['background_image'][$field_name] === $k) ? ' selected' : ''; - $html .= '<option value="' . $k . '" ' . $selected . '>' . $title . '</option>'; - } - $html .= '</select>'; - $html .= '</div>'; - } + $html .= '<div class="col mb-3">'; + $html .= '<label for="noahs_page_builder_background_image_style">' . $this->t('Image Style') . '</label>'; + $html .= '<select name="' . $name . '[image_style]" class="form-control noahs-select-image-style" field-settings>'; + foreach ($image_styles as $k => $style) { + $selected = (!empty($value['image_style']) && $value['image_style'] === $k) ? 'selected' : ''; + $html .= '<option value="' . $k . '" ' . $selected . '>' . $style . '</option>'; + } + $html .= '</select>'; + $html .= '</div>'; + foreach ($field_names as $label => $field_name) { $html .= '<div class="col mb-3">'; - $html .= '<label for="">' . $this->t('Custom Size') . '</label>'; - $html .= '<input type="text" name="' . $name . '[background_size_custom]" value="' . (!empty($value['background_size_custom']) ? $value['background_size_custom'] : '') . '" class="form-control" field-settings>'; - $html .= '<div class="nohas-field-description">' . $this->t('i.e. 100px 100px') . '</div>'; + $html .= '<label for="noahs_page_builder_' . $field_name . '">' . $label . '</label>'; + $html .= '<select name="' . $nameBase . '[' . $field_name . ']" data-style-css="' . str_replace('_', '-', $field_name) . '" class="form-control" field-settings>'; + foreach ($options[$field_name] as $k => $title) { + $selected = (!empty($value['background_image'][$field_name]) && $value['background_image'][$field_name] === $k) ? ' selected' : ''; + $html .= '<option value="' . $k . '" ' . $selected . '>' . $title . '</option>'; + } + $html .= '</select>'; $html .= '</div>'; + } + + $html .= '<div class="col mb-3">'; + $html .= '<label for="">' . $this->t('Custom Size') . '</label>'; + $html .= '<input type="text" name="' . $name . '[background_size_custom]" value="' . (!empty($value['background_size_custom']) ? $value['background_size_custom'] : '') . '" class="form-control" field-settings>'; + $html .= '<div class="nohas-field-description">' . $this->t('i.e. 100px 100px') . '</div>'; + $html .= '</div>'; $html .= '</div>'; return $html; diff --git a/src/Plugin/Control/ControlNoahsDivider.php b/src/Plugin/Control/ControlNoahsDivider.php index c596474..2e02cc5 100644 --- a/src/Plugin/Control/ControlNoahsDivider.php +++ b/src/Plugin/Control/ControlNoahsDivider.php @@ -27,6 +27,14 @@ class ControlNoahsDivider extends ControlBase implements ContainerFactoryPluginI /** * Constructs a new ControlNoahsDivider object. * + * @param array $configuration + * The configuration. + * @param string $plugin_id + * The plugin id. + * @param mixed $plugin_definition + * The plugin definition. + * @param \Drupal\noahs_page_builder\Service\WidgetServices $widget_services + * The widget services. * @param \Drupal\Core\File\FileSystemInterface $file_system * The file system service. */ @@ -118,13 +126,27 @@ class ControlNoahsDivider extends ControlBase implements ContainerFactoryPluginI } /** - * {@inheritdoc} + * Generate option block. + * + * @param string $name + * The name. + * @param string $type + * The type. + * @param array $value + * The value. + * @param array $options + * The options. + * @param array $optionsDirection + * The options direction. + * @param array $optionsAlign + * The options align. + * @param array $items + * The items. + * + * @return string + * The output. */ - private function generateOptionBlock($name, $type, $value, $options, $optionsDirection, $optionsAlign, $items) { - $currentAlign = !empty($value['align']) ? $value['align'] : ''; - $currentDirection = !empty($value['direction']) ? $value['direction'] : ''; - $selected_value = !empty($value['divider']) ? $value['divider'] : ''; - + protected function generateOptionBlock($name, $type, $value, $options, $optionsDirection, $optionsAlign, $items) { $output = '<div class="media-preview-actions media-preview-actions--divider overflow-auto mb-3" style="height:200px">'; $output .= '<div class="row g-3">'; foreach ($items as $k => $item) { @@ -189,10 +211,14 @@ class ControlNoahsDivider extends ControlBase implements ContainerFactoryPluginI } /** - * {@inheritdoc} + * List. + * + * @param string|null $name + * The name. + * + * @return array */ - private function list($name = NULL) - { + protected function list($name = NULL) { $module_path = NOAHS_PAGE_BUILDER_PATH; $icon_folder_path = $module_path . '/assets/svg-divider-kit/'; $files = $this->fileSystem->scanDirectory($icon_folder_path, '/\.svg$/'); diff --git a/src/Plugin/Control/ControlNoahsFont.php b/src/Plugin/Control/ControlNoahsFont.php index 48921bf..2928d1d 100644 --- a/src/Plugin/Control/ControlNoahsFont.php +++ b/src/Plugin/Control/ControlNoahsFont.php @@ -55,7 +55,7 @@ class ControlNoahsFont extends ControlBase { $output .= '<div class="row gx-2 mb-3">'; $output .= '<div class="col-4">'; - $output .= '<label for="noahs_page_builder_font">'. t('Font family') .'</label>'; + $output .= '<label for="noahs_page_builder_font">' . t('Font family') . '</label>'; $output .= '<select name="' . $name . '[font_family]" class="form-select" field-settings>'; foreach (Fonts::getFonts() as $key => $font) { $output .= '<option value="' . $key . '" ' . (!empty($value['font_family']) && $value['font_family'] === $font ? 'selected' : '') . '>' . $font . '</option>'; @@ -63,7 +63,7 @@ class ControlNoahsFont extends ControlBase { $output .= '</select>'; $output .= '</div>'; $output .= '<div class="col-4">'; - $output .= '<label for="noahs_page_builder_font">'. t('Font Weight') .'</label>'; + $output .= '<label for="noahs_page_builder_font">' . t('Font Weight') . '</label>'; $output .= '<select name="' . $name . '[font_weight]" class="form-select" field-settings>'; foreach (Fonts::getFontsWeights() as $key => $font) { $output .= '<option value="' . $key . '" ' . (!empty($value['font_weight']) && $value['font_weight'] === $font ? 'selected' : '') . '>' . $font . '</option>'; @@ -72,14 +72,14 @@ class ControlNoahsFont extends ControlBase { $output .= '</div>'; $output .= '<div class="col-4">'; - $output .= '<label for="noahs_page_builder_font">'. t('Font Size') .'</label>'; + $output .= '<label for="noahs_page_builder_font">' . t('Font Size') . '</label>'; $output .= '<input type="text" name="' . $name . '[font_size]" value="' . (!empty($value['font_size']) ? $value['font_size'] : '') . '" placeholder="16px" class="form-control" field-settings>'; $output .= '</div>'; $output .= '</div>'; $output .= '<div class="row gx-2 mb-3">'; $output .= '<div class="col-4">'; - $output .= '<label for="noahs_page_builder_font">'. t('Transform') .'</label>'; + $output .= '<label for="noahs_page_builder_font">' . t('Transform') . '</label>'; $output .= '<select name="' . $name . '[text_transform]" class="form-select" field-settings>'; foreach ($text_transform_options as $k => $label) { $output .= '<option value="' . $k . '" ' . (!empty($value['text_transform']) && $value['text_transform'] === $k ? 'selected' : '') . '>' . $label . '</option>'; @@ -88,7 +88,7 @@ class ControlNoahsFont extends ControlBase { $output .= '</div>'; $output .= '<div class="col-4">'; - $output .= '<label for="noahs_page_builder_font">'. t('Style') .'</label>'; + $output .= '<label for="noahs_page_builder_font">' . t('Style') . '</label>'; $output .= '<select name="' . $name . '[font_style]" class="form-select" field-settings>'; foreach ($font_style_options as $k => $label) { $output .= '<option value="' . $k . '" ' . (!empty($value['font_style']) && $value['font_style'] === $k ? 'selected' : '') . '>' . $label . '</option>'; @@ -97,7 +97,7 @@ class ControlNoahsFont extends ControlBase { $output .= '</div>'; $output .= '<div class="col-4">'; - $output .= '<label for="noahs_page_builder_font">'. t('Decoration') .'</label>'; + $output .= '<label for="noahs_page_builder_font">' . t('Decoration') . '</label>'; $output .= '<select name="' . $name . '[text_decoration]" class="form-select" field-settings>'; foreach ($text_decoration_options as $k => $label) { $output .= '<option value="' . $k . '" ' . (!empty($value['text_decoration']) && $value['text_decoration'] === $k ? 'selected' : '') . '>' . $label . '</option>'; @@ -108,29 +108,27 @@ class ControlNoahsFont extends ControlBase { $output .= '<div class="row gx-2 mb-3">'; $output .= '<div class="col-3">'; - $output .= '<label for="noahs_page_builder_font">'. t('Line height') .'</label>'; + $output .= '<label for="noahs_page_builder_font">' . t('Line height') . '</label>'; $output .= '<input type="text" name="' . $name . '[line_height]" class="form-control" value="' . (!empty($value['line_height']) ? $value['line_height'] : '') . '" field-settings>'; $output .= '</div>'; $output .= '<div class="col-3">'; - $output .= '<label for="noahs_page_builder_font">'. t('Letter Space') .'</label>'; + $output .= '<label for="noahs_page_builder_font">' . t('Letter Space') . '</label>'; $output .= '<input type="text" name="' . $name . '[letter_spacing]" class="form-control" value="' . (!empty($value['letter_spacing']) ? $value['letter_spacing'] : '') . '" field-settings>'; $output .= '</div>'; $output .= '<div class="col-3">'; - $output .= '<label for="noahs_page_builder_font">'. t('Word Space') .'</label>'; + $output .= '<label for="noahs_page_builder_font">' . t('Word Space') . '</label>'; $output .= '<input type="text" name="' . $name . '[word_spacing]" class="form-control" value="' . (!empty($value['word_spacing']) ? $value['word_spacing'] : '') . '" field-settings>'; $output .= '</div>'; $output .= '<div class="col-3">'; - $output .= '<label for="noahs_page_builder_font_color">'. t('Color') .'</label>'; + $output .= '<label for="noahs_page_builder_font_color">' . t('Color') . '</label>'; $output .= '<input type="text" name="' . $name . '[color]" class="form-control-color" value="' . (!empty($value['color']) ? $value['color'] : '') . '" field-settings>'; $output .= '</div>'; $output .= '</div>'; - - return $output; } diff --git a/src/Plugin/Control/ControlNoahsImage.php b/src/Plugin/Control/ControlNoahsImage.php index 6e7bd5a..2d2f9fc 100644 --- a/src/Plugin/Control/ControlNoahsImage.php +++ b/src/Plugin/Control/ControlNoahsImage.php @@ -13,6 +13,7 @@ use Drupal\Core\StringTranslation\StringTranslationTrait; class ControlNoahsImage extends ControlBase { use StringTranslationTrait; + /** * {@inheritdoc} */ diff --git a/src/Plugin/Control/ControlNoahsMargin.php b/src/Plugin/Control/ControlNoahsMargin.php index 76d9159..3eb3323 100644 --- a/src/Plugin/Control/ControlNoahsMargin.php +++ b/src/Plugin/Control/ControlNoahsMargin.php @@ -29,10 +29,8 @@ class ControlNoahsMargin extends ControlBase { $placeholder_right = !empty($data['item']['placeholder']['margin_right']) ? $data['item']['placeholder']['margin_right'] : NULL; $placeholder_bottom = !empty($data['item']['placeholder']['margin_bottom']) ? $data['item']['placeholder']['margin_bottom'] : NULL; - $output = ''; - $output .= '<div class="nohas-field-description">Use your property as px, em, rem, %, ...</div>'; $output .= '<ul class="field-element-list-horizontal">'; $output .= '<li>'; diff --git a/src/Plugin/Control/ControlNoahsShadows.php b/src/Plugin/Control/ControlNoahsShadows.php index a751ca0..84a8271 100644 --- a/src/Plugin/Control/ControlNoahsShadows.php +++ b/src/Plugin/Control/ControlNoahsShadows.php @@ -31,19 +31,19 @@ class ControlNoahsShadows extends ControlBase { $output .= '<ul class="field-element-list-horizontal">'; $output .= '<li>'; $output .= '<input type="text" name="' . htmlspecialchars($name, ENT_QUOTES, 'UTF-8') . '[shadow_x]" value="' . (!empty($value['shadow_x']) ? htmlspecialchars($value['shadow_x'], ENT_QUOTES, 'UTF-8') : '') . '" class="form-control" field-settings>'; - $output .= '<label for="noahs_page_builder_shadow_x">'.('Horizontal').'</label>'; + $output .= '<label for="noahs_page_builder_shadow_x">' . ('Horizontal') . '</label>'; $output .= '</li>'; $output .= '<li>'; $output .= '<input type="text" name="' . htmlspecialchars($name, ENT_QUOTES, 'UTF-8') . '[shadow_y]" value="' . (!empty($value['shadow_y']) ? htmlspecialchars($value['shadow_y'], ENT_QUOTES, 'UTF-8') : '') . '" class="form-control" field-settings>'; - $output .= '<label for="noahs_page_builder_shadow_y">'.('Vertical').'</label>'; + $output .= '<label for="noahs_page_builder_shadow_y">' . ('Vertical') . '</label>'; $output .= '</li>'; $output .= '<li>'; $output .= '<input type="text" name="' . htmlspecialchars($name, ENT_QUOTES, 'UTF-8') . '[blur]" value="' . (!empty($value['blur']) ? htmlspecialchars($value['blur'], ENT_QUOTES, 'UTF-8') : '') . '" class="form-control" field-settings>'; - $output .= '<label for="noahs_page_builder_shadow_blur">'.('Blur').'</label>'; + $output .= '<label for="noahs_page_builder_shadow_blur">' . ('Blur') . '</label>'; $output .= '</li>'; $output .= '<li>'; $output .= '<input type="text" name="' . htmlspecialchars($name, ENT_QUOTES, 'UTF-8') . '[spread]" value="' . (!empty($value['spread']) ? htmlspecialchars($value['spread'], ENT_QUOTES, 'UTF-8') : '') . '" class="form-control" field-settings>'; - $output .= '<label for="noahs_page_builder_shadow_spread">'.('Spread').'</label>'; + $output .= '<label for="noahs_page_builder_shadow_spread">' . ('Spread') . '</label>'; $output .= '</li>'; $output .= '</ul>'; $output .= '</div>'; diff --git a/src/Plugin/Control/ControlNoahsUrl.php b/src/Plugin/Control/ControlNoahsUrl.php index 838e0aa..6cfb70e 100644 --- a/src/Plugin/Control/ControlNoahsUrl.php +++ b/src/Plugin/Control/ControlNoahsUrl.php @@ -116,8 +116,6 @@ class ControlNoahsUrl extends ControlBase implements ContainerFactoryPluginInter $output .= '<input type="text" name="' . $name . '[text]" ' . $attributes . ' id="' . $data['item_id'] . '" title="' . $data['item']['title'] . '" class="' . $class . '" placeholder="' . $placeholder . '" value="' . $text . '" ' . $selector . ' field-settings/>'; $output .= '<input type="text" name="' . $name . '[url_params]" id="' . $data['item_id'] . '" title="' . t('Url params') . '" placeholder="?param=test" class="form-control mt-1" value="' . $value['url_params'] . '" field-settings/>'; - - $output .= '</div>'; return $output; diff --git a/src/Plugin/Control/ControlNoahsVideoUpload.php b/src/Plugin/Control/ControlNoahsVideoUpload.php index 0353374..810de74 100644 --- a/src/Plugin/Control/ControlNoahsVideoUpload.php +++ b/src/Plugin/Control/ControlNoahsVideoUpload.php @@ -24,6 +24,12 @@ class ControlNoahsVideoUpload extends ControlBase { */ protected $fileUrlGenerator; + /** + * Constructs a new ControlNoahsVideoUpload object. + * + * @param \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator + * The file URL generator service. + */ public function __construct(FileUrlGeneratorInterface $file_url_generator) { $this->fileUrlGenerator = $file_url_generator; } @@ -31,7 +37,7 @@ class ControlNoahsVideoUpload extends ControlBase { /** * {@inheritdoc} */ - public static function create(ContainerInterface $container) { + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static( $container->get('file_url_generator') ); diff --git a/src/Plugin/Control/ControlNumber.php b/src/Plugin/Control/ControlNumber.php index eaef832..df4b6cb 100644 --- a/src/Plugin/Control/ControlNumber.php +++ b/src/Plugin/Control/ControlNumber.php @@ -26,7 +26,7 @@ class ControlNumber extends ControlBase { $value = $params['value'] ?? NULL; $value = (empty($value) && !empty($data['item']['default_value'])) ? $data['item']['default_value'] : $value; $output = ''; - + $class = []; $class[] = 'form-control'; $attributes = ''; diff --git a/src/Plugin/Control/ControlText.php b/src/Plugin/Control/ControlText.php index ff09008..c913f86 100644 --- a/src/Plugin/Control/ControlText.php +++ b/src/Plugin/Control/ControlText.php @@ -29,7 +29,7 @@ class ControlText extends ControlBase { $attributes = ''; $class = []; $class[] = 'form-control'; - $class[] = !empty($data['item']['noahs_ai']) ? 'noahs-ai-control' : false; + $class[] = !empty($data['item']['noahs_ai']) ? 'noahs-ai-control' : FALSE; $placeholder = !empty($data['item']['placeholder']) ? $data['item']['placeholder'] : $data['item']['title']; $selector = !empty($data['item']['update_selector']) ? 'data-update-selector="#widget-id-' . $data['wid'] . ' ' . $data['item']['update_selector'] . '"' : NULL; @@ -59,7 +59,6 @@ class ControlText extends ControlBase { $class = implode(" ", $class); - $value = is_array($value) ? ($value['text'] ?? '') : $value; if (!empty($data['item']['format']) && $data['item']['format'] === 'json') { diff --git a/src/Plugin/Control/ControlTextarea.php b/src/Plugin/Control/ControlTextarea.php index 76b3f94..0f1e560 100644 --- a/src/Plugin/Control/ControlTextarea.php +++ b/src/Plugin/Control/ControlTextarea.php @@ -25,7 +25,7 @@ class ControlTextarea extends ControlBase { $data = $params['data'] ?? NULL; $name = $params['name'] ?? NULL; $value = $params['value'] ?? NULL; - if(!empty($value['text'])){ + if (!empty($value['text'])) { $value = $value['text']; } $delta = $params['delta'] ?? NULL; @@ -46,7 +46,7 @@ class ControlTextarea extends ControlBase { $class = []; $class[] = 'noahs_page_builder_textarea form-control'; - $class[] = !empty($data['item']['noahs_ai']) ? 'noahs-ai-control' : false; + $class[] = !empty($data['item']['noahs_ai']) ? 'noahs-ai-control' : FALSE; if (!empty($data['item']['attributes'])) { $attributes = implode(' ', array_map( function ($key, $value) { diff --git a/src/Plugin/Widget/WidgetBase.php b/src/Plugin/Widget/WidgetBase.php index 0086a04..c183fe4 100644 --- a/src/Plugin/Widget/WidgetBase.php +++ b/src/Plugin/Widget/WidgetBase.php @@ -17,7 +17,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; /** - * Clase base para los plugins de Widget. + * Base class for Widget plugins. */ abstract class WidgetBase extends PluginBase implements WidgetInterface, ContainerFactoryPluginInterface { /** @@ -83,6 +83,33 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface, Contain */ protected $requestStack; + /** + * Constructs a new WidgetBase object. + * + * @param array $configuration + * A configuration array containing information about the plugin instance. + * @param string $plugin_id + * @param mixed $plugin_definition + * The plugin implementation definition. + * @param \Twig\Environment $twig + * The Twig service. + * @param \Drupal\noahs_page_builder\Service\WidgetServices $widget_service + * The widget service. + * @param \Drupal\Core\Render\RendererInterface $renderer + * The renderer service. + * @param \Drupal\Core\Session\AccountProxyInterface $current_user + * The current user. + * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory + * The config factory service. + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager + * The entity type manager service. + * @param \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator + * The file URL generator service. + * @param \Drupal\Core\Routing\RouteMatchInterface $route_match + * The route match service. + * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack + * The request stack service. + */ public function __construct(array $configuration, $plugin_id, $plugin_definition, Environment $twig, WidgetServices $widget_service, RendererInterface $renderer, AccountProxyInterface $current_user, ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, FileUrlGeneratorInterface $file_url_generator, RouteMatchInterface $route_match, RequestStack $request_stack) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->twig = $twig; @@ -164,7 +191,10 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface, Contain } $element = 'div'; - $class = ['noahs_page_builder-widget', 'widget-' . str_replace('_', '-', $data->type)]; + $class = [ + 'noahs_page_builder-widget', + 'widget-' . str_replace('_', '-', $data->type), + ]; $subclass = ['widget-wrapper', 'element-transition']; $widget_default = 'element'; $column_size = NULL; @@ -182,37 +212,37 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface, Contain $widget_title = $widgetData['title']; $tabs .= "<li class='widget_type'><span>$widget_title</span></li>"; - $tabs .= "<li><div class='area_tooltip noahs_page_builder-edit-widget' title='" .t('Edit')."' data-widget-id='$id'><i class='fa-solid fa-pen-to-square'></i></div></li>"; + $tabs .= "<li><div class='area_tooltip noahs_page_builder-edit-widget' title='" . t('Edit') . "' data-widget-id='$id'><i class='fa-solid fa-pen-to-square'></i></div></li>"; $column_size = $data->column_size ?? NULL; if ($data->type === 'noahs_row') { $element = 'section'; $widget_default = 'section'; $tabs .= "<li><div class='noahs-add-column-section'> - <div class='area_tooltip noahs-tool-add-section before' title='" .t('Add Section bebore')."' data-widget-id='$id'><i class='fa-solid fa-plus'></i></div> - <div class='noahs-tool-add-column' data-bs-toggle='tooltip' data-bs-placement='right' title='" .t('Add Column')."' data-widget-id='$id'><i class='fa-solid fa-plus'></i></div> - <div class='noahs-tool-add-section after 'data-bs-toggle='tooltip' data-bs-placement='bottom' title='" .t('Add Section after')."' data-widget-id='$id'><i class='fa-solid fa-plus'></i></div> + <div class='area_tooltip noahs-tool-add-section before' title='" . t('Add Section bebore') . "' data-widget-id='$id'><i class='fa-solid fa-plus'></i></div> + <div class='noahs-tool-add-column' data-bs-toggle='tooltip' data-bs-placement='right' title='" . t('Add Column') . "' data-widget-id='$id'><i class='fa-solid fa-plus'></i></div> + <div class='noahs-tool-add-section after 'data-bs-toggle='tooltip' data-bs-placement='bottom' title='" . t('Add Section after') . "' data-widget-id='$id'><i class='fa-solid fa-plus'></i></div> <div></li>"; - $tabs .= "<li><div class='area_tooltip noahs_page_builder-move-section' title='" .t('Move')."' data-widget-id='$id'><i class='fa-solid fa-up-down-left-right'></i></div></li>"; + $tabs .= "<li><div class='area_tooltip noahs_page_builder-move-section' title='" . t('Move') . "' data-widget-id='$id'><i class='fa-solid fa-up-down-left-right'></i></div></li>"; } elseif ($data->type === 'noahs_column') { $widget_default = 'column'; - $tabs .= "<li><div class='area_tooltip noahs_page_builder-add-element-widget' title='" .t('Add Widget')."' data-widget-id='$id'><i class='fa-solid fa-plus'></i></div></li>"; - $tabs .= "<li><div class='area_tooltip noahs_page_builder-move-column' title='" .t('Move')."' data-widget-id='$id'><i class='fa-solid fa-up-down-left-right'></i></div></li>"; + $tabs .= "<li><div class='area_tooltip noahs_page_builder-add-element-widget' title='" . t('Add Widget') . "' data-widget-id='$id'><i class='fa-solid fa-plus'></i></div></li>"; + $tabs .= "<li><div class='area_tooltip noahs_page_builder-move-column' title='" . t('Move') . "' data-widget-id='$id'><i class='fa-solid fa-up-down-left-right'></i></div></li>"; } else { $class[] = 'element-widget'; - $tabs .= "<li><div class='area_tooltip noahs_page_builder-move-widget' title='" .t('Move')."' data-widget-id='$id'><i class='fa-solid fa-up-down-left-right'></i></div></li>"; + $tabs .= "<li><div class='area_tooltip noahs_page_builder-move-widget' title='" . t('Move') . "' data-widget-id='$id'><i class='fa-solid fa-up-down-left-right'></i></div></li>"; } $class[] = 'scrollme'; - $tabs .= "<li><div class='area_tooltip noahs_page_builder-remove-widget' title='" .t('Remove')."' data-widget-id='$id'><i class='fa-solid fa-trash'></i></div></li>"; - $tabs .= "<li><div class='area_tooltip noahs_page_builder-up-widget' title='" .t('Up')."' data-widget-id='$id'><i class='fa-solid fa-arrow-up'></i></div></li>"; - $tabs .= "<li><div class='area_tooltip noahs_page_builder-down-widget' title='" .t('Down')."' data-widget-id='$id'><i class='fa-solid fa-arrow-down'></i></div></li>"; + $tabs .= "<li><div class='area_tooltip noahs_page_builder-remove-widget' title='" . t('Remove') . "' data-widget-id='$id'><i class='fa-solid fa-trash'></i></div></li>"; + $tabs .= "<li><div class='area_tooltip noahs_page_builder-up-widget' title='" . t('Up') . "' data-widget-id='$id'><i class='fa-solid fa-arrow-up'></i></div></li>"; + $tabs .= "<li><div class='area_tooltip noahs_page_builder-down-widget' title='" . t('Down') . "' data-widget-id='$id'><i class='fa-solid fa-arrow-down'></i></div></li>"; if (empty($global_class)) { - $tabs .= "<li><div class='area_tooltip noahs_page_builder-clone-widget' title='" .t('Clone')."' data-widget-id='$id'><i class='fa-solid fa-clone'></i></div></li>"; + $tabs .= "<li><div class='area_tooltip noahs_page_builder-clone-widget' title='" . t('Clone') . "' data-widget-id='$id'><i class='fa-solid fa-clone'></i></div></li>"; } $tabs .= '<li><div class="dropdown"> <div class="dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> @@ -220,7 +250,7 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface, Contain </div>'; $tabs .= '<ul class="dropdown-menu p-0" aria-labelledby="navbarDropdown">'; if (empty($global_class)) { - $tabs .= '<li class="d-block"><div class="dropdown-item d-block noahs_copy_element">' . t('Copy') .'</div></li>'; + $tabs .= '<li class="d-block"><div class="dropdown-item d-block noahs_copy_element">' . t('Copy') . '</div></li>'; } if (is_module_installed('noahs_page_builder_pro')) { if ($data->type != 'noahs_row' && $data->type != 'noahs_column' && empty($global_class)) { @@ -314,8 +344,8 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface, Contain } } - if (!empty($data->settings->element->param_controls_default)){ - if ($current_request->query->has($data->settings->element->param_controls_default->text)){ + if (!empty($data->settings->element->param_controls_default)) { + if ($current_request->query->has($data->settings->element->param_controls_default->text)) { return; } @@ -325,14 +355,12 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface, Contain if ($route === 'noahs_page_builder.noahs_settings_iframe') { $tabs = ''; } - // if (!empty($data->settings->element->if_token)) { + // If (!empty($data->settings->element->if_token)) { // $controlService = \Drupal::service('noahs_page_builder.control_service'); // $inlineCSS = new NoahsSaveStylesController($controlService); // $efw = !empty($data->settings) ? json_decode(json_encode($data->settings), TRUE) : json_decode(json_encode($obj), TRUE); // $widgetStyles = '<style id="w_style_' . $data->wid . '">' . $inlineCSS->generateWidgetStyles($efw) . '</style>'; - // } - - + // }. $class = implode(' ', $class); return ' @@ -403,7 +431,7 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface, Contain if ($has_permission && isset($media)) { $url = Url::fromRoute('entity.media.edit_form', ['media' => $mid]); - $render['#prefix'] = t('<a href="@link" class="noahs-contextual--link" title="' . t('Edit edia') . '" target="_blank"><i class="fas fa-edit"></i></a>', ['@link' => $url->toString()]); + $render['#prefix'] = t('<a href="@link" class="noahs-contextual--link" title="@title" target="_blank"><i class="fas fa-edit"></i></a>', ['@link' => $url->toString(), '@title' => t('Edit media')]); } $html .= $this->renderer->render($render); diff --git a/src/Plugin/Widget/WidgetNoahsAccordion.php b/src/Plugin/Widget/WidgetNoahsAccordion.php index b9b1d17..65c0770 100644 --- a/src/Plugin/Widget/WidgetNoahsAccordion.php +++ b/src/Plugin/Widget/WidgetNoahsAccordion.php @@ -50,7 +50,7 @@ class WidgetNoahsAccordion extends WidgetBase { 'default_value' => 'Accordion Item', 'update_selector' => '.multipart-item_element_[index] .accordion-button', 'wrapper' => FALSE, - 'translate_ai' => true, + 'translate_ai' => TRUE, ], 'accordion_text' => [ 'title' => 'Text', @@ -59,7 +59,7 @@ class WidgetNoahsAccordion extends WidgetBase { 'default_value' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer at laoreet dolor, et ultricies odio. In blandit libero ac orci congue, at aliquam odio pharetra. Maecenas rhoncus augue ac nulla semper, ac imperdiet risus maximus.', 'update_selector' => '.multipart-item_element_[index] .accordion-body', 'wrapper' => FALSE, - 'translate_ai' => true, + 'translate_ai' => TRUE, ], 'indeividual_styles' => [ @@ -336,24 +336,23 @@ class WidgetNoahsAccordion extends WidgetBase { */ public function template($settings) { $elements = !empty($settings->element->accordion_items) ? $settings->element->accordion_items : []; - $max_items = !empty($settings->element->max_items_to_show) ? 'max-items-to-show-'.$settings->element->max_items_to_show : 'max-items-to-show-all'; + $max_items = !empty($settings->element->max_items_to_show) ? 'max-items-to-show-' . $settings->element->max_items_to_show : 'max-items-to-show-all'; $max_number = !empty($settings->element->max_items_to_show) ? $settings->element->max_items_to_show : 100; $arrayobj = new \ArrayObject($elements); $totalItems = count($arrayobj); - $maxItemsToShowFirst = $max_number; + $maxItemsToShowFirst = $max_number; $arrayobj = new \ArrayObject($elements); $html = ''; - $html .= '<div class="accordion accordion-flush multipart-item '.$max_items.'" data-items-total="'.$totalItems.'" data-max-items="'.$max_number.'" id="accordion_' . $settings->wid . '">'; + $html .= '<div class="accordion accordion-flush multipart-item ' . $max_items . '" data-items-total="' . $totalItems . '" data-max-items="' . $max_number . '" id="accordion_' . $settings->wid . '">'; // Slides. if (!empty($elements)) { $index = 0; - foreach ($elements as $element) { $isHidden = $index >= $maxItemsToShowFirst ? ' hidden' : ''; - + $html .= '<div class="accordion-item accordion-item_' . $index . ' multipart-item_element_' . $index . $isHidden . '">'; $html .= '<h2 class="accordion-header" id="flush-heading_' . $index . '">'; $html .= '<button class="accordion-button accordion-button_' . $index . ' collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapse_' . $index . '" aria-expanded="false" aria-controls="flush-collapse_' . $index . '">'; @@ -367,15 +366,15 @@ class WidgetNoahsAccordion extends WidgetBase { $html .= '</div>'; $html .= '</div>'; $html .= '</div>'; - + $index++; } - - // Botones de "Ver más" y "Ver menos" + + // Botones de "Ver más" y "Ver menos". if ($totalItems > $maxItemsToShowFirst) { $html .= '<div class="max-items-actions">'; - $html .= '<button id="showMoreButton" class="btn" type="button">'.t('Ver más').'<i class="fa-solid fa-plus"></i></button>'; - $html .= '<button id="showLessButton" class="btn hidden-item" type="button">'.t('Ver menos').'<i class="fa-solid fa-minus"></i></button>'; + $html .= '<button id="showMoreButton" class="btn" type="button">' . t('Ver más') . '<i class="fa-solid fa-plus"></i></button>'; + $html .= '<button id="showLessButton" class="btn hidden-item" type="button">' . t('Ver menos') . '<i class="fa-solid fa-minus"></i></button>'; $html .= '</div>'; } } diff --git a/src/Plugin/Widget/WidgetNoahsBars.php b/src/Plugin/Widget/WidgetNoahsBars.php index ebbf32e..2e1144d 100644 --- a/src/Plugin/Widget/WidgetNoahsBars.php +++ b/src/Plugin/Widget/WidgetNoahsBars.php @@ -37,7 +37,7 @@ class WidgetNoahsBars extends WidgetBase { 'title' => t('Skill List'), 'tab' => 'section_content', 'default_items' => 4, - 'wrapper' => false, + 'wrapper' => FALSE, 'fields' => [ 'skill_content' => [ 'type' => 'tab', @@ -103,13 +103,10 @@ class WidgetNoahsBars extends WidgetBase { $element_content = $twig->render(NOAHS_PAGE_BUILDER_PATH . '/templates/widgets/noahs_skill_bars.twig', [ 'settings' => $settings, - 'elements' => (array)$items, + 'elements' => (array) $items, ]); return $element_content; - - - } /** diff --git a/src/Plugin/Widget/WidgetNoahsButton.php b/src/Plugin/Widget/WidgetNoahsButton.php index 81ab6fe..25a4afd 100644 --- a/src/Plugin/Widget/WidgetNoahsButton.php +++ b/src/Plugin/Widget/WidgetNoahsButton.php @@ -42,7 +42,7 @@ class WidgetNoahsButton extends WidgetBase { 'default_value' => 'My button', 'update_selector' => '.btn > span', 'wrapper' => FALSE, - 'translate_ai' => true, + 'translate_ai' => TRUE, ]; $form['button_style'] = [ @@ -64,8 +64,8 @@ class WidgetNoahsButton extends WidgetBase { 'type' => 'checkbox', 'title' => t('Hide Title'), 'tab' => 'section_content', - 'value' => true, - 'default_value' => false, + 'value' => TRUE, + 'default_value' => FALSE, 'wrapper' => FALSE, 'attributes' => [ 'class' => 'noahs-regenerate-design', @@ -351,7 +351,7 @@ class WidgetNoahsButton extends WidgetBase { $icon = '<i class="' . $settings->button_icon->class . '"></i>'; } if (!empty($settings->button_url->node_id)) { - $url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/'.$settings->button_url->node_id); + $url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $settings->button_url->node_id); } elseif (!empty($settings->button_url->text)) { $url = $settings->button_url->text; @@ -362,19 +362,18 @@ class WidgetNoahsButton extends WidgetBase { if (!empty($settings->attribute->modal_type)) { $class[] = 'use-ajax'; } - $title = null; + $title = NULL; if (empty($settings->hide_title) && !empty($settings->button_title->text)) { $title = $settings->button_title->text; } $output .= '<div class="btn-container">'; - $output .= '<a href="' . $url . '" class="btn '. implode("", $class) . '"><span>' . $title . '</span>' . $icon . '</a>'; + $output .= '<a href="' . $url . '" class="btn ' . implode("", $class) . '"><span>' . $title . '</span>' . $icon . '</a>'; $output .= '</div>'; return $output; } - /** * {@inheritdoc} */ diff --git a/src/Plugin/Widget/WidgetNoahsCard.php b/src/Plugin/Widget/WidgetNoahsCard.php index e13d138..3f6be62 100644 --- a/src/Plugin/Widget/WidgetNoahsCard.php +++ b/src/Plugin/Widget/WidgetNoahsCard.php @@ -80,7 +80,7 @@ class WidgetNoahsCard extends WidgetBase { 'group' => 'card_group_text', 'update_selector' => '.card-title > *', 'wrapper' => FALSE, - 'translate_ai' => true, + 'translate_ai' => TRUE, 'default_value' => 'Card Title Here', ]; $form['card_tag'] = [ @@ -90,7 +90,7 @@ class WidgetNoahsCard extends WidgetBase { 'group' => 'card_group_text', 'update_selector' => '.card-tag-div', 'wrapper' => FALSE, - 'translate_ai' => true, + 'translate_ai' => TRUE, 'default_value' => 'Tag', ]; @@ -119,7 +119,7 @@ class WidgetNoahsCard extends WidgetBase { 'group' => 'card_group_text', 'update_selector' => '.card-text', 'wrapper' => FALSE, - 'translate_ai' => true, + 'translate_ai' => TRUE, 'default_value' => 'This is the card text, please write here', ]; @@ -134,7 +134,7 @@ class WidgetNoahsCard extends WidgetBase { 'group' => 'group_link', 'update_selector' => '.btn', 'wrapper' => FALSE, - 'translate_ai' => true, + 'translate_ai' => TRUE, 'default_value' => 'Button', ]; @@ -559,11 +559,11 @@ class WidgetNoahsCard extends WidgetBase { if ($card_style == 'overlay') { $html .= ' <div class="card card-olverlay h-100 bg-dark text-white">'; } - else if ($card_style == 'flipped') { - $html .= ' <div class="card card-'.$card_style.'"">'; + elseif ($card_style == 'flipped') { + $html .= ' <div class="card card-' . $card_style . '"">'; } else { - $html .= ' <div class="card w-100 h-100 card-'.$card_style.'">'; + $html .= ' <div class="card w-100 h-100 card-' . $card_style . '">'; } $cover_class = empty($settings->hremove_cover_image) ? 'object-fit-cover img-fluid' : 'object-fit-none'; diff --git a/src/Plugin/Widget/WidgetNoahsCardGrid.php b/src/Plugin/Widget/WidgetNoahsCardGrid.php index 6c0a933..2a390f1 100644 --- a/src/Plugin/Widget/WidgetNoahsCardGrid.php +++ b/src/Plugin/Widget/WidgetNoahsCardGrid.php @@ -65,7 +65,7 @@ class WidgetNoahsCardGrid extends WidgetBase { 'default_value' => 'This is a h2', 'wrapper' => FALSE, 'update_selector' => '.multipart-item_element_[index] .noahs_page_builder-cards-grid--title', - 'translate_ai' => true, + 'translate_ai' => TRUE, ], 'slideshow_text' => [ 'title' => 'Text', @@ -75,7 +75,7 @@ class WidgetNoahsCardGrid extends WidgetBase { 'tab' => 'slideshow_content', 'wrapper' => FALSE, 'update_selector' => '.multipart-item_element_[index] .noahs_page_builder-cards-grid--text', - 'translate_ai' => true, + 'translate_ai' => TRUE, ], 'button_title' => [ 'type' => 'text', @@ -84,7 +84,7 @@ class WidgetNoahsCardGrid extends WidgetBase { 'placeholder' => t('Title'), 'update_selector' => '.btn > span', 'wrapper' => FALSE, - 'translate_ai' => true, + 'translate_ai' => TRUE, ], 'slideshow_url' => [ 'title' => 'Url', @@ -179,7 +179,7 @@ class WidgetNoahsCardGrid extends WidgetBase { 'row-cols-1 row-cols-sm-2 row-cols-md-5' => '5', 'row-cols-1 row-cols-sm-2 row-cols-md-6' => '6', ], - 'state' => [ + 'state' => [ 'visible' => [ 'carousel_type' => ['value' => ['grid', 'flipped', 'overlay']], ], @@ -638,7 +638,7 @@ class WidgetNoahsCardGrid extends WidgetBase { 'style_css' => 'width', 'style_selector' => '.noahs-icon-wrapper', ]; - + $form['icon_box_height'] = [ 'type' => 'text', 'title' => t('Height'), @@ -730,7 +730,7 @@ class WidgetNoahsCardGrid extends WidgetBase { $elements = !empty($settings->element->slideshow_items) ? $settings->element->slideshow_items : []; $settings = $settings->element; - $html = '<div class="noahs-services-slide-container w-100 '.$settings->carousel_type.'">'; + $html = '<div class="noahs-services-slide-container w-100 ' . $settings->carousel_type . '">'; if ($settings->carousel_type === 'grid' || $settings->carousel_type === 'flipped' || $settings->carousel_type === 'overlay') { $html = '<div class="noahs-services-slide-container px-0 w-100">'; @@ -743,7 +743,7 @@ class WidgetNoahsCardGrid extends WidgetBase { $html .= '<div class="swiper noahs_elements_carousel noahs_page_builder-cards-grid">'; $html .= '<div class="swiper-wrapper multipart-item">'; } - $svg_url = !empty($settings->svg_icon_as_url) ? true : false; + $svg_url = !empty($settings->svg_icon_as_url) ? TRUE : FALSE; if (!empty($elements)) { $index = 0; @@ -755,16 +755,16 @@ class WidgetNoahsCardGrid extends WidgetBase { $svg_content = NULL; $image = NULL; $style = NULL; - + if (!empty($element->card_image->image_style)) { $style = $element->card_image->image_style; } - + if (!empty($element->card_image->token_media)) { $token_service = \Drupal::token(); $token = $element->card_image->token_media; $route_match = \Drupal::routeMatch(); - + $node = $route_match->getParameter('node'); if (!empty($node)) { $image = $token_service->replace($token, [ @@ -777,24 +777,25 @@ class WidgetNoahsCardGrid extends WidgetBase { if (!empty($element->single_slideshow_icon->fid)) { $file = File::load($element->single_slideshow_icon->fid); - if($file){ + if ($file) { $svg_url = $file->getFileUri(); - if($svg_url){ + if ($svg_url) { $svg_local_url = \Drupal::service('file_url_generator')->generateAbsoluteString($file->getFileUri()); - $svg_content = '<img src="'.$svg_local_url.'">'; - }else{ + $svg_content = '<img src="' . $svg_local_url . '">'; + } + else { $svg_content = file_get_contents($svg_url); } } } if (!empty($element->slideshow_url->node_id)) { - $url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/'.$element->slideshow_url->node_id); + $url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $element->slideshow_url->node_id); } elseif (!empty($element->slideshow_url->text)) { $url = $element->slideshow_url->text; } - + if (!empty($element->single_slideshow_image->token_media)) { $token_service = \Drupal::token(); $token = $element->single_slideshow_image->token_media; @@ -826,7 +827,6 @@ class WidgetNoahsCardGrid extends WidgetBase { <div class="noahs_page_builder-cards-grid--box"> <div class="noahs_page_builder-cards-grid--top">'; - if (empty($settings->remove_icon)) { if (!empty($svg_content)) { $html .= '<div class="noahs-icon-wrapper noahs-icon-svg d-flex justify-content-center align-items-center element-transition">' . $svg_content . '</div>'; @@ -845,19 +845,17 @@ class WidgetNoahsCardGrid extends WidgetBase { $html .= '</div>'; $html .= '<div class="noahs_page_builder-cards-grid--bottom">'; if (!empty($element->slideshow_text->text)) { - if (!empty($svg_content)) { $html .= '<div class="noahs-icon-wrapper noahs-icon-svg justify-content-center align-items-center hidden">' . $svg_content . '</div>'; } - else if(!empty($icon)){ + elseif (!empty($icon)) { $html .= '<div class="noahs-icon-wrapper justify-content-center align-items-center hidden"><i class="' . $icon . '"></i></div>'; } - + $html .= '<h4 class="title-2 hidden">' . $element->slideshow_title->text . '</h4>'; $html .= '<p class="noahs_page_builder-cards-grid--text">' . $element->slideshow_text->text . '</p>'; - } if (!empty($url)) { $html .= '<div class="btn-container mt-4"> diff --git a/src/Plugin/Widget/WidgetNoahsCarousel.php b/src/Plugin/Widget/WidgetNoahsCarousel.php index d712935..47b3996 100644 --- a/src/Plugin/Widget/WidgetNoahsCarousel.php +++ b/src/Plugin/Widget/WidgetNoahsCarousel.php @@ -43,7 +43,7 @@ class WidgetNoahsCarousel extends WidgetBase { 'type' => 'html', 'title' => t('Select your images'), 'tab' => 'section_content', - 'value' => '<br><button class="btn btn-secondary btn-labeled noahs_page_builder-add-item mb-3" id="add_multiple_images_field" data-element-id="gallery-images-wrapper"><span class="btn-label"><i class="fa-solid fa-circle-plus"></i></span>'. t('Add new Item') . '</button>', + 'value' => '<br><button class="btn btn-secondary btn-labeled noahs_page_builder-add-item mb-3" id="add_multiple_images_field" data-element-id="gallery-images-wrapper"><span class="btn-label"><i class="fa-solid fa-circle-plus"></i></span>' . t('Add new Item') . '</button>', ]; $form['gallery_items'] = [ @@ -294,7 +294,7 @@ class WidgetNoahsCarousel extends WidgetBase { $item_tablet = !empty($settings->element->carousel_type_columns_tablet) ? $settings->element->carousel_type_columns_tablet : '2'; $item_mobile = !empty($settings->element->carousel_type_columns_mobile) ? $settings->element->carousel_type_columns_mobile : '1'; $thumbnail_image = $image; - $output = '<div class="noahs_page_builder-carousel swiper '.$grey_effect.'" + $output = '<div class="noahs_page_builder-carousel swiper ' . $grey_effect . '" data-show-items-desktop="' . $item_desktop . '" data-show-items-tablet="' . $item_tablet . '" data-show-items-mobile="' . $item_mobile . '">'; @@ -311,17 +311,20 @@ class WidgetNoahsCarousel extends WidgetBase { if ($media->hasField($media_field_name) && !$media->get($media_field_name)->isEmpty()) { $file = $media->get($media_field_name)->entity; $file_uri = $file->getFileUri(); - + if (!empty($file) && !empty($thumbnails_image_style) && !empty(ImageStyle::load($thumbnails_image_style))) { - + $thumbnail_image = ImageStyle::load($thumbnails_image_style)->buildUrl($file_uri); - if($thumbnail_image){ + if ($thumbnail_image) { $image = ImageStyle::load($image_style)->buildUrl($file_uri); } $image = ImageStyle::load($image_style)->buildUrl($file_uri); - }else if(!empty($file)){ - $thumbnail_image = \Drupal::service('file_url_generator')->generateAbsoluteString($file_uri);; - $image = \Drupal::service('file_url_generator')->generateAbsoluteString($file_uri);; + } + elseif (!empty($file)) { + $thumbnail_image = \Drupal::service('file_url_generator')->generateAbsoluteString($file_uri); + ; + $image = \Drupal::service('file_url_generator')->generateAbsoluteString($file_uri); + ; } } } diff --git a/src/Plugin/Widget/WidgetNoahsColumn.php b/src/Plugin/Widget/WidgetNoahsColumn.php index 19d5e4d..67ea98d 100644 --- a/src/Plugin/Widget/WidgetNoahsColumn.php +++ b/src/Plugin/Widget/WidgetNoahsColumn.php @@ -45,7 +45,7 @@ class WidgetNoahsColumn extends WidgetBase { 'wrapper' => FALSE, 'open' => TRUE, 'slide' => TRUE, - 'units' => [] + 'units' => [], ]; $form['innver_column_width'] = [ 'type' => 'noahs_width', @@ -100,7 +100,7 @@ class WidgetNoahsColumn extends WidgetBase { 'revert' => t('Revert'), 'unset' => t('Unset'), ], - ]; + ]; $form['elements_align'] = [ 'type' => 'select', diff --git a/src/Plugin/Widget/WidgetNoahsDrupalBlock.php b/src/Plugin/Widget/WidgetNoahsDrupalBlock.php index 8af150a..829054d 100644 --- a/src/Plugin/Widget/WidgetNoahsDrupalBlock.php +++ b/src/Plugin/Widget/WidgetNoahsDrupalBlock.php @@ -28,7 +28,7 @@ class WidgetNoahsDrupalBlock extends WidgetBase { public function renderForm() { $form = []; $options = noahs_page_builder_load_blocks(); - + $form['section_content'] = [ 'type' => 'tab', 'title' => t('Countdown'), diff --git a/src/Plugin/Widget/WidgetNoahsHeading.php b/src/Plugin/Widget/WidgetNoahsHeading.php index 7f053b5..60d39d7 100644 --- a/src/Plugin/Widget/WidgetNoahsHeading.php +++ b/src/Plugin/Widget/WidgetNoahsHeading.php @@ -44,7 +44,7 @@ class WidgetNoahsHeading extends WidgetBase { 'update_selector' => '.widget-content span', 'noahs_ai' => TRUE, 'wrapper' => FALSE, - 'translate_ai' => TRUE + 'translate_ai' => TRUE, ]; $form['token_group'] = [ @@ -62,8 +62,8 @@ class WidgetNoahsHeading extends WidgetBase { $form['token_button'] = [ 'type' => 'html', 'group' => 'token_group', - 'value' => '<a class="btn btn-sm btn-outline-info noahs_page_builder-modal-tokens mb-4" href="#">'.t('Select Token').'</a>', - 'tab' => + 'value' => '<a class="btn btn-sm btn-outline-info noahs_page_builder-modal-tokens mb-4" href="#">' . t('Select Token') . '</a>', + 'tab' => 'section_content', ]; @@ -105,8 +105,8 @@ class WidgetNoahsHeading extends WidgetBase { 'options' => [ '' => 'Por defecto', 'flex-start' => t('Start'), - 'center' => t('Center'), - 'flex-end' => t('End'), + 'center' => t('Center'), + 'flex-end' => t('End'), ], 'wrapper' => FALSE, ]; @@ -150,7 +150,7 @@ class WidgetNoahsHeading extends WidgetBase { 'style_css' => 'background-color', 'style_hover' => TRUE, ]; - + $form['headling_border'] = [ 'type' => 'noahs_border', 'title' => t('Border'), @@ -216,7 +216,8 @@ class WidgetNoahsHeading extends WidgetBase { if (!empty($settings->heading_text->text)) { $title = $settings->heading_text->text; - }else{ + } + else { $title = ''; } diff --git a/src/Plugin/Widget/WidgetNoahsIconlist.php b/src/Plugin/Widget/WidgetNoahsIconlist.php index a69cd43..eb5c130 100644 --- a/src/Plugin/Widget/WidgetNoahsIconlist.php +++ b/src/Plugin/Widget/WidgetNoahsIconlist.php @@ -176,7 +176,6 @@ class WidgetNoahsIconlist extends WidgetBase { <div class="widget-content"> '; - if (!empty($elements)) { $output .= '<div class="noahs-list-group multipart-item ' . $list_orientation . '">'; @@ -185,9 +184,10 @@ class WidgetNoahsIconlist extends WidgetBase { $numbered++; $text = ''; - if(!empty($element->icon_text) && empty($element->icon_text->text)){ + if (!empty($element->icon_text) && empty($element->icon_text->text)) { $text = $element->icon_text; - }else if(!empty($element->icon_text->text)){ + } + elseif (!empty($element->icon_text->text)) { $text = $element->icon_text->text; } $output .= '<div class="noahs-list-group--item mb-3 multipart-item_' . $index . '">'; diff --git a/src/Plugin/Widget/WidgetNoahsImage.php b/src/Plugin/Widget/WidgetNoahsImage.php index 7e2df84..11384d0 100644 --- a/src/Plugin/Widget/WidgetNoahsImage.php +++ b/src/Plugin/Widget/WidgetNoahsImage.php @@ -48,7 +48,7 @@ class WidgetNoahsImage extends WidgetBase { 'title' => ('Image'), 'tab' => 'section_content', 'update_selector' => '.widget-image-src', - 'wrapper' => false, + 'wrapper' => FALSE, ]; $form['image_width'] = [ 'type' => 'text', diff --git a/src/Plugin/Widget/WidgetNoahsNetworkIcons.php b/src/Plugin/Widget/WidgetNoahsNetworkIcons.php index bfefe42..7443a82 100644 --- a/src/Plugin/Widget/WidgetNoahsNetworkIcons.php +++ b/src/Plugin/Widget/WidgetNoahsNetworkIcons.php @@ -143,7 +143,13 @@ class WidgetNoahsNetworkIcons extends WidgetBase { } /** + * Template. * + * @param array $settings + * The settings. + * + * @return string + * The output. */ public function template($settings) { $settings = $settings->element; diff --git a/src/Plugin/Widget/WidgetNoahsPlainText.php b/src/Plugin/Widget/WidgetNoahsPlainText.php index 217e557..b4d76b1 100644 --- a/src/Plugin/Widget/WidgetNoahsPlainText.php +++ b/src/Plugin/Widget/WidgetNoahsPlainText.php @@ -44,7 +44,7 @@ class WidgetNoahsPlainText extends WidgetBase { 'update_selector' => '.widget-content', 'translate' => TRUE, 'wrapper' => FALSE, - 'translate_ai' => true, + 'translate_ai' => TRUE, ]; $form['section_style'] = [ diff --git a/src/Plugin/Widget/WidgetNoahsRow.php b/src/Plugin/Widget/WidgetNoahsRow.php index 16f3e47..e31365d 100644 --- a/src/Plugin/Widget/WidgetNoahsRow.php +++ b/src/Plugin/Widget/WidgetNoahsRow.php @@ -135,7 +135,7 @@ class WidgetNoahsRow extends WidgetBase { 'style_type' => 'style', 'style_selector' => 'widget', 'style_css' => 'min-height', - 'wrapper' => false, + 'wrapper' => FALSE, 'state' => [ 'visible' => [ 'section_height' => ['value' => 'min-height'], @@ -150,7 +150,7 @@ class WidgetNoahsRow extends WidgetBase { 'style_type' => 'style', 'style_selector' => 'widget', 'style_css' => 'max-height', - 'wrapper' => false, + 'wrapper' => FALSE, 'state' => [ 'visible' => [ 'section_height' => ['value' => 'max-height'], @@ -206,7 +206,7 @@ class WidgetNoahsRow extends WidgetBase { 'tab' => 'section_content', 'title' => t('Inverted Columns'), ]; - + $form['columns_inverted'] = [ 'type' => 'checkbox', 'title' => t('Mobile'), @@ -215,7 +215,7 @@ class WidgetNoahsRow extends WidgetBase { 'style_type' => 'class', 'style_selector' => '.widget-wrapper > .noahs_page_builder-row-wrapper > .noahs_page_builder-row-container > .row-elements', 'value' => 'flex-column-reverse flex-sm-row', - 'wrapper' => FALSE + 'wrapper' => FALSE, ]; $form['columns_inverted_tablet'] = [ diff --git a/src/Plugin/Widget/WidgetNoahsSeparator.php b/src/Plugin/Widget/WidgetNoahsSeparator.php index c977adc..4941e82 100644 --- a/src/Plugin/Widget/WidgetNoahsSeparator.php +++ b/src/Plugin/Widget/WidgetNoahsSeparator.php @@ -124,7 +124,7 @@ class WidgetNoahsSeparator extends WidgetBase { 'title' => t('Separator Text'), 'tab' => 'section_content', 'group' => 'group_separator', - 'translate_ai' => true, + 'translate_ai' => TRUE, ]; $form['font'] = [ @@ -195,7 +195,7 @@ class WidgetNoahsSeparator extends WidgetBase { $class = !empty($settings->separator_type) ? $settings->separator_type : 'line'; $style = ''; $icon = !empty($settings->icon->class) ? '<i class="' . $settings->icon->class . '"></i>' : ''; - $title = !empty($settings->separator_text->text) ? $settings->separator_text->text : null; + $title = !empty($settings->separator_text->text) ? $settings->separator_text->text : NULL; $weight = !empty($settings->separator_weight->text) ? $settings->separator_weight->text : '1px'; $class .= !empty($icon) ? ' icon' : ''; diff --git a/src/Plugin/Widget/WidgetNoahsServicesSlide.php b/src/Plugin/Widget/WidgetNoahsServicesSlide.php index 4834b95..fb9447b 100644 --- a/src/Plugin/Widget/WidgetNoahsServicesSlide.php +++ b/src/Plugin/Widget/WidgetNoahsServicesSlide.php @@ -66,7 +66,7 @@ class WidgetNoahsServicesSlide extends WidgetBase { 'tab' => 'slideshow_content', 'default_value' => 'This is a h2', 'update_selector' => '.multipart-item_[index] .noahs_page_builder-slideshow-services--title', - 'translate_ai' => true, + 'translate_ai' => TRUE, ], 'slideshow_url' => [ @@ -550,7 +550,6 @@ class WidgetNoahsServicesSlide extends WidgetBase { foreach ($elements as $element) { - $thumbnails_image_style = !empty($element->single_slideshow_image->image_style) ? $element->single_slideshow_image->image_style : $thumbnails_image_style_general; $thumbnails_image_style = ($thumbnails_image_style === 'original') ? $thumbnails_image_style_general : $thumbnails_image_style; $icon = !empty($element->single_slideshow_icon->class) ? $element->single_slideshow_icon->class : 'fa-solid fa-check'; @@ -561,14 +560,13 @@ class WidgetNoahsServicesSlide extends WidgetBase { $svg_url = $file->getFileUri(); $svg_content = file_get_contents($svg_url); } - $url = !empty($element->slideshow_url->url) ? $element->slideshow_url->url : ''; if (!empty($element->slideshow_url->text) && filter_var($element->slideshow_url->text, FILTER_VALIDATE_URL)) { $url = $element->slideshow_url->text; } if (!empty($element->slideshow_url->node_id)) { - $url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/'.$element->slideshow_url->node_id); + $url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $element->slideshow_url->node_id); } // Single Image. @@ -583,7 +581,8 @@ class WidgetNoahsServicesSlide extends WidgetBase { $file_uri = $file->getFileUri(); if (!empty($settings->element->gallery_image_style) && $settings->element->gallery_image_style != 'original') { $image = ImageStyle::load($settings->element->gallery_image_style)->buildUrl($file_uri); - } else { + } + else { $image = \Drupal::service('file_url_generator')->generateAbsoluteString($file_uri); } } @@ -591,7 +590,6 @@ class WidgetNoahsServicesSlide extends WidgetBase { } } - if (!empty($element->single_slideshow_image->token_media)) { $token_service = \Drupal::token(); $token = $element->single_slideshow_image->token_media; diff --git a/src/Plugin/Widget/WidgetNoahsSettings.php b/src/Plugin/Widget/WidgetNoahsSettings.php index 23bbb06..d5210d6 100644 --- a/src/Plugin/Widget/WidgetNoahsSettings.php +++ b/src/Plugin/Widget/WidgetNoahsSettings.php @@ -2,8 +2,6 @@ namespace Drupal\noahs_page_builder\Plugin\Widget; -use Drupal\Core\Render\Markup; - /** * @WidgetPlugin( * id = "noahs_settings", @@ -39,7 +37,7 @@ class WidgetNoahsSettings extends WidgetBase { $form['trigger_action'] = [ 'type' => 'hidden', 'tab' => 'section_fonts', - 'wrapper' => false, + 'wrapper' => FALSE, 'attributes' => [ 'class' => 'trigger-settings-action', ], @@ -49,7 +47,7 @@ class WidgetNoahsSettings extends WidgetBase { 'type' => 'noahs_font', 'title' => t('Headline H1'), 'tab' => 'section_fonts', - 'open' => true, + 'open' => TRUE, 'style_type' => 'style', 'style_selector' => 'h1', 'responsive' => TRUE, @@ -66,7 +64,7 @@ class WidgetNoahsSettings extends WidgetBase { 'type' => 'noahs_font', 'title' => t('Headline H3'), 'tab' => 'section_fonts', - + 'style_type' => 'style', 'style_selector' => 'h3', 'responsive' => TRUE, @@ -75,7 +73,7 @@ class WidgetNoahsSettings extends WidgetBase { 'type' => 'noahs_font', 'title' => t('Headline H4'), 'tab' => 'section_fonts', - + 'style_type' => 'style', 'style_selector' => 'h4', 'responsive' => TRUE, @@ -84,7 +82,7 @@ class WidgetNoahsSettings extends WidgetBase { 'type' => 'noahs_font', 'title' => t('Headline H5'), 'tab' => 'section_fonts', - + 'style_type' => 'style', 'style_selector' => 'h5', 'responsive' => TRUE, @@ -106,8 +104,8 @@ class WidgetNoahsSettings extends WidgetBase { 'style_selector' => 'body', 'style_css' => 'background-color', ]; - - /** buttons */ + + // Section Buttons. $form['section_buttons'] = [ 'type' => 'tab', 'title' => t('Buttons'), @@ -118,7 +116,7 @@ class WidgetNoahsSettings extends WidgetBase { 'title' => t('Button type style'), 'description' => t('You can add predefined styles to buttons to save time.'), 'tab' => 'section_buttons', - 'wrapper' => false, + 'wrapper' => FALSE, 'options' => [ 'default' => 'Por defecto', 'style_1' => 'Style 1', @@ -134,7 +132,7 @@ class WidgetNoahsSettings extends WidgetBase { $btn_selector_3 = '.btn-style-3'; $btn_selector_4 = '.btn-style-4'; - /** Style Default */ + // Style Default $form['button_background_color'] = [ 'type' => 'noahs_color', @@ -148,7 +146,7 @@ class WidgetNoahsSettings extends WidgetBase { 'visible' => [ 'button_style' => ['value' => 'default'], ], - ] + ], ]; $form['button_font'] = [ @@ -163,7 +161,7 @@ class WidgetNoahsSettings extends WidgetBase { 'visible' => [ 'button_style' => ['value' => 'default'], ], - ] + ], ]; $form['button_border'] = [ @@ -179,7 +177,7 @@ class WidgetNoahsSettings extends WidgetBase { 'visible' => [ 'button_style' => ['value' => 'default'], ], - ] + ], ]; $form['button_padding'] = [ @@ -195,8 +193,8 @@ class WidgetNoahsSettings extends WidgetBase { 'visible' => [ 'button_style' => ['value' => 'default'], ], - ] - + ], + ]; $form['button_shadows'] = [ 'type' => 'noahs_shadows', @@ -210,9 +208,9 @@ class WidgetNoahsSettings extends WidgetBase { 'visible' => [ 'button_style' => ['value' => 'default'], ], - ] + ], ]; - + $form['button_border'] = [ 'type' => 'noahs_border', 'title' => t('Border'), @@ -225,7 +223,7 @@ class WidgetNoahsSettings extends WidgetBase { 'visible' => [ 'button_style' => ['value' => 'default'], ], - ] + ], ]; $form['button_radius'] = [ @@ -240,10 +238,10 @@ class WidgetNoahsSettings extends WidgetBase { 'visible' => [ 'button_style' => ['value' => 'default'], ], - ] + ], ]; - /** Style btn_selector_1 */ + // Style btn_selector_1 $form['button_background_color_1'] = [ 'type' => 'noahs_color', @@ -257,7 +255,7 @@ class WidgetNoahsSettings extends WidgetBase { 'visible' => [ 'button_style' => ['value' => 'style_1'], ], - ] + ], ]; $form['button_font_1'] = [ @@ -272,7 +270,7 @@ class WidgetNoahsSettings extends WidgetBase { 'visible' => [ 'button_style' => ['value' => 'style_1'], ], - ] + ], ]; $form['button_border_1'] = [ @@ -288,7 +286,7 @@ class WidgetNoahsSettings extends WidgetBase { 'visible' => [ 'button_style' => ['value' => 'style_1'], ], - ] + ], ]; $form['button_padding_1'] = [ @@ -304,8 +302,8 @@ class WidgetNoahsSettings extends WidgetBase { 'visible' => [ 'button_style' => ['value' => 'style_1'], ], - ] - + ], + ]; $form['button_shadows_1'] = [ 'type' => 'noahs_shadows', @@ -319,9 +317,9 @@ class WidgetNoahsSettings extends WidgetBase { 'visible' => [ 'button_style' => ['value' => 'style_1'], ], - ] + ], ]; - + $form['button_border_1'] = [ 'type' => 'noahs_border', 'title' => t('Border'), @@ -334,7 +332,7 @@ class WidgetNoahsSettings extends WidgetBase { 'visible' => [ 'button_style' => ['value' => 'style_1'], ], - ] + ], ]; $form['button_radius_1'] = [ @@ -349,10 +347,9 @@ class WidgetNoahsSettings extends WidgetBase { 'visible' => [ 'button_style' => ['value' => 'style_1'], ], - ] + ], ]; - /** Forms */ $form['section_forms'] = [ 'type' => 'tab', @@ -371,7 +368,6 @@ class WidgetNoahsSettings extends WidgetBase { 'style_hover' => TRUE, ]; - $form['forms_input_background_color'] = [ 'type' => 'noahs_color', 'title' => t('Background Color'), @@ -400,7 +396,7 @@ class WidgetNoahsSettings extends WidgetBase { 'style_selector' => $input_selectors, 'style_css' => 'border', 'responsive' => TRUE, - 'style_hover' => TRUE, + 'style_hover' => TRUE, ]; $form['forms_input_padding'] = [ @@ -412,7 +408,7 @@ class WidgetNoahsSettings extends WidgetBase { 'style_css' => 'padding', 'responsive' => TRUE, 'style_hover' => TRUE, - + ]; $form['forms_input_shadows'] = [ 'type' => 'noahs_shadows', @@ -421,7 +417,7 @@ class WidgetNoahsSettings extends WidgetBase { 'style_type' => 'style', 'style_selector' => $input_selectors, 'responsive' => TRUE, - 'style_hover' => TRUE, + 'style_hover' => TRUE, ]; $form['forms_input_radius'] = [ @@ -433,8 +429,7 @@ class WidgetNoahsSettings extends WidgetBase { 'responsive' => TRUE, 'style_hover' => TRUE, ]; - - + return $form; } diff --git a/src/Plugin/Widget/WidgetNoahsSlideshow.php b/src/Plugin/Widget/WidgetNoahsSlideshow.php index 44a178f..30603a9 100644 --- a/src/Plugin/Widget/WidgetNoahsSlideshow.php +++ b/src/Plugin/Widget/WidgetNoahsSlideshow.php @@ -58,8 +58,8 @@ class WidgetNoahsSlideshow extends WidgetBase { 'tab' => 'slideshow_content', 'default_value' => 'This is a h2', 'update_selector' => '.multipart-item_element_[index] .noahs_page_builder-slideshow--title', - 'wrapper' => false, - 'translate_ai' => true, + 'wrapper' => FALSE, + 'translate_ai' => TRUE, ], 'slideshow_text' => [ 'title' => 'Text', @@ -67,8 +67,8 @@ class WidgetNoahsSlideshow extends WidgetBase { 'tab' => 'slideshow_content', 'default_value' => 'In dignissim eget mauris ac consectetur. Fusce at auctor urna. Mauris in ex porta, blandit felis id, blandit diam.', 'update_selector' => '.multipart-item_element_[index] .noahs_page_builder-slideshow--text', - 'wrapper' => false, - 'translate_ai' => true, + 'wrapper' => FALSE, + 'translate_ai' => TRUE, ], 'slideshow_image' => [ 'type' => 'noahs_background_image', @@ -366,7 +366,13 @@ class WidgetNoahsSlideshow extends WidgetBase { } /** + * Template. + * + * @param array $settings + * The settings. * + * @return string + * The output. */ public function template($settings) { $elements = !empty($settings->element->slideshow_items) ? $settings->element->slideshow_items : []; @@ -405,7 +411,7 @@ class WidgetNoahsSlideshow extends WidgetBase { $url = $element->slideshow_url->text; } if (!empty($element->slideshow_url->node_id)) { - $url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/'.$element->slideshow_url->node_id); + $url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $element->slideshow_url->node_id); } // Single Image. @@ -477,7 +483,6 @@ class WidgetNoahsSlideshow extends WidgetBase { $index++; } } - $html .= '</div> <div class="swiper-pagination"></div> diff --git a/src/Plugin/Widget/WidgetNoahsText.php b/src/Plugin/Widget/WidgetNoahsText.php index 1dd66c5..7d0c294 100644 --- a/src/Plugin/Widget/WidgetNoahsText.php +++ b/src/Plugin/Widget/WidgetNoahsText.php @@ -43,7 +43,7 @@ class WidgetNoahsText extends WidgetBase { 'update_selector' => '.widget-content', 'noahs_ai' => TRUE, 'wrapper' => FALSE, - 'translate_ai' => true, + 'translate_ai' => TRUE, // 'translate' => true, ]; diff --git a/src/Service/ControlServices.php b/src/Service/ControlServices.php index 6157c21..f8fe1c4 100644 --- a/src/Service/ControlServices.php +++ b/src/Service/ControlServices.php @@ -7,7 +7,7 @@ use Drupal\Core\Plugin\DefaultPluginManager; use Drupal\Core\Extension\ModuleHandlerInterface; /** - * + * Control services. */ class ControlServices { @@ -39,7 +39,7 @@ class ControlServices { } /** - * + * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( @@ -50,6 +50,12 @@ class ControlServices { /** * Get control by id. + * + * @param string $control_id + * The control id. + * + * @return \Drupal\noahs_page_builder\Plugin\Control\ControlInterface + * The control. */ public function getControlById($control_id) { if ($this->controlManager->hasDefinition($control_id)) { @@ -61,7 +67,23 @@ class ControlServices { } /** + * Generate html. * + * @param array $data + * The data. + * @param array $values + * The values. + * @param string $name + * The name. + * @param string $value + * The value. + * @param string $wrapper + * The wrapper. + * @param string $delta + * The delta. + * + * @return string + * The html. */ public function generateHtml($data, $values, $name, $value, $wrapper, $delta = NULL) { if ($data) { @@ -74,7 +96,9 @@ class ControlServices { if (isset($data['item']['wrapper']) && $data['item']['wrapper'] === FALSE) { $output .= '<div class="noahs_page_builder_field field__' . $data['item']['type'] . ' noahs_page_builder_field__static without-wrapper" data-field-state="' . $state . '" data-field-name="' . $data['item_id'] . '">'; if ($data['item']['type'] != 'checkbox') { - if(!empty($data['item']['title'])){ $output .= '<label>' . $data['item']['title'] . '</label>';} + if (!empty($data['item']['title'])) { + $output .= '<label>' . $data['item']['title'] . '</label>'; + } } $output .= $content; $output .= '</div>'; @@ -102,6 +126,18 @@ class ControlServices { /** * Get html controls. + * + * @param array $data + * The data. + * @param array $values + * The values. + * @param string $wrapper + * The wrapper. + * @param string $delta + * The delta. + * + * @return string + * The html. */ public function extractHtml($data, $values, $wrapper, $delta = NULL) { if ($data) { @@ -158,7 +194,7 @@ class ControlServices { $name = 'element[attribute][' . $data['item_id'] . ']'; $value = $values['attribute'][$data['item_id']] ?? NULL; if (isset($data['parent'])) { - $name = 'element[' . $data['parent'] . '][element_' . $data['delta'] . '][attribute][' . $data['item_id'] .']'; + $name = 'element[' . $data['parent'] . '][element_' . $data['delta'] . '][attribute][' . $data['item_id'] . ']'; $value = !empty($values['attribute'][$data['item_id']]) ? $values['attribute'][$data['item_id']] : NULL; } $html = $this->generateHtml($data, $values, $name, $value, $wrapper, $data['delta']); @@ -182,14 +218,14 @@ class ControlServices { $content = $this->getContent($data, $name, $value, $data['delta']); if (!empty($data['item']['responsive'])) { if (!empty($data['item']['style_hover'])) { - return $this->hoverHTML($data, $content, $values, $wrapper); + return $this->hoverHtml($data, $content, $values, $wrapper); } else { - return $this->responsiveHTML($data, $content, NULL, $values, TRUE, $wrapper); + return $this->responsiveHtml($data, $content, NULL, $values, TRUE, $wrapper); } } elseif (!empty($data['item']['style_hover'])) { - return $this->hoverHTML($data, $content, $values, $wrapper); + return $this->hoverHtml($data, $content, $values, $wrapper); } return $html; @@ -197,9 +233,25 @@ class ControlServices { } /** - * {@inheritdoc} + * Get content. + * + * @param array $data + * The data. + * @param string $name + * The name. + * @param string $value + * The value. + * @param string $delta + * The delta. + * @param string $mediaquery + * The mediaquery. + * @param string $hover + * The hover. + * + * @return string + * The content. */ - private function getContent($data, $name, $value, $delta = NULL, $mediaquery = NULL, $hover = NULL) { + protected function getContent($data, $name, $value, $delta = NULL, $mediaquery = NULL, $hover = NULL) { if ($data) { @@ -244,9 +296,17 @@ class ControlServices { } /** + * Tabs hover html. * + * @param array $data + * The data. + * @param array $hover_status + * The hover status. + * + * @return string + * The html. */ - public function tabsHoverHtml($data, $hover_status){ + public function tabsHoverHtml($data, $hover_status): string { $html_hover = '<div class="hover_tabs btn-group d-flex mb-2">'; @@ -255,16 +315,29 @@ class ControlServices { if ($key_status === 'hover') { $icon = '<i class="las la-hand-pointer"></i>'; } - $html_hover .= '<a href="#hover_tab_' . $data['item_id'] . $key_status . '" class="hover_tabs-tab btn" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="'. $status . '">' . $icon . $status . '</a>'; + $html_hover .= '<a href="#hover_tab_' . $data['item_id'] . $key_status . '" class="hover_tabs-tab btn" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="' . $status . '">' . $icon . $status . '</a>'; } $html_hover .= '</div>'; return $html_hover; } + /** + * Hover html. + * + * @param array $data + * The data. + * @param string $content + * The content. + * @param array $values + * The values. + * @param string $wrapper + * The wrapper. * + * @return string + * The html. */ - public function hoverHTML(array $data, $content, $values, $wrapper) { + public function hoverHtml(array $data, $content, $values, $wrapper): ?string { if ($data) { $control_id = $data['item']['type']; $control = $this->getControlById($control_id); @@ -281,7 +354,7 @@ class ControlServices { $responsive_class = 'contain-responsive-tabs'; } $html_hover = ''; - $html_hover .= '<div class="field__hover noahs_page_builder_field '.$responsive_class.'" + $html_hover .= '<div class="field__hover noahs_page_builder_field ' . $responsive_class . '" data-field-state="' . $state . '" data-field-name="' . $data['item_id'] . '">'; $html_hover .= '<h5 class="d-flex justify-content-between expand-field" data-bs-toggle="collapse" href="#' . $data['item_id'] . '" role="button" aria-expanded="false" aria-controls="' . $data['item_id'] . '">' . $data['item']['title'] . '<i class="fa-solid fa-caret-down"></i></h5>'; @@ -296,7 +369,7 @@ class ControlServices { $name = 'element[css][desktop][' . $key_status . '][' . $data['item_id'] . ']'; $value = $values['css']['desktop'][$key_status][$data['item_id']] ?? ''; $content = $this->getContent($data, $name, $value, '', 'desktop', $key_status); - $html_hover .= $this->responsiveHTML($data, $content, $key_status, $values, FALSE, $wrapper); + $html_hover .= $this->responsiveHtml($data, $content, $key_status, $values, FALSE, $wrapper); } else { $name = 'element[css][desktop][' . $key_status . '][' . $data['item_id'] . ']'; @@ -315,9 +388,16 @@ class ControlServices { $html_hover .= '</div>'; return $html_hover; } + return NULL; } - public function tabsResponsiveHtml(){ + /** + * Tabs responsive html. + * + * @return string + * The html. + */ + public function tabsresponsiveHtml(): string { $responsive = '<div class="responsive__tabs">'; $responsive .= '<div class="responsive__tabs__wrapper">'; @@ -337,10 +417,27 @@ class ControlServices { $responsive .= '</div>'; return $responsive; } + /** + * Responsive html. * + * @param array $data + * The data. + * @param string $content + * The content. + * @param string $hover_status + * The hover status. + * @param array $values + * The values. + * @param bool $hover + * The hover. + * @param string $wrapper + * The wrapper. + * + * @return string + * The html. */ - public function responsiveHTML(array $data, $content, $hover_status, $values, $hover, $wrapper) { + public function responsiveHtml(array $data, $content, $hover_status, $values, $hover, $wrapper): ?string { if ($data) { $open = !empty($data['item']['open']) ? 'show' : ''; $active_class = !empty($data['item']['open']) ? 'active' : ''; @@ -348,15 +445,16 @@ class ControlServices { $control = $this->getControlById($control_id); $state = !empty($data['item']['state']) ? htmlspecialchars(json_encode($data['item']['state']), ENT_QUOTES, 'UTF-8') : NULL; $responsive = ''; - $hover_class = ($hover) ? 'hover' : null; - $responsive .= '<div class="noahs_page_builder_field noahs_page_builder_field__responsive '.$hover_class.' '.$active_class.' field__group field__' . $data['item']['type'] . '" + $hover_class = ($hover) ? 'hover' : NULL; + $responsive .= '<div class="noahs_page_builder_field noahs_page_builder_field__responsive ' . $hover_class . ' ' . $active_class . ' field__group field__' . $data['item']['type'] . '" data-field-state="' . $state . '" data-field-name="' . $data['item_id'] . '">'; if ($hover) { - $responsive .= '<h5 class="d-flex justify-content-between expand-field" data-bs-toggle="collapse" href="#' . $data['item_id'] . '" role="button" aria-expanded="true" aria-controls="' . $data['item_id'] . '">' . $data['item']['title'] . $this->tabsResponsiveHtml() . '<i class="fa-solid fa-caret-down"></i></h5>'; - }else{ - $responsive .= $this->tabsResponsiveHtml(); + $responsive .= '<h5 class="d-flex justify-content-between expand-field" data-bs-toggle="collapse" href="#' . $data['item_id'] . '" role="button" aria-expanded="true" aria-controls="' . $data['item_id'] . '">' . $data['item']['title'] . $this->tabsresponsiveHtml() . '<i class="fa-solid fa-caret-down"></i></h5>'; + } + else { + $responsive .= $this->tabsresponsiveHtml(); } if ($hover) { @@ -364,7 +462,6 @@ class ControlServices { $responsive .= '<div class="responsive-field-wrapper">'; } - foreach (self::getMediaQuery() as $k => $query) { $name = 'element[css][' . $k . '][default][' . $data['item_id'] . ']'; @@ -384,13 +481,12 @@ class ControlServices { } } - // If desktop version - + // If desktop version. if ($k === 'desktop' && !empty($value)) { $data['item']['placeholder'] = $value; } - // If tablet version + // If tablet version. if ($k === 'tablet' && !empty($value)) { $data['item']['placeholder'] = $value; @@ -399,12 +495,13 @@ class ControlServices { case 'desktop': $icon = '<i class="las la-desktop"></i>'; break; + case 'tablet': $icon = '<i class="las la-tablet-alt"></i>'; break; default: - $icon = '<i class="las la-mobile-alt"></i>'; + $icon = '<i class="las la-mobile-alt"></i>'; break; } $content = $this->getContent($data, $name, $value, $data['delta'], $k, $hover_status); @@ -425,12 +522,16 @@ class ControlServices { return $responsive; } + return NULL; } /** * Get default fields . + * + * @return array + * The form. */ - public function defaultFields() { + public function defaultFields(): array { $form = []; // Section Styles. $form['section_extras'] = [ @@ -477,7 +578,7 @@ class ControlServices { 'tab' => 'section_extras', 'placeholder' => 'Multiple classes should be separated with SPACE.', 'group' => 'group_extra', - 'wrapper' => false + 'wrapper' => FALSE, ]; $form['element_inner_class'] = [ @@ -669,9 +770,15 @@ class ControlServices { } /** + * Group fields. + * + * @param array $fields + * The fields. * + * @return array + * The fields. */ - public function groupFields($fields) { + public function groupFields($fields): array { // Iterar sobre el array original y agrupar por pestañas // group by tabs. @@ -712,9 +819,12 @@ class ControlServices { } /** + * Get media query. * + * @return array + * The media query. */ - public static function getMediaQuery() { + public static function getMediaQuery(): array { $media_query = [ "desktop" => "1600px", "tablet" => "920px", diff --git a/src/Service/WidgetServices.php b/src/Service/WidgetServices.php index 6db556c..fadde42 100644 --- a/src/Service/WidgetServices.php +++ b/src/Service/WidgetServices.php @@ -80,10 +80,14 @@ class WidgetServices { return $data; } + /** * Get widget list. + * + * @return array + * The widgets list. */ - public function getWidgetsList() { + public function getWidgetsList(): array { $data = []; $widgets = []; @@ -115,8 +119,14 @@ class WidgetServices { /** * Get widget. + * + * @param string $widget_id + * The widget id. + * + * @return \Drupal\Core\Plugin\DefaultPluginManager + * The widget. */ - public function loadWidgetById($widget_id) { + public function loadWidgetById($widget_id): ?object { if ($this->widgetManager->hasDefinition($widget_id)) { $widget = $this->widgetManager->createInstance($widget_id); return $widget; @@ -127,8 +137,14 @@ class WidgetServices { /** * Get widgets fields. + * + * @param string $widgetId + * The widget id. + * + * @return array + * The fields. */ - public function getWidgetFields($widgetId) { + public function getWidgetFields(string $widgetId): array { $el_fields = []; $default_fields = $this->controlManager->defaultFields(); @@ -140,22 +156,33 @@ class WidgetServices { return $el_fields; } + return $el_fields; } /** * Get widgets data. + * + * @param string $widgetId + * The widget id. + * + * @return array + * The data. */ - public function getWidgetData($widgetId) { + public function getWidgetData(string $widgetId): array { if ($this->widgetManager->hasDefinition($widgetId)) { $widget = $this->widgetManager->createInstance($widgetId); return $widget->data(); } + return []; } /** * Custom Image Style. + * + * @return array + * The image styles. */ - public function getImageStyle() { + public function getImageStyle(): array { $miObjeto = ['original' => 'Original']; $image_styles = $this->entityTypeManager->getStorage('image_style')->loadMultiple(); $array_image_styles = []; -- GitLab From bef7c17cdf76a05cb8d71911dc5d5145ae962c02 Mon Sep 17 00:00:00 2001 From: asghar <mr.asghar.khan@gmail.com> Date: Sun, 29 Jun 2025 13:48:36 +0500 Subject: [PATCH 6/7] WEBZONE-05: Fix the method rename issue. --- src/Controller/NoahsCloneWidgetController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/NoahsCloneWidgetController.php b/src/Controller/NoahsCloneWidgetController.php index 01246ce..87db1e9 100644 --- a/src/Controller/NoahsCloneWidgetController.php +++ b/src/Controller/NoahsCloneWidgetController.php @@ -22,7 +22,7 @@ class NoahsCloneWidgetController extends ControllerBase { * @return \Symfony\Component\HttpFoundation\JsonResponse * The json response. */ - public function cloneWidget($old_id, $new_id): JsonResponse { + public function clone(string $old_id, string $new_id): JsonResponse { $widgetService = \Drupal::service('noahs_page_builder.widget_service'); $settings = []; -- GitLab From 2d9ad176f623561a3d18842d2995b16e8665760b Mon Sep 17 00:00:00 2001 From: Shahzaib <shahzaib15@gmail.com> Date: Tue, 1 Jul 2025 17:31:29 +0000 Subject: [PATCH 7/7] WEBZONE-05:Latest changes to refine the noahs module code. --- noahs_page_builder.services.yml | 7 ++ src/Controller/NoahsController.php | 33 ++++++-- src/Controller/NoahsModalController.php | 19 ++++- src/ControlsManager.php | 24 +++++- src/ModalForm.php | 43 ++++++++-- src/Plugin/Control/ControlBase.php | 61 +++++++++++++- src/Plugin/Control/ControlNoahsDivider.php | 41 ---------- .../Control/ControlNoahsMultipleElements.php | 6 +- src/Plugin/Control/ControlNoahsUrl.php | 42 ---------- .../Control/ControlNoahsVideoUpload.php | 28 ------- src/Plugin/Widget/WidgetBase.php | 82 ++++++++++++++++++- src/Plugin/Widget/WidgetNoahsBars.php | 4 +- src/Plugin/Widget/WidgetNoahsButton.php | 2 +- src/Plugin/Widget/WidgetNoahsCard.php | 6 +- src/Plugin/Widget/WidgetNoahsCardGrid.php | 13 ++- src/Plugin/Widget/WidgetNoahsCarousel.php | 12 ++- src/Plugin/Widget/WidgetNoahsColumn.php | 2 +- src/Plugin/Widget/WidgetNoahsDrupalBlock.php | 6 +- .../Widget/WidgetNoahsDrupalNodeTitle.php | 7 +- .../Widget/WidgetNoahsDrupalSiteLogo.php | 2 +- .../Widget/WidgetNoahsDrupalSiteTitle.php | 3 +- src/Plugin/Widget/WidgetNoahsDrupalToken.php | 4 +- src/Plugin/Widget/WidgetNoahsDrupalViews.php | 4 +- src/Plugin/Widget/WidgetNoahsGallery.php | 4 +- src/Plugin/Widget/WidgetNoahsHeading.php | 6 +- src/Plugin/Widget/WidgetNoahsImage.php | 4 +- src/Plugin/Widget/WidgetNoahsRow.php | 2 +- .../Widget/WidgetNoahsServicesSlide.php | 10 +-- src/Plugin/Widget/WidgetNoahsSettings.php | 4 +- src/Plugin/Widget/WidgetNoahsSlideshow.php | 10 +-- src/Plugin/Widget/WidgetNoahsVideo.php | 6 +- src/Service/WidgetServices.php | 18 +--- 32 files changed, 304 insertions(+), 211 deletions(-) diff --git a/noahs_page_builder.services.yml b/noahs_page_builder.services.yml index 1858174..2f77ad0 100644 --- a/noahs_page_builder.services.yml +++ b/noahs_page_builder.services.yml @@ -11,6 +11,13 @@ services: noahs_page_builder.control_service: class: Drupal\noahs_page_builder\Service\ControlServices arguments: ['@plugin.manager.control', '@module_handler'] + noahs_page_builder.modal_form: + class: Drupal\noahs_page_builder\ModalForm + arguments: ['@noahs_page_builder.control_service', '@noahs_page_builder.controls_manager'] controller.noahs_save_styles: class: Drupal\noahs_page_builder\Controller\NoahsSaveStylesController arguments: ['@noahs_page_builder.control_service'] + noahs_page_builder.controls_manager: + class: Drupal\noahs_page_builder\ControlsManager + arguments: ['@noahs_page_builder.control_service'] + diff --git a/src/Controller/NoahsController.php b/src/Controller/NoahsController.php index 6ef9c1f..fd2c12d 100644 --- a/src/Controller/NoahsController.php +++ b/src/Controller/NoahsController.php @@ -134,6 +134,20 @@ class NoahsController extends ControllerBase { */ protected $messenger; + /** + * The controls manager service. + * + * @var \Drupal\noahs_page_builder\ControlsManager + */ + protected $controlsManager; + + /** + * The controls model form service. + * + * @var \Drupal\noahs_page_builder\ModalForm + */ + protected $modalForm; + /** * NoahsController constructor. * @@ -163,6 +177,10 @@ class NoahsController extends ControllerBase { * The messenger service. * @param \Drupal\Core\DependencyInjection\ClassResolverInterface $class_resolver * The class resolver service. + * @param \Drupal\noahs_page_builder\ControlsManager $controls_manager + * The control manager service. + * @param \Drupal\noahs_page_builder\ModalForm $modal_form + * The control manager service. */ public function __construct( WidgetServices $widget_service, @@ -178,6 +196,8 @@ class NoahsController extends ControllerBase { FileSystemInterface $file_system, MessengerInterface $messenger, ClassResolverInterface $class_resolver, + ControlsManager $controls_manager, + ModalForm $modal_form, ) { $this->widgetService = $widget_service; $this->languageManager = $language_manager; @@ -193,6 +213,8 @@ class NoahsController extends ControllerBase { $this->fileSystem = $file_system; $this->messenger = $messenger; $this->classResolver = $class_resolver; + $this->controlsManager = $controls_manager; + $this->modalForm = $modal_form; } /** @@ -218,6 +240,8 @@ class NoahsController extends ControllerBase { $container->get('file_system'), $container->get('messenger'), $container->get('class_resolver'), + $container->get('noahs_page_builder.controls_manager'), + $container->get('noahs_page_builder.modal_form'), ); } @@ -629,7 +653,7 @@ class NoahsController extends ControllerBase { $data = json_decode($request->getContent(), TRUE); $fields = $this->widgetService->getWidgetFields($data['widget_id']); - $form = ModalForm::renderForm($fields, $data); + $form = $this->modalForm->renderForm($fields, $data); return new JsonResponse(['html' => '<form>' . $form[0] . '</form>']); } @@ -816,7 +840,7 @@ class NoahsController extends ControllerBase { */ public function getPageClasses($data, $type): ?string { $classes = NULL; - $obj_class = new ControlsManager(); + $obj_class = $this->controlsManager; $page_settings = $data['page_settings']; $page_fields = $data['page_fields']; @@ -840,7 +864,7 @@ class NoahsController extends ControllerBase { */ public function getPageAttributes($data, $type): ?string { $classes = NULL; - $obj_class = new ControlsManager(); + $obj_class = $this->controlsManager; $page_settings = $data['page_settings']; $page_fields = $data['page_fields']; @@ -863,8 +887,7 @@ class NoahsController extends ControllerBase { */ private function extractClasses($item, $type): array { $classes = []; - $obj_class = new ControlsManager(); - + $obj_class = $this->controlsManager; if (!empty($item['settings'])) { $widget_settings = $item['settings']; $fields = $this->widgetService->getWidgetFields($item['type']); diff --git a/src/Controller/NoahsModalController.php b/src/Controller/NoahsModalController.php index ae9d522..23f4ab2 100644 --- a/src/Controller/NoahsModalController.php +++ b/src/Controller/NoahsModalController.php @@ -22,16 +22,28 @@ class NoahsModalController extends ControllerBase { protected $widgetService; + /** + * The widget services. + * + * @var \Drupal\noahs_page_builder\ModalForm + */ + + protected $modalForm; + /** * ModalController constructor. * * @param \Drupal\noahs_page_builder\Service\WidgetServices $widget_service * The widget services. + * @param \Drupal\noahs_page_builder\ModalForm $modal_form + * The model form services. */ public function __construct( - WidgetServices $widget_service + WidgetServices $widget_service, + ModalForm $modal_form, ) { $this->widgetService = $widget_service; + $this->modalForm = $modal_form; } /** @@ -44,7 +56,8 @@ class NoahsModalController extends ControllerBase { */ public static function create(ContainerInterface $container) { return new static( - $container->get('noahs_page_builder.widget_service') + $container->get('noahs_page_builder.widget_service'), + $container->get('noahs_page_builder.modal_form') ); } @@ -71,7 +84,7 @@ class NoahsModalController extends ControllerBase { $fields = $this->widgetService->getWidgetFields($widget); - $form = ModalForm::renderForm($fields, $settings); + $form = $this->modalForm->renderForm($fields, $settings); $output = '<div class="noahs_page_builder-modal ' . $global_class . '">'; $output .= '<div class="noahs_page_builder-modal_container">'; diff --git a/src/ControlsManager.php b/src/ControlsManager.php index 2b6c068..c650a71 100644 --- a/src/ControlsManager.php +++ b/src/ControlsManager.php @@ -2,11 +2,30 @@ namespace Drupal\noahs_page_builder; +use Drupal\noahs_page_builder\Service\ControlServices; + /** * Controls manager. */ class ControlsManager { + /** + * The control service. + * + * @var \Drupal\noahs_page_builder\Service\ControlServices + */ + protected $controlService; + + /** + * Constructs a new ControlsManager object. + * + * @param \Drupal\noahs_page_builder\Service\ControlServices $controlService + * The control service. + */ + public function __construct(ControlServices $controlService) { + $this->controlService = $controlService; + } + /** * Render tabs with inputs inside. * @@ -26,7 +45,7 @@ class ControlsManager { */ public function renderTabs($tabs, $values, $multiple = NULL, $delta = NULL, $parent = NULL) { - $controlService = \Drupal::service('noahs_page_builder.control_service'); + $controlService = $this->controlService; $html_tabs = ''; $tab_titles = []; @@ -149,8 +168,7 @@ class ControlsManager { * The html. */ public function renderControls($data, $values, $wrapper = NULL, $delta = NULL): string { - $controlService = \Drupal::service('noahs_page_builder.control_service'); - return $controlService->extractHtml($data, $values, $wrapper, $delta); + return $this->controlService->extractHtml($data, $values, $wrapper, $delta); } /** diff --git a/src/ModalForm.php b/src/ModalForm.php index 84d6967..302273d 100644 --- a/src/ModalForm.php +++ b/src/ModalForm.php @@ -2,11 +2,40 @@ namespace Drupal\noahs_page_builder; +use Drupal\noahs_page_builder\Service\ControlServices; +use Drupal\noahs_page_builder\ControlsManager; + /** * Modal form. */ class ModalForm { + /** + * The control service. + * + * @var \Drupal\noahs_page_builder\Service\ControlServices + */ + protected $controlService; + /** + * The control service. + * + * @var Drupal\noahs_page_builder\ControlsManager + */ + protected $controlsManager; + + /** + * Constructs a new ModalForm object. + * + * @param \Drupal\noahs_page_builder\Service\ControlServices $controlService + * The control service. + * @param \Drupal\noahs_page_builder\ControlsManager $controlsManager + * The control service. + */ + public function __construct(ControlServices $controlService, ControlsManager $controlsManager) { + $this->controlService = $controlService; + $this->controlsManager = $controlsManager; + } + /** * Render form. * @@ -22,13 +51,11 @@ class ModalForm { * @return array * The form. */ - public static function renderForm(array $fields, array $values, int $delta = NULL, string $parent = NULL): array { - - $groupFields = $controlService->groupFields($fields); + public function renderForm($fields, $values, $delta = NULL, string $parent = NULL): array { - $tabs_class = new ControlsManager(); + $groupFields = $this->controlService->groupFields($fields); - $data_controls = $tabs_class->renderTabs($groupFields, $values); + $data_controls = $this->controlsManager->renderTabs($groupFields, $values); $form[] = $data_controls['form']; @@ -50,7 +77,7 @@ class ModalForm { * @return array * The form. */ - public static function renderSubFields(array $fields, array $values = NULL, int $delta = NULL, string $parent = NULL): array { + public function renderSubFields(array $fields, array $values = NULL, int $delta = NULL, string $parent = NULL): string { $tabs = []; @@ -81,9 +108,7 @@ class ModalForm { } } - $tabs_class = new ControlsManager(); - - $data_controls = $tabs_class->renderTabs($tabs, $values, 'multiple', $delta, $parent); + $data_controls = $this->controlsManager->renderTabs($tabs, $values, 'multiple', $delta, $parent); return $data_controls['form']; } diff --git a/src/Plugin/Control/ControlBase.php b/src/Plugin/Control/ControlBase.php index 43f8553..9ca261d 100644 --- a/src/Plugin/Control/ControlBase.php +++ b/src/Plugin/Control/ControlBase.php @@ -6,6 +6,10 @@ use Drupal\Component\Plugin\PluginBase; use Drupal\noahs_page_builder\Service\WidgetServices; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\noahs_page_builder\ModalForm; +use Drupal\path_alias\AliasManagerInterface; +use Drupal\Core\File\FileSystemInterface; +use Drupal\Core\File\FileUrlGeneratorInterface; /** * Control base. @@ -19,6 +23,34 @@ abstract class ControlBase extends PluginBase implements ControlInterface, Conta */ protected $widgetServices; + /** + * The modal form service. + * + * @var \Drupal\noahs_page_builder\ModalForm + */ + protected $modalForm; + + /** + * The path alias manager service. + * + * @var \Drupal\path_alias\AliasManagerInterface + */ + protected $pathAliasManager; + + /** + * The file system service. + * + * @var \Drupal\Core\File\FileSystemInterface + */ + protected $fileSystem; + + /** + * The file URL generator service. + * + * @var \Drupal\Core\File\FileUrlGeneratorInterface + */ + protected $fileUrlGenerator; + /** * Constructs the control plugin. * @@ -30,10 +62,31 @@ abstract class ControlBase extends PluginBase implements ControlInterface, Conta * Plugin definition. * @param \Drupal\noahs_page_builder\Service\WidgetServices $widget_services * The widget service. + * @param \Drupal\noahs_page_builder\ModalForm $modal_form + * The widget service. + * @param \Drupal\path_alias\AliasManagerInterface $path_alias_manager + * The widget service. + * @param \Drupal\Core\File\FileSystemInterface $file_system + * The file system service. + * @param \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator + * The file URL generator service. */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, WidgetServices $widget_services) { + public function __construct( + array $configuration, + $plugin_id, + $plugin_definition, + WidgetServices $widget_services, + ModalForm $modal_form, + AliasManagerInterface $path_alias_manager, + FileSystemInterface $file_system, + FileUrlGeneratorInterface $file_url_generator, + ) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->widgetServices = $widget_services; + $this->modalForm = $modal_form; + $this->pathAliasManager = $path_alias_manager; + $this->fileSystem = $file_system; + $this->fileUrlGenerator = $file_url_generator; } /** @@ -44,7 +97,11 @@ abstract class ControlBase extends PluginBase implements ControlInterface, Conta $configuration, $plugin_id, $plugin_definition, - $container->get('noahs_page_builder.widget_service') + $container->get('noahs_page_builder.widget_service'), + $container->get('noahs_page_builder.modal_form'), + $container->get('path_alias.manager'), + $container->get('file_system'), + $container->get('file_url_generator') ); } diff --git a/src/Plugin/Control/ControlNoahsDivider.php b/src/Plugin/Control/ControlNoahsDivider.php index 2e02cc5..f51ab8d 100644 --- a/src/Plugin/Control/ControlNoahsDivider.php +++ b/src/Plugin/Control/ControlNoahsDivider.php @@ -3,10 +3,7 @@ namespace Drupal\noahs_page_builder\Plugin\Control; use Drupal\Core\StringTranslation\StringTranslationTrait; -use Drupal\Core\File\FileSystemInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\noahs_page_builder\Service\WidgetServices; /** * @ControlPlugin( @@ -17,44 +14,6 @@ use Drupal\noahs_page_builder\Service\WidgetServices; class ControlNoahsDivider extends ControlBase implements ContainerFactoryPluginInterface { use StringTranslationTrait; - /** - * The file system service. - * - * @var \Drupal\Core\File\FileSystemInterface - */ - protected $fileSystem; - - /** - * Constructs a new ControlNoahsDivider object. - * - * @param array $configuration - * The configuration. - * @param string $plugin_id - * The plugin id. - * @param mixed $plugin_definition - * The plugin definition. - * @param \Drupal\noahs_page_builder\Service\WidgetServices $widget_services - * The widget services. - * @param \Drupal\Core\File\FileSystemInterface $file_system - * The file system service. - */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, WidgetServices $widget_services, FileSystemInterface $file_system) { - parent::__construct($configuration, $plugin_id, $plugin_definition, $widget_services); - $this->fileSystem = $file_system; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('noahs_page_builder.widget_service'), - $container->get('file_system') - ); - } /** * {@inheritdoc} diff --git a/src/Plugin/Control/ControlNoahsMultipleElements.php b/src/Plugin/Control/ControlNoahsMultipleElements.php index 5490e38..502e6e8 100644 --- a/src/Plugin/Control/ControlNoahsMultipleElements.php +++ b/src/Plugin/Control/ControlNoahsMultipleElements.php @@ -35,7 +35,7 @@ class ControlNoahsMultipleElements extends ControlBase { $default_items_array = []; $default_items_array['sub_elements'] = array_fill(0, $default_items, NULL); - $fields = $data['item']['fields']; + $fields = !empty($data['item']['fields']) && is_array($data['item']['fields']) ? $data['item']['fields'] : []; $values = !empty($values['sub_elements']) ? $values : $default_items_array; $parent = $data['item_id']; @@ -55,7 +55,7 @@ class ControlNoahsMultipleElements extends ControlBase { <div id="colapse_replace" class="accordion-collapse collapse" aria-labelledby="header_replace" data-bs-parent="#' . $data['item_id'] . '"> <div class="accordion-body">'; $newvalue['wid'] = $data['wid']; - $default_form = ModalForm::renderSubFields($fields, $newvalue, 'replace_it', $parent); + $default_form = $this->modalForm->renderSubFields($fields, $newvalue, '0', $parent); $html .= $default_form; $html .= ' </div> @@ -83,7 +83,7 @@ class ControlNoahsMultipleElements extends ControlBase { $newvalue['wid'] = $data['wid']; $i = str_replace('element_', '', $i); - $form = ModalForm::renderSubFields($fields, $newvalue, $i, $parent); + $form = $this->modalForm->renderSubFields($fields, $newvalue, $i, $parent); $output .= '<div class="accordion-item" data-delta="' . htmlspecialchars($i, ENT_QUOTES, 'UTF-8') . '">'; $output .= '<h2 class="accordion-header" id="header_' . htmlspecialchars($i, ENT_QUOTES, 'UTF-8') . '">'; diff --git a/src/Plugin/Control/ControlNoahsUrl.php b/src/Plugin/Control/ControlNoahsUrl.php index 6cfb70e..a58bf08 100644 --- a/src/Plugin/Control/ControlNoahsUrl.php +++ b/src/Plugin/Control/ControlNoahsUrl.php @@ -2,9 +2,6 @@ namespace Drupal\noahs_page_builder\Plugin\Control; -use Drupal\path_alias\AliasManagerInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\noahs_page_builder\Service\WidgetServices; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; /** @@ -17,45 +14,6 @@ use Drupal\Core\Plugin\ContainerFactoryPluginInterface; */ class ControlNoahsUrl extends ControlBase implements ContainerFactoryPluginInterface { - /** - * The path alias manager service. - * - * @var \Drupal\path_alias\AliasManagerInterface - */ - protected $pathAliasManager; - - /** - * Constructs a new ControlNoahsUrl object. - */ - public function __construct( - array $configuration, - $plugin_id, - $plugin_definition, - WidgetServices $widget_services, - AliasManagerInterface $path_alias_manager, - ) { - parent::__construct($configuration, $plugin_id, $plugin_definition, $widget_services); - $this->pathAliasManager = $path_alias_manager; - } - - /** - * {@inheritdoc} - */ - public static function create( - ContainerInterface $container, - array $configuration, - $plugin_id, - $plugin_definition, - ) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('noahs_page_builder.widget_service'), - $container->get('path_alias.manager') - ); - } - /** * {@inheritdoc} */ diff --git a/src/Plugin/Control/ControlNoahsVideoUpload.php b/src/Plugin/Control/ControlNoahsVideoUpload.php index 810de74..2237663 100644 --- a/src/Plugin/Control/ControlNoahsVideoUpload.php +++ b/src/Plugin/Control/ControlNoahsVideoUpload.php @@ -4,8 +4,6 @@ namespace Drupal\noahs_page_builder\Plugin\Control; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\file\Entity\File; -use Drupal\Core\File\FileUrlGeneratorInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; /** * @ControlPlugin( @@ -17,32 +15,6 @@ class ControlNoahsVideoUpload extends ControlBase { use StringTranslationTrait; - /** - * The file URL generator service. - * - * @var \Drupal\Core\File\FileUrlGeneratorInterface - */ - protected $fileUrlGenerator; - - /** - * Constructs a new ControlNoahsVideoUpload object. - * - * @param \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator - * The file URL generator service. - */ - public function __construct(FileUrlGeneratorInterface $file_url_generator) { - $this->fileUrlGenerator = $file_url_generator; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $container->get('file_url_generator') - ); - } - /** * {@inheritdoc} */ diff --git a/src/Plugin/Widget/WidgetBase.php b/src/Plugin/Widget/WidgetBase.php index c183fe4..6bdba3a 100644 --- a/src/Plugin/Widget/WidgetBase.php +++ b/src/Plugin/Widget/WidgetBase.php @@ -15,6 +15,10 @@ use Drupal\noahs_page_builder\Service\WidgetServices; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\path_alias\AliasManagerInterface; +use Drupal\Core\Utility\Token; +use Drupal\Core\Block\BlockManagerInterface; +use Drupal\Core\Controller\TitleResolverInterface; /** * Base class for Widget plugins. @@ -83,12 +87,53 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface, Contain */ protected $requestStack; + /** + * The path alias manager service. + * + * @var \Drupal\path_alias\AliasManagerInterface + */ + protected AliasManagerInterface $aliasManager; + + /** + * Constructs a WidgetNoahsButton object. + * + * @param array $configuration + * A configuration array containing information about the plugin instance. + * @param string $plugin_id + * The plugin ID for the plugin instance. + * @param mixed $plugin_definition + * The plugin implementation definition. + * @param \Drupal\path_alias\AliasManagerInterface $alias_manager + * The path alias manager service. + */ + /** + * The token service. + * + * @var \Drupal\Core\Utility\Token + */ + protected Token $token; + + /** + * The block plugin manager. + * + * @var \Drupal\Core\Block\BlockManagerInterface + */ + protected BlockManagerInterface $blockManager; + + /** + * The title resolver service. + * + * @var Drupal\Core\Controller\TitleResolverInterface + */ + protected TitleResolverInterface $titleResolver; + /** * Constructs a new WidgetBase object. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id + * Plugin configuration. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Twig\Environment $twig @@ -109,8 +154,33 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface, Contain * The route match service. * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack * The request stack service. + * @param \Drupal\path_alias\AliasManagerInterface $alias_manager + * The route match service. + * @param \Drupal\Core\Utility\Token $token + * The request stack service. + * @param \Drupal\Core\Block\BlockManagerInterface $block_manager + * The request stack service. + * @param \Drupal\Core\Controller\TitleResolverInterface $title_resolver + * The request stack service. */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, Environment $twig, WidgetServices $widget_service, RendererInterface $renderer, AccountProxyInterface $current_user, ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, FileUrlGeneratorInterface $file_url_generator, RouteMatchInterface $route_match, RequestStack $request_stack) { + public function __construct( + array $configuration, + $plugin_id, + $plugin_definition, + Environment $twig, + WidgetServices $widget_service, + RendererInterface $renderer, + AccountProxyInterface $current_user, + ConfigFactoryInterface $config_factory, + EntityTypeManagerInterface $entity_type_manager, + FileUrlGeneratorInterface $file_url_generator, + RouteMatchInterface $route_match, + RequestStack $request_stack, + AliasManagerInterface $alias_manager, + Token $token, + BlockManagerInterface $block_manager, + TitleResolverInterface $title_resolver, + ) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->twig = $twig; $this->widgetService = $widget_service; @@ -121,6 +191,10 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface, Contain $this->fileUrlGenerator = $file_url_generator; $this->routeMatch = $route_match; $this->requestStack = $request_stack; + $this->aliasManager = $alias_manager; + $this->token = $token; + $this->blockManager = $block_manager; + $this->titleResolver = $title_resolver; } /** @@ -139,7 +213,11 @@ abstract class WidgetBase extends PluginBase implements WidgetInterface, Contain $container->get('entity_type.manager'), $container->get('file_url_generator'), $container->get('current_route_match'), - $container->get('request_stack') + $container->get('request_stack'), + $container->get('path_alias.manager'), + $container->get('token'), + $container->get('plugin.manager.block'), + $container->get('title_resolver') ); } diff --git a/src/Plugin/Widget/WidgetNoahsBars.php b/src/Plugin/Widget/WidgetNoahsBars.php index 2e1144d..a0f5733 100644 --- a/src/Plugin/Widget/WidgetNoahsBars.php +++ b/src/Plugin/Widget/WidgetNoahsBars.php @@ -2,6 +2,8 @@ namespace Drupal\noahs_page_builder\Plugin\Widget; +use Drupal\noahs_page_builder\Plugin\Widget\WidgetBase; + /** * @WidgetPlugin( * id = "noahs_bars", @@ -99,7 +101,7 @@ class WidgetNoahsBars extends WidgetBase { $settings = $settings->element; $items = !empty($settings->skill_list) ? $settings->skill_list : []; - $twig = \Drupal::service('twig'); + $twig = $this->twig; $element_content = $twig->render(NOAHS_PAGE_BUILDER_PATH . '/templates/widgets/noahs_skill_bars.twig', [ 'settings' => $settings, diff --git a/src/Plugin/Widget/WidgetNoahsButton.php b/src/Plugin/Widget/WidgetNoahsButton.php index 25a4afd..9d4a4b7 100644 --- a/src/Plugin/Widget/WidgetNoahsButton.php +++ b/src/Plugin/Widget/WidgetNoahsButton.php @@ -351,7 +351,7 @@ class WidgetNoahsButton extends WidgetBase { $icon = '<i class="' . $settings->button_icon->class . '"></i>'; } if (!empty($settings->button_url->node_id)) { - $url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $settings->button_url->node_id); + $url = $this->aliasManager->getAliasByPath('/node/' . $settings->button_url->node_id); } elseif (!empty($settings->button_url->text)) { $url = $settings->button_url->text; diff --git a/src/Plugin/Widget/WidgetNoahsCard.php b/src/Plugin/Widget/WidgetNoahsCard.php index 3f6be62..b8e4a07 100644 --- a/src/Plugin/Widget/WidgetNoahsCard.php +++ b/src/Plugin/Widget/WidgetNoahsCard.php @@ -531,7 +531,7 @@ class WidgetNoahsCard extends WidgetBase { $image = ImageStyle::load($settings->image->image_style)->buildUrl($file_uri); } else { - $image = \Drupal::service('file_url_generator')->generateAbsoluteString($file_uri); + $image = $this->fileUrlGenerator->generateAbsoluteString($file_uri); } } @@ -540,9 +540,9 @@ class WidgetNoahsCard extends WidgetBase { } if (!empty($settings->image->token_media)) { - $token_service = \Drupal::token(); + $token_service = $this->token; $token = $settings->image->token_media; - $route_match = \Drupal::routeMatch(); + $route_match = $this->routeMatch; $node = $route_match->getParameter('node'); if (!empty($node)) { diff --git a/src/Plugin/Widget/WidgetNoahsCardGrid.php b/src/Plugin/Widget/WidgetNoahsCardGrid.php index 2a390f1..c13addb 100644 --- a/src/Plugin/Widget/WidgetNoahsCardGrid.php +++ b/src/Plugin/Widget/WidgetNoahsCardGrid.php @@ -761,9 +761,9 @@ class WidgetNoahsCardGrid extends WidgetBase { } if (!empty($element->card_image->token_media)) { - $token_service = \Drupal::token(); + $token_service = $this->token; $token = $element->card_image->token_media; - $route_match = \Drupal::routeMatch(); + $route_match = $this->routeMatch; $node = $route_match->getParameter('node'); if (!empty($node)) { @@ -780,7 +780,7 @@ class WidgetNoahsCardGrid extends WidgetBase { if ($file) { $svg_url = $file->getFileUri(); if ($svg_url) { - $svg_local_url = \Drupal::service('file_url_generator')->generateAbsoluteString($file->getFileUri()); + $svg_local_url = $this->fileUrlGenerator->generateAbsoluteString($file->getFileUri()); $svg_content = '<img src="' . $svg_local_url . '">'; } else { @@ -790,17 +790,16 @@ class WidgetNoahsCardGrid extends WidgetBase { } if (!empty($element->slideshow_url->node_id)) { - $url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $element->slideshow_url->node_id); + $url = $this->aliasManager->getAliasByPath('/node/' . $element->slideshow_url->node_id); } elseif (!empty($element->slideshow_url->text)) { $url = $element->slideshow_url->text; } if (!empty($element->single_slideshow_image->token_media)) { - $token_service = \Drupal::token(); + $token_service = $this->token; $token = $element->single_slideshow_image->token_media; - $route_match = \Drupal::routeMatch(); - + $route_match = $this->routeMatch; $node = $route_match->getParameter('node'); if (!empty($node)) { $image = $token_service->replace($token, [ diff --git a/src/Plugin/Widget/WidgetNoahsCarousel.php b/src/Plugin/Widget/WidgetNoahsCarousel.php index 47b3996..8e5dcee 100644 --- a/src/Plugin/Widget/WidgetNoahsCarousel.php +++ b/src/Plugin/Widget/WidgetNoahsCarousel.php @@ -294,9 +294,9 @@ class WidgetNoahsCarousel extends WidgetBase { $item_tablet = !empty($settings->element->carousel_type_columns_tablet) ? $settings->element->carousel_type_columns_tablet : '2'; $item_mobile = !empty($settings->element->carousel_type_columns_mobile) ? $settings->element->carousel_type_columns_mobile : '1'; $thumbnail_image = $image; - $output = '<div class="noahs_page_builder-carousel swiper ' . $grey_effect . '" + $output = '<div class="noahs_page_builder-carousel swiper ' . $grey_effect . '" data-show-items-desktop="' . $item_desktop . '" - data-show-items-tablet="' . $item_tablet . '" + data-show-items-tablet="' . $item_tablet . '" data-show-items-mobile="' . $item_mobile . '">'; $output .= '<div class="swiper-wrapper">'; @@ -321,10 +321,8 @@ class WidgetNoahsCarousel extends WidgetBase { $image = ImageStyle::load($image_style)->buildUrl($file_uri); } elseif (!empty($file)) { - $thumbnail_image = \Drupal::service('file_url_generator')->generateAbsoluteString($file_uri); - ; - $image = \Drupal::service('file_url_generator')->generateAbsoluteString($file_uri); - ; + $thumbnail_image = $this->fileUrlGenerator->generateAbsoluteString($file_uri); + $image = $this->fileUrlGenerator->generateAbsoluteString($file_uri); } } } @@ -335,7 +333,7 @@ class WidgetNoahsCarousel extends WidgetBase { if (isset($item->url)) { if (!empty($item->node_id)) { - $url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $item->node_id); + $url = $this->aliasManager->getAliasByPath('/node/' . $item->node_id); } elseif (filter_var($item->url, FILTER_VALIDATE_URL)) { $url = $item->url; diff --git a/src/Plugin/Widget/WidgetNoahsColumn.php b/src/Plugin/Widget/WidgetNoahsColumn.php index 67ea98d..d80c3ca 100644 --- a/src/Plugin/Widget/WidgetNoahsColumn.php +++ b/src/Plugin/Widget/WidgetNoahsColumn.php @@ -233,7 +233,7 @@ class WidgetNoahsColumn extends WidgetBase { */ public function template($settings, $content = '') { - $twig = \Drupal::service('twig'); + $twig = $this->twig; $element_content = $twig->render(NOAHS_PAGE_BUILDER_PATH . '/templates/widgets/noahs_column.twig', [ 'settings' => $settings, 'content' => $content, diff --git a/src/Plugin/Widget/WidgetNoahsDrupalBlock.php b/src/Plugin/Widget/WidgetNoahsDrupalBlock.php index 829054d..db52064 100644 --- a/src/Plugin/Widget/WidgetNoahsDrupalBlock.php +++ b/src/Plugin/Widget/WidgetNoahsDrupalBlock.php @@ -54,11 +54,11 @@ class WidgetNoahsDrupalBlock extends WidgetBase { if (!empty($settings->drupal_block)) { - $block_manager = \Drupal::service('plugin.manager.block'); + $block_manager = $this->blockManager; $config = []; $plugin_block = $block_manager->createInstance($settings->drupal_block, $config); - $access_result = $plugin_block->access(\Drupal::currentUser()); + $access_result = $plugin_block->access($this->currentUser); if (is_object($access_result) && $access_result->isForbidden() || is_bool($access_result) && !$access_result) { return; } @@ -67,7 +67,7 @@ class WidgetNoahsDrupalBlock extends WidgetBase { if ($plugin_block) { $build = $plugin_block->build(); - $render_block = \Drupal::service('renderer')->render( + $render_block = $this->renderer->render( $build ); diff --git a/src/Plugin/Widget/WidgetNoahsDrupalNodeTitle.php b/src/Plugin/Widget/WidgetNoahsDrupalNodeTitle.php index 427104e..b2fad84 100644 --- a/src/Plugin/Widget/WidgetNoahsDrupalNodeTitle.php +++ b/src/Plugin/Widget/WidgetNoahsDrupalNodeTitle.php @@ -105,10 +105,9 @@ class WidgetNoahsDrupalNodeTitle extends WidgetBase { public function template($settings) { $settings = $settings->element; - $request = \Drupal::request(); - $request = \Drupal::request(); - $route_match = \Drupal::routeMatch(); - $title = \Drupal::service('title_resolver')->getTitle($request, $route_match->getRouteObject()); + $request = $this->requestStack->getCurrentRequest(); + $route = $this->routeMatch->getRouteObject(); + $title = $this->titleResolver->getTitle($request, $route); $ouput = ''; $ouput .= '<div class="widget-content d-flex w-100">'; diff --git a/src/Plugin/Widget/WidgetNoahsDrupalSiteLogo.php b/src/Plugin/Widget/WidgetNoahsDrupalSiteLogo.php index 7695436..52c4267 100644 --- a/src/Plugin/Widget/WidgetNoahsDrupalSiteLogo.php +++ b/src/Plugin/Widget/WidgetNoahsDrupalSiteLogo.php @@ -64,7 +64,7 @@ class WidgetNoahsDrupalSiteLogo extends WidgetBase { public function template($settings) { $logo_relative_path = theme_get_setting('logo.url'); - $site_name = \Drupal::config('system.site')->get('name'); + $site_name = $this->configFactory->get('system.site')->get('name'); $element_content = $this->twig()->render(NOAHS_PAGE_BUILDER_PATH . '/templates/widgets/element_noahs_drupal_site_logo.twig', [ 'logo_relative_path' => $logo_relative_path, 'site_name' => $site_name, diff --git a/src/Plugin/Widget/WidgetNoahsDrupalSiteTitle.php b/src/Plugin/Widget/WidgetNoahsDrupalSiteTitle.php index 8c7915b..e5e84af 100644 --- a/src/Plugin/Widget/WidgetNoahsDrupalSiteTitle.php +++ b/src/Plugin/Widget/WidgetNoahsDrupalSiteTitle.php @@ -90,8 +90,7 @@ class WidgetNoahsDrupalSiteTitle extends WidgetBase { * {@inheritdoc} */ public function template($settings) { - $config = \Drupal::config('system.site'); - + $config = $this->configFactory->get('system.site'); $ouput = ''; $ouput .= '<div class="widget-content d-flex w-100">'; $ouput .= '<' . ($settings['element']['site_title_type'] ?? 'h1') . '>'; diff --git a/src/Plugin/Widget/WidgetNoahsDrupalToken.php b/src/Plugin/Widget/WidgetNoahsDrupalToken.php index 05cfff9..03d409c 100644 --- a/src/Plugin/Widget/WidgetNoahsDrupalToken.php +++ b/src/Plugin/Widget/WidgetNoahsDrupalToken.php @@ -55,12 +55,12 @@ class WidgetNoahsDrupalToken extends WidgetBase { */ public function template($settings) { $settings = $settings->element; - $token_service = \Drupal::token(); + $token_service = $this->token; $rendered_token = ''; if (!empty($settings->token->text)) { $token = $settings->token->text; - $route_match = \Drupal::routeMatch(); + $route_match = $this->routeMatch; $node = $route_match->getParameter('node'); if (!empty($node)) { diff --git a/src/Plugin/Widget/WidgetNoahsDrupalViews.php b/src/Plugin/Widget/WidgetNoahsDrupalViews.php index ffa33b6..4d204a9 100644 --- a/src/Plugin/Widget/WidgetNoahsDrupalViews.php +++ b/src/Plugin/Widget/WidgetNoahsDrupalViews.php @@ -109,7 +109,7 @@ class WidgetNoahsDrupalViews extends WidgetBase { $args = NULL; if (!empty($settings->token->text)) { - $token_service = \Drupal::token(); + $token_service = $this->token; $token = $settings->token->text; $rendered_token = $token_service->replace($token); $args = $rendered_token; @@ -140,7 +140,7 @@ class WidgetNoahsDrupalViews extends WidgetBase { unset($view->pager); } $view_render = $view->buildRenderable($display_id); - $render_block = \Drupal::service('renderer')->render($view_render); + $render_block = $this->renderer->render($view_render); $render_block = !empty($render_block) ? $render_block->__toString() : NULL; } diff --git a/src/Plugin/Widget/WidgetNoahsGallery.php b/src/Plugin/Widget/WidgetNoahsGallery.php index 0dd3f83..512c14e 100644 --- a/src/Plugin/Widget/WidgetNoahsGallery.php +++ b/src/Plugin/Widget/WidgetNoahsGallery.php @@ -30,7 +30,7 @@ class WidgetNoahsGallery extends WidgetBase { */ public function renderForm() { $form = []; - $image_styles = \Drupal::entityQuery('image_style')->execute(); + $image_styles = $this->entityTypeManager->getStorage('image_style')->getQuery()->execute(); // Section Content. $form['section_content'] = [ 'type' => 'tab', @@ -231,7 +231,7 @@ class WidgetNoahsGallery extends WidgetBase { if (isset($item->url)) { $text = !empty($item->text) ? $item->text : ''; if (!empty($item->node_id)) { - $url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $item->node_id); + $url = $this->aliasManager->getAliasByPath('/node/' . $item->node_id); } elseif (filter_var($item, FILTER_VALIDATE_URL)) { $url = $item->text; diff --git a/src/Plugin/Widget/WidgetNoahsHeading.php b/src/Plugin/Widget/WidgetNoahsHeading.php index 60d39d7..50b5f5f 100644 --- a/src/Plugin/Widget/WidgetNoahsHeading.php +++ b/src/Plugin/Widget/WidgetNoahsHeading.php @@ -208,10 +208,10 @@ class WidgetNoahsHeading extends WidgetBase { /** * {@inheritdoc} */ - public static function template($settings) { + public function template($settings) { $settings = $settings->element; - $token_service = \Drupal::token(); + $token_service = $this->token; $rendered_token = ''; if (!empty($settings->heading_text->text)) { @@ -223,7 +223,7 @@ class WidgetNoahsHeading extends WidgetBase { if (!empty($settings->token->text)) { $token = $settings->token->text; - $route_match = \Drupal::routeMatch(); + $route_match = $this->routeMatch; $node = $route_match->getParameter('node'); if (!empty($node)) { diff --git a/src/Plugin/Widget/WidgetNoahsImage.php b/src/Plugin/Widget/WidgetNoahsImage.php index 11384d0..07a603a 100644 --- a/src/Plugin/Widget/WidgetNoahsImage.php +++ b/src/Plugin/Widget/WidgetNoahsImage.php @@ -137,9 +137,9 @@ class WidgetNoahsImage extends WidgetBase { } if (!empty($settings->element->image->token_media)) { - $token_service = \Drupal::token(); + $token_service = $this->token; $token = $settings->element->image->token_media; - $route_match = \Drupal::routeMatch(); + $route_match = $this->routeMatch; $node = $route_match->getParameter('node'); if (!empty($node)) { diff --git a/src/Plugin/Widget/WidgetNoahsRow.php b/src/Plugin/Widget/WidgetNoahsRow.php index e31365d..d9a3e4e 100644 --- a/src/Plugin/Widget/WidgetNoahsRow.php +++ b/src/Plugin/Widget/WidgetNoahsRow.php @@ -310,7 +310,7 @@ class WidgetNoahsRow extends WidgetBase { */ public function template($settings, $content = '') { - $twig = \Drupal::service('twig'); + $twig = $this->twig; $element_content = $twig->render(NOAHS_PAGE_BUILDER_PATH . '/templates/widgets/noahs_row.twig', [ 'settings' => $settings, diff --git a/src/Plugin/Widget/WidgetNoahsServicesSlide.php b/src/Plugin/Widget/WidgetNoahsServicesSlide.php index fb9447b..9b1a8e3 100644 --- a/src/Plugin/Widget/WidgetNoahsServicesSlide.php +++ b/src/Plugin/Widget/WidgetNoahsServicesSlide.php @@ -566,7 +566,7 @@ class WidgetNoahsServicesSlide extends WidgetBase { $url = $element->slideshow_url->text; } if (!empty($element->slideshow_url->node_id)) { - $url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $element->slideshow_url->node_id); + $url = $this->aliasManager->getAliasByPath('/node/' . $element->slideshow_url->node_id); } // Single Image. @@ -583,7 +583,7 @@ class WidgetNoahsServicesSlide extends WidgetBase { $image = ImageStyle::load($settings->element->gallery_image_style)->buildUrl($file_uri); } else { - $image = \Drupal::service('file_url_generator')->generateAbsoluteString($file_uri); + $image = $this->fileUrlGenerator->generateAbsoluteString($file_uri); } } } @@ -591,9 +591,9 @@ class WidgetNoahsServicesSlide extends WidgetBase { } if (!empty($element->single_slideshow_image->token_media)) { - $token_service = \Drupal::token(); + $token_service = $this->token; $token = $element->single_slideshow_image->token_media; - $route_match = \Drupal::routeMatch(); + $route_match = $this->routeMatch; $node = $route_match->getParameter('node'); if (!empty($node)) { @@ -692,7 +692,7 @@ class WidgetNoahsServicesSlide extends WidgetBase { $html .= '</div> <!-- If we need pagination --> <div class="swiper-pagination"></div> - + <!-- If we need navigation buttons --> <div class="swiper-button-prev"></div> <div class="swiper-button-next"></div> diff --git a/src/Plugin/Widget/WidgetNoahsSettings.php b/src/Plugin/Widget/WidgetNoahsSettings.php index d5210d6..ac9b6fc 100644 --- a/src/Plugin/Widget/WidgetNoahsSettings.php +++ b/src/Plugin/Widget/WidgetNoahsSettings.php @@ -436,8 +436,8 @@ class WidgetNoahsSettings extends WidgetBase { /** * {@inheritdoc} */ - public static function template($settings) { - $twig = \Drupal::service('twig'); + public function template($settings) { + $twig = $this->twig; $element_content = $twig->render(NOAHS_PAGE_BUILDER_PATH . '/templates/widgets/noahs_settings.twig', [ 'settings' => $settings, diff --git a/src/Plugin/Widget/WidgetNoahsSlideshow.php b/src/Plugin/Widget/WidgetNoahsSlideshow.php index 30603a9..e782e39 100644 --- a/src/Plugin/Widget/WidgetNoahsSlideshow.php +++ b/src/Plugin/Widget/WidgetNoahsSlideshow.php @@ -399,7 +399,7 @@ class WidgetNoahsSlideshow extends WidgetBase { $image = ImageStyle::load($element->slideshow_image->image_style)->buildUrl($file_uri); } else { - $image = \Drupal::service('file_url_generator')->generateAbsoluteString($file_uri); + $image = $this->fileUrlGenerator->generateAbsoluteString($file_uri); } } } @@ -411,7 +411,7 @@ class WidgetNoahsSlideshow extends WidgetBase { $url = $element->slideshow_url->text; } if (!empty($element->slideshow_url->node_id)) { - $url = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $element->slideshow_url->node_id); + $url = $this->aliasManager->getAliasByPath('/node/' . $element->slideshow_url->node_id); } // Single Image. @@ -428,7 +428,7 @@ class WidgetNoahsSlideshow extends WidgetBase { $image = ImageStyle::load($element->single_slideshow_image->image_style)->buildUrl($file_uri); } else { - $image = \Drupal::service('file_url_generator')->generateAbsoluteString($file_uri); + $image = $this->fileUrlGenerator->generateAbsoluteString($file_uri); } } } @@ -436,9 +436,9 @@ class WidgetNoahsSlideshow extends WidgetBase { } if (!empty($element->single_slideshow_image->token_media)) { - $token_service = \Drupal::token(); + $token_service = $this->token; $token = $element->single_slideshow_image->token_media; - $route_match = \Drupal::routeMatch(); + $route_match = $this->routeMatch; $node = $route_match->getParameter('node'); if (!empty($node)) { diff --git a/src/Plugin/Widget/WidgetNoahsVideo.php b/src/Plugin/Widget/WidgetNoahsVideo.php index 799bffa..7902201 100644 --- a/src/Plugin/Widget/WidgetNoahsVideo.php +++ b/src/Plugin/Widget/WidgetNoahsVideo.php @@ -259,7 +259,7 @@ class WidgetNoahsVideo extends WidgetBase { /** * {@inheritdoc} */ - public static function template($settings) { + public function template($settings) { $settings = $settings->element; $url = 'https://www.youtube.com/watch?v=FL0aKqxxvHc'; @@ -280,7 +280,7 @@ class WidgetNoahsVideo extends WidgetBase { $image = ImageStyle::load($settings->video_image->image_style)->buildUrl($file_uri); } else { - $image = \Drupal::service('file_url_generator')->generateAbsoluteString($file_uri); + $image = $this->fileUrlGenerator->generateAbsoluteString($file_uri); } } @@ -288,7 +288,7 @@ class WidgetNoahsVideo extends WidgetBase { $video_file = File::load($settings->video_local->fid); $video_file_uri = $video_file->getFileUri(); $file_name = $video_file->filemime->value; - $video_local_url = \Drupal::service('file_url_generator')->generateAbsoluteString($video_file_uri); + $video_local_url = $this->fileUrlGenerator->generateAbsoluteString($video_file_uri); } if (!empty($settings->video_type)) { diff --git a/src/Service/WidgetServices.php b/src/Service/WidgetServices.php index fadde42..3d74209 100644 --- a/src/Service/WidgetServices.php +++ b/src/Service/WidgetServices.php @@ -137,14 +137,8 @@ class WidgetServices { /** * Get widgets fields. - * - * @param string $widgetId - * The widget id. - * - * @return array - * The fields. */ - public function getWidgetFields(string $widgetId): array { + public function getWidgetFields($widgetId) { $el_fields = []; $default_fields = $this->controlManager->defaultFields(); @@ -156,24 +150,16 @@ class WidgetServices { return $el_fields; } - return $el_fields; } /** * Get widgets data. - * - * @param string $widgetId - * The widget id. - * - * @return array - * The data. */ - public function getWidgetData(string $widgetId): array { + public function getWidgetData($widgetId) { if ($this->widgetManager->hasDefinition($widgetId)) { $widget = $this->widgetManager->createInstance($widgetId); return $widget->data(); } - return []; } /** -- GitLab