From: Anthony Talarico Date: Tue, 29 Mar 2016 13:07:09 +0000 (-0400) Subject: removing changes, plugin broken at this point X-Git-Tag: v1.0.0^2~150 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=b8c3c228cb08da6e232a002531f41fb89bed6333;p=WP-Plugins%2Fglm-member-db-events.git removing changes, plugin broken at this point --- diff --git a/models/front/events/frontAdd.php b/models/front/events/frontAdd.php deleted file mode 100644 index 7f26ffa..0000000 --- a/models/front/events/frontAdd.php +++ /dev/null @@ -1,167 +0,0 @@ - - * @license PHP Version 3.0 {@link http://www.php.net/license/3_0.txt} - */ -class GlmMembersFront_events_frontAdd extends GlmMembersFront_events_baseAction -{ - /** - * modelAction - * - * @param bool $actionData Action Data passed to the modelAction - * - * @access public - * @return void - */ - public function modelAction($actionData = false) - { - $allEvents = $this->getList(); - //echo '
' . print_r( $allEvents, true ) . '
'; - $status = $categoryId = null; - $action = ''; - $settings = $events = $event = $categoryEvents = array(); - if (isset($_REQUEST['eventId']) && $eventId = filter_var($_REQUEST['eventId'], FILTER_VALIDATE_INT)) { - $search = true; - $action = 'event-detail'; - } - if (isset($_REQUEST['category']) && $categoryId = filter_var($_REQUEST['category'], FILTER_VALIDATE_INT)) { - $search = true; - $action = 'event-list'; - } - if (isset($_REQUEST['search']) && $search = filter_var($_REQUEST['search'], FILTER_VALIDATE_INT)) { - $search = true; - $action = 'event-list'; - } - if ( isset($_REQUEST['glm_event_from']) ) { - $fromDate = filter_var($_REQUEST['glm_event_from'], FILTER_SANITIZE_STRING); - } else { - $fromDate = date('m/d/Y'); - } - if ( isset($_REQUEST['glm_event_to']) ) { - $toDate = filter_var($_REQUEST['glm_event_to'], FILTER_SANITIZE_STRING); - } else { - if ( isset($_REQUEST['t']) && $t = filter_var( $_REQUEST['t'], FILTER_SANITIZE_STRING ) ) { - switch ( $t ) { - case 'today': - $toDate = date('m/d/Y'); - break; - case 'tomorrow': - $fromDate = $toDate = date('m/d/Y', strtotime( '+ 1 day' )); - break; - case 'nextseven': - $toDate = date('m/d/Y', strtotime( '+ 7 days' )); - break; - default: - $toDate = date('m/d/Y', strtotime( '+ 2 weeks' )); - break; - } - } else { - $toDate = date('m/d/Y', strtotime( '+ 2 weeks' )); - } - } - if ( $fromDate && $toDate ) { - $from = date('Y-m-d', strtotime($fromDate)); - $to = date('Y-m-d', strtotime($toDate)); - $this->dateRange = "start_time BETWEEN CAST('{$from}' AS DATE) AND CAST('{$to}' as DATE)"; - } - //echo '
$this->dateRange: ' . print_r($this->dateRange, true) . '
'; - - if (isset($_REQUEST['event_name']) && $eventNameSearch = filter_var($_REQUEST['event_name'], FILTER_SANITIZE_STRING)) { - $search = true; - $action = 'event-list'; - } else { - $eventNameSearch = false; - } - - $categories = $this->getCategories(); - wp_register_script( - 'event-dashboard-js', - GLM_MEMBERS_EVENTS_PLUGIN_BASE_URL . '/js/dashboard.js', - 'jquery-datepicker', - GLM_MEMBERS_EVENTS_PLUGIN_VERSION, - true - ); - wp_enqueue_script('event-dashboard-js'); - - - switch ($action) { - case 'event-list': - $events = $this->getModelEventsData($categoryId); - $view = 'agenda.html'; - break; - default: - $view = 'agenda.html'; - $events = $this->getModelEventsData($categoryId); - break; - } - - // group the events by the starting date - $eventsByDate = array(); - if ($events) { - foreach ( $events as $event ) { - foreach ( $event['times'] as $eventTime ) { - $eventDateTime = mktime( - 0, 0, 0, - date('n', $eventTime['start_time']['timestamp']), - date('j', $eventTime['start_time']['timestamp']), - date('Y', $eventTime['start_time']['timestamp']) - ); - $event['starting_date'] = $eventTime['start_time']['timestamp']; - $event['ending_date'] = $eventTime['end_time']['timestamp']; - $event['hasSameTimes'] = ($event['starting_date'] == $event['ending_date']) ? 1 : 0; - $eventsByDate[$eventDateTime][$eventTime['start_time']['timestamp']] = $event; - } - } - ksort($eventsByDate); - } - //echo '
$eventsByDate: ' . print_r($eventsByDate, true) . '
'; - //if ($eventNameSearch) { - //$events = array_filter($events, function($event) use($eventNameSearch){ - //return preg_match('/' . preg_quote( $eventNameSearch ) . '/i', $event['title']); - //}); - //} - - // Compile template data - $templateData = array( - 'siteBaseUrl' => GLM_MEMBERS_EVENTS_SITE_BASE_URL, - 'currentUrl' => GLM_MEMBERS_EVENTS_PLUGIN_CURRENT_URL, - 'categoryId' => $categoryId, - 'categories' => $categories, - //'events' => $events, - 'eventsByDate' => $eventsByDate, - //'event' => $event, - 'catEvents' => $categoryEvents, - 'fromDate' => $fromDate, - 'toDate' => $toDate, - 'eventName' => $eventNameSearch, - 'imgUrl' => GLM_MEMBERS_PLUGIN_MEDIA_URL . '/images/small/' - ); - - error_reporting(E_ALL ^ E_NOTICE); - return array( - 'status' => $status, - 'menuItemRedirect' => false, - 'modelRedirect' => false, - 'view' => 'front/events/frontAdd.html', - 'data' => $templateData, - 'settings' => $settings - ); - } -} diff --git a/setup/validActions.php b/setup/validActions.php index 5cdf7de..f0c382e 100644 --- a/setup/validActions.php +++ b/setup/validActions.php @@ -49,9 +49,7 @@ $glmMembersEventsAddOnValidActions = array( 'frontActions' => array( 'events' => array( 'list' => GLM_MEMBERS_EVENTS_PLUGIN_SLUG, - 'detail' => GLM_MEMBERS_EVENTS_PLUGIN_SLUG, - 'frontAdd' => GLM_MEMBERS_EVENTS_PLUGIN_SLUG - + 'detail' => GLM_MEMBERS_EVENTS_PLUGIN_SLUG ) ) ); diff --git a/views/front/events/frontAdd.html b/views/front/events/frontAdd.html deleted file mode 100644 index 998a759..0000000 --- a/views/front/events/frontAdd.html +++ /dev/null @@ -1,200 +0,0 @@ - -
-
- - - - - - - - - -{if $haveEvent} - - - - - - - - - - - - - - - - -{/if} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Event Name: - - {if $event.fieldFail.name}

{$event.fieldFail.name}

{/if}
-
Member: - {if $haveMember} - {$memberData.member_name} - {else} - - {/if} -
Name for URLs:{$event.fieldData.name_slug}
Created:{$event.fieldData.created.datetime}
Last Updated:{$event.fieldData.updated.datetime}
Last Approved:{$event.fieldData.approved.datetime}
Status: - - {if $event.fieldFail.status}

{$event.fieldFail.status}

{/if} -
Categories - - - -
Add a new Category
-
- - - - - - - - - -
Category Name: - -
-
Parent Category: - -
OR
- -
-

* Required

- Cancel - -
- - - -    Select a category to add to box below.
-
- - {if isset($event.fieldData.categories) && $event.fieldData.categories} - {foreach $event.fieldData.categories as $c} -
- {if $c.parent_name != ''}{$c.parent_name}: {/if}{$c.name} - X - -
- {/foreach} - {/if} -
-
Intro Text: - - {if $event.fieldFail.intro}

{$event.fieldFail.intro}

{/if} -
Description: - {php} - wp_editor('{$event.fieldData.descr|escape:quotes}', 'glm_descr', array( - // 'media_buttons' => true, - // 'quicktags' => false, - // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. - 'textarea_name' => 'descr', - 'editor_height' => 200, // Height in px, overrides editor_rows - // 'textarea_rows' => 8 - )); - {/php} - {if $event.fieldFail.descr}

{$event.fieldFail.descr}

{/if} -
Image: - - {if $event.fieldData.image} - - - - - {/if} - -
-
- -
-
- Delete Image
- {$event.fieldData.image}
-
New image:
-
- {if $event.fieldFail.image}

{$event.fieldFail.image}

{/if} -
Web Address (URL): - - {if $event.fieldFail.url}

{$event.fieldFail.url}

{/if}
-
Ticketing Address (URL): - - {if $event.fieldFail.ticket_url}

{$event.fieldFail.ticket_url}

{/if}
-
Description of Cost: - - {if $event.fieldFail.cost}

{$event.fieldFail.cost}

{/if}
-
Notes: - - {if $event.fieldFail.notes}

{$event.fieldFail.notes}

{/if} -
- -
-