Converted wp_editor regerences to not use {php}.
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 4 Dec 2018 17:41:50 +0000 (12:41 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 4 Dec 2018 17:41:50 +0000 (12:41 -0500)
Also removed contacts--POS_OLD.htm. Apparently no longer needed.

views/admin/contacts/edit.html
views/admin/member/contacts--POS_OLD.html [deleted file]
views/admin/profile/index.html

index 4d0fcc1..0d53402 100644 (file)
                 <tr>
                     <th {if $contactInfo.fieldRequired.descr}class="glm-required"{/if}>Position/Responsibilities:</th>
                     <td {if $contactInfo.fieldFail.descr}class="glm-form-bad-input"{/if}>
-                        {php}
-                            wp_editor('{$contactInfo.fieldData.descr|escape:quotes}', 'glm_descr', array(
-                                'quicktags' => false,
-                                'media_buttons' => false,
-                                'wpautop' => false,
-                                'textarea_name' => 'descr',
-                                'editor_height' => 100,     // Height in px, overrides editor_rows
-                                    // 'textarea_rows' => 4,
-                            ));
-                        {/php}
+                        {wp_editor(
+                            $contactInfo.fieldData.descr,
+                            'glm_descr',
+                            json_decode('{
+                                "media_buttons":    false,
+                                "quicktags":        false,
+                                "textarea_name":    "descr",
+                                "editor_height":    100
+                            }', true)
+                        )}
                         {if $contactInfo.fieldFail.descr}<p>{$contactInfo.fieldFail.descr}</p>{/if}
                     </td>
                 </tr>
                 <tr>
                     <th {if $contactInfo.fieldRequired.notes}class="glm-required"{/if}>Notes:</th>
                     <td {if $contactInfo.fieldFail.notes}class="glm-form-bad-input"{/if}>
-                        {php}
-                            wp_editor('{$contactInfo.fieldData.notes|escape:quotes}', 'glm_notes', array(
-                                'quicktags' => false,
-                                'media_buttons' => false,
-                                'wpautop' => false,
-                                'textarea_name' => 'notes',
-                                'editor_height' => 100,     // Height in px, overrides editor_rows
-                                    // 'textarea_rows' => 4,
-                            ));
-                        {/php}
+                        {wp_editor(
+                            $contactInfo.fieldData.notes,
+                            'glm_notes',
+                            json_decode('{
+                                "media_buttons":    false,
+                                "quicktags":        false,
+                                "textarea_name":    "notes",
+                                "editor_height":    100
+                            }', true)
+                        )}
                         {if $contactInfo.fieldFail.notes}<p>{$contactInfo.fieldFail.notes}</p>{/if}
                     </td>
                 </tr>
diff --git a/views/admin/member/contacts--POS_OLD.html b/views/admin/member/contacts--POS_OLD.html
deleted file mode 100644 (file)
index 4d90702..0000000
+++ /dev/null
@@ -1,671 +0,0 @@
-{include file='admin/member/header.html'}
-
-{if $userDeleted}
-    <h3><span class="glm-warning">Contact Deleted:</span></h3>
-    <ul class="glm-li">
-  {if $wpUserDeleted}
-        <li>The associated system user was also removed.</li>
-  {else}
-        <li>Other roles were assigned to the associated system user so that system user has not been removed.</li>
-  {/if}
-    </ul>
-{/if}
-
-{if $haveMember}
-  {if $option == 'list'}
-
-    {if apply_filters('glm_members_permit_admin_member_contacts_add_contact', true)}
-    <a href="{$thisUrl}?page={$thisPage}&glm_action=contacts&member={$memberID}&option=create" class="button button-primary glm-button glm-right">Add New {$terms.term_member_cap} Contact</a>
-    {/if}
-    <form class="glm-right" onSubmit="return false;">
-       <span{if $haveFilter} class="glm-notice"{/if}><b>List Filters:</b>&nbsp;&nbsp;</span>
-       <input type="checkbox" id="filterArchived" class="listFilter"{if $filterArchived} checked{/if}>Show Archived&nbsp;&nbsp;
-       &nbsp;&nbsp;
-       <input type="text" id="filterText" class="listFilter" value="{$filterText}"> Search
-       &nbsp;&nbsp;&nbsp;&nbsp;
-    </form>
-    <p>&nbsp;</p>
-    <table class="wp-list-table striped glm-admin-table">
-        <thead>
-            <tr>
-                <th>Name</th>
-                <th>Active</th>
-                <th>Type</th>
-                <th>Access</th>
-                <th>User</th>
-                <th>Contact For</th>
-                <th>Organization</th>
-                <th>Location</th>
-            </tr>
-        </thead>
-        <tbody>
-{if $haveContacts}
-    {foreach $contacts as $c}
-            <tr>
-                <td class="glm-shrink">
-        {if apply_filters('glm_members_permit_admin_member_contacts_view_contact', true)}
-                    <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=contacts&option=edit&member={$c.ref_dest}&contact={$c.id}">{$c.lname}, {$c.fname}</a>
-        {else}
-                    {$c.lname}, {$c.fname}
-        {/if}
-                </td>
-                <td class="glm-shrink">{$c.active.name}</td>
-                <td>{$c.contact_type.name}</td>
-                <td class="glm-shrink">{$c.access.name}</td>
-                <td class="glm-nowrap">{$c.contact_role_short.name}</td>
-                <td class="glm-nowrap">{$c.ref_type.name} - {$c.ref_dest_name}</td>
-                <td class="glm-shrink">{$c.org}</td>
-                <td class="glm-shrink">{$c.city.name}, {$c.state.name}</td>
-            </tr>
-    {/foreach}
-{else}
-            <tr class="alternate"><td colspan="2">(no contacts listed)</td></tr>
-{/if}
-        </tbody>
-    </table>
-
-<!-- Check for invalid contact ID to edit -->
-  {elseif $option == 'edit' && !$contactID}
-
-        <h3><span class="glm-error">ERROR:</span> Specified contact not found!</h3>
-
-  {elseif $newContactExists}
-
-        <h4><span class="glm-warning">NOTE:</span> The Email address or username for this contact is already in use. Please check if they already are a contact in this system.</h3>
-
-  {elseif $misMatchedWpUsers}
-
-        <h3>
-            <span class="glm-warning">NOTE:</span>
-            The Email address for this contact is already in use by an existing system user but the username is in use by a different
-            system user. As such we are unable to match this request to a specific existing system user. We suggest you determine what
-            the "Username" is for the existing Wordpress user with the Email address you requested. Please call for assistance if needed.
-        </h3>
-
-  {elseif $newContactCreated}
-
-        <h3><span class="glm-warning">New Contact Created:</span> {$contactInfo.fieldData.fname} {$contactInfo.fieldData.lname} - {$contactInfo.fieldData.email}</h3>
-    {if $usernameChangedToWP || $usingExistingWPContact}
-        <h3><span class="glm-notice">NOTE:</span></h3>
-        <ul class="glm-li">
-    {/if}
-    {if $usingExistingWPContact}
-            <li>An existing system user was found with the same Email address. This contact will be associated with that system user. </li>
-            <li>The password of the existing system user was not updated. The system user will continue to use their existing password.</li>
-    {/if}
-    {if $usernameChangedToWP}
-            <li>The username was changed to match the username of the system user found with the specified Email address.</li>
-            <li>The username for this contact is: <span class="glm-notice">{$contactInfo.fieldData.username}</span></li>
-    {/if}
-    {if $usernameChangedToWP || $usingExistingWPContact}
-        </ul>
-    {/if}
-
-  {else} <!-- !$option -->
-
-
-   {if apply_filters('glm_members_permit_admin_member_contacts_edit_contact', true)}
-
-    {if $option == 'create' || $option == 'edit'}
-
-         <a href="{$thisUrl}?page={$thisPage}&glm_action=contacts&member={$memberID}" class="button button-primary glm-button glm-right">Return to Contact List</a>
-
-      {if $option == 'create'}
-        <h2 class="glm-left">Add New Contact</h2>
-      {else}
-        {if $contactUpdated}<h2 class="glm-notice glm-flash-updated">Contact Updated</h2>{/if}
-        <a id="deleteContactButton" class="button button-primary glm-button glm-right">Delete this Contact</a>
-        <div id="deleteContactDialog" class="glm-dialog-box" title="Delete Contact">
-            <center>
-                <p><a id="deleteContactCancel" class="button button-primary">Cancel</a></p>
-                <p><input id="deleteContactSubmit" type="submit" value="Delete this contact"></p>
-            </center>
-            <div class="glm-item-container">
-                <p><center><span class="glm-error">WARNING:</span></center></p>
-                <p>
-                    <span class="glm-warning">Clicking the "Delete this Contact" button above will
-                    delete all of the data and images associated with this contact.
-                    </span>
-                </p>
-                <p>
-                    <span class="glm-error">Once deleted, this information will no longer be available and cannot be retrieved!</span>
-                </p>
-            </div>
-            <p>
-                This contact may instead be "Archived" rather than deleted using the "Contact Display:" pick-list. When archived, the contact is not displayed on the front-end
-                of the Web site, any login assoicated with this contact is deactivated, and the contact will not show on contact lists unless "Archived" is selected.
-                Unlike delete, an archived contact may be changed back to normal use.
-            </p>
-        </div>
-        <h2 class="glm-left">Edit Contact</h2>
-      {/if}
-
-
-        <form action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data">
-            <input type="hidden" name="glm_action" value="contacts">
-            <input type="hidden" name="member" value="{$memberData.id}">
-        {if $option == 'create'}
-            <input type="hidden" name="option" value="addNew">
-            <input type="hidden" name="create_time" value="now">
-            <input type="hidden" name="ref_type" value="{$refType}">
-            <input type="hidden" name="ref_dest" value="{$memberData.id}">
-        {else}
-            <input type="hidden" name="option" value="submit">
-            <input type="hidden" name="contact" value="{$contactInfo.fieldData.id}">
-            <input type="hidden" name="id" value="{$contactInfo.fieldData.id}">
-            <input type="hidden" name="modify_time" value="now">
-        {/if}
-
-            <table class="glm-admin-table glm-shrink">
-                <tr>
-                    <th>Contact For:</th>
-                    <td>{if $option=='create'}{$refTypeName}{else}{$contactInfo.fieldData.ref_type.name}{/if} - {$memberData.name}</td>
-                </tr>
-                <tr>
-                    <th>Active:</th>
-                    <td>
-                        <input type="checkbox" name="active" {if $contactInfo.fieldData.active.value} checked{/if}>
-                    </td>
-                </tr>
-            {if $option != 'create'}
-                <tr>
-                    <th>Created:</th>
-                    <td>{$contactInfo.fieldData.create_time.datetime}</td>
-                </tr>
-                <tr>
-                    <th>Last Updated:</th>
-                    <td>{$contactInfo.fieldData.modify_time.datetime}</td>
-                </tr>
-            {/if}
-                <tr>
-                    <th {if $contactInfo.fieldRequired.fname}class="glm-required"{/if}>First Name:</th>
-                    <td {if $contactInfo.fieldFail.fname}class="glm-form-bad-input"{/if}>
-                        <input type="text" name="fname" value="{$contactInfo.fieldData.fname}" class="glm-form-text-input-short">
-                        {if $contactInfo.fieldFail.fname}<p>{$contactInfo.fieldFail.fname}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.lname}class="glm-required"{/if}>Last Name:</th>
-                    <td {if $contactInfo.fieldFail.lname}class="glm-form-bad-input"{/if}>
-                        <input type="text" name="lname" value="{$contactInfo.fieldData.lname}" class="glm-form-text-input-short">
-                        {if $contactInfo.fieldFail.lname}<p>{$contactInfo.fieldFail.lname}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.contact_type}class="glm-required"{/if}>Contact Type:</th>
-                    <td {if $contactInfo.fieldFail.contact_type}class="glm-form-bad-input"{/if}>
-                        <select name="contact_type">
-            {foreach from=$contactInfo.fieldData.contact_type.list item=v}
-                            <option value="{$v.value}"{if $v.default} selected="selected"{/if}>
-                                {$v.name}
-                            </option>
-            {/foreach}
-                        </select>
-                        {if $contactInfo.fieldFail.contact_type}<p>{$contactInfo.fieldFail.contact_type}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.contact_role}class="glm-required"{/if}>Permissions:</th>
-                    <td {if $contactInfo.fieldFail.contact_role}class="glm-form-bad-input"{/if}>
-                        <select name="contact_role">
-            {foreach from=$contactInfo.fieldData.contact_role.list item=v}
-                            <option value="{$v.value}"{if $v.default} selected="selected"{/if}>
-                                {$v.name}
-                            </option>
-            {/foreach}
-                        </select>
-                        {if $contactInfo.fieldFail.contact_role}<p>{$contactInfo.fieldFail.contact_role}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.access}class="glm-required"{/if}>Display/Moderate/Archive:</th>
-                    <td {if $contactInfo.fieldFail.access}class="glm-form-bad-input"{/if}>
-                        <select name="access">
-            {foreach from=$contactInfo.fieldData.access.list item=v}
-                            <option value="{$v.value}"{if $v.default} selected="selected"{/if}>{$v.name}</option>
-            {/foreach}
-                        </select>
-                        {if $contactInfo.fieldFail.access}<p>{$contactInfo.fieldFail.access}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-            {if $option == 'create'}
-                    <th {if $contactInfo.fieldRequired.email}class="glm-required"{/if}>Email Address:</th>
-                    <td {if $contactInfo.fieldFail.email}class="glm-form-bad-input"{/if}>
-                        <input type="text" name="email" value="{$contactInfo.fieldData.email}" class="glm-form-text-input-medium" placeholder="(ex: name@domain.com)">
-                        <br><span class="glm-notice">NOTE:</span> This field is required for users who will have login privileges.
-                        {if $contactInfo.fieldFail.email}<p>{$contactInfo.fieldFail.email}</p>{/if}
-                    </td>
-            {else}
-                    <th>Email Address::</th>
-                    <td>{$contactInfo.fieldData.email}</td>
-            {/if}
-                </tr>
-                <tr>
-
-            {if $option == 'create'}
-                    <th {if $contactInfo.fieldRequired.username}class="glm-required"{/if}>Login Username:</th>
-                    <td {if $contactInfo.fieldFail.username}class="glm-form-bad-input"{/if}>
-                        <input type="text" name="username" value="{$contactInfo.fieldData.username}" class="glm-form-text-input-medium" placeholder="(no spaces permitted)">
-                        <br><span class="glm-notice">NOTE:</span> The username cannot be changed once the contact is created.
-                        {if $contactInfo.fieldFail.username}<p>{$contactInfo.fieldFail.username}</p>{/if}
-                    </td>
-            {else}
-                    <th>Login Username:</th>
-                    <td>{$contactInfo.fieldData.username}</td>
-            {/if}
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.password}class="glm-required"{/if}>Login password:</th>
-                    <td {if $contactInfo.fieldFail.password}class="glm-form-bad-input"{/if}>
-                        <input type="text" name="password" value="{$contactInfo.fieldData.password}" class="glm-form-text-input-medium" placeholder="{if $option=='create'}(no spaces permitted){else}(Password does not show, only enter to change password.){/if}">
-                        {if $option == 'create'}
-                            <span class="glm-notice">Save this password.</span>
-                            <br>A randomly generated password has been supplied. You may change this as desired.
-                            There is no way to view a password once it's set. However, a user may recover a password using their
-                            Email address at the login page.
-                        {else}
-                            <br>NOTE: Enter a password here <b><i>only</i></b> if you need to change it.
-                        {/if}
-                            <br>The password must be at least 8 characters and include at least one number, one letter, and at least one
-                            special character. (# . - _ , $ % & !)</b>
-                        {if $contactInfo.fieldFail.password}<p>{$contactInfo.fieldFail.password}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.alt_email}class="glm-required"{/if}>Alternate Email Address:</th>
-                    <td {if $contactInfo.fieldFail.alt_email}class="glm-form-bad-input"{/if}>
-                        <input type="text" name="alt_email" value="{$contactInfo.fieldData.alt_email}" class="glm-form-text-input-short" placeholder="ex: name@domain.com">
-                        {if $contactInfo.fieldFail.alt_email}<p>{$contactInfo.fieldFail.alt_email}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.org}class="glm-required"{/if}>Organization:</th>
-                    <td {if $contactInfo.fieldFail.org}class="glm-form-bad-input"{/if}>
-                        <input type="text" name="org" value="{$contactInfo.fieldData.org}" class="glm-form-text-input-medium">
-                        {if $contactInfo.fieldFail.org}<p>{$contactInfo.fieldFail.org}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.title}class="glm-required"{/if}>Title/Position:</th>
-                    <td {if $contactInfo.fieldFail.title}class="glm-form-bad-input"{/if}>
-                        <input type="text" name="title" value="{$contactInfo.fieldData.title}" class="glm-form-text-input-medium">
-                        {if $contactInfo.fieldFail.title}<p>{$contactInfo.fieldFail.title}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.descr}class="glm-required"{/if}>Position/Responsibilities:</th>
-                    <td {if $contactInfo.fieldFail.descr}class="glm-form-bad-input"{/if}>
-                        {php}
-                            wp_editor('{$contactInfo.fieldData.descr|escape:quotes}', 'glm_descr', array(
-                                'quicktags' => false,
-                                'media_buttons' => false,
-                                'wpautop' => false,
-                                'textarea_name' => 'descr',
-                                'editor_height' => 100,     // Height in px, overrides editor_rows
-                                    // 'textarea_rows' => 4,
-                            ));
-                        {/php}
-                        {if $contactInfo.fieldFail.descr}<p>{$contactInfo.fieldFail.descr}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.image}class="glm-required"{/if}>Image:</th>
-                    <td {if $contactInfo.fieldFail.image}class="glm-form-bad-input"{/if}>
-            {if $contactInfo.fieldData.image}
-                        <div id="largeImageDialog" class="glm-dialog-box" title="Large sized image">
-                            <img src="{$glmPluginMediaUrl}/images/large/{$contactInfo.fieldData.image}">
-                            <a id="largeImageCancel" class="button button-primary glm-right">Close</a><br>
-                        </div>
-                        <table class="glm-admin-image-edit-table">
-                            <tr>
-                                <td><img src="{$glmPluginMediaUrl}/images/thumb/{$contactInfo.fieldData.image}"></td>
-                                <td>
-                                    <input type="checkbox" name="image_delete"> Delete Image<br>
-                                    {$contactInfo.fieldData.image}<br>
-                                    <p><div id="largeImageButton" class="button button-primary">Show Large Image</div></p>
-                                </td>
-
-                            </tr>
-                        </table>
-            {/if}
-                        <input type="file" name="image_new">
-                        {if $contactInfo.fieldFail.image}<p>{$contactInfo.fieldFail.image}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.addr1}class="glm-required"{/if}>Address Line 1:</th>
-                    <td {if $contactInfo.fieldFail.addr1}class="glm-form-bad-input"{/if}>
-                        <input type="text" id="addr1" name="addr1" value="{$contactInfo.fieldData.addr1}" class="glm-form-text-input glm-geocodeAction">
-                        {if $contactInfo.fieldFail.addr1}<p>{$contactInfo.fieldFail.addr1}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.addr2}class="glm-required"{/if}>Address Line 2:</th>
-                    <td {if $contactInfo.fieldFail.addr2}class="glm-form-bad-input"{/if}>
-                        <input id="addr2" type="text" name="addr2" value="{$contactInfo.fieldData.addr2}" class="glm-form-text-input glm-geocodeAction">
-                        {if $contactInfo.fieldFail.addr2}<p>{$contactInfo.fieldFail.addr2}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th>City</th>
-                    <td class="glm-item-container">
-                        <!--  Add new city dialog -->
-                        <div id="newCityButton" class="button button-secondary glm-right">Add a new City</div>
-                        <div id="newCityDialog" class="glm-dialog-box" title="Enter a New City">
-                            <table class="glm-admin-table">
-                                <tr>
-                                    <th class="glm-required">City Name:</th>
-                                    <td id="newCityNameTD">
-                                        <input id="newCityName" type="text" name="newCityName" class="glm-form-text-input">
-                                        <div id="newCityNameRequired"></div>
-                                    </td>
-                                </tr>
-                            </table>
-                            <p><span class="glm-required">*</span> Required</p>
-                            <a id="newCityCancel" class="button button-primary glm-right">Cancel</a>
-                            <input id="newCitySubmit" type="submit" value="Add new City">
-                        </div>
-                        <!-- City Selection -->
-                        <input id="cityName" type="hidden" name="newCityName" value=""><!-- this field is only used if adding a new city to pass the new name -->
-                        <select name="city" id="city" class="glm-geocodeAction">
-                            <option value="0"><option>
-            {foreach from=$contactInfo.fieldData.city.list item=v}
-                            <option value="{$v.value}"{if $v.default} selected="selected"{/if}>
-                                {$v.name}
-                            </option>
-            {/foreach}
-                        </select>
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.state}class="glm-required"{/if}>State:</th>
-                    <td {if $contactInfo.fieldFail.state}class="glm-form-bad-input"{/if}>
-                        <select id="state" name="state" class="glm-geocodeAction">
-            {foreach from=$contactInfo.fieldData.state.list item=v}
-                            <option value="{$v.value}"{if $v.default} selected="selected"{/if}>
-                                {$v.name}
-                            </option>
-            {/foreach}
-                        </select>
-                        {if $contactInfo.fieldFail.state}<p>{$contactInfo.fieldFail.state}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.zip}class="glm-required"{/if}>ZIP / Postal Code:</th>
-                    <td {if $contactInfo.fieldFail.zip}class="glm-form-bad-input"{/if}>
-                        <input id="zip" type="text" name="zip" value="{$contactInfo.fieldData.zip}" class="glm-form-text-input-short glm-geocodeAction">
-                        {if $contactInfo.fieldFail.zip}<p>{$contactInfo.fieldFail.zip}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.country}class="glm-required"{/if}>Country:</th>
-                    <td {if $contactInfo.fieldFail.country}class="glm-form-bad-input"{/if}>
-                        <select id="country" name="country" class="glm-geocodeAction">
-            {foreach from=$contactInfo.fieldData.country.list item=v}
-                            <option value="{$v.value}"{if $v.default} selected="selected"{/if}>
-                                {$v.name} {$v.value}
-                            </option>
-            {/foreach}
-                        </select>
-                        {if $contactInfo.fieldFail.country}<p>{$contactInfo.fieldFail.country}</p>{/if}
-                    </td>
-                </tr>
-            <!-- NOT DOING LAT/LON FOR NOW -->
-                <tr>
-                    <th {if $contactInfo.fieldRequired.url}class="glm-required"{/if}>Web Address (URL):</th>
-                    <td {if $contactInfo.fieldFail.url}class="glm-form-bad-input"{/if}>
-            {if $contactInfo.fieldData.url}
-                        <a class="button button-secondary glm-right" href="http://{$contactInfo.fieldData.url}" target="urlTarget">Test Link</a>
-            {/if}
-                        http://<input type="text" name="url" value="{$contactInfo.fieldData.url}" class="glm-form-text-input-medium" placeholder="ex: www.gaslightmedia.com">
-                        {if $contactInfo.fieldFail.url}<p>{$contactInfo.fieldFail.url}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.office_phone}class="glm-required"{/if}>Office Phone #:</th>
-                    <td {if $contactInfo.fieldFail.office_phone}class="glm-form-bad-input"{/if}>
-                        <input type="text" name="office_phone" value="{$contactInfo.fieldData.office_phone}" class="glm-form-text-input-short" placeholder="ex: 123-456-7890 ext 123">
-                        {if $contactInfo.fieldFail.office_phone}<p>{$contactInfo.fieldFail.office_phone}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.home_phone}class="glm-required"{/if}>Home Phone #:</th>
-                    <td {if $contactInfo.fieldFail.home_phone}class="glm-form-bad-input"{/if}>
-                        <input type="text" name="home_phone" value="{$contactInfo.fieldData.home_phone}" class="glm-form-text-input-short" placeholder="ex: 123-456-7890 ext 123">
-                        {if $contactInfo.fieldFail.home_phone}<p>{$contactInfo.fieldFail.home_phone}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.mobile_phone}class="glm-required"{/if}>Mobile Phone #:</th>
-                    <td {if $contactInfo.fieldFail.mobile_phone}class="glm-form-bad-input"{/if}>
-                        <input type="text" name="mobile_phone" value="{$contactInfo.fieldData.mobile_phone}" class="glm-form-text-input-short" placeholder="ex: 123-456-7890 ext 123">
-                        {if $contactInfo.fieldFail.mobile_phone}<p>{$contactInfo.fieldFail.mobile_phone}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.alt_phone}class="glm-required"{/if}>Alternate Phone #:</th>
-                    <td {if $contactInfo.fieldFail.alt_phone}class="glm-form-bad-input"{/if}>
-                        <input type="text" name="alt_phone" value="{$contactInfo.fieldData.alt_phone}" class="glm-form-text-input-short" placeholder="ex: 123-456-7890 ext 123">
-                        {if $contactInfo.fieldFail.alt_phone}<p>{$contactInfo.fieldFail.alt_phone}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.fax}class="glm-required"{/if}>FAX #:</th>
-                    <td {if $contactInfo.fieldFail.fax}class="glm-form-bad-input"{/if}>
-                        <input type="text" name="fax" value="{$contactInfo.fieldData.fax}" class="glm-form-text-input-short" placeholder="ex: 123-456-7890 ext 123">
-                        {if $contactInfo.fieldFail.fax}<p>{$contactInfo.fieldFail.fax}</p>{/if}
-                    </td>
-                </tr>
-                <tr>
-                    <th {if $contactInfo.fieldRequired.notes}class="glm-required"{/if}>Notes:</th>
-                    <td {if $contactInfo.fieldFail.notes}class="glm-form-bad-input"{/if}>
-                        {php}
-                            wp_editor('{$contactInfo.fieldData.notes}', 'glm_notes', array(
-                                'quicktags' => false,
-                                'media_buttons' => false,
-                                'wpautop' => false,
-                                'textarea_name' => 'notes',
-                                'editor_height' => 100,     // Height in px, overrides editor_rows
-                                    // 'textarea_rows' => 4,
-                            ));
-                        {/php}
-                        {if $contactInfo.fieldFail.notes}<p>{$contactInfo.fieldFail.notes}</p>{/if}
-                    </td>
-                </tr>
-            </table>
-            <p><span class="glm-required">*</span> Required</p>
-            <input id="updateContact" type="submit" value="{if $contactID && $contactInfo}Update contact{else}Add new contact{/if}">
-        </form>
-
-    {/if}
-
-   {else} <!-- may edit contact -->
-
-            <table class="glm-admin-table glm-shrink">
-                <tr><th>Contact For:</th><td>{$contactInfo.fieldData.ref_type.name} - {$memberData.name}</td></tr>
-                <tr><th>Active:</th><td>{$contactInfo.fieldData.active.name}</td></tr>
-                <tr><th>Created:</th><td>{$contactInfo.fieldData.create_time.datetime}</td></tr>
-                <tr><th>Last Updated:</th><td>{$contactInfo.fieldData.modify_time.datetime}</td></tr>
-                <tr><th>First Name:</th><td>{$contactInfo.fieldData.fname}</td></tr>
-                <tr><th>Last Name:</th><td>{$contactInfo.fieldData.lname}</td></tr>
-                <tr><th>Contact Type:</th><td>{$contactInfo.fieldData.contact_type.name}</td></tr>
-                <tr><th>Email Address::</th><td>{$contactInfo.fieldData.email}</td></tr>
-                <tr><th>Alternate Email Address:</th><td>{$contactInfo.fieldData.alt_email}</td></tr>
-                <tr><th>Organization:</th><td>{$contactInfo.fieldData.org}</td></tr>
-                <tr><th>Title/Position:</th><td>{$contactInfo.fieldData.title}</td></tr>
-                <tr><th>Position/Responsibilities:</th><td>{$contactInfo.fieldData.descr}</td></tr>
-                <tr>
-                    <th>Image:</th>
-                    <td>
-            {if $contactInfo.fieldData.image}
-                        <img src="{$glmPluginMediaUrl}/images/thumb/{$contactInfo.fieldData.image}">
-            {/if}
-                    </td>
-                </tr>
-                <tr><th>Address Line 1:</th><td>{$contactInfo.fieldData.addr1}</td></tr>
-                <tr><th>Address Line 2:</th><td>{$contactInfo.fieldData.addr2}</td></tr>
-                <tr><th>City</th><td>{$contactInfo.fieldData.city.name}</td></tr>
-                <tr><th>State:</th><td>{$contactInfo.fieldData.state.name}</td></tr>
-                <tr><th>ZIP / Postal Code:</th><td>{$contactInfo.fieldData.zip}</td></tr>
-                <tr><th>Country:</th><td>{$contactInfo.fieldData.country.name}</td></tr>
-                <tr>
-                    <th>Web Address (URL):</th>
-                    <td>
-            {if $contactInfo.fieldData.url}
-                        <a href="http://{$contactInfo.fieldData.url}" target="urlTarget">{$contactInfo.fieldData.url}</a>
-            {/if}
-                    </td>
-                </tr>
-                <tr><th>Office Phone #:</th><td>{$contactInfo.fieldData.office_phone}</td></tr>
-                <tr><th>Home Phone #:</th><td>{$contactInfo.fieldData.home_phone}</td></tr>
-                <tr><th>Mobile Phone #:</th><td>{$contactInfo.fieldData.mobile_phone}</td></tr>
-                <tr><th>Alternate Phone #:</th><td>{$contactInfo.fieldData.alt_phone}</td></tr>
-                <tr><th>FAX #:</th><td>{$contactInfo.fieldData.fax}</td></tr>
-                <tr><th>Notes:</th><td>{$contactInfo.fieldData.notes}</td></tr>
-            </table>
-   {/if} <!-- mey edit contact -->
-
-  {/if} <!-- /if option -->
-
-{else} <!-- Member not specified or not found -->
-    <h2 class="glm-error">No current {$terms.term_member}.</h2>
-{/if}
-
-    <script type="text/javascript">
-        jQuery(document).ready(function($) {
-
-            // Filter triggers
-            $(".listFilter" ).change( function() {
-
-                var filter = '';
-
-                // Check for archived filter
-                if ($("#filterArchived").attr('checked')) {
-                    filter += '&filterArchived=true';
-                }
-
-                // Check for name filter
-                var filterText = $("#filterText").val();
-                if (filterText != '') {
-                    filter += '&filterText=' + encodeURIComponent(filterText).replace(/%20/g,'+');
-                }
-
-                window.location.href = "{$thisUrl}?page={$thisPage}&glm_action=contacts&member={$memberID}" + filter;
-
-                return false;
-            });
-
-            /*
-             * New City Dialog
-             */
-
-            // Setup dialog box for adding a new city
-            $("#newCityDialog").dialog({
-                autoOpen: false,
-                minWidth: 400,
-                dialogClass: "glm-dialog-no-close"
-            });
-            $('#newCityCancel').click( function() {
-                $("#newCityDialog").dialog("close");
-            });
-
-            // Ad a new city button action - pop-up dialog
-            $('#newCityButton').click( function() {
-                $("#newCityDialog").dialog("open");
-            });
-
-            // Submit new city
-            var newCityAdded = false;
-            $('#newCitySubmit').click( function() {
-
-                // Get new city name
-                var newCityName = $('#newCityName').val();
-
-                // If no name is supplied, notify used it's required
-                if (newCityName == '') {
-                    $('#newCityNameTD').addClass('glm-form-bad-input');
-                    $('#newCityNameRequired').text('A city name is required!');
-                    return false;
-                }
-
-                // Add new city name to the hidden field that will pass the new name to PHP.
-                $('#cityName').val(newCityName);
-
-                // Add new city name to picklist and for storing - Only one permitted per submission
-                if (newCityAdded) {
-
-                    // New city already added, so just update the name and select that one
-                    $('#city').val(-1);
-                    $('#city option:selected').text(newCityName);
-
-                } else {
-
-                    // Add the new city name to the city picklist
-                    $('#city').append('<option value="-1">' + newCityName + '</option>');
-                    $('#city').val(-1);
-                    $('#newCityNameTD').append('<input type="hidden" name="newCity" value="' + newCityName + '">');
-                    newCityAdded = true;
-
-                }
-
-                // Clear new city name from form
-                $('#newCityName').val('');
-
-                $("#newCityDialog").dialog("close");
-
-            });
-
-            /*
-             * Large Image Dialog
-             */
-
-            // Setup dialog box for showing enlarged image image
-            x = $('#largeImageDialog').dialog({
-                autoOpen: false,
-                resizable: false,
-                dialogClass: "glm-dialog-no-close"
-            });
-            $('#largeImageCancel').click( function() {
-                $('#largeImageDialog').dialog("close");
-            });
-
-            // Show large image - pop-up dialog - resize at time of pop-up
-            $('#largeImageButton').click( function() {
-                $("#largeImageDialog").dialog("open");
-                $( "#largesImageDialog" ).dialog( "option", "position", { my: "center", at: "center", of: window } );
-                var newWidth = $(window).width() * .8;
-                $( "#largeImageDialog" ).dialog( "option", "width", newWidth );
-            });
-
-            // Resize whenever window size changes
-            $(window).resize(function(){
-                $( "#largeImageDialog" ).dialog( "option", "position", { my: "center", at: "center", of: window } );
-                var newWidth = $(window).width() * .8;
-                $( "#largeImageDialog" ).dialog( "option", "width", newWidth );
-            });
-
-            // Delete Contact dialog
-            $("#deleteContactDialog").dialog({
-                autoOpen: false,
-                minWidth: 400,
-                dialogClass: "glm-dialog-no-close"
-            });
-            $('#deleteContactButton').click( function() {
-                $('#deleteContactDialog').dialog('open');
-            });
-            $('#deleteContactCancel').click( function() {
-                $("#deleteContactDialog").dialog("close");
-            });
-            $('#deleteContactSubmit').click( function() {
-                window.location.replace("{$thisUrl}?page={$thisPage}&glm_action=contacts&member={$memberID}&option=delete&contact={$contactID}");
-            });
-
-            // Flash certain elements for a short time after display
-            $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
-
-        });
-    </script>
-
-
-{include file='admin/footer.html'}
index 79201e0..f594b44 100644 (file)
                 <tr>
                     <th {if $contactInfo.fieldRequired.descr}class="glm-required"{/if}>Position/Responsibilities:</th>
                     <td {if $contactInfo.fieldFail.descr}class="glm-form-bad-input"{/if}>
-                        {php}
-                            wp_editor('{$contactInfo.fieldData.descr|escape:quotes}', 'glm_descr', array(
-                                'quicktags' => false,
-                                'media_buttons' => false,
-                                'wpautop' => false,
-                                'textarea_name' => 'descr',
-                                'editor_height' => 100,     // Height in px, overrides editor_rows
-                                    // 'textarea_rows' => 4,
-                            ));
-                        {/php}
+                        {wp_editor(
+                            $contactInfo.fieldData.descr,
+                            'glm_descr',
+                            json_decode('{
+                                "media_buttons":    false,
+                                "quicktags":        false,
+                                "textarea_name":    "descr",
+                                "editor_height":    100
+                            }', true)
+                        )}
                         {if $contactInfo.fieldFail.descr}<p>{$contactInfo.fieldFail.descr}</p>{/if}
                     </td>
                 </tr>