xandeadx

DeepSeek V4 Pro (paid)

Jun 26th, 2026 (edited)
98
0
Never
4
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.68 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Drupal\current_date\Plugin\Block;
  4.  
  5. use Drupal\Core\Block\Attribute\Block;
  6. use Drupal\Core\Block\BlockBase;
  7. use Drupal\Core\Datetime\DateFormatterInterface;
  8. use Drupal\Core\Datetime\Entity\DateFormat;
  9. use Drupal\Core\Form\FormStateInterface;
  10. use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
  11. use Drupal\Core\StringTranslation\TranslatableMarkup;
  12. use Symfony\Component\DependencyInjection\ContainerInterface;
  13.  
  14. /**
  15.  * Provides a block that displays the current date.
  16.  */
  17. #[Block(
  18.  id: "current_date_block",
  19.   admin_label: new TranslatableMarkup("Current date")
  20. )]
  21. class CurrentDateBlock extends BlockBase implements ContainerFactoryPluginInterface {
  22.  
  23.   public function __construct(
  24.     array $configuration,
  25.     $plugin_id,
  26.     $plugin_definition,
  27.     protected DateFormatterInterface $dateFormatter,
  28.   ) {
  29.     parent::__construct($configuration, $plugin_id, $plugin_definition);
  30.   }
  31.  
  32.   public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
  33.     return new static(
  34.       $configuration,
  35.       $plugin_id,
  36.       $plugin_definition,
  37.       $container->get('date.formatter')
  38.     );
  39.   }
  40.  
  41.   public function defaultConfiguration() {
  42.     return [
  43.       'date_format' => 'medium',
  44.       'label_display' => 'visible',
  45.     ];
  46.   }
  47.  
  48.   public function blockForm($form, FormStateInterface $form_state) {
  49.     $form['date_format'] = [
  50.       '#type' => 'select',
  51.       '#title' => $this->t('Date format'),
  52.       '#description' => $this->t('Choose the format for displaying the date.'),
  53.       '#options' => $this->getDateFormatOptions(),
  54.       '#default_value' => $this->configuration['date_format'],
  55.       '#required' => TRUE,
  56.     ];
  57.     return $form;
  58.   }
  59.  
  60.   public function blockSubmit($form, FormStateInterface $form_state) {
  61.     $this->configuration['date_format'] = $form_state->getValue('date_format');
  62.   }
  63.  
  64.   public function build() {
  65.     $request_time = \Drupal::time()->getRequestTime();
  66.     $format = $this->configuration['date_format'];
  67.  
  68.     $build = [
  69.       '#type' => 'html_tag',
  70.       '#tag' => 'div',
  71.       '#attributes' => ['class' => ['current-date-block']],
  72.       '#value' => $this->dateFormatter->format($request_time, $format),
  73.       '#cache' => [
  74.         'max-age' => 0,
  75.       ],
  76.     ];
  77.  
  78.     return $build;
  79.   }
  80.  
  81.   protected function getDateFormatOptions() {
  82.     $options = [];
  83.     $date_formats = DateFormat::loadMultiple();
  84.     foreach ($date_formats as $id => $date_format) {
  85.       $options[$id] = $this->t('@label (@format)', [
  86.         '@label' => $date_format->label(),
  87.         '@format' => $date_format->getPattern(),
  88.       ]);
  89.     }
  90.     return $options;
  91.   }
  92.  
  93. }
  94.  
Advertisement
Comments
  • User was banned
  • User was banned
  • Gabundo
    25 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • User was banned
Add Comment
Please, Sign In to add comment