Commit current progress.

This commit is contained in:
calcu1on
2025-03-23 08:44:18 -04:00
parent e3425095dd
commit bef289950b
9 changed files with 145 additions and 30 deletions

View File

@@ -11,29 +11,17 @@ function dc_core_page_attachments(array &$attachments) {
}
}
function dc_core_views_pre_view(ViewExecutable $view) {
if ($view->id() !== 'floorplans_by_property') {
return;
}
$cur_node = \Drupal::routeMatch()->getParameter('node');
if (!$cur_node instanceof \Drupal\node\NodeInterface) {
return;
}
if (!$cur_node->hasField('field_property')) {
return;
}
// current property.
$property = $cur_node->get('field_property')->first()->getValue()['target_id'] ?? FALSE;
assert(!is_null($property));
$increased_price_data = [
];
$exposed_input = $view->getExposedInput();
if (isset($exposed_input['field_price_value'])) {
$filters = $view->display_handler->getOption('filters');
$filters['field_price_value']['group_info']['group_items'][3]['title'] = "339+";
$filters['field_price_value']['group_info']['group_items'][3]['value']['value'] = 339;
$view->display_handler->overrideOption('filters', $filters);
}
function dc_core_form_taxonomy_term_ufc_events_form_alter(&$form, &$form_state, $form_id) {
$form['actions']['refresh'] = array(
'#type' => 'submit',
'#value' => t('Refresh Property'),
'#access' => TRUE,
'#submit' => ['dc_core_taxo_form_submit'],
'#weight' => -30,
);
}
function dc_core_taxo_form_submit($form, &$form_state) {
}

View File

@@ -15,7 +15,7 @@ final class CharacterImport extends DrushCommands {
public function importCharacters(): void {
$http_client = \Drupal::httpClient();
$character_endpoint = "https://dchadwick.ddev.site/api/character-list";
$data = $http_client->get($character_endpoint)->getBody()->getContents();
$data = $http_client->get($character_endpoint, ['verify'=>FALSE,])->getBody()->getContents();
$json_data = json_decode($data, TRUE);
// Create the queue.
$character_import_queue = \Drupal::queue('character_import');

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace Drupal\dc_core\Plugin\Block;
use Drupal\Core\Block\Attribute\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\StringTranslation\TranslatableMarkup;
#[Block(
id: "copyright_block",
admin_label: new TranslatableMarkup("Copyright Block"),
category: new TranslatableMarkup("DC Core")
)]
final class CopyrightBlock extends BlockBase {
/**
* {@inheritdoc}
*/
public function build(): array {
$year = date('Y');
"<p>&#169; Dan Chadwick {$year}</p>";
$build = [
'#markup' => "<p>&#169; Dan Chadwick {$year}</p>",
];
return $build;
}
}