Merge branch 'main' into joeykimsey-com
This commit is contained in:
45
app/plugins/subscribe/plugin.php
Normal file
45
app/plugins/subscribe/plugin.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/subscribe/plugin.php
|
||||
*
|
||||
* This houses all of the main plugin info and functionality.
|
||||
*
|
||||
* @package TP Subscribe
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Plugins;
|
||||
|
||||
use ReflectionClass;
|
||||
use TheTempusProject\Classes\Installer;
|
||||
use TheTempusProject\Houdini\Classes\Navigation;
|
||||
use TheTempusProject\Classes\Plugin;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
|
||||
class Subscribe extends Plugin {
|
||||
private static $loaded = false;
|
||||
public $pluginName = 'TP Subscribe';
|
||||
public $pluginAuthor = 'JoeyK';
|
||||
public $pluginWebsite = 'https://TheTempusProject.com';
|
||||
public $modelVersion = '1.0';
|
||||
public $pluginVersion = '3.0';
|
||||
public $pluginDescription = 'A simple plugin to add a method for users to share their email.';
|
||||
public $admin_links = [
|
||||
[
|
||||
'text' => '<i class="fa fa-fw fa-address-book"></i> Subscriptions',
|
||||
'url' => '{ROOT_URL}admin/subscriptions',
|
||||
],
|
||||
];
|
||||
|
||||
public function __construct( $load = false ) {
|
||||
parent::__construct( $load );
|
||||
if ( ! self::$loaded ) {
|
||||
Components::append( 'FOOTER_RIGHT', Views::simpleView( 'subscribe.footer.right') );
|
||||
self::$loaded = true;
|
||||
}
|
||||
}
|
||||
}
|
24
app/plugins/subscribe/views/admin/add.html
Normal file
24
app/plugins/subscribe/views/admin/add.html
Normal file
@ -0,0 +1,24 @@
|
||||
<div class="context-main-bg context-main p-3">
|
||||
<legend class="text-center">Add Subscriber</legend>
|
||||
<hr>
|
||||
{ADMIN_BREADCRUMBS}
|
||||
<form action="" method="post">
|
||||
<fieldset>
|
||||
<!-- Subject -->
|
||||
<div class="mb-3 row">
|
||||
<label for="email" class="col-lg-5 col-form-label text-end">Email:</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="email" class="form-control" name="email" id="email" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hidden Token -->
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
</fieldset>
|
||||
|
||||
<!-- Submit Button -->
|
||||
<div class="text-center">
|
||||
<button type="submit" name="submit" value="submit" class="btn btn-primary btn-lg center-block">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
40
app/plugins/subscribe/views/admin/list.html
Normal file
40
app/plugins/subscribe/views/admin/list.html
Normal file
@ -0,0 +1,40 @@
|
||||
<div class="context-main-bg context-main p-3">
|
||||
<legend class="text-center">Subscribers</legend>
|
||||
<hr>
|
||||
{ADMIN_BREADCRUMBS}
|
||||
<form action="{ROOT_URL}admin/subscriptions/delete" method="post">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%">ID</th>
|
||||
<th style="width: 85%">email</th>
|
||||
<th style="width: 5%"></th>
|
||||
<th style="width: 5%">
|
||||
<input type="checkbox" onchange="checkAll(this)" name="check.s" value="S_[]">
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{LOOP}
|
||||
<tr>
|
||||
<td align="center">{ID}</td>
|
||||
<td>{EMAIL}</td>
|
||||
<td><a href="{ROOT_URL}admin/subscriptions/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td>
|
||||
<td>
|
||||
<input type="checkbox" value="{ID}" name="S_[]">
|
||||
</td>
|
||||
</tr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<tr>
|
||||
<td align="center" colspan="6">
|
||||
No results to show.
|
||||
</td>
|
||||
</tr>
|
||||
{/ALT}
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="{ROOT_URL}admin/subscriptions/add" class="btn btn-sm btn-primary">Add</a>
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
|
||||
</form>
|
||||
</div>
|
@ -1,15 +1,11 @@
|
||||
|
||||
<div class="col-lg-3 text-center">
|
||||
<h3>Subscribe</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<div class="input-append newsletter-box">
|
||||
<form action="{ROOT_URL}subscribe/home" method="post" class="form-horizontal">
|
||||
<input type="email" class="full form-control" placeholder="Email" id="email" name="email" autocomplete="email" style="margin-bottom: 15px;">
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary center-block">Subscribe</button>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="col-md-5 offset-md-1 mb-3 text-center">
|
||||
<h5 class="">Subscribe</h5>
|
||||
<div class="d-flex flex-column flex-sm-row gap-2 justify-content-center mx-auto">
|
||||
<form action="{ROOT_URL}subscribe/home" method="post" class="form-horizontal">
|
||||
<label for="email" class="visually-hidden">Email address</label>
|
||||
<input name="email" id="email" type="email" class="form-control my-2" placeholder="Email address" autocomplete="email">
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
<button class="btn btn-primary my-2 w-100" name="submit" value="submit" type="submit">Subscribe</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user