From: Steve Sutton Date: Wed, 8 Feb 2017 15:51:21 +0000 (-0500) Subject: Move files into correct names. X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=ad93d3eeb0c46a12d1cc24b318889b3bf7ef171c;p=WP-Plugins%2Fglm-member-db-communicator.git Move files into correct names. For new name --- diff --git a/models/admin/communicator/index.php b/models/admin/communicator/index.php new file mode 100644 index 0000000..5413348 --- /dev/null +++ b/models/admin/communicator/index.php @@ -0,0 +1,95 @@ + + * @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/ + */ + +class GlmMembersAdmin_streamsend_index // extends GlmDataStreamsend +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + + /** + * Constructor + * + * This contractor performs the work for this model. This model returns + * an array containing the following. + * + * 'status' + * + * True if successful and false if there was a fatal failure. + * + * 'view' + * + * A suggested view name that the controller 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 Streamsend data class + * + * Note, the third parameter is a flag that indicates to the Contacts + * data class that it should flag a group of fields as 'view_only'. + */ + //parent::__construct(false, false, true); + + } + + 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/streamsend/index.html', + 'data' => $templateData + ); + + } + + +} diff --git a/models/admin/management/communicator.php b/models/admin/management/communicator.php new file mode 100644 index 0000000..7cfdc41 --- /dev/null +++ b/models/admin/management/communicator.php @@ -0,0 +1,214 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release streamsend.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ + * @link http://dev.gaslightmedia.com/ + */ + +// Load Management Streamsend data abstract +//require_once GLM_MEMBERS_STREAMSEND_PLUGIN_CLASS_PATH.'/data/dataManagement.php'; + +/** + * GlmMembersAdmin_management_streamsend + * + * PHP version 5 + * + * @category Model + * @package GLM Member DB + * @author Chuck Scott + * @license http://www.gaslightmedia.com Gaslightmedia + * @release SVN: $Id: packaging.php,v 1.0 2011/01/25 19:31:47 cscott + * Exp $ + */ +class GlmMembersAdmin_management_streamsend //extends GlmDataStreamsendManagement +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * dbh Postgres database connection + * + * @var mixed + * @access public + */ + public $dbh; + /** + * settings used for the schema and tablenames + * + * @var mixed + * @access public + */ + public $settings = array(); + /** + * streamsend + * + * @var bool + * @access public + */ + public $streamsend = array(); + public $image_owner; + + /** + * 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); + + } + + /** + * modelAction + * + * @param bool $actionData + * @access public + * @return void + */ + public function modelAction($actionData = false) + { + + $option = false; + $settings_updated = false; + $settings_update_error = false; + $streamsend_settings = false; + $option2 = false; + + if (isset($_REQUEST['option'])) { + $option = $_REQUEST['option']; + } + + switch ($option) { + + case 'settings': + + default: + + // Make sure option is set if default + $option = 'settings'; + + // Determine if current user can edit configurations + if (!current_user_can('glm_members_management')) { + return array( + 'status' => false, + 'menuItemRedirect' => 'error', + 'modelRedirect' => 'index', + 'view' => 'admin/error/index.html', + 'data' => array( + 'reason' => 'User does not have rights to make configuration changes.' + ) + ); + } + + // Check for submission option + $option2 = ''; + if (isset($_REQUEST['option2'])) { + $option2 = $_REQUEST['option2']; + } + + switch($option2) { + + // Update the settings and redisplay the form + case 'submit': + + // Update the event management settings + //$streamsend_settings = $this->updateEntry(1); + if ($streamsend_settings['status']) { + $settings_updated = true; + } else { + $settings_update_error = true; + } + + break; + + // Default is to get the current settings and display the form + default: + + // Try to get the first (should be only) entry for general settings. + //$streamsend_settings = $this->editEntry(1); + //echo '
$streamsend_settings: ' . print_r( $streamsend_settings, true ) . '
'; + + if ($streamsend_settings === false) { + + if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { + glmMembersAdmin::addNotice("  /models/admin/management/streamsend.php: Unable to load streamsend management settings.", 'Alert'); + } + + } + + break; + + } + + break; + + } + + // Populate the state list for event default state selection + $streamsend_settings['event_default_state'] = $this->config['states']; + + // Compile template data + $template_data = array( + 'option' => $option, + 'settingsUpdated' => $settings_updated, + 'settingsUpdateError' => $settings_update_error, + 'streamsendSettings' => $streamsend_settings, + ); + + // Return status, suggested view, and data to controller + return array( + 'status' => true, + 'menuItemRedirect' => false, + 'modelRedirect' => false, + 'view' => 'admin/management/streamsend.html', + 'data' => $template_data + ); + + + } + +} + +?> diff --git a/models/admin/management/streamsend.php b/models/admin/management/streamsend.php deleted file mode 100644 index 7cfdc41..0000000 --- a/models/admin/management/streamsend.php +++ /dev/null @@ -1,214 +0,0 @@ - - * @license http://www.gaslightmedia.com Gaslightmedia - * @release streamsend.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ - * @link http://dev.gaslightmedia.com/ - */ - -// Load Management Streamsend data abstract -//require_once GLM_MEMBERS_STREAMSEND_PLUGIN_CLASS_PATH.'/data/dataManagement.php'; - -/** - * GlmMembersAdmin_management_streamsend - * - * PHP version 5 - * - * @category Model - * @package GLM Member DB - * @author Chuck Scott - * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: packaging.php,v 1.0 2011/01/25 19:31:47 cscott - * Exp $ - */ -class GlmMembersAdmin_management_streamsend //extends GlmDataStreamsendManagement -{ - - /** - * WordPress Database Object - * - * @var $wpdb - * @access public - */ - public $wpdb; - /** - * dbh Postgres database connection - * - * @var mixed - * @access public - */ - public $dbh; - /** - * settings used for the schema and tablenames - * - * @var mixed - * @access public - */ - public $settings = array(); - /** - * streamsend - * - * @var bool - * @access public - */ - public $streamsend = array(); - public $image_owner; - - /** - * 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); - - } - - /** - * modelAction - * - * @param bool $actionData - * @access public - * @return void - */ - public function modelAction($actionData = false) - { - - $option = false; - $settings_updated = false; - $settings_update_error = false; - $streamsend_settings = false; - $option2 = false; - - if (isset($_REQUEST['option'])) { - $option = $_REQUEST['option']; - } - - switch ($option) { - - case 'settings': - - default: - - // Make sure option is set if default - $option = 'settings'; - - // Determine if current user can edit configurations - if (!current_user_can('glm_members_management')) { - return array( - 'status' => false, - 'menuItemRedirect' => 'error', - 'modelRedirect' => 'index', - 'view' => 'admin/error/index.html', - 'data' => array( - 'reason' => 'User does not have rights to make configuration changes.' - ) - ); - } - - // Check for submission option - $option2 = ''; - if (isset($_REQUEST['option2'])) { - $option2 = $_REQUEST['option2']; - } - - switch($option2) { - - // Update the settings and redisplay the form - case 'submit': - - // Update the event management settings - //$streamsend_settings = $this->updateEntry(1); - if ($streamsend_settings['status']) { - $settings_updated = true; - } else { - $settings_update_error = true; - } - - break; - - // Default is to get the current settings and display the form - default: - - // Try to get the first (should be only) entry for general settings. - //$streamsend_settings = $this->editEntry(1); - //echo '
$streamsend_settings: ' . print_r( $streamsend_settings, true ) . '
'; - - if ($streamsend_settings === false) { - - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice("  /models/admin/management/streamsend.php: Unable to load streamsend management settings.", 'Alert'); - } - - } - - break; - - } - - break; - - } - - // Populate the state list for event default state selection - $streamsend_settings['event_default_state'] = $this->config['states']; - - // Compile template data - $template_data = array( - 'option' => $option, - 'settingsUpdated' => $settings_updated, - 'settingsUpdateError' => $settings_update_error, - 'streamsendSettings' => $streamsend_settings, - ); - - // Return status, suggested view, and data to controller - return array( - 'status' => true, - 'menuItemRedirect' => false, - 'modelRedirect' => false, - 'view' => 'admin/management/streamsend.html', - 'data' => $template_data - ); - - - } - -} - -?> diff --git a/models/admin/streamsend/index.php b/models/admin/streamsend/index.php deleted file mode 100644 index 5413348..0000000 --- a/models/admin/streamsend/index.php +++ /dev/null @@ -1,95 +0,0 @@ - - * @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/ - */ - -class GlmMembersAdmin_streamsend_index // extends GlmDataStreamsend -{ - - /** - * WordPress Database Object - * - * @var $wpdb - * @access public - */ - public $wpdb; - /** - * Plugin Configuration Data - * - * @var $config - * @access public - */ - public $config; - - /** - * Constructor - * - * This contractor performs the work for this model. This model returns - * an array containing the following. - * - * 'status' - * - * True if successful and false if there was a fatal failure. - * - * 'view' - * - * A suggested view name that the controller 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 Streamsend data class - * - * Note, the third parameter is a flag that indicates to the Contacts - * data class that it should flag a group of fields as 'view_only'. - */ - //parent::__construct(false, false, true); - - } - - 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/streamsend/index.html', - 'data' => $templateData - ); - - } - - -} diff --git a/views/admin/management/communicator.html b/views/admin/management/communicator.html new file mode 100644 index 0000000..077964f --- /dev/null +++ b/views/admin/management/communicator.html @@ -0,0 +1,29 @@ +{include file='admin/management/header.html'} + + + + + + + + + + + + +
+ {if $settingsUpdated}

Settings Updated

{/if} + {if $settingsUpdateError}Settings Update Error{/if} +

Management Settings

+
+
+ + + + +
+ +
+
diff --git a/views/admin/management/streamsend.html b/views/admin/management/streamsend.html deleted file mode 100644 index 077964f..0000000 --- a/views/admin/management/streamsend.html +++ /dev/null @@ -1,29 +0,0 @@ -{include file='admin/management/header.html'} - - - - - - - - - - - - -
- {if $settingsUpdated}

Settings Updated

{/if} - {if $settingsUpdateError}Settings Update Error{/if} -

Management Settings

-
-
- - - - -
- -
-