-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: packaged cmseditor (#2) * feat: composer file * feat: add license + changelog * Add files via upload * Delete CmsEditor directory * Delete resources/views directory --------- Co-authored-by: Rene <rene@notfound.nl> Co-authored-by: Xander Schuurman <44030544+keeama13@users.noreply.github.com> * feat: migrations + routes + restructure (#3) * feat: migrations + routes + restructure * fix: added composer + removed cmseditor folder * fix: providers * feat: models in package (#4) * feat: models in package * feat: packaged controllers * feat: seeders in package * fix: removed test echo * feat: lang + views * feat: services + provides * feat: package * feat: finalizing package * feat: last changes * fix: remove surplus migrations * feat: database seeders * feat: add helpers * fix: policy namespacing * fix: class name * fix: remove user provider * feat: last configs --------- Co-authored-by: Rene <rene@notfound.nl> * fix: syntax error in composer file * style: formatting * feat: add pinter * fix!: database prefix (#6) * feat: Events (#7) * feat: models in package * feat: packaged controllers * feat: seeders in package * fix: removed test echo * feat: lang + views * feat: services + provides * feat: package * feat: finalizing package * feat: last changes * fix: remove surplus migrations * feat: database seeders * feat: add helpers * fix: policy namespacing * fix: class name * fix: remove user provider * feat: last configs * feat: events * feat: events namespace * fix: namespace errors * style: formatting * fix: composer syntax error --------- Co-authored-by: keeama13 <xander@schuurmannen.nl> Co-authored-by: Rene <rene@notfound.nl> * fix: forms * feat: namespace changes (#9) * feat: namespace changes * feat: namespacing * feat: working views * fix: remove duplicate entries * fix: remove SiteBoss namspace * style: formatting --------- Co-authored-by: René <github@registraties.notfound.nl> Co-authored-by: Rene <rene@notfound.nl> * fix: removed laravel assets from publish (#10) * fix: class path name * fix!: formbuilder problem quickfix * style: formatting * Fix/solr indexer (#13) * fix: add timestamps to search table * fix: replace all white spaces by single spaces * fix: get page title * style: formatting --------- Co-authored-by: Thessa Kockelkorn <thessa@notfound.nl> Co-authored-by: René <rene@notfound.nl> * feat: add Siteboss Helper * fix: helper class namespace * fix: visible for CmsConfig * feat: remove unused function (#15) * feat: removed siteboss_path() * feat: app config, routes, factory updated * fix: factorytype * style: formatting * style: formatting * feat: SOLR localization (#14) * feat: forced localization of path * fix: mv creation of content string to pageservice * fix: get localized title --------- Co-authored-by: Thessa Kockelkorn <thessa@notfound.nl> * feat: searchable * feat!: Form handler (#16) * fix: clamav no socket * feat: call FormHandler * fix: re-add getSummaryHtml * fix getSummaryHtml for files * style: formatting --------- Co-authored-by: René <rene@notfound.nl> * feat: mail helper (#17) * feat: send mail from helper * style: formatting * fix: send debug mails --------- Co-authored-by: Rene <rene@notfound.nl> --------- Co-authored-by: Rene <rene@notfound.nl> Co-authored-by: Xander Schuurman <44030544+keeama13@users.noreply.github.com> Co-authored-by: keeama13 <xander@schuurmannen.nl> Co-authored-by: thessakockelkorn <70509512+thessakockelkorn@users.noreply.github.com> Co-authored-by: Thessa Kockelkorn <thessa@notfound.nl>
- Loading branch information
1 parent
6c69173
commit 2b5d144
Showing
21 changed files
with
286 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
database/migrations/2023_06_07_114849_update_search_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
// | ||
Schema::table('cms_search', function (Blueprint $table) { | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
// | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
|
||
namespace NotFound\Framework\Helpers; | ||
|
||
use NotFound\Framework\Models\CmsConfig; | ||
|
||
class SitebossHelper | ||
{ | ||
public static ?array $config = null; | ||
|
||
/** | ||
* config | ||
* | ||
* Returns a value from the cms_config table. | ||
* | ||
* @param mixed $code The internal code for the config value. | ||
* @param mixed $failOnMissing Whether to throw an exception if the config value is missing. | ||
* @return string|object|null The value of the config. | ||
*/ | ||
public static function config(string $code, bool $failOnMissing = true): string|object|null | ||
{ | ||
if (is_null(self::$config)) { | ||
self::$config = CmsConfig::all()->keyBy('code')->toArray(); | ||
} | ||
|
||
if (! isset(self::$config[$code])) { | ||
if ($failOnMissing) { | ||
throw new \Exception("Missing config code: {$code}"); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
if (self::$config[$code]['type'] === 2) { | ||
return json_decode(self::$config[$code]['value'], true); | ||
} | ||
|
||
return self::$config[$code]['value']; | ||
} | ||
|
||
public static function mail(string $to_name, string $to_email, string $subject, $html, $data = false) | ||
{ | ||
$sendgrid_api_key = self::config('sendgrid_api_key', true); | ||
$sendgrid_sender_email = self::config('sendgrid_sender_email', true); | ||
$sendgrid_sender_name = self::config('sendgrid_sender_name', true); | ||
|
||
$email = new \SendGrid\Mail\Mail(); | ||
$email->setFrom($sendgrid_sender_email, $sendgrid_sender_name); | ||
$email->setSubject($subject); | ||
|
||
if (app()->hasDebugModeEnabled()) { | ||
$email->addTo(\env('SB_ERROR_EMAIL', $to_email)); | ||
} else { | ||
if (filter_var($to_email, FILTER_VALIDATE_EMAIL)) { | ||
$email->addTo($to_email, $to_name); | ||
} else { | ||
return 400; | ||
} | ||
} | ||
|
||
// if ($data != false) { | ||
// // HTML is a Twig template with data | ||
// if(!site::$page->twig) | ||
// { | ||
// site::$page->getTwig(); | ||
// } | ||
// $html = site::$page->twig->render($html, $data); | ||
// } | ||
$email->addContent('text/html', $html); | ||
$sendgrid = new \SendGrid($sendgrid_api_key); | ||
try { | ||
$response = $sendgrid->send($email); | ||
|
||
return $response->statusCode(); | ||
} catch (\Exception $e) { | ||
echo 'Caught exception: '.$e->getMessage()."\n"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace NotFound\Framework\Interfaces; | ||
|
||
interface FormHandlerInterface | ||
{ | ||
public function __construct(string $langUrl, $formInfo, $formValidator); | ||
|
||
public function run(): bool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.