Update the footor and off-canvas areas
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 3 Jun 2015 15:58:12 +0000 (11:58 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 3 Jun 2015 15:58:12 +0000 (11:58 -0400)
Bring in the data from the glm-client-info plugin

footer.php
functions.php
parts/off-canvas-menu.php

index 747f582..e1d28c8 100644 (file)
@@ -12,9 +12,9 @@
                                                 <a href="#"><img src="<?php echo get_template_directory_uri(); ?>/assets/enews-signup.jpg"></a>
                                             </div>
                                             <div id="footer_address" class="small-12 medium-6 columns text-center">
-                                                <h3>Toski Sands Market</h3>
-                                                <span>2296 Petoskey Harbor Springs Rd (M-119)</span>
-                                                <span>Petoskey, MI 49770</span>
+                                            <h3><?php echo glm_get_clientinfo_option('businessName');?></h3>
+                                                <span><?php echo glm_get_clientinfo_option('address');?></span>
+                                                <span><?php echo glm_get_clientinfo_option('city');?>, <?php echo glm_get_clientinfo_option('state');?> <?php echo glm_get_clientinfo_option('zip');?></span>
                                                 <br><span>
                                                     <a href="<?php echo get_home_url(); ?>/location/">
                                                         Location
                                             </div>
                                         </div>
                                         <div class="row">
+                                            <?php
+                                            $extraContent = glm_get_clientinfo_option('extra');
+                                            $extra = explode("\n", $extraContent);
+                                            foreach ($extra as $item) :?>
                                             <div class="large-4 columns show-for-large-up">
-                                                <p><strong>Market:</strong> 231-347-1571</p>
-                                            </div>
-                                            <div class="large-4 columns show-for-large-up">
-                                                <p><strong>Party Store:</strong> 231-347-9631</p>
-                                            </div>
-                                            <div class="large-4 columns show-for-large-up">
-                                                <p><strong>Fax:</strong> 231-347-3542</p>
+                                            <?php if (strpos($item, ':')) :?>
+                                            <?php $extraParts = explode(":", $item);?>
+                                                <p><strong><?php echo $extraParts[0];?>:</strong> <?php echo $extraParts[1];?></p>
+                                            <?php endif;?>
                                             </div>
+                                            <?php endforeach; ?>
                                         </div>
                                     </div>
                                 </div>
index 9765bde..b7827df 100644 (file)
@@ -6,6 +6,21 @@ $includePages = array();
 $frontPageId  = get_option('page_on_front');
 add_action('widgets_init', 'glm_quicksite_widget_init');
 
+if (!function_exists('glm_get_clientinfo_option')) {
+    function glm_get_clientinfo_option($name)
+    {
+        $settings = get_option('glmclientinfo_settings');
+        $states   = get_option('glmclientinfo_states');
+        if ($name == 'stateFull' && $settings['state']) {
+            return $states[$settings['state']];
+        }
+        if ($name == 'state2Full' && $settings['state2']) {
+            return $states[$settings['state2']];
+        }
+        return ($settings && $settings[$name]) ? $settings[$name]: null;
+    }
+}
+
 if (!function_exists('glm_quicksite_widget_init')) {
 
     function glm_quicksite_widget_init()
@@ -173,7 +188,7 @@ function glm_side_menu() {
     } else {
         $ID = $parent->ID;
     }
-    echo '<h1>'.get_the_title($ID).'</h1>';    
+    echo '<h1>'.get_the_title($ID).'</h1>';
     echo '<ul class="sidebar"><!-- begin -->'."\n";
     echo wp_list_pages( 'child_of='.$ID.'&title_li=&depth=1&echo=0');
     echo '</ul><!-- end -->'."\n";
index 0f34861..caa5233 100644 (file)
@@ -5,11 +5,20 @@
         <li><a href="#">Contact</a></li>
     </ul>
     <ul>
-        <li>2296 Petoskey <br>Harbor Springs Rd (M-119)</li>
-        <li>Petoskey, MI 49770</li>
-        <li><strong>Market:</strong> 231-347-1571</li>
-        <li><strong>Party Store:</strong> 231-347-9631</li>
-        <li><strong>Fax:</strong> 231-347-3542</li>
+        <li><?php echo glm_get_clientinfo_option('address');?></li>
+        <li><?php echo glm_get_clientinfo_option('city');?>, <?php echo glm_get_clientinfo_option('state');?> <?php echo glm_get_clientinfo_option('zip');?></li>
+        <?php
+        $extraContent = glm_get_clientinfo_option('extra');
+        $extra = explode("\n", $extraContent);
+        foreach ($extra as $item) :?>
+        <li>
+
+        <?php if (strpos($item, ':')) :?>
+        <?php $extraParts = explode(":", $item);?>
+            <strong><?php echo $extraParts[0];?>:</strong> <?php echo $extraParts[1];?>
+        <?php endif;?>
+        </li>
+        <?php endforeach; ?>
     </ul>
     <ul class="offcavas-social-list">
         <li><a href="https://www.facebook.com/pages/Toski-Sands-Market-Wine-Shop/149657178496827"><img src="<?php echo get_template_directory_uri(); ?>/assets/facebook-icon.png"></a></li>