Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="markie">
<description>PHP CodeSniffer configuration for the markie Drupal project.</description>

<!-- Scan custom modules and theme PHP files. -->
<file>web/modules/custom</file>
<file>web/themes/custom</file>

<!-- Exclude directories that contain third-party or generated code. -->
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>

<!-- Use Drupal and DrupalPractice coding standards. -->
<rule ref="Drupal"/>
<rule ref="DrupalPractice"/>

<!--
Exclude CSS sniffs that produce false positives with modern CSS features:
CSS custom properties, multi-line values, blank lines in :root,
and :where() pseudo-selector treated as multiple selectors.
-->
<rule ref="Squiz.CSS.MissingColon">
<exclude-pattern>*.css</exclude-pattern>
</rule>
<rule ref="Squiz.CSS.SemicolonSpacing">
<exclude-pattern>*.css</exclude-pattern>
</rule>
<rule ref="Squiz.CSS.Indentation.BlankLine">
<exclude-pattern>*.css</exclude-pattern>
</rule>
<rule ref="Squiz.CSS.Indentation.Incorrect">
<exclude-pattern>*.css</exclude-pattern>
</rule>
<rule ref="Drupal.CSS.ClassDefinitionNameSpacing.MultipleSelectors">
<exclude-pattern>*.css</exclude-pattern>
</rule>

<!--
Exclude the version key warning for custom (non-distributed) theme/module
info files. The version key is valid for site-specific custom code.
-->
<rule ref="Drupal.InfoFiles.AutoAddedKeys">
<exclude-pattern>web/themes/custom/*</exclude-pattern>
<exclude-pattern>web/modules/custom/*</exclude-pattern>
</rule>

</ruleset>
9 changes: 7 additions & 2 deletions web/modules/custom/markie/markie.install
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?php

use \Drupal\node\Entity\Node;
/**
* @file
* Install, update and uninstall functions for the markie module.
*/

use Drupal\node\Entity\Node;

/**
* Implements hook_update_N().
Expand All @@ -14,7 +19,7 @@ function markie_update_10001() {
// Load all the nodes.
$nodes = Node::loadMultiple($nids);
foreach ($nodes as $node) {
// Set the field_video_checked boolean to TRUE
// Set the field_video_checked boolean to TRUE.
$node->set('field_video_checked', TRUE);
$node->save();
$node->set('field_video_checked', FALSE);
Expand Down
14 changes: 10 additions & 4 deletions web/modules/custom/markie/markie.module
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<?php

/**
* Implements hook_preprocess_HOOK().
*/
* @file
* Hook implementations for the markie module.
*/

use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;

/**
* Implements hook_preprocess_HOOK().
*/
function markie_preprocess_media(&$variables) {
/** @var \\Drupal\\media\\Entity\\Media $media */
$media = $variables['media'];
Expand All @@ -22,11 +29,10 @@ function markie_preprocess_user(&$variables) {
// Just in case we ever add a sensitive field to user profiles, block
// anonymous users from viewing user profiles in the default view mode, where
// all fields are shown by default.

// 1. Check if we are on the user profile page.
// 2. Check if the current user is an anonymous user.
// 3. If so, return 403.
if (\Drupal::routeMatch()->getRouteName() === 'entity.user.canonical' && \Drupal::currentUser()->isAnonymous()) {
throw new \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException();
throw new AccessDeniedHttpException();
}
}
2 changes: 1 addition & 1 deletion web/themes/custom/markconroy/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
markconroy theme, generated from starterkit_theme. Additional information on generating themes can be found in the [Starterkit documentation](https://www.drupal.org/docs/core-modules-and-themes/core-themes/starterkit-theme).
markconroy theme, generated from starterkit_theme. Additional information on generating themes can be found in the [Starterkit documentation](https://www.drupal.org/docs/core-modules-and-themes/core-themes/starterkit-theme).
2 changes: 1 addition & 1 deletion web/themes/custom/markconroy/css/base/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ blockquote {

blockquote > * + * {
margin-block-start: var(--spacing-small);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
.breadcrumb a {
color: var(--color-primary);
font-weight: normal;
}
}
1 change: 0 additions & 1 deletion web/themes/custom/markconroy/css/components/homepage.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@
justify-content: center;
align-items: center;
flex-wrap: wrap;

}
2 changes: 1 addition & 1 deletion web/themes/custom/markconroy/css/components/pager.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.pager__item.is-active a {
color: var(--color-primary);
text-decoration: none;
}
}
4 changes: 2 additions & 2 deletions web/themes/custom/markconroy/markconroy.theme
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function markconroy_preprocess_image_widget(array &$variables) {
* Implements hook_preprocess_HOOK() for page templates.
*/
function markconroy_preprocess_page(array &$variables) {
// $variables['#attached']['library'][] = 'markconroy/course-signup-popup-form';
$variables['#attached']['library'][] = 'markconroy/mailing-list-signup-popup-form';
$variables['#attached']['library'][] =
'markconroy/mailing-list-signup-popup-form';
}

/**
Expand Down