setting up functions file reader for lib modules
authoranthony <astalarico@gmail.com>
Tue, 12 Jun 2018 02:05:45 +0000 (22:05 -0400)
committeranthony <astalarico@gmail.com>
Tue, 12 Jun 2018 02:05:45 +0000 (22:05 -0400)
25 files changed:
dev/app.scss
dev/core/defaults/functions/defaults.php [new file with mode: 0644]
dev/core/defaults/functions/menu-walker.php [new file with mode: 0644]
dev/core/defaults/functions/navigation.php [new file with mode: 0644]
dev/core/defaults/menu-walker.php [deleted file]
dev/core/defaults/navigation.php [deleted file]
dev/core/footer/functions/footer.php [new file with mode: 0644]
dev/core/front-page/functions/front-page.php [new file with mode: 0644]
dev/core/interior-page/functions/interior-page.php [new file with mode: 0644]
dev/core/off-canvas-overlay/functions/off-canvas-overlay.php [new file with mode: 0644]
dev/core/off-canvas/functions/off_canvas.php [new file with mode: 0644]
dev/core/topbar/functions/topbar.php [new file with mode: 0644]
dev/custom/action-items/action-items.js [deleted file]
dev/custom/action-items/action-items.js.off [new file with mode: 0644]
dev/custom/action-items/functions/action-items.php [new file with mode: 0644]
dev/custom/glm-blocks/functions/glm-blocks.php [new file with mode: 0644]
dev/custom/glma/functions/glma.php [new file with mode: 0644]
dev/custom/nextgen/functions/nextgen.php [new file with mode: 0644]
dev/custom/sidebar/functions/sidebar.php [new file with mode: 0644]
dev/custom/slideshow/functions/slideshow.php [new file with mode: 0644]
dev/custom/slideshow/slideshow.js [deleted file]
dev/custom/slideshow/slideshow.js.off [new file with mode: 0644]
dev/modules.php
functions.php
setup/renderer.js

index 812e806..7202ec1 100644 (file)
 
 /*Custom Modules */
 @import "custom/sidebar/sidebar";
-@import "custom/slideshow/slideshow";
+//@import "custom/slideshow/slideshow";
 @import "custom/gravity-forms/gravity-forms";
 @import "custom/weather/weather";
 @import "custom/nextgen/nextgen";
 @import "custom/glma/glm-member-db";
-@import "custom/glma/glm-member-db-events";
-@import "custom/blocks/blocks";
+//@import "custom/glma/glm-member-db-events";
+//@import "custom/blocks/blocks";
 @import "custom/action-items/action-items";
 @import "custom/svg-map/svg-map";
