Skip to content

Commit

Permalink
Create DatabaseAdminExtension.php
Browse files Browse the repository at this point in the history
generate css file after dev/build
  • Loading branch information
priscillay-toast authored Sep 15, 2023
1 parent b164d56 commit 9e23df3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Extensions/DatabaseAdminExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace Toast\ThemeColours\Extensions;

use SilverStripe\Control\Director;
use SilverStripe\ORM\DataExtension;
use SilverStripe\Security\Security;
use Toast\ThemeColours\Helpers\Helper;

class DatabaseAdminExtension extends DataExtension
{
public function onAfterBuild()
{
//generate all the required css files by theme colours
if (Security::database_is_ready()) {
// theme colours
if (Helper::getCurrentSiteConfig()) Helper::generateCSSFiles();
}
}
}

0 comments on commit 9e23df3

Please sign in to comment.