xandeadx

GLM 5.2 (paid)

Jun 26th, 2026 (edited)
51
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.96 KB | None | 0 0
  1. <?php
  2.  
  3. declare(strict_types=1);
  4.  
  5. namespace Drupal\current_date\Plugin\Block;
  6.  
  7. use Drupal\Core\Block\Attribute\Block;
  8. use Drupal\Core\Block\BlockBase;
  9. use Drupal\Core\Datetime\DateFormatterInterface;
  10. use Drupal\Core\Form\FormStateInterface;
  11. use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
  12. use Drupal\Core\StringTranslation\TranslatableMarkup;
  13. use Symfony\Component\DependencyInjection\ContainerInterface;
  14.  
  15. /**
  16.  * Provides a block that displays the current date.
  17.  */
  18. #[Block(
  19.  id: 'current_date_block',
  20.   admin_label: new TranslatableMarkup('Current date'),
  21.   category: new TranslatableMarkup('Custom'),
  22. )]
  23. class CurrentDateBlock extends BlockBase implements ContainerFactoryPluginInterface {
  24.  
  25.   /**
  26.    * The available predefined date format types.
  27.    */
  28.   protected const FORMAT_TYPES = [
  29.     'short' => 'Short',
  30.     'medium' => 'Medium',
  31.     'long' => 'Long',
  32.     'custom' => 'Custom',
  33.   ];
  34.  
  35.   public function __construct(
  36.     array $configuration,
  37.     $plugin_id,
  38.     $plugin_definition,
  39.     protected DateFormatterInterface $dateFormatter,
  40.   ) {
  41.     parent::__construct($configuration, $plugin_id, $plugin_definition);
  42.   }
  43.  
  44.   /**
  45.    * {@inheritdoc}
  46.    */
  47.   public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): static {
  48.     return new static(
  49.       $configuration,
  50.       $plugin_id,
  51.       $plugin_definition,
  52.       $container->get('date.formatter'),
  53.     );
  54.   }
  55.  
  56.   /**
  57.    * {@inheritdoc}
  58.    */
  59.   public function defaultConfiguration(): array {
  60.     return [
  61.       'date_format_type' => 'medium',
  62.       'custom_format' => 'd.m.Y',
  63.     ];
  64.   }
  65.  
  66.   /**
  67.    * {@inheritdoc}
  68.    */
  69.   public function blockForm($form, FormStateInterface $form_state): array {
  70.     $config = $this->getConfiguration();
  71.  
  72.     $form['date_format_type'] = [
  73.       '#type' => 'select',
  74.       '#title' => $this->t('Date format'),
  75.       '#description' => $this->t('Choose a predefined date format or "Custom" to enter your own PHP date format string.'),
  76.       '#options' => array_map([$this, 't'], self::FORMAT_TYPES),
  77.       '#default_value' => $config['date_format_type'],
  78.     ];
  79.  
  80.     $form['custom_format'] = [
  81.       '#type' => 'textfield',
  82.       '#title' => $this->t('Custom date format'),
  83.       '#description' => $this->t('A PHP date format string (e.g. <em>d.m.Y</em>, <em>Y-m-d H:i</em>). Used only when "Custom" format is selected. See the <a href=":url">PHP manual</a> for available placeholders.', [':url' => 'https://www.php.net/manual/datetime.format.php']),
  84.       '#default_value' => $config['custom_format'],
  85.       '#states' => [
  86.         'visible' => [
  87.           ':input[name="settings[date_format_type]"]' => ['value' => 'custom'],
  88.         ],
  89.       ],
  90.     ];
  91.  
  92.     return $form;
  93.   }
  94.  
  95.   /**
  96.    * {@inheritdoc}
  97.    */
  98.   public function blockSubmit($form, FormStateInterface $form_state): void {
  99.     $this->configuration['date_format_type'] = $form_state->getValue('date_format_type');
  100.     $this->configuration['custom_format'] = $form_state->getValue('custom_format');
  101.   }
  102.  
  103.   /**
  104.    * {@inheritdoc}
  105.    */
  106.   public function blockValidate($form, FormStateInterface $form_state): void {
  107.     if ($form_state->getValue('date_format_type') === 'custom' && trim((string) $form_state->getValue('custom_format')) === '') {
  108.       $form_state->setErrorByName('custom_format', $this->t('A custom date format string is required when "Custom" format is selected.'));
  109.     }
  110.   }
  111.  
  112.   /**
  113.    * {@inheritdoc}
  114.    */
  115.   public function build(): array {
  116.     $config = $this->getConfiguration();
  117.     $type = $config['date_format_type'];
  118.     $format = $type === 'custom' ? $config['custom_format'] : '';
  119.  
  120.     $formatted = $this->dateFormatter->format(
  121.       \Drupal::time()->getRequestTime(),
  122.       $type === 'custom' ? 'custom' : $type,
  123.       $format,
  124.     );
  125.  
  126.     return [
  127.       '#theme' => 'current_date',
  128.       '#date' => $formatted,
  129.       '#cache' => [
  130.         'max-age' => 0,
  131.       ],
  132.     ];
  133.   }
  134.  
  135. }
  136.  
Advertisement
Comments
  • User was banned
  • D_Celcraft
    2 days
    # CSS 0.82 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://drive.google.com/file/d/1cvQPOZ7JecI0L6lqdIzIHJbHQBiDRT4U/view
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
Add Comment
Please, Sign In to add comment