--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * Search Status for Main Dashboard Widget
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Gaslight Media <info@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @version 0.1
+ */
+
+/*
+ * Check whether there's any notices that should be displayed
+ * in the main dashboard widget.
+ */
+class GlmMembersAdmin_dashboardWidget_search
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+
+ /*
+ * Constructor
+ *
+ * This contructor 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;
+
+ }
+
+ /*
+ * Perform Model Action
+ *
+ * This method does the work for this model and returns any resulting data
+ *
+ * @return array Status and data array
+ *
+ * 'status'
+ *
+ * True if successfull and false if there was a fatal failure.
+ *
+ * 'menuItemRedirect'
+ *
+ * If not false, provides a menu item the controller should
+ * execute after this one. Normally if this is used, there would also be a
+ * modelRedirect value supplied as well.
+ *
+ * 'modelRedirect'
+ *
+ * If not false, provides an action the controller should execute after
+ * this one.
+ *
+ * '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.
+ *
+ */
+ public function modelAction ($actionData = false)
+ {
+
+ // Get the Open Search Server parameters from management settings
+ $index = $this->config['settings']['search_index'];
+ $website = $this->config['settings']['website'];
+ $login = $this->config['settings']['login'];
+ $key = $this->config['settings']['login_key'];
+
+ $displayNotice = false;
+
+ $indexNotice = false;
+ if (trim($index) == '') {
+ $indexNotice = true;
+ $displayNotice = true;
+ }
+
+ $websiteNotice = false;
+ if (trim($website) != GLM_MEMBERS_HOSTNAME) {
+ $websiteNotice = true;
+ $displayNotice = true;
+ }
+
+ $loginNotice = false;
+ if (trim($website) == '') {
+ $loginNotice = true;
+ $displayNotice = true;
+ }
+
+ $keyNotice = false;
+ if (trim($key) == '') {
+ $keyNotice = true;
+ $displayNotice = true;
+ }
+
+ // Compile template data
+ $templateData = array(
+ 'displayNotice' => $displayNotice,
+ 'indexNotice' => $indexNotice,
+ 'websiteNotice' => $websiteNotice,
+ 'loginNotice' => $loginNotice,
+ 'keyNotice' => $keyNotice,
+ );
+
+ // Return status, suggested view, and data to controller - also return any modified settings
+ return array(
+ 'status' => true,
+ 'menuItemRedirect' => false,
+ 'modelRedirect' => false,
+ 'view' => 'admin/dashboardWidget/search.html',
+ 'data' => $templateData
+ );
+
+ }
+
+
+}
+
+?>
\ No newline at end of file
*
* This array is merged with the data from any registered add-ons
* providing short-code features. The plugin providing the short-code
- * is designated in the 'plugin' elemeent.
+ * is designated in the 'plugin' element.
*
* A shortcode is unique to a particular plugin. To provide additional
* data and features to a short-code, an add-on should use filters
</tr>
<tr>
<td> </td>
- <th>type="{search type}"</th>
+ <th>type="{search type}" NOT YET IMPLEMENTED</th>
<td>
The type of search
<p>
</tr>
<tr>
<td> </td>
- <th>order="{order type}"</th>
+ <th>order="{order type}" NOT YET IMPLEMENTED</th>
<td>
Order of search results
<p>