From c409fdf5ab4e9fe99681b363dac2ae45312ea578 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 30 Mar 2016 11:29:44 -0400 Subject: [PATCH] Setting up for pdf creator --- js/dashboard.js | 2 +- models/front/events/baseAction.php | 6 ++++++ models/front/events/list.php | 6 +++++- setup/frontHooks.php | 11 +++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/js/dashboard.js b/js/dashboard.js index 53b8641..058c9b1 100644 --- a/js/dashboard.js +++ b/js/dashboard.js @@ -21,6 +21,6 @@ } $('#glm-event-pdf-submit').click(function(event){ eventForm = $('#glm-member-event-search'); - eventForm.attr('action', eventForm.attr('action') + '?pdf=1'); + eventForm.attr('action', eventForm.attr('action') + '?glm-event-pdf=1'); }); }).call(this); diff --git a/models/front/events/baseAction.php b/models/front/events/baseAction.php index d717b0e..4df4e84 100644 --- a/models/front/events/baseAction.php +++ b/models/front/events/baseAction.php @@ -43,6 +43,12 @@ abstract class GlmMembersFront_events_baseAction extends GlmDataEvents parent::__construct(false, false); } + public function printEvents() + { + echo 'hello'; + //include '/var/www/localhost/htdocs/pdfTest/index.php'; + } + /** * getCategories * diff --git a/models/front/events/list.php b/models/front/events/list.php index 6e0bf22..d5fe325 100644 --- a/models/front/events/list.php +++ b/models/front/events/list.php @@ -48,9 +48,12 @@ class GlmMembersFront_events_list extends GlmMembersFront_events_baseAction $search = true; $action = 'event-list'; } - if (isset($_REQUEST['pdf']) && $pdf = filter_var($_REQUEST['pdf'], FILTER_VALIDATE_BOOLEAN)) { + if (isset($_REQUEST['glm-event-pdf']) && $pdf = filter_var($_REQUEST['glm-event-pdf'], FILTER_VALIDATE_BOOLEAN)) { $search = true; $action = 'pdf'; + include '/var/www/localhost/htdocs/pdfTest/index.php'; + //echo '
$_REQUEST: ' . print_r($_REQUEST, true) . '
'; + exit; } if ( isset($_REQUEST['glm_event_from']) ) { $fromDate = filter_var($_REQUEST['glm_event_from'], FILTER_SANITIZE_STRING); @@ -110,6 +113,7 @@ class GlmMembersFront_events_list extends GlmMembersFront_events_baseAction $view = 'agenda.html'; break; case 'pdf': + include '/var/www/localhost/htdocs/pdfTest/index.php'; $events = $this->getModelEventsData($categoryId); echo '
$events: ' . print_r($events, true) . '
'; exit; diff --git a/setup/frontHooks.php b/setup/frontHooks.php index 3c4e751..0941ee0 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -48,3 +48,14 @@ add_filter('init', function() { } }); +//add_action('query_vars', function($vars){ + //array_push($vars, 'glm-event-pdf'); + //return $vars; +//}); +//add_action('wp', function($wp){ + //if ( array_key_exists( 'glm-event-pdf', $wp->query_vars ) && $wp->query_vars['glm-event-pdf'] == '1' ) { + ////echo '
$this: ' . print_r($this, true) . '
'; + //echo '
$_REQUEST: ' . print_r($_REQUEST, true) . '
'; + //die('here it is!'); + //} +//}); -- 2.17.1