Add bookmark exports and sharing + various fixes
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/bugreport/controllers/bugreport.php
|
||||
* app/plugins/bookmarks/controllers/bookmarks.php
|
||||
*
|
||||
* This is the bug reports controller.
|
||||
*
|
||||
* @package TP BugReports
|
||||
* @package TP Bookmarks
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
@ -27,6 +27,7 @@ use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Houdini\Classes\Forms as HoudiniForms;
|
||||
use TheTempusProject\Houdini\Classes\Navigation;
|
||||
use TheTempusProject\Houdini\Classes\Template;
|
||||
use TheTempusProject\Hermes\Functions\Route as Routes;
|
||||
|
||||
class Bookmarks extends Controller {
|
||||
protected static $bookmarks;
|
||||
@ -53,6 +54,7 @@ class Bookmarks extends Controller {
|
||||
$userFolderTabsView = '';
|
||||
}
|
||||
Components::set( 'userFolderTabs', $userFolderTabsView );
|
||||
Components::set( 'SITE_URL', Routes::getAddress() );
|
||||
Views::raw( $tabsView );
|
||||
}
|
||||
|
||||
@ -150,9 +152,13 @@ class Bookmarks extends Controller {
|
||||
Issues::add( 'error', [ 'There was an error creating your bookmark.' => Check::userErrors() ] );
|
||||
return Views::view( 'bookmarks.bookmarks.create' );
|
||||
}
|
||||
self::$bookmarks->refreshInfo( $result );
|
||||
// self::$bookmarks->refreshInfo( $result );
|
||||
Session::flash( 'success', 'Your Bookmark has been created.' );
|
||||
Redirect::to( 'bookmarks/bookmarks/'. $folderID );
|
||||
if ( ! empty( $folderID ) ) {
|
||||
Redirect::to( 'bookmarks/bookmarks/'. $folderID );
|
||||
} else {
|
||||
Redirect::to( 'bookmarks/index' );
|
||||
}
|
||||
}
|
||||
|
||||
public function editBookmark( $id = null ) {
|
||||
@ -318,6 +324,36 @@ class Bookmarks extends Controller {
|
||||
/**
|
||||
* Functionality
|
||||
*/
|
||||
public function publish( $id = null ) {
|
||||
$bookmark = self::$bookmarks->findById( $id );
|
||||
if ( $bookmark == false ) {
|
||||
Session::flash( 'error', 'Bookmark not found.' );
|
||||
return Redirect::to( 'bookmarks/index' );
|
||||
}
|
||||
if ( $bookmark->createdBy != App::$activeUser->ID ) {
|
||||
Session::flash( 'error', 'You do not have permission to modify this bookmark.' );
|
||||
return Redirect::to( 'bookmarks/index' );
|
||||
}
|
||||
self::$bookmarks->publish( $id );
|
||||
Session::flash( 'success', 'Bookmark mad Public.' );
|
||||
return Redirect::to( 'bookmarks/share' );
|
||||
}
|
||||
|
||||
public function retract( $id = null ) {
|
||||
$bookmark = self::$bookmarks->findById( $id );
|
||||
if ( $bookmark == false ) {
|
||||
Session::flash( 'error', 'Bookmark not found.' );
|
||||
return Redirect::to( 'bookmarks/index' );
|
||||
}
|
||||
if ( $bookmark->createdBy != App::$activeUser->ID ) {
|
||||
Session::flash( 'error', 'You do not have permission to modify this bookmark.' );
|
||||
return Redirect::to( 'bookmarks/index' );
|
||||
}
|
||||
self::$bookmarks->retract( $id );
|
||||
Session::flash( 'success', 'Bookmark made Private.' );
|
||||
return Redirect::to( 'bookmarks/share' );
|
||||
}
|
||||
|
||||
public function hideBookmark( $id = null ) {
|
||||
$bookmark = self::$bookmarks->findById( $id );
|
||||
if ( $bookmark == false ) {
|
||||
@ -452,6 +488,108 @@ class Bookmarks extends Controller {
|
||||
// dv ( $out );
|
||||
}
|
||||
|
||||
public function export() {
|
||||
$folders = self::$folders->byUser();
|
||||
|
||||
if ( ! Input::exists('submit') ) {
|
||||
return Views::view( 'bookmarks.export', $folders );
|
||||
}
|
||||
|
||||
if ( ! Forms::check( 'exportBookmarks' ) ) {
|
||||
Issues::add( 'error', [ 'There was an error exporting your bookmarks.' => Check::userErrors() ] );
|
||||
return Views::view( 'bookmarks.export', $folders );
|
||||
}
|
||||
|
||||
$htmlDoc = '';
|
||||
$htmlDoc .= '<!DOCTYPE NETSCAPE-Bookmark-file-1>' . PHP_EOL;
|
||||
$htmlDoc .= '<!-- This is an automatically generated file.' . PHP_EOL;
|
||||
$htmlDoc .= ' It will be read and overwritten.' . PHP_EOL;
|
||||
$htmlDoc .= ' DO NOT EDIT! -->' . PHP_EOL;
|
||||
$htmlDoc .= '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">' . PHP_EOL;
|
||||
$htmlDoc .= '<TITLE>Bookmarks</TITLE>' . PHP_EOL;
|
||||
$htmlDoc .= '<H1>Bookmarks</H1>' . PHP_EOL;
|
||||
$htmlDoc .= '<DL><p>' . PHP_EOL;
|
||||
foreach ( Input::post('BF_') as $key => $id ) {
|
||||
if ( $id == 'unsorted' ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$folder = self::$folders->findById( $id );
|
||||
if ( $folder == false ) {
|
||||
Session::flash( 'error', 'Folder not found.' );
|
||||
return Redirect::to( 'bookmarks/index' );
|
||||
}
|
||||
$links = self::$bookmarks->byFolder( $folder->ID );
|
||||
$htmlDoc .= $this->exportFolder( $folder->title, $folder->createdAt, $folder->createdAt, $links );
|
||||
}
|
||||
$htmlDoc .= '</DL><p>' . PHP_EOL;
|
||||
|
||||
$folder = UPLOAD_DIRECTORY . App::$activeUser->username;
|
||||
if ( !file_exists( $folder ) ) {
|
||||
mkdir( $folder, 0777, true );
|
||||
}
|
||||
$file = $folder . DIRECTORY_SEPARATOR . 'export.html';
|
||||
|
||||
$result = file_put_contents( $file, $htmlDoc );
|
||||
|
||||
if ($result !== false) {
|
||||
$filename = basename($file);
|
||||
$downloadUrl = '/uploads/' . App::$activeUser->username . '/export.html';
|
||||
|
||||
Session::flash( 'success', 'Your Export is available for download <a target="_blank" href="' . $downloadUrl . '">here</a>.' );
|
||||
Redirect::to( 'bookmarks/export' );
|
||||
} else {
|
||||
Session::flash( 'error', 'There was an issue exporting your bookmarks, please try again.' );
|
||||
return Redirect::to( 'bookmarks/export' );
|
||||
}
|
||||
}
|
||||
|
||||
private function exportFolder( $title, $editedAt, $createdAt, $links ) {
|
||||
$htmlDoc = '<DT><H3 ADD_DATE="'.$createdAt.'" LAST_MODIFIED="'.$editedAt.'">'.$title.'</H3>' . PHP_EOL;
|
||||
$htmlDoc .= '<DL><p>' . PHP_EOL;
|
||||
if ( ! empty( $links ) ) {
|
||||
foreach ( $links as $key => $link ) {
|
||||
$htmlDoc .= $this->exportLink( $link->url, $link->icon, $link->createdAt, $link->title );
|
||||
}
|
||||
}
|
||||
$htmlDoc .= '</DL><p>' . PHP_EOL;
|
||||
return $htmlDoc;
|
||||
}
|
||||
|
||||
private function exportLink( $url, $icon, $createdAt, $title ) {
|
||||
$htmlDoc = '<DT><A HREF="'.$url.'" ADD_DATE="'.$createdAt.'" ICON="'.$icon.'">'.$title.'</A>' . PHP_EOL;
|
||||
return $htmlDoc;
|
||||
}
|
||||
|
||||
public function share( $id = '' ) {
|
||||
$panelArray = [];
|
||||
$folders = self::$folders->byUser();
|
||||
foreach ( $folders as $key => $folder ) {
|
||||
$panel = new \stdClass();
|
||||
$folderObject = new \stdClass();
|
||||
if ( $folder->privacy == 'private' ) {
|
||||
$folderObject->privacyBadge = '<span class="mx-2 badge bg-success">Private</span>';
|
||||
$links = self::$bookmarks->publicByFolder( $folder->ID );
|
||||
} else {
|
||||
$folderObject->privacyBadge = '<span class="mx-2 badge bg-danger">Public</span>';
|
||||
$links = self::$bookmarks->byFolder( $folder->ID );
|
||||
}
|
||||
$folderObject->bookmarks = $links;
|
||||
|
||||
$folderObject->ID = $folder->ID;
|
||||
$folderObject->uuid = $folder->uuid;
|
||||
$folderObject->title = $folder->title;
|
||||
$folderObject->color = $folder->color;
|
||||
|
||||
|
||||
|
||||
$folderObject->bookmarkListRows = Views::simpleView( 'bookmarks.components.shareListRows', $folderObject->bookmarks );
|
||||
$panel->panel = Views::simpleView( 'bookmarks.components.shareListPanel', [$folderObject] );
|
||||
$panelArray[] = $panel;
|
||||
}
|
||||
return Views::view( 'bookmarks.share', $panelArray );
|
||||
}
|
||||
|
||||
public function parseBookmarks($htmlContent)
|
||||
{
|
||||
$started = false;
|
||||
@ -511,9 +649,6 @@ class Bookmarks extends Controller {
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function setFolderSelect( $folderID ) {
|
||||
$options = self::$folders->simpleByUser();
|
||||
$out = '';
|
||||
|
127
app/plugins/bookmarks/controllers/shared.php
Normal file
127
app/plugins/bookmarks/controllers/shared.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
/**
|
||||
* app/plugins/bookmarks/controllers/shared.php
|
||||
*
|
||||
* This is the bug reports controller.
|
||||
*
|
||||
* @package TP Bookmarks
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject\Controllers;
|
||||
|
||||
use TheTempusProject\Hermes\Functions\Redirect;
|
||||
use TheTempusProject\Bedrock\Functions\Session;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Classes\Controller;
|
||||
use TheTempusProject\Models\Bookmarks as Bookmark;
|
||||
use TheTempusProject\Models\Folders;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Hermes\Functions\Route as Routes;
|
||||
|
||||
class Shared extends Controller {
|
||||
protected static $bookmarks;
|
||||
protected static $folders;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
self::$bookmarks = new Bookmark;
|
||||
self::$folders = new Folders;
|
||||
self::$title = 'Bookmarks - {SITENAME}';
|
||||
self::$pageDescription = 'Add and save url bookmarks here.';
|
||||
Components::set( 'SITE_URL', Routes::getAddress() );
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$bookmarks = self::$bookmarks->noFolder();
|
||||
$folders = self::$folders->byUser();
|
||||
|
||||
$panelArray = [];
|
||||
if ( !empty( $folders ) ) {
|
||||
foreach ( $folders as $folder ) {
|
||||
$panel = new \stdClass();
|
||||
$folderObject = new \stdClass();
|
||||
$folderObject->bookmarks = self::$bookmarks->byFolder( $folder->ID );
|
||||
$folderObject->ID = $folder->ID;
|
||||
$folderObject->title = $folder->title;
|
||||
$folderObject->color = $folder->color;
|
||||
$folderObject->bookmarkListRows = Views::simpleView( 'bookmarks.components.bookmarkListRows', $folderObject->bookmarks );
|
||||
$panelArray[] = $folderObject;
|
||||
}
|
||||
}
|
||||
Components::set( 'foldersList', Views::simpleView( 'bookmarks.folders.list', $folders ) );
|
||||
Components::set( 'folderPanels', Views::simpleView( 'bookmarks.components.bookmarkListPanel', $panelArray ) );
|
||||
Components::set( 'bookmarksList', Views::simpleView( 'bookmarks.bookmarks.list', $bookmarks ) );
|
||||
return Views::view( 'bookmarks.dash' );
|
||||
}
|
||||
|
||||
public function shared( $type = '', $id = '' ) {
|
||||
if ( empty( $type ) ) {
|
||||
Session::flash( 'error', 'Unknown share' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
|
||||
if ( empty( $id ) ) {
|
||||
Session::flash( 'error', 'Unknown share' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
|
||||
$type = strtolower( $type );
|
||||
if ( ! in_array( $type, ['link','folder'] ) ) {
|
||||
Session::flash( 'error', 'Unknown share' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
|
||||
$this->$type( $id );
|
||||
}
|
||||
|
||||
public function link( $id = '' ) {
|
||||
if ( empty( $id ) ) {
|
||||
Session::flash( 'error', 'Unknown share' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
$bookmark = self::$bookmarks->findByUuid( $id );
|
||||
if ( $bookmark == false ) {
|
||||
Session::flash( 'error', 'Unknown share' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
if ( $bookmark->createdBy != App::$activeUser->ID ) {
|
||||
if ( $bookmark->privacy == 'private' ) {
|
||||
if ( empty( $bookmark->folderID ) ) {
|
||||
Session::flash( 'error', 'Unknown share' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
$folder = self::$folders->findByUuid( $bookmark->folderID );
|
||||
if ( $folder == false ) {
|
||||
Session::flash( 'error', 'Unknown share' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
if ( $folder->privacy == 'private' ) {
|
||||
Session::flash( 'error', 'Unknown share' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
}
|
||||
}
|
||||
return Views::view( 'bookmarks.shareLink', $bookmark );
|
||||
}
|
||||
|
||||
public function folder( $id = '' ) {
|
||||
if ( empty( $id ) ) {
|
||||
Session::flash( 'error', 'Unknown share' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
$folder = self::$folders->findByUuid( $id );
|
||||
if ( $folder == false ) {
|
||||
Session::flash( 'error', 'Unknown share' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
if ( $folder->privacy == 'private' ) {
|
||||
Session::flash( 'error', 'Unknown share' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
return Views::view( 'bookmarks.shareFolder', $folder );
|
||||
}
|
||||
}
|
@ -26,6 +26,7 @@ class BookmarksForms extends Forms {
|
||||
self::addHandler( 'editBookmark', __CLASS__, 'editBookmark' );
|
||||
self::addHandler( 'editFolder', __CLASS__, 'editFolder' );
|
||||
self::addHandler( 'importBookmarks', __CLASS__, 'importBookmarks' );
|
||||
self::addHandler( 'exportBookmarks', __CLASS__, 'exportBookmarks' );
|
||||
}
|
||||
|
||||
public static function createBookmark() {
|
||||
@ -141,6 +142,32 @@ class BookmarksForms extends Forms {
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function exportBookmarks() {
|
||||
if ( ! Input::exists( 'submit' ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( ! Input::exists( 'BF_' ) ) {
|
||||
return false;
|
||||
}
|
||||
// if ( ! Input::exists( 'title' ) ) {
|
||||
// Check::addUserError( 'You must include a title.' );
|
||||
// return false;
|
||||
// }
|
||||
// if ( ! Input::exists( 'color' ) ) {
|
||||
// Check::addUserError( 'You must include a color.' );
|
||||
// return false;
|
||||
// }
|
||||
// if ( ! Input::exists( 'privacy' ) ) {
|
||||
// Check::addUserError( 'You must include a privacy.' );
|
||||
// return false;
|
||||
// }
|
||||
// if ( !self::token() ) {
|
||||
// Check::addUserError( 'token - comment out later.' );
|
||||
// return false;
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
new BookmarksForms;
|
@ -62,6 +62,7 @@ class Bookmarks extends DatabaseModel {
|
||||
'color' => $color,
|
||||
'privacy' => $privacy,
|
||||
'createdBy' => $user,
|
||||
'uuid' => generateUuidV4(),
|
||||
'createdAt' => time(),
|
||||
];
|
||||
if ( !empty( $folderID ) ) {
|
||||
@ -102,6 +103,20 @@ class Bookmarks extends DatabaseModel {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function findByUuid( $id ) {
|
||||
$whereClause = ['uuid', '=', $id];
|
||||
if ( empty( $limit ) ) {
|
||||
$bookmarks = self::$db->get( $this->tableName, $whereClause );
|
||||
} else {
|
||||
$bookmarks = self::$db->get( $this->tableName, $whereClause, 'ID', 'DESC', [0, $limit] );
|
||||
}
|
||||
if ( !$bookmarks->count() ) {
|
||||
Debug::info( 'No Bookmarks found.' );
|
||||
return false;
|
||||
}
|
||||
return $this->filter( $bookmarks->first() );
|
||||
}
|
||||
|
||||
public function byUser( $limit = null ) {
|
||||
$whereClause = ['createdBy', '=', App::$activeUser->ID];
|
||||
if ( empty( $limit ) ) {
|
||||
@ -132,6 +147,21 @@ class Bookmarks extends DatabaseModel {
|
||||
return $this->filter( $bookmarks->results() );
|
||||
}
|
||||
|
||||
public function publicByFolder( $id, $limit = null ) {
|
||||
$whereClause = ['createdBy', '=', App::$activeUser->ID, 'AND'];
|
||||
$whereClause = array_merge( $whereClause, [ 'folderID', '=', $id, 'AND', 'privacy', '=', 'public' ] );
|
||||
if ( empty( $limit ) ) {
|
||||
$bookmarks = self::$db->get( $this->tableName, $whereClause );
|
||||
} else {
|
||||
$bookmarks = self::$db->get( $this->tableName, $whereClause, 'ID', 'DESC', [0, $limit] );
|
||||
}
|
||||
if ( !$bookmarks->count() ) {
|
||||
Debug::info( 'No Bookmarks found.' );
|
||||
return false;
|
||||
}
|
||||
return $this->filter( $bookmarks->results() );
|
||||
}
|
||||
|
||||
public function noFolder( $id = 0, $limit = 10 ) {
|
||||
$whereClause = ['createdBy', '=', App::$activeUser->ID, 'AND'];
|
||||
if ( !empty( $id ) ) {
|
||||
@ -318,6 +348,12 @@ class Bookmarks extends DatabaseModel {
|
||||
$instance->iconHtml = '<img src="' . $base_url . ltrim( $instance->icon, '/' ) .'" />';
|
||||
}
|
||||
}
|
||||
|
||||
if ( $instance->privacy == 'private' ) {
|
||||
$instance->privacyBadge = '<span class="mx-3 badge bg-success">Private</span>';
|
||||
} else {
|
||||
$instance->privacyBadge = '<span class="mx-3 badge bg-danger">Public</span>';
|
||||
}
|
||||
if ( empty( $instance->hiddenAt ) ) {
|
||||
$instance->hideBtn = '
|
||||
<a href="{ROOT_URL}bookmarks/hideBookmark/'.$instance->ID.'" class="btn btn-sm btn-warning">
|
||||
@ -392,6 +428,38 @@ class Bookmarks extends DatabaseModel {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function publish( $id ) {
|
||||
if ( !Check::id( $id ) ) {
|
||||
Debug::info( 'Bookmarks: illegal ID.' );
|
||||
return false;
|
||||
}
|
||||
$fields = [
|
||||
'privacy' => 'public',
|
||||
];
|
||||
if ( !self::$db->update( $this->tableName, $id, $fields ) ) {
|
||||
new CustomException( 'bookmarkUpdate' );
|
||||
Debug::error( "Bookmarks: $id not updated" );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public function retract( $id ) {
|
||||
if ( !Check::id( $id ) ) {
|
||||
Debug::info( 'Bookmarks: illegal ID.' );
|
||||
return false;
|
||||
}
|
||||
$fields = [
|
||||
'privacy' => 'private',
|
||||
];
|
||||
if ( !self::$db->update( $this->tableName, $id, $fields ) ) {
|
||||
new CustomException( 'bookmarkUpdate' );
|
||||
Debug::error( "Bookmarks: $id not updated" );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public function archive( $id ) {
|
||||
if ( !Check::id( $id ) ) {
|
||||
|
@ -56,6 +56,7 @@ class Bookmarkviews extends DatabaseModel {
|
||||
'title' => $title,
|
||||
'description' => $description,
|
||||
'privacy' => $privacy,
|
||||
'uuid' => generateUuidV4(),
|
||||
'createdBy' => App::$activeUser->ID,
|
||||
'createdAt' => time(),
|
||||
];
|
||||
|
@ -38,6 +38,20 @@ class Folders extends DatabaseModel {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function findByUuid( $id ) {
|
||||
$whereClause = ['uuid', '=', $id];
|
||||
if ( empty( $limit ) ) {
|
||||
$folders = self::$db->get( $this->tableName, $whereClause );
|
||||
} else {
|
||||
$folders = self::$db->get( $this->tableName, $whereClause, 'ID', 'DESC', [0, $limit] );
|
||||
}
|
||||
if ( !$folders->count() ) {
|
||||
Debug::info( 'No Folders found.' );
|
||||
return false;
|
||||
}
|
||||
return $this->filter( $folders->first() );
|
||||
}
|
||||
|
||||
public function create( $title, $folderID = 0, $description = '', $color = 'default', $privacy = 'private', $user = null ) {
|
||||
if ( empty( $user ) ) {
|
||||
$user = App::$activeUser->ID;
|
||||
@ -51,6 +65,7 @@ class Folders extends DatabaseModel {
|
||||
'description' => $description,
|
||||
'color' => $color,
|
||||
'privacy' => $privacy,
|
||||
'uuid' => generateUuidV4(),
|
||||
'createdBy' => $user,
|
||||
'createdAt' => time(),
|
||||
];
|
||||
|
@ -1,19 +1,3 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="container py-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
@ -109,12 +93,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
45
app/plugins/bookmarks/views/components/shareListPanel.html
Normal file
45
app/plugins/bookmarks/views/components/shareListPanel.html
Normal file
@ -0,0 +1,45 @@
|
||||
{LOOP}
|
||||
<div class="col-xlg-6 col-lg-6 col-md-6 col-sm-6 bookmark-card">
|
||||
<div class="card m-3 accordion">
|
||||
<div class="accordion-item">
|
||||
<div class="card-header accordion-header bg-{color} context-main" data-bs-target="#Collapse{ID}" data-bs-toggle="collapse" aria-expanded="true" aria-controls="Collapse{ID}">
|
||||
{title}{privacyBadge}
|
||||
<a class="btn btn-sm btn-primary float-end" data-bs-toggle="modal" data-bs-target="#linkShare{ID}">
|
||||
<i class="fa fa-fw fa-share"></i>
|
||||
</a>
|
||||
<div class="modal fade" id="linkShare{ID}" tabindex="-1" style="display: none;" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="exampleModalCenteredScrollableTitle">Modal title</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="text" value="{SITE_URL}shared/folder/{uuid}" name="input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="Collapse{ID}" class="accordion-collapse collapse show" style="width:100%; position: relative;">
|
||||
<div class="card-body accordion-body context-other-bg p-2">
|
||||
<ul class="list-group">
|
||||
{bookmarkListRows}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-footer d-flex justify-content-center align-items-center context-main-bg">
|
||||
<span class="ms-auto">
|
||||
<a href="{ROOT_URL}bookmarks/bookmarks/{ID}" class="btn btn-sm btn-primary"><i class="fa fa-fw fa-list"></i></a>
|
||||
<a href="{ROOT_URL}bookmarks/folders/{ID}" class="btn btn-sm btn-primary"><i class="fa fa-fw fa-info-circle"></i></a></td>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<div class="col-xlg-6 col-lg-6 col-md-6 col-sm-6">
|
||||
<p>no folders</p>
|
||||
</div>
|
||||
{/ALT}
|
30
app/plugins/bookmarks/views/components/shareListRows.html
Normal file
30
app/plugins/bookmarks/views/components/shareListRows.html
Normal file
@ -0,0 +1,30 @@
|
||||
{LOOP}
|
||||
<li class="list-group-item mb-1 context-main-b bg-{color}">
|
||||
<a href="{ROOT_URL}bookmarks/bookmark/{ID}" class="context-main">{iconHtml}</a>
|
||||
<a href="{url}"> {title}</a>{privacyBadge}
|
||||
<span class="float-end">
|
||||
<a href="{ROOT_URL}bookmarks/retract/{ID}" class="btn btn-sm btn-success"><i class="fa fa-fw fa-eye"></i></a>
|
||||
<a class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#linkShare{ID}">
|
||||
<i class="fa fa-fw fa-share"></i>
|
||||
</a>
|
||||
<div class="modal fade" id="linkShare{ID}" tabindex="-1" style="display: none;" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="exampleModalCenteredScrollableTitle">Modal title</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="text" value="{SITE_URL}shared/link/{uuid}" name="input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</li>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<li class="list-group-item py-1">
|
||||
<p class="list-group text-center">No Bookmarks</p>
|
||||
</li>
|
||||
{/ALT}
|
48
app/plugins/bookmarks/views/export.html
Normal file
48
app/plugins/bookmarks/views/export.html
Normal file
@ -0,0 +1,48 @@
|
||||
<div class="mb-4 mt-4">
|
||||
<div class="offset-md-1 col-10 py-3 context-main-bg">
|
||||
<legend class="text-center">Bookmark Export</legend>
|
||||
<hr>
|
||||
<h3 class="text-center text-muted">Select which folders to include in the export.</h3>
|
||||
<div class="row g-3 col-4 offset-4" data-masonry='{ "percentPosition": false }' id="bookmarkSort">
|
||||
<form action="" method="post">
|
||||
<table class="table context-main">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center" style="width: 80%">Title</th>
|
||||
<th style="width: 20%">
|
||||
<input type="checkbox" onchange="checkAll(this)" name="check.g" value="BF_[]"/>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="">
|
||||
<tr>
|
||||
<td class="text-center">Unsorted</td>
|
||||
<td>
|
||||
<input type="checkbox" value="unsorted" name="BF_[]">
|
||||
</td>
|
||||
</tr>
|
||||
{LOOP}
|
||||
<tr>
|
||||
<td class="text-center">{prettyTitle}</td>
|
||||
<td>
|
||||
<input type="checkbox" value="{ID}" name="BF_[]">
|
||||
</td>
|
||||
</tr>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<tr>
|
||||
<td class="text-center context-main" colspan="7">
|
||||
No Folders To Export
|
||||
</td>
|
||||
</tr>
|
||||
{/ALT}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<p>Literally every browser is chromium based now, so they all have a standard import/export.</p>
|
||||
<button type="submit" name="submit" value="submit" class="btn btn-primary btn-lg">Create Export</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
@ -1,8 +1,6 @@
|
||||
<div class="row">
|
||||
<div class="offset-md-2 col-8 py-3 context-main-bg mt-4">
|
||||
<div class="text-center">
|
||||
<legend class="">Folders List</legend>
|
||||
</div>
|
||||
{foldersList}
|
||||
<div class="offset-md-2 col-8 py-3 context-main-bg mt-4">
|
||||
<div class="text-center">
|
||||
<legend class="">Folders List</legend>
|
||||
</div>
|
||||
{foldersList}
|
||||
</div>
|
@ -1,13 +1,3 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="container py-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
@ -68,12 +58,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
@ -1,18 +1,15 @@
|
||||
<div class="col-4 offset-md-4 py-3">
|
||||
<legend class="">Import Bookmarks</legend>
|
||||
<form action="" method="post" enctype="multipart/form-data" class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="bookmark_file" class="col-lg-3 control-label">Export file (.html):</label>
|
||||
<div class="col-lg-3">
|
||||
<div class="mb-4 mt-4">
|
||||
<div class="offset-md-1 col-10 py-3 context-main-bg">
|
||||
<legend class="text-center">Import Bookmarks</legend>
|
||||
<hr>
|
||||
<div class="offset-3 col-lg-6 my-4">
|
||||
<form action="" method="post" enctype="multipart/form-data" class="text-center">
|
||||
<label for="bookmark_file" class="col-lg-3 control-label">Import file (.html):</label>
|
||||
<input type="file" name="bookmark_file" id="bookmark_file" accept=".html">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="submit" class="col-lg-3 control-label"></label>
|
||||
<div class="col-lg-3">
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary center-block ">Import</button>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<button type="submit" name="submit" value="submit" class="btn btn-primary btn-lg center-block">Import</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
@ -2,5 +2,7 @@
|
||||
<li class="nav-item context-main-bg mx-1"><a href="{ROOT_URL}bookmarks/index/" class="nav-link">Dashboard</a></li>
|
||||
<li class="nav-item context-main-bg mx-1"><a href="{ROOT_URL}bookmarks/folders/" class="nav-link">Folders</a></li>
|
||||
<li class="nav-item context-main-bg mx-1"><a href="{ROOT_URL}bookmarks/import/" class="nav-link">Import</a></li>
|
||||
<li class="nav-item context-main-bg mx-1"><a href="{ROOT_URL}bookmarks/export/" class="nav-link">Export</a></li>
|
||||
<li class="nav-item context-main-bg mx-1"><a href="{ROOT_URL}bookmarks/share/" class="nav-link">Share</a></li>
|
||||
</ul>
|
||||
{userFolderTabs}
|
19
app/plugins/bookmarks/views/share.html
Normal file
19
app/plugins/bookmarks/views/share.html
Normal file
@ -0,0 +1,19 @@
|
||||
<div class="mb-4 mt-4">
|
||||
<div class="offset-md-1 col-10 py-3 context-main-bg">
|
||||
<legend class="text-center">Share</legend>
|
||||
<hr>
|
||||
<div class="offset-3 col-lg-6 my-4">
|
||||
<p>Any link or folder can be shared. By default, the extensions and app both default to <strong>private</strong>. On this page, you can quickly see a list of any public links and folders. These "public" items can be shared with anyone who has the link.</p>
|
||||
</div>
|
||||
{LOOP}
|
||||
<div class="col-6 col-md-12">
|
||||
{panel}
|
||||
</div>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<div class="col-12">
|
||||
<p class="text-center">No <strong>public</strong> folders found.</p>
|
||||
</div>
|
||||
{/ALT}
|
||||
</div>
|
||||
</div>
|
48
app/plugins/bookmarks/views/shareFolder.html
Normal file
48
app/plugins/bookmarks/views/shareFolder.html
Normal file
@ -0,0 +1,48 @@
|
||||
<div class="container py-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card shadow">
|
||||
<!-- Card Header -->
|
||||
<div class="card-header text-center bg-dark text-white">
|
||||
<h3 class="card-title mb-0">Bookmark Folder</h3>
|
||||
</div>
|
||||
|
||||
<!-- Card Body -->
|
||||
<div class="card-body">
|
||||
<div class="row align-items-center">
|
||||
|
||||
<!-- User Details -->
|
||||
<div class="offset-md-2 col-md-8">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">Title:</th>
|
||||
<td>{title}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Privacy:</th>
|
||||
<td>{privacy}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Color:</th>
|
||||
<td>{color}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Created:</th>
|
||||
<td>{DTC}{createdAt}{/DTC}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" colspan="2">Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">{description}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
83
app/plugins/bookmarks/views/shareLink.html
Normal file
83
app/plugins/bookmarks/views/shareLink.html
Normal file
@ -0,0 +1,83 @@
|
||||
<div class="container py-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card shadow">
|
||||
<!-- Card Header -->
|
||||
<div class="card-header text-center bg-dark text-white">
|
||||
<h3 class="card-title mb-0">Bookmark</h3>
|
||||
</div>
|
||||
|
||||
<!-- Card Body -->
|
||||
<div class="card-body">
|
||||
<div class="row align-items-center">
|
||||
|
||||
<!-- User Details -->
|
||||
<div class="offset-md-2 col-md-8">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">Title:</th>
|
||||
<td>{title}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">URL:</th>
|
||||
<td>{url}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Type:</th>
|
||||
<td>{linkType}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Privacy:</th>
|
||||
<td>{privacy}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Color:</th>
|
||||
<td>{color}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Created:</th>
|
||||
<td>{DTC}{createdAt}{/DTC}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Archived:</th>
|
||||
<td>{DTC}{archivedAt}{/DTC}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Hidden:</th>
|
||||
<td>{DTC}{hiddenAt}{/DTC}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Last Refreshed:</th>
|
||||
<td>{DTC}{refreshedAt}{/DTC}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" colspan="2">Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">{description}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" colspan="2">Icon</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">{iconHtml}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">{icon}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" colspan="2">Meta</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">{meta}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -30,42 +30,46 @@ use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
use TheTempusProject\Bedrock\Functions\Hash;
|
||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||
use Stripe\StripeClient;
|
||||
|
||||
class Member extends Controller {
|
||||
public static $customers;
|
||||
public static $products;
|
||||
public static $stripe;
|
||||
private static $loaded = false;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
Template::noIndex();
|
||||
$api_key = Config::getValue( 'memberships/stripeSecret' );
|
||||
self::$customers = new MembershipCustomers;
|
||||
self::$products = new MembershipProducts;
|
||||
|
||||
if ( ! self::$loaded ) {
|
||||
Template::noIndex();
|
||||
self::$customers = new MembershipCustomers;
|
||||
self::$products = new MembershipProducts;
|
||||
$api_key = Config::getValue( 'memberships/stripeSecret' );
|
||||
if ( $api_key == 'sk_xxxxxxxxxxxxxxx' || empty($api_key) ) {
|
||||
Debug::error( "Memberships:__construct No Stripe Key found" );
|
||||
} else {
|
||||
self::$stripe = new StripeClient( $api_key );
|
||||
}
|
||||
self::$loaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$this->confirmAuth();
|
||||
self::$title = 'Members Area';
|
||||
if ( !App::$isMember ) {
|
||||
Session::flash( 'error', 'You do not have permission to view this page.' );
|
||||
return Redirect::home();
|
||||
}
|
||||
Views::view( 'members.members' );
|
||||
}
|
||||
|
||||
public function managepayment( $id = null ) {
|
||||
|
||||
|
||||
|
||||
$api_key = Config::getValue( 'memberships/stripeSecret' );
|
||||
$stripe = new \Stripe\StripeClient( $api_key );
|
||||
|
||||
$customer = self::$customers->findOrCreate( App::$activeUser->ID );
|
||||
$this->confirmAuth();
|
||||
$customer = self::$customers->findByUserID( App::$activeUser->ID );
|
||||
if ( empty( $customer ) ) {
|
||||
Session::flash( 'error', 'You do not have any active payment methods. You can subscribe by going <a href="/member/join/1">here</a>' );
|
||||
return Redirect::to( 'member/manage' );
|
||||
}
|
||||
try {
|
||||
$session = $stripe->billingPortal->sessions->create([
|
||||
$session = self::$stripe->billingPortal->sessions->create([
|
||||
'customer' => $customer,
|
||||
'return_url' => Routes::getAddress() . 'member/manage',
|
||||
]);
|
||||
@ -76,21 +80,14 @@ class Member extends Controller {
|
||||
return Redirect::to( 'member/manage' );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
header('Location: ' . $session->url);
|
||||
exit;
|
||||
}
|
||||
|
||||
public function cancelconfirm( $id = null ) {
|
||||
$this->confirmAuth();
|
||||
$memberships = new Memberships;
|
||||
$result = $memberships->cancel( $id );
|
||||
// dv( $result );
|
||||
if ( ! empty( $result ) ) {
|
||||
Session::flash( 'success', 'Your Membership has been paused.' );
|
||||
Redirect::to( 'member/manage' );
|
||||
@ -101,9 +98,9 @@ class Member extends Controller {
|
||||
}
|
||||
|
||||
public function pauseconfirm( $id = null ) {
|
||||
$this->confirmAuth();
|
||||
$memberships = new Memberships;
|
||||
$result = $memberships->cancel( $id );
|
||||
// dv( $result );
|
||||
if ( ! empty( $result ) ) {
|
||||
Session::flash( 'success', 'Your Membership has been paused.' );
|
||||
Redirect::to( 'member/manage' );
|
||||
@ -114,42 +111,64 @@ class Member extends Controller {
|
||||
}
|
||||
|
||||
public function pause( $id = null ) {
|
||||
$this->confirmAuth();
|
||||
self::$title = 'pause Membership';
|
||||
Components::set( 'pauseid', $id );
|
||||
Views::view( 'members.pause' );
|
||||
}
|
||||
|
||||
public function resume( $id = null ) {
|
||||
$this->confirmAuth();
|
||||
self::$title = 'resume Membership';
|
||||
Views::view( 'members.resume' );
|
||||
}
|
||||
|
||||
public function cancel( $id = null ) {
|
||||
$this->confirmAuth();
|
||||
self::$title = 'Cancel Membership';
|
||||
Components::set( 'cancelid', $id );
|
||||
Views::view( 'members.cancel' );
|
||||
}
|
||||
|
||||
public function manage( $id = null ) {
|
||||
if ( ! App::$isLoggedIn ) {
|
||||
Session::flash( 'error', 'You do not have permission to access this page.' );
|
||||
return Redirect::home();
|
||||
}
|
||||
self::$title = 'Manage Membership';
|
||||
|
||||
|
||||
$menu = Views::simpleView( 'nav.usercp', App::$userCPlinks );
|
||||
Navigation::activePageSelect( $menu, null, true, true );
|
||||
|
||||
|
||||
$memberships = new Memberships;
|
||||
$userMemberships = $memberships->getUserSubs();
|
||||
|
||||
Views::view( 'members.manage', $userMemberships );
|
||||
}
|
||||
|
||||
|
||||
public function upgrade( $id = null ) {
|
||||
if ( ! App::$isLoggedIn ) {
|
||||
Session::flash( 'error', 'You do not have permission to access this page.' );
|
||||
return Redirect::home();
|
||||
}
|
||||
self::$title = 'Upgrade Membership';
|
||||
Views::view( 'members.upgrade' );
|
||||
}
|
||||
|
||||
public function join( $id = null ) {
|
||||
public function join( $plan = 'monthly' ) {
|
||||
if ( ! App::$isLoggedIn ) {
|
||||
Session::flash( 'error', 'You do not have permission to access this page.' );
|
||||
return Redirect::home();
|
||||
}
|
||||
$plan = strtolower( $plan );
|
||||
if ( ! in_array( $plan, ['monthly','yearly'] ) ) {
|
||||
Session::flash( 'error', 'Unknown plan' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
|
||||
self::$title = 'Join {SIITENAME}!';
|
||||
$product = self::$products->findById( $id );
|
||||
$stripePrice = $this->findPrice( $plan );
|
||||
|
||||
$product = self::$products->findByPriceID( $stripePrice );
|
||||
if ( empty( $product ) ) {
|
||||
Session::flash( 'success', 'We aren\'t currently accepting new members, please check back soon!' );
|
||||
return Redirect::home();
|
||||
@ -157,92 +176,50 @@ class Member extends Controller {
|
||||
Views::view( 'members.landing1', $product );
|
||||
}
|
||||
|
||||
public function getyearly( $id = null ) {
|
||||
if ( empty( $id ) ) {
|
||||
Issues::add( 'error', 'no id' );
|
||||
return $this->index();
|
||||
}
|
||||
$product = self::$products->findById( $id );
|
||||
if ( empty( $product ) ) {
|
||||
Issues::add( 'error', 'no product' );
|
||||
return $this->index();
|
||||
public function checkout( $plan = 'monthly' ) {
|
||||
if ( ! App::$isLoggedIn ) {
|
||||
Session::flash( 'error', 'You do not have permission to access this page.' );
|
||||
return Redirect::home();
|
||||
}
|
||||
$customer = self::$customers->findOrCreate( App::$activeUser->ID );
|
||||
if ( empty( $customer ) ) {
|
||||
Issues::add( 'error', 'no customer' );
|
||||
return $this->index();
|
||||
}
|
||||
$stripePrice = $this->findPrice( $plan );
|
||||
|
||||
self::$title = 'Purchase';
|
||||
$price = $product->stripe_price_yearly;
|
||||
$api_key = Config::getValue( 'memberships/stripeSecret' );
|
||||
$stripe = new \Stripe\StripeClient( $api_key );
|
||||
$session = $stripe->checkout->sessions->create([
|
||||
$session = self::$stripe->checkout->sessions->create([
|
||||
'payment_method_types' => ['card'],
|
||||
'customer' => $customer,
|
||||
'line_items' => [[
|
||||
'price' => $price,
|
||||
'price' => $stripePrice,
|
||||
'quantity' => 1,
|
||||
]],
|
||||
'mode' => 'subscription',
|
||||
'success_url' => Routes::getAddress() . 'member/paymentcomplete?session_id={CHECKOUT_SESSION_ID}',
|
||||
'cancel_url' => Routes::getAddress() . 'member/paymentcanceled',
|
||||
'success_url' => Routes::getAddress() . 'member/payment/complete?session_id={CHECKOUT_SESSION_ID}',
|
||||
'cancel_url' => Routes::getAddress() . 'member/payment/cancel',
|
||||
]);
|
||||
header('Location: ' . $session->url);
|
||||
exit;
|
||||
}
|
||||
|
||||
public function getmonthly( $id = null ) {
|
||||
if ( empty( $id ) ) {
|
||||
Issues::add( 'error', 'no id' );
|
||||
return $this->index();
|
||||
}
|
||||
$product = self::$products->findById( $id );
|
||||
if ( empty( $product ) ) {
|
||||
Issues::add( 'error', 'no product' );
|
||||
return $this->index();
|
||||
}
|
||||
$customer = self::$customers->findOrCreate( App::$activeUser->ID );
|
||||
if ( empty( $customer ) ) {
|
||||
Issues::add( 'error', 'no customer' );
|
||||
return $this->index();
|
||||
public function payment( $type = '' ) {
|
||||
$type = strtolower( $type );
|
||||
if ( ! in_array( $type, ['cancel','complete'] ) ) {
|
||||
Session::flash( 'error', 'Unknown Payment' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
|
||||
self::$title = 'Purchase';
|
||||
$price = $product->stripe_price_monthly;
|
||||
$api_key = Config::getValue( 'memberships/stripeSecret' );
|
||||
$stripe = new \Stripe\StripeClient( $api_key );
|
||||
$session = $stripe->checkout->sessions->create([
|
||||
'payment_method_types' => ['card'],
|
||||
'customer' => $customer,
|
||||
'line_items' => [[
|
||||
'price' => $price,
|
||||
'quantity' => 1,
|
||||
]],
|
||||
'mode' => 'subscription',
|
||||
'success_url' => Routes::getAddress() . 'member/paymentcomplete?session_id={CHECKOUT_SESSION_ID}',
|
||||
'cancel_url' => Routes::getAddress() . 'member/paymentcanceled',
|
||||
]);
|
||||
header('Location: ' . $session->url);
|
||||
exit;
|
||||
}
|
||||
|
||||
public function paymentcanceled() {
|
||||
self::$title = '(almost) Members Area';
|
||||
Views::view( 'members.paymentcanceled' );
|
||||
}
|
||||
if ( $type == 'cancel' ) {
|
||||
self::$title = '(almost) Members Area';
|
||||
return Views::view( 'members.paymentcanceled' );
|
||||
}
|
||||
|
||||
public function paymentcomplete() {
|
||||
self::$title = '(almost) Members Area';
|
||||
Views::view( 'members.paymentcomplete' );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// This combines a registration with a checkout
|
||||
public function signup( $plan = 'monthly' ) {
|
||||
$plan = strtolower( $plan );
|
||||
if ( ! in_array( $plan, ['monthly','yearly'] ) ) {
|
||||
@ -255,11 +232,10 @@ class Member extends Controller {
|
||||
Session::flash( 'error', 'Unknown product' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
|
||||
$stripePrice = $this->findPrice( $plan );
|
||||
|
||||
$index = 'stripe_price_' . $plan;
|
||||
$pretty = 'prettyPrice' . ucfirst( $plan );
|
||||
|
||||
$stripePrice = $product->$index;
|
||||
$prettyPrice = $product->$pretty;
|
||||
|
||||
self::$title = 'Sign up for {SITENAME} ' . ucfirst( $plan );
|
||||
@ -267,17 +243,21 @@ class Member extends Controller {
|
||||
Components::set( 'planName', ucfirst( $plan ) );
|
||||
Components::set( 'prettyPrice', $prettyPrice );
|
||||
Components::set( 'TERMS', Views::simpleView( 'terms' ) );
|
||||
|
||||
if ( App::$isLoggedIn ) {
|
||||
Session::flash( 'notice', 'You are already logged in, were you looking for information on <a href="#">Upgrading</a>?' );
|
||||
Session::flash( 'notice', 'You are already logged in, you can <a href="/member/join">subscribe here</a>, or <a href="/member/upgrade">upgrade here</a>.' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
|
||||
if ( !Input::exists() ) {
|
||||
return Views::view( 'members.register' );
|
||||
}
|
||||
|
||||
if ( ! Forms::check( 'register' ) ) {
|
||||
Issues::add( 'error', [ 'There was an error with your registration.' => Check::userErrors() ] );
|
||||
return Views::view( 'members.register' );
|
||||
}
|
||||
|
||||
self::$user->create( [
|
||||
'username' => Input::post( 'username' ),
|
||||
'password' => Hash::make( Input::post( 'password' ) ),
|
||||
@ -297,10 +277,7 @@ class Member extends Controller {
|
||||
Session::flash( 'error', 'Thank you for registering! Unfortunately, there was an issue communicating with Stripe and we can\'t collect payment right now.' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
|
||||
$api_key = Config::getValue( 'memberships/stripeSecret' );
|
||||
$stripe = new \Stripe\StripeClient( $api_key );
|
||||
$session = $stripe->checkout->sessions->create([
|
||||
$session = self::$stripe->checkout->sessions->create([
|
||||
'payment_method_types' => ['card'],
|
||||
'customer' => $customer,
|
||||
'line_items' => [[
|
||||
@ -308,10 +285,34 @@ class Member extends Controller {
|
||||
'quantity' => 1,
|
||||
]],
|
||||
'mode' => 'subscription',
|
||||
'success_url' => Routes::getAddress() . 'member/paymentcomplete?session_id={CHECKOUT_SESSION_ID}',
|
||||
'cancel_url' => Routes::getAddress() . 'member/paymentcanceled',
|
||||
'success_url' => Routes::getAddress() . 'member/payment/complete?session_id={CHECKOUT_SESSION_ID}',
|
||||
'cancel_url' => Routes::getAddress() . 'member/payment/cancel',
|
||||
]);
|
||||
header('Location: ' . $session->url);
|
||||
exit;
|
||||
}
|
||||
|
||||
private function findPrice( $plan ) {
|
||||
$plan = strtolower( $plan );
|
||||
if ( ! in_array( $plan, ['monthly','yearly'] ) ) {
|
||||
Session::flash( 'error', 'Unknown plan' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
|
||||
$product = self::$products->mainProduct();
|
||||
if ( empty( $product ) ) {
|
||||
Session::flash( 'error', 'Unknown product' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
$index = 'stripe_price_' . $plan;
|
||||
$stripePrice = $product->$index;
|
||||
return $stripePrice;
|
||||
}
|
||||
|
||||
private function confirmAuth() {
|
||||
if ( ! App::$isLoggedIn || ! App::$isMember ) {
|
||||
Session::flash( 'error', 'You do not have permission to access this page.' );
|
||||
return Redirect::home();
|
||||
}
|
||||
}
|
||||
}
|
@ -49,8 +49,6 @@ class Memberships extends DatabaseModel {
|
||||
}
|
||||
self::$loaded = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function filter( $postArray, $params = [] ) {
|
||||
|
@ -18,6 +18,7 @@ use Stripe\StripeClient;
|
||||
use TheTempusProject\Bedrock\Classes\Config;
|
||||
use TheTempusProject\Hermes\Functions\Route as Routes;
|
||||
use TheTempusProject\Models\Memberships;
|
||||
use TheTempusProject\Models\MembershipProducts as Products;
|
||||
|
||||
class Members extends Plugin {
|
||||
public static $stripe;
|
||||
@ -42,7 +43,7 @@ class Members extends Plugin {
|
||||
];
|
||||
public $admin_links = [
|
||||
[
|
||||
'text' => '<i class="fa fa-fw fa-arrows-v"></i> Memberships',
|
||||
'text' => '<i class="fa fa-fw fa-arrow-down"></i> Memberships',
|
||||
'url' => [
|
||||
[
|
||||
'text' => '<i class="fa fa-fw fa-database"></i> Products',
|
||||
@ -60,15 +61,20 @@ class Members extends Plugin {
|
||||
],
|
||||
];
|
||||
public $main_links = [
|
||||
// [
|
||||
// 'text' => 'Members',
|
||||
// 'url' => '{ROOT_URL}member/index',
|
||||
// 'filter' => 'member',
|
||||
// ],
|
||||
[
|
||||
'text' => 'Members',
|
||||
'url' => '{ROOT_URL}member/index',
|
||||
'filter' => 'member',
|
||||
'text' => 'Subscribe',
|
||||
'url' => '{ROOT_URL}member/join',
|
||||
'filter' => 'nonmember',
|
||||
],
|
||||
[
|
||||
'text' => 'Become a Member',
|
||||
'url' => '{ROOT_URL}member/join/1',
|
||||
'filter' => 'nonmember',
|
||||
'text' => 'Upgrade',
|
||||
'url' => '{ROOT_URL}member/upgrade',
|
||||
'filter' => 'upgrade',
|
||||
],
|
||||
];
|
||||
public $resourceMatrix = [
|
||||
@ -129,7 +135,13 @@ class Members extends Plugin {
|
||||
$this->filters[] = [
|
||||
'name' => 'nonmember',
|
||||
'find' => '#{NONMEMBER}(.*?){/NONMEMBER}#is',
|
||||
'replace' => ( App::$isLoggedIn && ! App::$isMember ? '$1' : '' ),
|
||||
'replace' => ( App::$isLoggedIn && App::$isMember == false ? '$1' : '' ),
|
||||
'enabled' => true,
|
||||
];
|
||||
$this->filters[] = [
|
||||
'name' => 'upgrade',
|
||||
'find' => '#{UPGRADE}(.*?){/UPGRADE}#is',
|
||||
'replace' => ( App::$isLoggedIn && ( App::$isMember === 'monthly' ) ? '$1' : '' ),
|
||||
'enabled' => true,
|
||||
];
|
||||
$api_key = Config::getValue( 'memberships/stripeSecret' );
|
||||
@ -147,14 +159,20 @@ class Members extends Plugin {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function userHasActiveMembership( $user_id ) {
|
||||
self::$memberships = new Memberships;
|
||||
$membership = self::$memberships->findActiveByUserID( $user_id );
|
||||
$memberships = new Memberships;
|
||||
$membership = $memberships->findActiveByUserID( $user_id );
|
||||
if ( empty( $membership ) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
$products = new Products;
|
||||
$product = $products->findByPriceID( $membership->subscription_price_id );
|
||||
if ( $product->stripe_price_monthly == $membership->subscription_price_id ) {
|
||||
return 'monthly';
|
||||
}
|
||||
return 'yearly';
|
||||
}
|
||||
|
||||
public static function webhookSetup() {
|
||||
|
@ -1,62 +1,128 @@
|
||||
<section id="features" class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<h3>Organize Your Bookmarks</h3>
|
||||
<p>Keep all your bookmarks organized with custom categories and tags.</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>Import and Export</h3>
|
||||
<p>Seamlessly import and export your bookmarks (paid plans).</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>Accessible Anywhere</h3>
|
||||
<p>Your bookmarks are securely stored and accessible from any device.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="pricing" class="text-center bg-light-gray" style="padding-top: 30px;">
|
||||
<div class="container">
|
||||
<h2>Pricing</h2>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3>Free</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>Basic bookmark storage</p>
|
||||
<p>No import/export</p>
|
||||
<p>Completely free</p>
|
||||
<a href="{ROOT_URL}member/getmonthly/{ID}" class="btn btn-success">Sign Up</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="card">
|
||||
<div class="card-header bg-primary">
|
||||
<h3>{name} Monthly</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>Import/export bookmarks</p>
|
||||
<p>Advanced curation tools</p>
|
||||
<p>{prettyPriceMonthly}/month</p>
|
||||
<a href="{ROOT_URL}member/getmonthly/{ID}" class="btn btn-primary">Sign Up</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="card">
|
||||
<div class="card-header bg-primary">
|
||||
<h3>{name} Yearly</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>Save with annual billing</p>
|
||||
<p>All features included</p>
|
||||
<p>{prettyPriceYearly}/year</p>
|
||||
<a href="{ROOT_URL}member/getyearly/{ID}" class="btn btn-primary">Sign Up</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- Compare plans -->
|
||||
<div class="table-responsive pricing-container container pb-4" id="compare">
|
||||
<h1 class="display-6 text-center my-4">Compare plans</h1>
|
||||
<table class="table text-center context-main">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 34%;"></th>
|
||||
<th style="width: 22%;">Free</th>
|
||||
<th style="width: 22%;">Pro</th>
|
||||
<th style="width: 22%;">Enterprise</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row" class="text-start">Add and Manage Bookmarks</th>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" class="text-start">Extensions for all major browsers</th>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row" class="text-start">Access from any device</th>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" class="text-start">Import/Export Features</th>
|
||||
<td></td>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" class="text-start">Customizable Dashboards / Pages</th>
|
||||
<td></td>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" class="text-start">Request/Influence Development</th>
|
||||
<td></td>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" class="text-start">Early Access</th>
|
||||
<td></td>
|
||||
<td><i class="fa fa-fw fa-check"></i></td>
|
||||
<td><i class="fa-solid fa-check"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" class="text-start">Cheaper</th>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><i class="fa-solid fa-check"></i></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="b-example-divider"></div>
|
||||
|
||||
<!-- Plan Choices -->
|
||||
<div class="d-flex justify-content-center" id="pricing">
|
||||
<div class="pricing-container container row row-cols-1 row-cols-md-3 my-5 text-center">
|
||||
<div class="col">
|
||||
<div class="card mb-4 rounded-3 shadow-sm h-100 context-main-bg">
|
||||
<div class="card-header py-3">
|
||||
<h4 class="my-0 fw-normal">Free</h4>
|
||||
</div>
|
||||
<div class="card-body d-flex flex-column">
|
||||
<h1 class="card-title pricing-card-title">$0<small class="text-muted fw-light">/mo</small></h1>
|
||||
<ul class="list-unstyled mt-3 mb-4">
|
||||
<li>Add / Manage your bookmarks</li>
|
||||
<li>Extensions for all major browsers</li>
|
||||
<li>Access from any device</li>
|
||||
</ul>
|
||||
<a href="/register" class="mt-auto w-100 btn btn-lg btn-outline-primary">
|
||||
Sign-Up for Free
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="card mb-4 rounded-3 shadow-sm h-100 context-main-bg">
|
||||
<div class="card-header py-3">
|
||||
<h4 class="my-0 fw-normal">Monthly</h4>
|
||||
</div>
|
||||
<div class="card-body d-flex flex-column">
|
||||
<h1 class="card-title pricing-card-title">$4.99<small class="text-muted fw-light">/month</small></h1>
|
||||
<ul class="list-unstyled mt-3 mb-4">
|
||||
<li>Import/Export Features</li>
|
||||
<li>Integration with TempusTools App (WIP)</li>
|
||||
<li>Customizable Dashboards / Pages</li>
|
||||
<li>Direct control of Feature Development</li>
|
||||
<li>Early Access to new features</li>
|
||||
</ul>
|
||||
<a href="/member/checkout/monthly" class="mt-auto w-100 btn btn-lg btn-primary">
|
||||
Get started
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="card mb-4 rounded-3 shadow-sm border-primary h-100 context-main-bg">
|
||||
<div class="card-header py-3 text-bg-primary border-primary">
|
||||
<h4 class="my-0 fw-normal">Yearly</h4>
|
||||
</div>
|
||||
<div class="card-body d-flex flex-column">
|
||||
<h1 class="card-title pricing-card-title">$19.99<small class="text-muted fw-light">/year</small></h1>
|
||||
<ul class="list-unstyled mt-3 mb-4">
|
||||
<li>Its cheaper if you like the product</li>
|
||||
</ul>
|
||||
<a href="/member/checkout/yearly" class="mt-auto w-100 btn btn-lg btn-primary">
|
||||
Get started
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -20,7 +20,7 @@
|
||||
<div class="card-body">
|
||||
<p>{prettyPriceMonthly}/month</p>
|
||||
<p>All pro features unlocked</p>
|
||||
<a href="{ROOT_URL}member/getmonthly/{ID}" class="btn btn-success btn-block">Get Started</a>
|
||||
<a href="{ROOT_URL}member/checkout/monthly" class="btn btn-success btn-block">Get Started</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -30,7 +30,7 @@
|
||||
<div class="card-body">
|
||||
<p>{prettyPriceYearly}/year</p>
|
||||
<p>Save {prettySavings} annually!</p>
|
||||
<a href="{ROOT_URL}member/getyearly/{ID}" class="btn btn-info btn-block">Sign Up</a>
|
||||
<a href="{ROOT_URL}member/checkout/yearly" class="btn btn-info btn-block">Sign Up</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,27 +1,24 @@
|
||||
<div class="container">
|
||||
<div class="col-8 mx-auto p-4 rounded shadow-sm mb-5 context-main-bg mt-4 text-center">
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2 text-center">
|
||||
<h2>Upgrade to a Yearly Plan</h2>
|
||||
<h2 class="text-primary mb-4">Upgrade to a Yearly Plan</h2>
|
||||
<p class="lead">
|
||||
Save more and enjoy uninterrupted access to all features with our yearly plan!
|
||||
Save more and enjoy uninterrupted access to all features with our yearly plan!
|
||||
</p>
|
||||
<p>
|
||||
Upgrading now means you'll save <strong>X%</strong> compared to the monthly plan.
|
||||
Stay committed and make the most of our service.
|
||||
Upgrading now means you'll save <strong> nearly $40 a year</strong> compared to the monthly plan.
|
||||
Stay committed and make the most of our service.
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<button class="btn btn-lg btn-success btn-block">
|
||||
Upgrade to Yearly
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<button class="btn btn-lg btn-primary btn-block">
|
||||
Stay on Monthly
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<a href="/member/checkout/yearly" class="btn btn-lg btn-success btn-block">
|
||||
Upgrade to Yearly
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<a href="/member/upgrade" class="btn btn-lg btn-primary btn-block">
|
||||
Stay on Monthly
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
@ -1,18 +1,20 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-sm-12 blog-main">
|
||||
<div class="blog-post">
|
||||
<h2 class="blog-post-title">{title}</h2>
|
||||
<hr>
|
||||
<p class="blog-post-meta">{DTC date}{suggestedOn}{/DTC} by <a href="{ROOT_URL}home/profile/{author}">{submittedBy}</a></p>
|
||||
{suggestion}
|
||||
{ADMIN}
|
||||
<div class="col-8 mx-auto p-4 rounded shadow-sm mb-5 context-main-bg mt-4">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-sm-12 blog-main">
|
||||
<div class="blog-post">
|
||||
<h2 class="blog-post-title">{title}</h2>
|
||||
<hr>
|
||||
<a href="{ROOT_URL}admin/suggestions/delete/{ID}" class="btn btn-md btn-danger" role="button">Delete</a>
|
||||
<a href="{ROOT_URL}admin/suggestions/edit/{ID}" class="btn btn-md btn-warning" role="button">Edit</a>
|
||||
<hr>
|
||||
{/ADMIN}
|
||||
</div><!-- /.suggestions-post -->
|
||||
{COMMENTS}
|
||||
{NEWCOMMENT}
|
||||
</div><!-- /.suggestions-main -->
|
||||
</div><!-- /.row -->
|
||||
<p class="blog-post-meta">{DTC date}{suggestedOn}{/DTC} by <a href="{ROOT_URL}home/profile/{author}">{submittedBy}</a></p>
|
||||
{suggestion}
|
||||
{ADMIN}
|
||||
<hr>
|
||||
<a href="{ROOT_URL}admin/suggestions/delete/{ID}" class="btn btn-md btn-danger" role="button">Delete</a>
|
||||
<a href="{ROOT_URL}admin/suggestions/edit/{ID}" class="btn btn-md btn-warning" role="button">Edit</a>
|
||||
<hr>
|
||||
{/ADMIN}
|
||||
</div><!-- /.suggestions-post -->
|
||||
{COMMENTS}
|
||||
{NEWCOMMENT}
|
||||
</div><!-- /.suggestions-main -->
|
||||
</div><!-- /.row -->
|
||||
</div>
|
||||
|
@ -37,7 +37,7 @@ class Wip extends Plugin {
|
||||
];
|
||||
public $admin_links = [
|
||||
[
|
||||
'text' => '<i class="fa fa-fw fa-support"></i> Wip',
|
||||
'text' => '<i class="fa fa-fw fa-flask"></i> Wip',
|
||||
'url' => '{ROOT_URL}admin/wip',
|
||||
],
|
||||
];
|
||||
|
Reference in New Issue
Block a user