-@import "custom/woocommerce/woocommerce";
\ No newline at end of file
+@import "custom/woocommerce/woocommerce";";";";";
\ No newline at end of file
diff --git a/dev/core/defaults/functions/defaults.php b/dev/core/defaults/functions/defaults.php
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dev/core/defaults/functions/menu-walker.php b/dev/core/defaults/functions/menu-walker.php
new file mode 100644 (file)
index 0000000..6141090
--- /dev/null
@@ -0,0 +1,81 @@
+<?php
+/**
+ * Customize the output of menus for Foundation top bar
+ */
+if ( ! class_exists( 'Glm_Theme_Top_Bar_Walker' ) ) :
+class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu {
+    function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) {
+        static $mainLevelCounter;
+        if ($depth == 0) {
+            ++$mainLevelCounter;
+        }
+        $element->has_children = ! empty( $children_elements[ $element->ID ] );
+        $element->classes[] = ( $element->current || $element->current_item_ancestor ) ? 'active' : '';
+        $element->classes[] = ( $element->has_children && 1 !== $max_depth ) ? 'has-dropdown' : '';
+        $element->classes[] = ( $element->post_parent == 0 && $mainLevelCounter <= 3 ) ? 'drop-right' : 'drop-left';
+        parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
+    }
+
+    function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
+        $item_html = '';
+        parent::start_el( $item_html, $object, $depth, $args );
+
+        // Insert style to display page's thumbnail
+        $item_style = '';
+        if ($depth == 0 && has_post_thumbnail((int)$object->object_id)) {
+            $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id((int)$object->object_id), 'large');
+            $item_style .= "<style>#menu-item-".$object->ID." > .dropdown:before { background-image: url('".$thumbnail[0]."');</style>";
+        }
+        //$output .= ( 0 == $depth ) ? '<li class="divider"></li>' : '';
+        $classes = empty( $object->classes ) ? array() : (array) $object->classes;
+        if ( in_array( 'label', $classes ) ) {
+            //$output .= '<li class="divider"></li>';
+            $item_html = preg_replace( '/<a[^>]*>(.*)<\/a>/iU', '<label>$1</label>', $item_html );
+        }
+        if ( in_array( 'divider', $classes ) ) {
+            $item_html = preg_replace( '/<a[^>]*>( .* )<\/a>/iU', '', $item_html );
+        }
+        if ($item_style)
+            $output .= $item_style;
+        $output .= $item_html;
+    }
+
+    function start_lvl( &$output, $depth = 0, $args = array() ) {
+        $output .= "\n<ul class=\"sub-menu dropdown\">\n";
+    }
+}
+endif;
+if ( ! class_exists( 'Glm_Theme_Off_Canvas_Walker' ) ) :
+class Glm_Theme_Off_Canvas_Walker extends Walker_Nav_Menu {
+    function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) {
+        $element->has_children = ! empty( $children_elements[ $element->ID ] );
+        $element->classes[] = ( $element->current || $element->current_item_ancestor ) ? 'active' : '';
+        $element->classes[] = ( $element->has_children && 1 !== $max_depth ) ? 'page_item_has_children' : '';
+        $element->classes[] = 'page_item';
+
+        parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
+    }
+
+    function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
+        $item_html = '';
+        parent::start_el( $item_html, $object, $depth, $args );
+
+        $classes = empty( $object->classes ) ? array() : (array) $object->classes;
+
+        if ( in_array( 'label', $classes ) ) {
+            $item_html = preg_replace( '/<a[^>]*>(.*)<\/a>/iU', '<label>$1</label>', $item_html );
+        }
+        $item_html = preg_replace("/<br>/", " ", $item_html);
+        $output .= $item_html;
+    }
+
+    function start_lvl( &$output, $depth = 0, $args = array() ) {
+        $output .= "\n<ul class=\"children\">\n";
+    }
+
+    function end_lvl(&$output, $depth = 0, $args = array()){
+        $output .= '</ul>';
+    }
+}
+endif;
+?>
diff --git a/dev/core/defaults/functions/navigation.php b/dev/core/defaults/functions/navigation.php
new file mode 100644 (file)
index 0000000..68365b4
--- /dev/null
@@ -0,0 +1,178 @@
+<?php
+
+register_nav_menus(array(
+  'top-bar'     => 'Site Navigation',
+  'mobile-menu' => 'Off Canvas'
+));
+if ( ! function_exists( 'glm_theme_members_only' ) ) {
+    function glm_theme_members_only($location) {
+        echo '<ul class="members-only">';
+        echo glm_theme_top_bar( $location );
+        echo '</ul>';
+    }
+}
+
+/**
+ * Top Bar
+ */
+if ( ! function_exists( 'glm_theme_top_bar' ) ) {
+  function glm_theme_top_bar($location) {
+      wp_nav_menu(array(
+          'container' => false,                           // remove nav container
+          'container_class' => '',                        // class of container
+          'menu' => '',                                   // menu name
+          'menu_class' => '',                             // adding custom nav class
+          'theme_location' => $location,                  // where it's located in the theme
+          'before' => '',                                 // before each link <a>
+          'after' => '',                                  // after each link </a>
+          'link_before' => '',                            // before each link text
+          'link_after' => '',                             // after each link text
+          'depth' => 3,                                   // limit the depth of the nav
+          'fallback_cb' => false,                         // fallback function (see below)
+          'walker' => new Glm_Theme_Top_Bar_Walker()
+      ));
+  }
+}
+
+/**
+ * Mobile off-canvas
+ */
+if ( ! function_exists( 'glm_theme_mobile_off_canvas' ) ) {
+    function glm_theme_mobile_off_canvas($location) {
+        echo '<div class="left-off-canvas-list">';
+        echo '<ul><li class="page_item"><a href="' . get_bloginfo('url') . '">Home</a></li>';
+        echo glm_get_mobile_nav_menu( $location );
+        echo glm_get_mobile_nav_menu( 'top-bar' );
+        echo '</ul></div>';
+    }
+}
+if ( ! function_exists( 'glm_theme_additional_off_canvas' ) ) {
+    function glm_theme_additional_off_canvas($location) {
+        echo glm_get_mobile_nav_menu( $location );
+    }
+}
+function glm_get_mobile_nav_menu( $theme_location )
+{
+    $menu = wp_nav_menu(array(
+        'echo'            => false,             // don't echo
+        'container'       => false,             // remove nav container
+        'container_class' => '',                // class of container
+        'menu'            => '',                // menu name
+        'menu_class'      => 'off-canvas-list', // adding custom nav class
+        'theme_location'  => $theme_location,       // where it's located in the theme
+        'before'          => '',                // before each link <a>
+        'after'           => '',                // after each link </a>
+        'link_before'     => '',                // before each link text
+        'link_after'      => '',                // after each link text
+        'depth'           => 5,                 // limit the depth of the nav
+        'fallback_cb'     => false,             // fallback function (see below)
+        'walker'          => new Glm_Theme_Off_Canvas_Walker()
+    ));
+    return preg_replace( array( '%^<ul[^>]*>%', '%</ul>$%' ), '', $menu );
+}
+
+/**
+ * Footer
+ */
+if ( ! function_exists( 'glm_theme_footer' ) ) {
+  function glm_theme_footer() {
+      wp_nav_menu(array(
+          'container' => false,                           // remove nav container
+          'container_class' => '',                        // class of container
+          'menu' => '',                                   // menu name
+          'menu_class' => '',                             // adding custom nav class
+          'theme_location' => 'footer',                   // where it's located in the theme
+          'before' => '',                                 // before each link <a>
+          'after' => '',                                  // after each link </a>
+          'link_before' => '',                            // before each link text
+          'link_after' => '',                             // after each link text
+          'depth' => 1,                                   // limit the depth of the nav
+          'fallback_cb' => false,                         // fallback function (see below)
+      ));
+  }
+}
+
+/**
+ * glm_page_menu
+ *
+ * Grab the top level pages and their sub pages as the main navigation
+ */
+function glm_page_menu($parent = 0, $class = '')
+{
+    $menuConfig   = glm_get_menu_options();
+    $frontPageId  = get_option('page_on_front');
+    $parents      = array();
+    $args         = array(
+        'post_type'   => 'page',
+        'parent'      => $parent,
+        'number'      => '',
+        'exclude'     => $frontPageId,
+        'post_status' => 'publish',
+        'sort_order'  => 'asc',
+        'sort_column' => 'menu_order'
+    );
+    if ($parent == 0 && $menuConfig['menu_options']['main_level_pages']) {
+        $args['include'] = $menuConfig['menu_options']['main_level_pages'];
+    }
+    $pages = get_pages($args);
+    echo '<ul'.(($class)?' class="'.$class.'"':'').'><!-- begin -->'."\n";
+    foreach ($pages as $page) {
+        $childs = get_pages('child_of=' . $page->ID);
+        if (count($childs) > 0) {
+            echo '<li class="has-dropdown">'."\n";
+            echo '<a href="'.get_permalink($page->ID).'">'.$page->post_title.'</a>'."\n";
+            echo glm_page_menu($page->ID, 'sub-menu dropdown');
+            echo '</li>'."\n";
+        } else {
+            echo '<li><a href="'.get_permalink($page->ID).'">'.$page->post_title.'</a></li>'."\n";
+        }
+    }
+    echo '</ul><!-- end -->'."\n";
+}
+
+/**
+ * glm_offcanvas_menu
+ *
+ * Generate the list of pages as nested ul li list
+ */
+function glm_offcanvas_menu()
+{
+    wp_page_menu(array(
+        'depth' => 0,
+        'sort_column' => 'menu_order',
+        'menu_class' => 'left-off-canvas-list'
+    ));
+}
+
+/**
+ * get_menu_options
+ *
+ * Grab the menu options from the theme.ini file
+ */
+function glm_get_menu_options()
+{
+    static $menu_options;
+    $themeConfig = get_template_directory() . '/theme.ini';
+
+    if (!$menu_options && is_file($themeConfig)) {
+        $menu_options = parse_ini_file($themeConfig, true);
+    }
+    return $menu_options;
+}
+
+function glm_side_menu() {
+    global $post;
+    $parents = get_post_ancestors($post->ID);
+    $id = ($parents) ? $parents[count($parents)-1]: $post->ID;
+    $parent = get_page( $id );
+    if ($id == 0) {
+        $ID = $post->ID;
+    } else {
+        $ID = $parent->ID;
+    }
+    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";
+}
+
diff --git a/dev/core/defaults/menu-walker.php b/dev/core/defaults/menu-walker.php
deleted file mode 100644 (file)
index 6141090..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
-/**
- * Customize the output of menus for Foundation top bar
- */
-if ( ! class_exists( 'Glm_Theme_Top_Bar_Walker' ) ) :
-class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu {
-    function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) {
-        static $mainLevelCounter;
-        if ($depth == 0) {
-            ++$mainLevelCounter;
-        }
-        $element->has_children = ! empty( $children_elements[ $element->ID ] );
-        $element->classes[] = ( $element->current || $element->current_item_ancestor ) ? 'active' : '';
-        $element->classes[] = ( $element->has_children && 1 !== $max_depth ) ? 'has-dropdown' : '';
-        $element->classes[] = ( $element->post_parent == 0 && $mainLevelCounter <= 3 ) ? 'drop-right' : 'drop-left';
-        parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
-    }
-
-    function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
-        $item_html = '';
-        parent::start_el( $item_html, $object, $depth, $args );
-
-        // Insert style to display page's thumbnail
-        $item_style = '';
-        if ($depth == 0 && has_post_thumbnail((int)$object->object_id)) {
-            $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id((int)$object->object_id), 'large');
-            $item_style .= "<style>#menu-item-".$object->ID." > .dropdown:before { background-image: url('".$thumbnail[0]."');</style>";
-        }
-        //$output .= ( 0 == $depth ) ? '<li class="divider"></li>' : '';
-        $classes = empty( $object->classes ) ? array() : (array) $object->classes;
-        if ( in_array( 'label', $classes ) ) {
-            //$output .= '<li class="divider"></li>';
-            $item_html = preg_replace( '/<a[^>]*>(.*)<\/a>/iU', '<label>$1</label>', $item_html );
-        }
-        if ( in_array( 'divider', $classes ) ) {
-            $item_html = preg_replace( '/<a[^>]*>( .* )<\/a>/iU', '', $item_html );
-        }
-        if ($item_style)
-            $output .= $item_style;
-        $output .= $item_html;
-    }
-
-    function start_lvl( &$output, $depth = 0, $args = array() ) {
-        $output .= "\n<ul class=\"sub-menu dropdown\">\n";
-    }
-}
-endif;
-if ( ! class_exists( 'Glm_Theme_Off_Canvas_Walker' ) ) :
-class Glm_Theme_Off_Canvas_Walker extends Walker_Nav_Menu {
-    function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) {
-        $element->has_children = ! empty( $children_elements[ $element->ID ] );
-        $element->classes[] = ( $element->current || $element->current_item_ancestor ) ? 'active' : '';
-        $element->classes[] = ( $element->has_children && 1 !== $max_depth ) ? 'page_item_has_children' : '';
-        $element->classes[] = 'page_item';
-
-        parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
-    }
-
-    function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
-        $item_html = '';
-        parent::start_el( $item_html, $object, $depth, $args );
-
-        $classes = empty( $object->classes ) ? array() : (array) $object->classes;
-
-        if ( in_array( 'label', $classes ) ) {
-            $item_html = preg_replace( '/<a[^>]*>(.*)<\/a>/iU', '<label>$1</label>', $item_html );
-        }
-        $item_html = preg_replace("/<br>/", " ", $item_html);
-        $output .= $item_html;
-    }
-
-    function start_lvl( &$output, $depth = 0, $args = array() ) {
-        $output .= "\n<ul class=\"children\">\n";
-    }
-
-    function end_lvl(&$output, $depth = 0, $args = array()){
-        $output .= '</ul>';
-    }
-}
-endif;
-?>
diff --git a/dev/core/defaults/navigation.php b/dev/core/defaults/navigation.php
deleted file mode 100644 (file)
index 68365b4..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-<?php
-
-register_nav_menus(array(
-  'top-bar'     => 'Site Navigation',
-  'mobile-menu' => 'Off Canvas'
-));
-if ( ! function_exists( 'glm_theme_members_only' ) ) {
-    function glm_theme_members_only($location) {
-        echo '<ul class="members-only">';
-        echo glm_theme_top_bar( $location );
-        echo '</ul>';
-    }
-}
-
-/**
- * Top Bar
- */
-if ( ! function_exists( 'glm_theme_top_bar' ) ) {
-  function glm_theme_top_bar($location) {
-      wp_nav_menu(array(
-          'container' => false,                           // remove nav container
-          'container_class' => '',                        // class of container
-          'menu' => '',                                   // menu name
-          'menu_class' => '',                             // adding custom nav class
-          'theme_location' => $location,                  // where it's located in the theme
-          'before' => '',                                 // before each link <a>
-          'after' => '',                                  // after each link </a>
-          'link_before' => '',                            // before each link text
-          'link_after' => '',                             // after each link text
-          'depth' => 3,                                   // limit the depth of the nav
-          'fallback_cb' => false,                         // fallback function (see below)
-          'walker' => new Glm_Theme_Top_Bar_Walker()
-      ));
-  }
-}
-
-/**
- * Mobile off-canvas
- */
-if ( ! function_exists( 'glm_theme_mobile_off_canvas' ) ) {
-    function glm_theme_mobile_off_canvas($location) {
-        echo '<div class="left-off-canvas-list">';
-        echo '<ul><li class="page_item"><a href="' . get_bloginfo('url') . '">Home</a></li>';
-        echo glm_get_mobile_nav_menu( $location );
-        echo glm_get_mobile_nav_menu( 'top-bar' );
-        echo '</ul></div>';
-    }
-}
-if ( ! function_exists( 'glm_theme_additional_off_canvas' ) ) {
-    function glm_theme_additional_off_canvas($location) {
-        echo glm_get_mobile_nav_menu( $location );
-    }
-}
-function glm_get_mobile_nav_menu( $theme_location )
-{
-    $menu = wp_nav_menu(array(
-        'echo'            => false,             // don't echo
-        'container'       => false,             // remove nav container
-        'container_class' => '',                // class of container
-        'menu'            => '',                // menu name
-        'menu_class'      => 'off-canvas-list', // adding custom nav class
-        'theme_location'  => $theme_location,       // where it's located in the theme
-        'before'          => '',                // before each link <a>
-        'after'           => '',                // after each link </a>
-        'link_before'     => '',                // before each link text
-        'link_after'      => '',                // after each link text
-        'depth'           => 5,                 // limit the depth of the nav
-        'fallback_cb'     => false,             // fallback function (see below)
-        'walker'          => new Glm_Theme_Off_Canvas_Walker()
-    ));
-    return preg_replace( array( '%^<ul[^>]*>%', '%</ul>$%' ), '', $menu );
-}
-
-/**
- * Footer
- */
-if ( ! function_exists( 'glm_theme_footer' ) ) {
-  function glm_theme_footer() {
-      wp_nav_menu(array(
-          'container' => false,                           // remove nav container
-          'container_class' => '',                        // class of container
-          'menu' => '',                                   // menu name
-          'menu_class' => '',                             // adding custom nav class
-          'theme_location' => 'footer',                   // where it's located in the theme
-          'before' => '',                                 // before each link <a>
-          'after' => '',                                  // after each link </a>
-          'link_before' => '',                            // before each link text
-          'link_after' => '',                             // after each link text
-          'depth' => 1,                                   // limit the depth of the nav
-          'fallback_cb' => false,                         // fallback function (see below)
-      ));
-  }
-}
-
-/**
- * glm_page_menu
- *
- * Grab the top level pages and their sub pages as the main navigation
- */
-function glm_page_menu($parent = 0, $class = '')
-{
-    $menuConfig   = glm_get_menu_options();
-    $frontPageId  = get_option('page_on_front');
-    $parents      = array();
-    $args         = array(
-        'post_type'   => 'page',
-        'parent'      => $parent,
-        'number'      => '',
-        'exclude'     => $frontPageId,
-        'post_status' => 'publish',
-        'sort_order'  => 'asc',
-        'sort_column' => 'menu_order'
-    );
-    if ($parent == 0 && $menuConfig['menu_options']['main_level_pages']) {
-        $args['include'] = $menuConfig['menu_options']['main_level_pages'];
-    }
-    $pages = get_pages($args);
-    echo '<ul'.(($class)?' class="'.$class.'"':'').'><!-- begin -->'."\n";
-    foreach ($pages as $page) {
-        $childs = get_pages('child_of=' . $page->ID);
-        if (count($childs) > 0) {
-            echo '<li class="has-dropdown">'."\n";
-            echo '<a href="'.get_permalink($page->ID).'">'.$page->post_title.'</a>'."\n";
-            echo glm_page_menu($page->ID, 'sub-menu dropdown');
-            echo '</li>'."\n";
-        } else {
-            echo '<li><a href="'.get_permalink($page->ID).'">'.$page->post_title.'</a></li>'."\n";
-        }
-    }
-    echo '</ul><!-- end -->'."\n";
-}
-
-/**
- * glm_offcanvas_menu
- *
- * Generate the list of pages as nested ul li list
- */
-function glm_offcanvas_menu()
-{
-    wp_page_menu(array(
-        'depth' => 0,
-        'sort_column' => 'menu_order',
-        'menu_class' => 'left-off-canvas-list'
-    ));
-}
-
-/**
- * get_menu_options
- *
- * Grab the menu options from the theme.ini file
- */
-function glm_get_menu_options()
-{
-    static $menu_options;
-    $themeConfig = get_template_directory() . '/theme.ini';
-
-    if (!$menu_options && is_file($themeConfig)) {
-        $menu_options = parse_ini_file($themeConfig, true);
-    }
-    return $menu_options;
-}
-
-function glm_side_menu() {
-    global $post;
-    $parents = get_post_ancestors($post->ID);
-    $id = ($parents) ? $parents[count($parents)-1]: $post->ID;
-    $parent = get_page( $id );
-    if ($id == 0) {
-        $ID = $post->ID;
-    } else {
-        $ID = $parent->ID;
-    }
-    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";
-}
-
diff --git a/dev/core/footer/functions/footer.php b/dev/core/footer/functions/footer.php
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dev/core/front-page/functions/front-page.php b/dev/core/front-page/functions/front-page.php
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dev/core/interior-page/functions/interior-page.php b/dev/core/interior-page/functions/interior-page.php
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dev/core/off-canvas-overlay/functions/off-canvas-overlay.php b/dev/core/off-canvas-overlay/functions/off-canvas-overlay.php
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dev/core/off-canvas/functions/off_canvas.php b/dev/core/off-canvas/functions/off_canvas.php
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dev/core/topbar/functions/topbar.php b/dev/core/topbar/functions/topbar.php
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dev/custom/action-items/action-items.js b/dev/custom/action-items/action-items.js
deleted file mode 100644 (file)
index c3e3049..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-$(function() {
-    console.log( "action items!" );
-});
\ No newline at end of file
diff --git a/dev/custom/action-items/action-items.js.off b/dev/custom/action-items/action-items.js.off
new file mode 100644 (file)
index 0000000..c3e3049
--- /dev/null
@@ -0,0 +1,3 @@
+$(function() {
+    console.log( "action items!" );
+});
\ No newline at end of file
diff --git a/dev/custom/action-items/functions/action-items.php b/dev/custom/action-items/functions/action-items.php
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dev/custom/glm-blocks/functions/glm-blocks.php b/dev/custom/glm-blocks/functions/glm-blocks.php
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dev/custom/glma/functions/glma.php b/dev/custom/glma/functions/glma.php
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dev/custom/nextgen/functions/nextgen.php b/dev/custom/nextgen/functions/nextgen.php
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dev/custom/sidebar/functions/sidebar.php b/dev/custom/sidebar/functions/sidebar.php
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dev/custom/slideshow/functions/slideshow.php b/dev/custom/slideshow/functions/slideshow.php
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/dev/custom/slideshow/slideshow.js b/dev/custom/slideshow/slideshow.js
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/dev/custom/slideshow/slideshow.js.off b/dev/custom/slideshow/slideshow.js.off
new file mode 100644 (file)
index 0000000..e69de29
index cb5888c..30796e0 100644 (file)
@@ -1,7 +1,22 @@
 <?php
 /* Core Modules */
 require_once('core/header/functions/header.php');
