renamed supportFunctions class to obitSupportFunctions and renamed the file to obitSu...
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 2 Mar 2017 18:14:12 +0000 (13:14 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 2 Mar 2017 18:14:12 +0000 (13:14 -0500)
Added the wpdb and config objects to the obitSupportFunctions instance in list.php

classes/obitSupportFunctions.php [new file with mode: 0644]
classes/supportFunctions.php [deleted file]
models/admin/obits/list.php

diff --git a/classes/obitSupportFunctions.php b/classes/obitSupportFunctions.php
new file mode 100644 (file)
index 0000000..3ea9a07
--- /dev/null
@@ -0,0 +1,131 @@
+<?php
+/**
+ * GLM Member-DB WordPress Add-On Plugin
+ * Obits Support function class
+ *
+ * PHP version 5.3
+ *
+ * @category Data
+ * @package  GLM Member-DB
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @release  SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
+ */
+
+/**
+ * GlmSupportFunctionsClass
+ *
+ * PHP version 5
+ *
+ * @category Data
+ * @package GLM Member DB
+ * @author  Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ *          @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott
+ *          Exp $
+ */
+class GlmObitSupportFunctions
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+    /**
+     * Data Table Name
+     *
+     * @var $table
+     * @access public
+     */
+    public $table;
+    /**
+     * Field definitions
+     *
+     * 'type' is type of field as defined by the application
+     * text Regular text field
+     * pointer Pointer to an entry in another table
+     * 'filters' is the filter name for a particular filter ID in PHP filter
+     * functions
+     * See PHP filter_id()
+     *
+     * 'use' is when to use the field
+     * l = List
+     * g = Get
+     * n = New
+     * i = Insert
+     * e = Edit
+     * u = Update
+     * d = Delete
+     * a = All
+     *
+     * @var $ini
+     * @access public
+     */
+    public $fields = false;
+
+    /**
+     * Constructor
+     *
+     * @param object $d database connection
+     * @param array $config Configuration array
+     * @param bool $limitedEdit Flag to say indicate limited edit requested
+     *
+     * @return void
+     * @access public
+     */
+    public function __construct($wpdb, $config, $limitedEdit = false)
+    {
+
+        // If this class is not being extended along with existing $wpdb and $config
+        if (!$this->wpdb) {
+
+            // Save WordPress Database object
+            $this->wpdb = $wpdb;
+
+            // Save plugin configuration object
+            $this->config = $config;
+
+        }
+
+     
+    }
+     /**
+     * getObitYearRange
+     *
+     * @param year range starting date
+     *
+     * @return array of date ranges
+     * @access public
+     */
+    
+    public function getObitYearRange($start){
+         
+        $start_range = $start;
+
+        $current = date('Y');
+        
+        for($start_range; $start_range <= $current; $start_range += 10){
+            $end_calc = $start_range + 9;
+            if($end_calc <= $current){
+                $end = $end_calc;
+            } else {
+                $end = 'Present';
+            }
+            $ranges[] = array('start' => $start_range, 'end' => $end);
+        }
+            return array_reverse( $ranges );
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/classes/supportFunctions.php b/classes/supportFunctions.php
deleted file mode 100644 (file)
index efd0236..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-<?php
-/**
- * GLM Member-DB WordPress Add-On Plugin
- * Obits Support function class
- *
- * PHP version 5.3
- *
- * @category Data
- * @package  GLM Member-DB
- * @author   Chuck Scott <cscott@gaslightmedia.com>
- * @license  http://www.gaslightmedia.com Gaslightmedia
- * @release  SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott Exp $
- */
-
-/**
- * GlmSupportFunctionsClass
- *
- * PHP version 5
- *
- * @category Data
- * @package GLM Member DB
- * @author  Chuck Scott <cscott@gaslightmedia.com>
- * @license http://www.gaslightmedia.com Gaslightmedia
- *          @release SVN: $Id: dataAddedInfoFields.php,v 1.0 2011/01/25 19:31:47 cscott
- *          Exp $
- */
-class GlmSupportFunctions
-{
-
-    /**
-     * WordPress Database Object
-     *
-     * @var $wpdb
-     * @access public
-     */
-    public $wpdb;
-    /**
-     * Plugin Configuration Data
-     *
-     * @var $config
-     * @access public
-     */
-    public $config;
-    /**
-     * Data Table Name
-     *
-     * @var $table
-     * @access public
-     */
-    public $table;
-    /**
-     * Field definitions
-     *
-     * 'type' is type of field as defined by the application
-     * text Regular text field
-     * pointer Pointer to an entry in another table
-     * 'filters' is the filter name for a particular filter ID in PHP filter
-     * functions
-     * See PHP filter_id()
-     *
-     * 'use' is when to use the field
-     * l = List
-     * g = Get
-     * n = New
-     * i = Insert
-     * e = Edit
-     * u = Update
-     * d = Delete
-     * a = All
-     *
-     * @var $ini
-     * @access public
-     */
-    public $fields = false;
-
-    /**
-     * Constructor
-     *
-     * @param object $d database connection
-     * @param array $config Configuration array
-     * @param bool $limitedEdit Flag to say indicate limited edit requested
-     *
-     * @return void
-     * @access public
-     */
-    public function __construct($wpdb, $config, $limitedEdit = false)
-    {
-
-        // If this class is not being extended along with existing $wpdb and $config
-        if (!$this->wpdb) {
-
-            // Save WordPress Database object
-            $this->wpdb = $wpdb;
-
-            // Save plugin configuration object
-            $this->config = $config;
-
-        }
-
-     
-    }
-     /**
-     * getObitYearRange
-     *
-     * @param year range starting date
-     *
-     * @return array of date ranges
-     * @access public
-     */
-    
-    public function getObitYearRange($start){
-         
-        $start_range = $start;
-
-        $current = date('Y');
-        
-        for($start_range; $start_range <= $current; $start_range += 10){
-            $end_calc = $start_range + 9;
-            if($end_calc <= $current){
-                $end = $end_calc;
-            } else {
-                $end = 'Present';
-            }
-            $ranges[] = array('start' => $start_range, 'end' => $end);
-        }
-            return array_reverse( $ranges );
-    }
-
-}
-
-?>
\ No newline at end of file
index 383d81d..2d120da 100644 (file)
@@ -17,7 +17,7 @@
 require_once GLM_MEMBERS_OBITS_PLUGIN_CLASS_PATH.'/data/dataObits.php';
 
 // Load support functions class
-require_once GLM_MEMBERS_OBITS_PLUGIN_CLASS_PATH . '/supportFunctions.php';
+require_once GLM_MEMBERS_OBITS_PLUGIN_CLASS_PATH . '/obitSupportFunctions.php';
 
 class GlmMembersAdmin_obits_list extends GlmDataObits
 {
@@ -90,7 +90,7 @@ class GlmMembersAdmin_obits_list extends GlmDataObits
 
     public function modelAction($actionData = false)
     {
-        $year_range = new GlmSupportFunctions();
+        $year_range = new GlmObitSupportFunctions($this->wpdb, $this->config);
 
         $numbObits       = 0;
         $option          = 'list';