Get form back in
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 10 May 2016 21:03:41 +0000 (17:03 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 10 May 2016 21:03:41 +0000 (17:03 -0400)
Update the field name in the data abstract so it will work
working on the correct values from the array of urls to populate the
form.

classes/data/dataUrls.php
models/admin/member/social.php
notes.md [new file with mode: 0644]
views/admin/settings/social.html

index 373a89a..2e3218e 100644 (file)
@@ -151,8 +151,8 @@ class GlmDataUrls extends GlmDataAbstract
                 'use' => 'a'
             ),
             // The social medium
-            'social' => array (
-                'field' => 'social',
+            'medium' => array (
+                'field' => 'medium',
                 'type' => 'text',
                 'default' => true,
                 'use' => 'a'
@@ -181,4 +181,4 @@ class GlmDataUrls extends GlmDataAbstract
 
 }
 
-?>
\ No newline at end of file
+?>
index 9dadd0f..bed3875 100644 (file)
@@ -139,8 +139,16 @@ class GlmMembersAdmin_member_social //extends GlmDataUrls
         }
 
         // Refresh the Url list before returning it
-        $urlList = $Urls->getList();
+        $memberUrlList = array();
+        $urlList = $Urls->getList("member_id = " . $memberID);
+        if (!empty($urlList)) {
+            foreach ($urlList as $url) {
+
+                $memberUrlList[strtolower($url['medium'])] = $url['url'];
+            }
+        }
         if ($debug) {
+            echo '<pre>$urlList: ' . print_r($urlList, true) . '</pre>';
             echo "<hr />Request:<table>";
             foreach($_REQUEST as $key=>$value) {
                 echo("<tr><td>$key</td><td>$value</td></tr>");
@@ -156,7 +164,7 @@ class GlmMembersAdmin_member_social //extends GlmDataUrls
         $templateData = array(
             'displayData' => $displayData,
             'socials' => $socialList,
-            'urlList' => $urlList[$memberID],
+            'urlList' => $memberUrlList,
             'assetsUrl' => GLM_MEMBERS_SOCIAL_PLUGIN_ASSETS_URL,
             'urlUpdated' => $urlUpdated,
             'socialError' => $socialError,
diff --git a/notes.md b/notes.md
new file mode 100644 (file)
index 0000000..cd2d266
--- /dev/null
+++ b/notes.md
@@ -0,0 +1,6 @@
+# Notes for the social plugin
+
+When you goto the members social tab then click the social tab again it is not keeping the member id in the url and dies.
+
+The social urls are not being put back into the form.
+
index b552145..ae0c44d 100644 (file)
@@ -22,7 +22,7 @@
                     <td class="glm-member-db-social-management-name">
                         {$socialItem.name}
                     </td>
-<!--                    <td>
+-                    <td>
                         <input type="button" class="button glm-button submit" value="Change Icon" name="newSocialIcon">
                     </td>
                     <td>
@@ -42,7 +42,7 @@
                         </div>
                     </td>
                     <td colspan="2"><b>New image:</b> <input type="file" name="logo_new"></td>
-                    <td><div id="glm-galleryImageLarger_logo" class="glm-imageDialog"></div></td>-->
+                    <td><div id="glm-galleryImageLarger_logo" class="glm-imageDialog"></div></td>
                 </tr>
             {/foreach}
             </table>
@@ -57,4 +57,4 @@
             $(".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).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
         });
 </script>
-{include file='admin/footer.html'}
\ No newline at end of file
+{include file='admin/footer.html'}