--- /dev/null
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * Members List Export by AJAX
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @version 0.1
+ */
+
+/**
+ *
+ * This class exports the currently selected members list
+ * to a printable HTML file, to a CSV file, or otherwise.
+ */
+class GlmMembersAdmin_ajax_glmTextSearch
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+
+ /**
+ * Constructor
+ *
+ * This constructor sets up this model. At this time that only includes
+ * storing away the WordPress data object.
+ *
+ * @return object Class object
+ *
+ */
+ public function __construct ($wpdb, $config)
+ {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ //parent::__construct(false, false);
+
+ }
+
+ /**
+ * Perform Model Action
+ *
+ * This modelAction takes an AJAX image upload and stores the image in the
+ * media/images directory of the plugin.
+ *
+ * This model action does not return, it simply does it's work then calls die();
+ *
+ * @param $actionData
+ *
+ * Echos JSON string as response and does not return
+ */
+ public function modelAction ($actionData = false)
+ {
+ if( isset( $_REQUST['table'] ) ){
+
+ }
+ $data = "test";
+ $return = array(
+ 'data' => $data , // Where our events list will go
+ );
+
+ header('Content-type:application/json;charset=utf-8', true);
+ echo json_encode($return);
+ wp_die();
+ }
+}
foreach ( $this->config[ 'addOns' ] as $a ) {
if ( has_filter( $a['slug'] . "-dashboard-widget") ) {
//var_dump($a);
- $addonData[$a['slug']]['name'] = $a['short_name'];
- $addonData[$a['slug']]['slug'] = $a['slug'];
- $addonData[$a['slug']]['index'] = $a['index'];
- $addonData[$a['slug']]['widgetData'] = apply_filters($a['slug'] . "-dashboard-widget", "");
+ $addons[$a['slug']]['name'] = $a['short_name'];
+ $addons[$a['slug']]['slug'] = $a['slug'];
+ $addons[$a['slug']]['index'] = $a['index'];
+ $addons[$a['slug']]['widgetData'] = apply_filters($a['slug'] . "-dashboard-widget", "");
} else {
echo "<br>" . $a['slug'] . " has no filter called " . $a['slug'] . "-dashboard-widget";
'clickThroughCounts' => $clickThroughCounts,
'detailViewCounts' => $detailViewCounts,
'statusPending' => $this->config['status_numb']['Pending'],
- //'widgetData' => $addonData['widgetData'],
- 'addonData' => $addonData,
+ //'widgetData' => $addons['widgetData'],
+ 'addons' => $addons,
);
// Return status, suggested view, and data to controller.
'fileLibraryDownload' => 'glm-member-db',
'fileLibraryDelete' => 'glm-member-db',
'fileLibraryUpdate' => 'glm-member-db',
- 'glmCron' => 'glm-member-db'
+ 'glmCron' => 'glm-member-db',
+ 'glmTextSearch' => 'glm-member-db',
),
'dashboard' => array(
'index' => 'glm-member-db',
--- /dev/null
+<div class="row">
+ <div class="s12 col input-field glm-widget-search">
+ <input id="{$addon.slug}" type="text" class="glm-widget-search-input search-autocomplete">
+ <label for="{$addon.slug}">Search</label>
+ </div>
+</div>
+<script>
+ jQuery(function($){
+
+ let data = {
+ action : 'glm_members_admin_ajax',
+ glm_action : 'glmTextSearch',
+ table : '{$widgetField.table}'
+ }
+ $.ajax({
+ type: 'POST',
+ url: '{$ajaxUrl}',
+ data: data,
+ success: function(response) {
+ console.log(response)
+ $('input.earch-autocomplete').autocomplete({
+ data: {
+ "Apple": null,
+ "Microsoft": null,
+ "Google": 'https://placehold.it/250x250'
+ }, // The max amount of results that can be shown at once. Default: Infinity.
+ });
+ }
+ });
+ });
+</script>
\ No newline at end of file
<div class="glm-summary-widgets">
<div class="row">
<div class="glm-summary-widget col s12 m6 l4">
- {foreach $addonData as $widgetData}
+ {foreach $addons as $addon}
{include file='./summaryWidget.html'}
{/foreach}
</div>
<ul id="members-summary-widget" class="summary members-summary-widget dashboard-summary-widget collapsible">
<li>
- <div class="summary-widget-handle collapsible-header"><pre> {$widgetData.name}</pre></div>
+ <div class="summary-widget-handle collapsible-header"><pre> {$addon.name}</pre></div>
<div class="summary-widget-body collapsible-body">
- {foreach $widgetData as $widgetField}
- {$widgetField|var_dump}
+ {foreach $addon as $addonData}
+ { $addonData|var_dump}
+ {/foreach}
+ {foreach $addon.widgetData as $widgetField}
+ <pre>{$widgetField|@print_r}</pre>
+
+ {if $widgetField.type == 'textsearch'}
+ {include file='../newDashboard/components/widgetSearch.html'}
+ {/if}
{/foreach}
<div class="quicklinks">
<a href="#">Dashboard</a>
</span>
</span>
</div>
+ <div class="summary-widget-handle collapsible-header"><pre> { $w|var_dump} </pre></div>
+ <div class="summary-widget-body collapsible-body">
+
</div>
</li>
</ul>