From: Anthony Talarico Date: Mon, 1 Oct 2018 18:51:02 +0000 (-0400) Subject: merging all js scripts from the components into the index.html and only passing objec... X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=b484c8eac65d2d4f7c5ab782dd623f2fbfe3753f;p=WP-Plugins%2Fglm-member-db.git merging all js scripts from the components into the index.html and only passing object from each component --- diff --git a/models/admin/export/index.php b/models/admin/export/index.php new file mode 100644 index 00000000..5d478bbb --- /dev/null +++ b/models/admin/export/index.php @@ -0,0 +1,89 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ + * @link http://dev.gaslightmedia.com/ + */ + +require_once GLM_MEMBERS_PLUGIN_CLASS_PATH . '/data/dataFileLibrary.php'; + +/* + * This model is called when the "Shortcodes" menu is selected + * + */ +class GlmMembersAdmin_export_index +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + + /* + * 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 members data class + parent::__construct(false, false); + + } + + public function modelAction($actionData = false) { + + + // Compile template data + $templateData = array( + + ); + + // Return status, any suggested view, and any data to controller + return array( + 'status' => true, + 'modelRedirect' => false, + 'view' => 'admin/export/index.html', + 'data' => $templateData + ); + + } +} diff --git a/models/admin/newDashboard/index.php b/models/admin/newDashboard/index.php index f6c26a17..e2507a8f 100644 --- a/models/admin/newDashboard/index.php +++ b/models/admin/newDashboard/index.php @@ -231,6 +231,7 @@ class GlmMembersAdmin_newDashboard_index extends GlmDataMembers 'detailViewCounts' => $detailViewCounts, 'statusPending' => $this->config['status_numb']['Pending'], 'addons' => $addons, + 'baseUrl' => GLM_MEMBERS_PLUGIN_URL ); // Return status, suggested view, and data to controller. diff --git a/setup/adminHooks.php b/setup/adminHooks.php index ecd328ac..ddd5fde4 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -431,6 +431,9 @@ add_filter( 'content' => 'Add Member', 'url' => $memberIndexPage . "&glm_action=memberEdit&option=add", 'classes' => '', + 'data' => '', + 'styles' => '' + ], ], ], @@ -461,6 +464,14 @@ add_filter( 'table' => $membersTable, 'url' => $membersIndexPage . "&option=search", ], + [ + 'id' => 'eventExportModal', + 'title' => 'Export Events', + 'order' => 99, + 'template' => 'entityAmount', + 'table' => $membersTable, + 'url' => $membersIndexPage . "&option=search", + ], [ 'id' => 'textSearch', 'order' => 2, diff --git a/setup/validActions.php b/setup/validActions.php index 3be69eb9..c67c1373 100644 --- a/setup/validActions.php +++ b/setup/validActions.php @@ -103,7 +103,11 @@ $glmMembersValidActions = array( ), 'import' => array( 'index' => 'glm-member-db' + ), + 'export' => array( + 'index' => 'glm-member-db' ) + ), 'frontActions' => array( 'members' => array( diff --git a/views/admin/export/index.html b/views/admin/export/index.html new file mode 100644 index 00000000..d99f0243 --- /dev/null +++ b/views/admin/export/index.html @@ -0,0 +1,49 @@ +
+ + + + + + + + + + + + {$count = 0} + {foreach $fileData as $fileHeader => $file} + + + + + + + + {$count = $count + 1} + {/foreach} + + + + +
File TypeNew FileSample FileCurrent FileUpdated
+ {$fileHeader} + + + + Sample {$fileHeader} File + + {if $file.exists} + {$fileHeader} File + {/if} + + {if $file.exists} + {$file.mtime|date_format:"%D %I:%M %p"} + {/if} +
Clear Data + + +
+ +
+ +{include file='admin/footer.html'} diff --git a/views/admin/newDashboard/components/buttons.html b/views/admin/newDashboard/components/buttons.html index 9fe464c6..30d0fddb 100644 --- a/views/admin/newDashboard/components/buttons.html +++ b/views/admin/newDashboard/components/buttons.html @@ -3,8 +3,8 @@ {foreach $component.buttons as $buttonName => $buttonData} - {if $buttonData.content}{$buttonData.content}{/if} + href="{if $buttonData.url}{$buttonData.url}{/if}{if $buttonData.data}export-modal{else}#{/if}" {if $buttonData.data} data-export={$buttonData.data} {/if}> + {if $buttonData.content}{$buttonData.content} {$buttonData.data}{/if} {/foreach} diff --git a/views/admin/newDashboard/components/dateSearch.html b/views/admin/newDashboard/components/dateSearch.html index fae42a9a..9be4f117 100644 --- a/views/admin/newDashboard/components/dateSearch.html +++ b/views/admin/newDashboard/components/dateSearch.html @@ -11,28 +11,9 @@ \ No newline at end of file + \ No newline at end of file diff --git a/views/admin/newDashboard/components/modal.html b/views/admin/newDashboard/components/modal.html new file mode 100644 index 00000000..9896264b --- /dev/null +++ b/views/admin/newDashboard/components/modal.html @@ -0,0 +1,3 @@ + + +{$add.result} \ No newline at end of file diff --git a/views/admin/newDashboard/components/textSearch.html b/views/admin/newDashboard/components/textSearch.html index ab211db0..aa54511a 100644 --- a/views/admin/newDashboard/components/textSearch.html +++ b/views/admin/newDashboard/components/textSearch.html @@ -7,56 +7,11 @@ \ No newline at end of file diff --git a/views/admin/newDashboard/index.html b/views/admin/newDashboard/index.html index c3598f46..1b7544bc 100644 --- a/views/admin/newDashboard/index.html +++ b/views/admin/newDashboard/index.html @@ -10,13 +10,103 @@ + + + + {include file='admin/footer.html'} \ No newline at end of file