+require_once('core/topbar/functions/topbar.php');
+require_once('core/footer/functions/footer.php');
+require_once('core/front-page/functions/front-page.php');
+require_once('core/interior-page/functions/interior-page.php');
+require_once('core/off-canvas/functions/off-canvas.php');
+require_once('core/off-canvas-overlay/functions/off-canvas-overlay.php');
+require_once('core/blog/functions/blog.php');
 
 /* Custom Modules */
 require_once('custom/gravity-forms/functions/gravity-forms.php');
-require_once('custom/woocommerce/functions/woocommerce.php');
\ No newline at end of file
+require_once('custom/woocommerce/functions/woocommerce.php');
+require_once('custom/svg-map-forms/functions/svg-map.php');
+require_once('custom/sidebar/functions/sidebar.php');
+require_once('custom/nextgen/functions/nextgen.php');
+require_once('custom/glm-blocks/functions/glm-blocks.php');
+require_once('custom/action-items/functions/action-items.php');
+require_once('custom/glma/functions/glma.php');
+require_once('custom/weather/functions/weather.php');
+require_once('custom/slideshow/functions/slideshow.php');
\ No newline at end of file
index da86067..945b943 100644 (file)
@@ -1,6 +1,6 @@
 <?php
-require_once('dev/core/defaults/menu-walker.php');
-require_once('dev/core/defaults/navigation.php');
+require_once('dev/core/defaults/functions/menu-walker.php');
+require_once('dev/core/defaults/functions/navigation.php');
 require_once(__DIR__ . '/dev/modules.php');
 
 
