Added Wordpress Editor to textarea fields
authorChuck Scott <cscott@gaslightmedia.com>
Mon, 23 Mar 2015 13:26:47 +0000 (09:26 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Mon, 23 Mar 2015 13:26:47 +0000 (09:26 -0400)
classes/data/dataMemberInfo.php
lib/smartyTemplateSupport.php
views/admin/member/memberInfo.html

index 5dd38db..82bdce2 100644 (file)
@@ -178,6 +178,7 @@ class GlmDataMemberInfo extends GlmDataAbstract
                        'descr' => array(
                                'field' => 'descr',
                                'type' => 'text',
+                               'filter' => FILTER_SANITIZE_MAGIC_QUOTES,
                                'use' => 'a'
                        ),
 
@@ -310,6 +311,7 @@ class GlmDataMemberInfo extends GlmDataAbstract
                        'notes' => array (
                                'field' => 'notes',
                                'type' => 'text',
+                               'filter' => FILTER_SANITIZE_MAGIC_QUOTES,
                                'use' => 'a'
                        )
 
index 3e5c296..07ee1ef 100644 (file)
@@ -53,9 +53,10 @@ class smartyTemplateSupport {
                /*
                 * Load and instatiate Smarty Templates
                 */
-               require (GLM_MEMBERS_PLUGIN_PATH . '/lib/Smarty-3.1.21/libs/Smarty.class.php');
-
-               $this->template = new Smarty ();
+//             require (GLM_MEMBERS_PLUGIN_PATH . '/lib/Smarty-3.1.21/libs/Smarty.class.php');
+//             $this->template = new Smarty ();
+               require (GLM_MEMBERS_PLUGIN_PATH . '/lib/Smarty-3.1.21/libs/SmartyBC.class.php');
+               $this->template = new SmartyBC ();
 
                /*
                 * Configure Smarty Templates for this site
index 0f289d4..f8d2766 100644 (file)
             <tr>
                 <th {if $memberInfo.fieldRequired.descr}class="glm-required"{/if}>Description:</th>
                 <td {if $memberInfo.fieldFail.descr}class="glm-form-bad-input"{/if}>
-                    <textarea name="descr" class="glm-form-textarea" placeholder="General description of the member.">{$memberInfo.fieldData.descr}</textarea>
+                    {php}
+                        wp_editor('{$memberInfo.fieldData.descr}', 'glm_descr', array(
+                            'media_buttons' => false,
+                            'quicktags' => false,
+                            'textarea_name' => 'descr',
+                            'editor_height' => 200,     // Height in px, overrides editor_rows
+                                // 'textarea_rows' => 8
+                        ));
+                    {/php}
                     {if $memberInfo.fieldFail.descr}<p>{$memberInfo.fieldFail.descr}</p>{/if}
                 </td>
             </tr>
             <tr>
                 <th {if $memberInfo.fieldRequired.notes}class="glm-required"{/if}>Notes:</th>
                 <td {if $memberInfo.fieldFail.notes}class="glm-form-bad-input"{/if}>
-                    <textarea name="notes" class="glm-form-textarea" placeholder="For reference only. Not displayed to users.">{$memberInfo.fieldData.notes}</textarea>
+                    {php}
+                        wp_editor('{$memberInfo.fieldData.notes}', 'glm_notes', array(
+                            'quicktags' => false,
+                            'media_buttons' => false,
+                            'textarea_name' => 'notes',
+                            'editor_height' => 100,     // Height in px, overrides editor_rows
+                                // 'textarea_rows' => 4,
+                        ));
+                    {/php}
                     {if $memberInfo.fieldFail.notes}<p>{$memberInfo.fieldFail.notes}</p>{/if}
                 </td>
             </tr>