* @link https://TheTempusProject.com * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Plugins; use TheTempusProject\Classes\Plugin; use TheTempusProject\Models\Events; use TheTempusProject\Models\Bookmarks as Bookmark; use TheTempusProject\Models\Folders; use TheTempusProject\Houdini\Classes\Components; use TheTempusProject\Houdini\Classes\Template; use TheTempusProject\TheTempusProject as App; class Bookmarks extends Plugin { public $pluginName = 'TP Bookmarks'; public $configName = 'bookmarks'; public $pluginAuthor = 'JoeyK'; public $pluginWebsite = 'https://TheTempusProject.com'; public $modelVersion = '1.0'; public $pluginVersion = '3.0'; public $pluginDescription = 'A simple plugin which adds a site wide bookmark system.'; public $permissionMatrix = [ 'useBookmarks' => [ 'pretty' => 'Can use the bookmarks feature', 'default' => false, ], 'createEvents' => [ 'pretty' => 'Can add events to bookmarks', 'default' => false, ], ]; public $main_links = [ [ 'text' => 'Bookmarks', 'url' => '{ROOT_URL}bookmarks/index', 'filter' => 'loggedin', ], [ 'text' => 'Tutorials', 'url' => '{ROOT_URL}bookmarks/tutorials', 'filter' => 'bkmtuts', ], [ 'text' => 'Extensions', 'url' => '{ROOT_URL}extensions/index', ], ]; public $info_footer_links = [ [ 'text' => 'Tutorials', 'url' => '{ROOT_URL}bookmarks/tutorials', ], ]; public $configMatrix = [ 'enabled' => [ 'type' => 'radio', 'pretty' => 'Enable Bookmarks.', 'default' => true, ], ]; public $preferenceMatrix = [ 'editModeSwitch' => [ 'pretty' => 'Bookmarks default setting for edit mode', 'type' => 'checkbox', 'default' => 'false', ], 'showArchivedSwitch' => [ 'pretty' => 'Show archived bookmarks by default', 'type' => 'checkbox', 'default' => 'false', ], 'showHiddenSwitch' => [ 'pretty' => 'Show hidden bookmarks by default', 'type' => 'checkbox', 'default' => 'false', ], 'archiveButtonSwitch' => [ 'pretty' => 'Show the archive buttons by default', 'type' => 'checkbox', 'default' => 'false', ], 'visibilityButtonSwitch' => [ 'pretty' => 'Show the visibility buttons by default', 'type' => 'checkbox', 'default' => 'false', ], 'privacyButtonSwitch' => [ 'pretty' => 'Show the privacy buttons by default', 'type' => 'checkbox', 'default' => 'true', ], 'shareButtonSwitch' => [ 'pretty' => 'Show the share buttons by default', 'type' => 'checkbox', 'default' => 'true', ], 'addButtonSwitch' => [ 'pretty' => 'Show the add buttons by default', 'type' => 'checkbox', 'default' => 'true', ], 'bookmarkTutorials' => [ 'pretty' => 'Show tutorials for the bookmark feature', 'type' => 'checkbox', 'default' => 'true', ], ]; public $resourceMatrix = [ 'routes' => [ [ 'original_url' => 'chrome', 'redirect_type' => 'external', 'nickname' => 'Chrome Extension', 'forwarded_url' => 'https://chromewebstore.google.com/detail/allthebookmarks/hcofhopnjoodmakhhmgmoohgpdhfkgii?authuser=0&hl=en', ], [ 'original_url' => 'brave', 'redirect_type' => 'external', 'nickname' => 'Brave Extension', 'forwarded_url' => 'https://chromewebstore.google.com/detail/allthebookmarks/hcofhopnjoodmakhhmgmoohgpdhfkgii?authuser=0&hl=en', ], [ 'original_url' => 'firefox', 'redirect_type' => 'external', 'nickname' => 'Firefox Extension', 'forwarded_url' => 'https://addons.mozilla.org/en-US/firefox/addon/allthebookmarks/', ], // [ // 'original_url' => 'edge', // 'redirect_type' => 'external', // 'nickname' => 'Edge Extension', // 'forwarded_url' => 'https://www.facebook.com/thetempusproject', // ], // [ // 'original_url' => 'opera', // 'redirect_type' => 'external', // 'nickname' => 'Opera Extension', // 'forwarded_url' => 'https://www.facebook.com/thetempusproject', // ], ] ]; public $bookmarks; public $folders; protected static $loaded = false; public function __construct( $load = false ) { $this->bookmarks = new Bookmark; $this->folders = new Folders; if ( ! self::$loaded && $load ) { $tutpref = true; if ( App::$isLoggedIn ) { if ( empty( App::$activeUser->prefs['bookmarkTutorials'] ) ) { $tutpref = false; } } $this->filters[] = [ 'name' => 'bkmtuts', 'find' => '#{BKMTUTS}(.*?){/BKMTUTS}#is', 'replace' => ( $tutpref ? '$1' : '' ), 'enabled' => true, ]; } parent::__construct( $load ); if ( ! self::$loaded && $load ) { self::$loaded = true; } } }