index 546e756..45014c2 100644 (file)
@@ -2,37 +2,14 @@ const path          = require('path');
 const fs            = require('fs');
 const merge         = require('merge-stream');
 
-
-// activate or deactivate the JS files for each module
-const modPaths  = ['dev/core/', 'dev/custom/'];
-modPaths.forEach(function(scriptPath){
-    getFolders(scriptPath).map(function(folder){
-        let jsFile = path.join(__dirname, `../${scriptPath}${folder}/${folder}.js`);
-        let newJsFile = jsFile+'.off';
-       
-        fs.exists(jsFile, function(exists) {
-            if(exists){
-                fs.rename(jsFile, newJsFile, function(err){
-                    if (err) throw err;
-                });
-            }
-        });
-        fs.exists(newJsFile, function(exists) {
-            if(exists){
-                fs.rename(newJsFile, jsFile, function(err){
-                    if (err) throw err;
-                });
-            }
-        });
-    })
-})
+var functionsFileReader = require('readline').createInterface({
+    input: require('fs').createReadStream('dev/modules.php')
+});
 
 var lineReader = require('readline').createInterface({
     input: require('fs').createReadStream('dev/app.scss')
 });
-var functionsFileReader = require('readline').createInterface({
-    input: require('fs').createReadStream('dev/modules.php')
-});
+
 String.prototype.stripSlashes = function(){
     return this.replace(/\\(.)/mg, "$1");
 }
