From: Chuck Scott Date: Fri, 2 Mar 2018 21:07:23 +0000 (-0500) Subject: Starting setup of new plugin. X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=a41c6c2f248d7449fb11226fbdc3f5b4c9d37e6a;p=WP-Plugins%2Fglm-member-db-assets.git Starting setup of new plugin. Admin assets index model and view creted and added to menu and valid actions. Added initial database tables for management and settings. --- diff --git a/index.php b/index.php index 391096d..9a4b661 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,6 @@ + * @license http://www.gaslightmedia.com Gaslightmedia + * @release index.php,v 1.0 2018/03/02 19:31:47 cscott Exp $ + * @link http://dev.gaslightmedia.com/ + */ + +// Load Assets data abstract +// require_once GLM_MEMBERS_ASSETS_PLUGIN_CLASS_PATH.'/data/dataAssets.php'; + +class GlmMembersAdmin_assets_index // extends GlmDataAssetsIndex +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + + /** + * Constructor + * + * This contructor performs the work for this model. This model returns + * an array containing the following. + * + * 'status' + * + * True if successfull and false if there was a fatal failure. + * + * 'view' + * + * A suggested view name that the contoller should use instead of the + * default view for this model or false to indicate that the default view + * should be used. + * + * 'data' + * + * Data that the model is returning for use in merging with the view to + * produce output. + * + * @wpdb object WordPress database object + * + * @return array Array containing status, suggested view, and any data + */ + public function __construct ($wpdb, $config) + { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + /* + * Run constructor for the Assets data class + */ + // parent::__construct(false, false, true); + + } + + public function modelAction($actionData = false) + { + $view = 'index'; + + + // Compile template data + $templateData = array( + ); + + // Return status, any suggested view, and any data to controller + return array( + 'status' => true, + 'modelRedirect' => false, + 'view' => 'admin/assets/'.$view.'.html', + 'data' => $templateData + ); + + } + +} \ No newline at end of file diff --git a/setup/adminMenus.php b/setup/adminMenus.php index 5ec3f55..de27354 100644 --- a/setup/adminMenus.php +++ b/setup/adminMenus.php @@ -50,3 +50,12 @@ * */ +add_submenu_page( + 'glm-members-admin-menu-members', + 'Asset Management', + 'Asset Mgt', + 'glm_members_members', + 'glm-members-admin-menu-assets-index', + function() {$this->controller('assets', 'index');} + ); + diff --git a/setup/databaseScripts/create_database_V0.0.1.sql b/setup/databaseScripts/create_database_V0.0.1.sql new file mode 100644 index 0000000..65ab5c6 --- /dev/null +++ b/setup/databaseScripts/create_database_V0.0.1.sql @@ -0,0 +1,68 @@ +-- Gaslight Media Assets Database +-- File Created: 03/02/2018 14:40:00 +-- Database Version: 0.0.19 +-- Database Creation Script +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashes +-- +/* + * General Database Organization + * ----------------------------- + * + */ + +-- Management Options +-- General configurationm parameters for the Asset Management application +-- Only one entry in this table! +CREATE TABLE {prefix}management ( + id INT NOT NULL AUTO_INCREMENT, + canonical_asset_page TINYTEXT NULL, -- Canonical page slug for assets + PRIMARY KEY (id) +); + +---- + +-- Terms used in site modifiable on Management page in admin - Only 1 entry in this table +-- Terms in this table should be all self-explanatory +CREATE TABLE {prefix}settings_terms ( + id INT NOT NULL AUTO_INCREMENT, + assets_term_assets_name TINYTEXT NULL, -- Term "Asset Management" + assets_term_asset TINYTEXT NULL, + assets_term_asset_cap TINYTEXT NULL, + assets_term_asset_plur TINYTEXT NULL, + assets_term_asset_plur_cap TINYTEXT NULL, + PRIMARY KEY (id) +); + +---- + +-- Insert into management table +INSERT INTO {prefix}management + ( + canonical_asset_page + ) + VALUES + ( + 'assets' -- assets_canonical_assets_page + ); + +---- + +-- Insert into settings_terms table +INSERT INTO {prefix}settings_terms + ( + assets_term_assets_name, + assets_term_asset, + assets_term_asset_cap, + assets_term_asset_plur, + assets_term_asset_plur_cap + ) + VALUES + ( + 'Asset Management', -- assets_term_assets_name + 'asset', -- assets_term_asset + 'Asset', -- assets_term_asset_cap + 'assets', -- assets_term_asset_plur + 'Assets' -- assets_term_asset_plur_cap + ); diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php new file mode 100644 index 0000000..ac27d09 --- /dev/null +++ b/setup/databaseScripts/dbVersions.php @@ -0,0 +1,20 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release dbVersions.php $ + * @link http://dev.gaslightmedia.com/ + */ + +$glmMembersAssetsDbVersions = array( + '0.0.1' => array('version' => '0.0.1', 'tables' => 2, 'date' => '03/2/2018') +); + + diff --git a/setup/validActions.php b/setup/validActions.php index a3fc0ef..d473d8e 100644 --- a/setup/validActions.php +++ b/setup/validActions.php @@ -59,6 +59,9 @@ $glmMembersAssetsAddOnValidActions = array( 'adminActions' => array( + 'assets' => array( + 'index' => GLM_MEMBERS_ASSETS_PLUGIN_SLUG + ) ), 'frontActions' => array( ) diff --git a/views/admin/assets/index.html b/views/admin/assets/index.html new file mode 100644 index 0000000..ae11402 --- /dev/null +++ b/views/admin/assets/index.html @@ -0,0 +1,15 @@ +

Asset Management Dashboard

+ +
+

Pending Actions

+
+ +
+

Assets List

+
+ + +
+

Assets Calendar

+
+