@@ -99,14 +76,12 @@ function parseModules(reader,line){
             active = true;
         }
     
-        if(reader.input.path.indexOf('.php') <= -1){
-            localStorage.setItem(modName, JSON.stringify({path: reader.input.path, line: line, modName: modName, active: active}))
-            $('<li />', {
-                class: `module-item module-active-${active}`,
-                id: `${modName}`,
-                text: `${modName}`
-            }).appendTo(modList)
-        }
+        localStorage.setItem(modName, JSON.stringify({path: reader.input.path, line: line, modName: modName, active: active}))
+        $('<li />', {
+            class: `module-item module-active-${active}`,
+            id: `${modName}`,
+            text: `${modName}`
+        }).appendTo(modList)
     }
 }
 // true is used for init parsing of theme modules, edit is to activate or de-activate modules
@@ -115,7 +90,6 @@ function parseModules(reader,line){
 // last param is the path to the file to be editted since we can't use the readLine Stream again (idk how yet)
 function scanModules(parse, edit, state){
     if(parse) {
-        console.log("init parse")
         readLines("parse");
     }else if(edit){
         readLines("edit", state)
@@ -126,6 +100,12 @@ scanModules(true, false, false);
 
 
 let allModules = JSON.parse(localStorage.getItem("modules"))
+// activate or deactivate the JS files for each module
+const modPaths  = ['dev/core/', 'dev/custom/'];
+
+functionsFileReader.on('line', function (line) {
+    parsePhpLibs(this, line)
+});
 
 // On Click Set Mod State
 $(document).on("click", ".module-item", function(){
@@ -133,6 +113,7 @@ $(document).on("click", ".module-item", function(){
     let modName = _.attr("id");
     let thisMod = JSON.parse(localStorage.getItem(modName))
 
+    let moduleLocation = `dev/${thisMod.line.split("import ").pop().replace(/[;'"]+/g, '')}`;
     let state = {path: thisMod.path, line: thisMod.line, name: modName}
     
     if( _.hasClass("module-active-true") ){
@@ -146,4 +127,22 @@ $(document).on("click", ".module-item", function(){
     }
 
     scanModules(false, true , state)
+
+    // Activate or De-Activate JS Files
+    let jsFile = path.join(__dirname, `../${moduleLocation}.js`);
+    let newJsFile = jsFile+'.off';
+    fs.exists(jsFile, function(exists) {
+        if(exists){
+            fs.rename(jsFile, newJsFile, function(err){
+                if (err) throw err;
+            });
+        }
+    });
+    fs.exists(newJsFile, function(exists) {
+        if(exists){
+            fs.rename(newJsFile, jsFile, function(err){
+                if (err) throw err;
+            });
+        }
+    });
 })
\ No newline at end of file