height: 22px;
background-position: 0px 0px !important;
}
+#addEventFields{
+ display:none;
+}
\ No newline at end of file
jQuery(".glm-read-more").click(function(){
this.preventDefault();
return false;
+ });
+ jQuery("#addEvent").on("click", function (e){
+ e.preventDefault();
+ jQuery("#addEventFields").slideToggle('slow');
+ jQuery(this).toggleClass('open');
+ return false;
+
+
+
});
}
};
WHERE name_slug = '$eventslug'";
$eventId = $this->wpdb->get_var($sql);
}
-
$categories = $this->getCategories();
wp_register_script(
'googlemaps-js',
$categoryEvents = array();
break;
}
+
+ // for shareThis url and title variables in its span tag
$permalink = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
+ $icsFile = get_permalink(2934);
$title = get_the_title();
// Compile template data
'event' => $event,
'permalink' => $permalink,
'title' => $title,
+ 'icsFile' => $icsFile,
'mainImgUrl' => GLM_MEMBERS_PLUGIN_MEDIA_URL . '/images/large/'
);
'settings' => $settings
);
}
+
}
+
--- /dev/null
+<?php
+
+/**
+ * export.php
+ *
+ */
+
+require_once GLM_MEMBERS_EVENTS_PLUGIN_CLASS_PATH . '/data/dataEvents.php';
+require_once GLM_MEMBERS_EVENTS_PLUGIN_PATH . '/models/front/events/baseAction.php';
+
+/**
+ * GLmMembersFront_event_detail
+ *
+ * @uses GlmDataEvents
+ * @package GlmMemberEvents
+ * @version 0.0.1
+ * @copyright Copyright (c) 2010 All rights reserved.
+ * @author Steve Sutton <steve@gaslightmedia.com>
+ * @license PHP Version 3.0 {@link http://www.php.net/license/3_0.txt}
+ */
+class GLmMembersFront_events_export extends GlmMembersFront_events_baseAction
+{
+ /**
+ * modelAction
+ *
+ * @param bool $actionData Action Data passed to the modelAction
+ *
+ * @access public
+ * @return void
+ */
+
+
+
+ public function modelAction($actionData = false)
+ {
+ header("Content-Type: text/Calendar");
+header("Content-Disposition: inline; filename=calendar.ics");
+
+echo "BEGIN:VCALENDARn";
+echo "PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//ENn";
+echo "VERSION:2.0n";
+echo "METHOD:PUBLISHn";
+echo "X-MS-OLK-FORCEINSPECTOROPEN:TRUEn";
+
+echo "BEGIN:VEVENTn";
+echo "CLASS:PUBLICn";
+echo "CREATED:$createdn";
+echo "DESCRIPTION:Description of the Event Goes Heren";
+echo "DTSTAMP:20120715T190000n";
+echo "DTSTART:20120715T190000n";
+echo "DTEND:20120715T210000n";
+echo "LAST-MODIFIED:0101T000000n";
+echo "LOCATION:Location_of_Eventn";
+echo "PRIORITY:5n";
+echo "SEQUENCE:0n";
+echo "SUMMARY;LANGUAGE=en-us:Summary Messagen";
+echo "TRANSP:OPAQUEn";
+echo "UID:$random_numbern"; // UID just needs to be some random number. I used rand() in PHP.
+echo "X-MICROSOFT-CDO-BUSYSTATUS:BUSYn";
+echo "X-MICROSOFT-CDO-IMPORTANCE:1n";
+echo "X-MICROSOFT-DISALLOW-COUNTER:FALSEn";
+echo "X-MS-OLK-ALLOWEXTERNCHECK:TRUEn";
+echo "X-MS-OLK-AUTOFILLLOCATION:FALSEn";
+echo "X-MS-OLK-CONFTYPE:0n";
+
+//Here is where you set the reminder for the event.
+echo "BEGIN:VALARMn";
+echo "TRIGGER:-PT1440Mn";
+echo "ACTION:DISPLAYn";
+echo "DESCRIPTION:Reminder - Reminder Text Goes Heren";
+
+echo "END:VALARMn";
+echo "END:VEVENTn";
+echo "END:VCALENDARn";
+// $status = null;
+// $action = '';
+// $settings = $event = array();
+//
+// if ( isset($_REQUEST['glm_event_from']) ) {
+// $fromDate = filter_var($_REQUEST['glm_event_from'], FILTER_SANITIZE_STRING);
+// } else {
+// $fromDate = date('m/d/Y');
+// }
+// $this->dateRange = "start_time >= '{$fromDate}'";
+//
+// if ( isset($_REQUEST['eventId']) && $eventId = filter_var($_REQUEST['eventId'], FILTER_VALIDATE_INT)) {
+// $search = true;
+// $action = 'event-detail';
+// } else {
+// $search = true;
+// $action = 'event-detail';
+// $eventslug = get_query_var( 'eventslug' );
+// //echo '<pre>$eventslug: ' . print_r($eventslug, true) . '</pre>';
+// $sql = "
+// SELECT id
+// FROM ".GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX. "events
+// WHERE name_slug = '$eventslug'";
+// $eventId = $this->wpdb->get_var($sql);
+// }
+//
+// $fileName = $eventslug . "ics";
+//
+// $categories = $this->getCategories();
+// $eventIcs = $this->getModelEventData($eventId);
+// $times = $eventIcs['times'];
+// foreach($times as $time){
+// $start = $time['start_time']['timestamp'];
+// }
+//// echo '<pre>', print_r($eventIcs = $this->getModelEventData($eventId)), '</pre>';
+//// echo '<pre>', print_r($eventIcs['times']), '</pre>';
+//
+// // note that we are using "H" instead of "g" because iCalendar's Time format
+// // requires 24-hour time (see RFC 5545 section 3.3.12 for info).
+// function dateToCal($timestamp) {
+// return date('Ymd\THis\Z', $timestamp);
+// }
+// echo dateToCal($start);
+// // Escapes a string of characters
+// function escapeString($string) {
+// return preg_replace('/([\,;])/','\\\$1', $string);
+// }
+//
+// // for shareThis url and title variables in its span tag
+// $permalink = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
+// $title = get_the_title();
+// $templateData = array(
+// 'siteBaseUrl' => GLM_MEMBERS_EVENTS_SITE_BASE_URL,
+// 'currentUrl' => $_SERVER['HTTP_REFERER'],
+// 'categories' => $categories,
+// 'fromDate' => $fromDate,
+// 'event' => $event,
+// 'permalink' => $permalink,
+// 'title' => $title,
+// 'icsFile' => $icsFile,
+// 'mainImgUrl' => GLM_MEMBERS_PLUGIN_MEDIA_URL . '/images/large/'
+// );
+//
+// error_reporting(E_ALL ^ E_NOTICE);
+// return array(
+// 'status' => $status,
+// 'menuItemRedirect' => false,
+// 'modelRedirect' => false,
+// 'view' => 'front/events/export.html',
+// 'data' => $templateData,
+// 'settings' => $settings
+// );
+
+ }
+}
+
+
'attributes' => array(
'id' => false
)
- )
+ ),
+ 'glm-members-event-export' => array(
+ 'plugin' => GLM_MEMBERS_EVENTS_PLUGIN_SLUG,
+ 'menu' => 'events',
+ 'action' => 'export'
+ )
);
$glmMembersEventsShortcodesDescription = '
'frontActions' => array(
'events' => array(
'list' => GLM_MEMBERS_EVENTS_PLUGIN_SLUG,
- 'detail' => GLM_MEMBERS_EVENTS_PLUGIN_SLUG
+ 'detail' => GLM_MEMBERS_EVENTS_PLUGIN_SLUG,
+ 'export' =>GLM_MEMBERS_EVENTS_PLUGIN_SLUG
)
)
);
--- /dev/null
+
+<div id="addEventFields" title="Add Your Event" >
+ <form action="{$currentUrl}" method="post">
+ <table id="glm-table-descr" class="glm-admin-table glm-event-table">
+ <tr>
+ <th {if $event.fieldRequired.name}class="glm-required"{/if}>Event Name:</th>
+ <td {if $event.fieldFail.name}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
+ <input type="text" name="name" value="{$event.fieldData.name}" class="glm-form-text-input-medium" placeholder="Name of this event.">
+ {if $event.fieldFail.name}<p>{$event.fieldFail.name}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th>Member:</th>
+ <td>
+ {if $haveMember}
+ {$memberData.member_name}
+ {else}
+ <select name="ref_dest">
+ {foreach $event.fieldData.ref_dest.list as $v}
+ <option value="{$v.value}"{if $v.default} selected{/if}>{$v.name}</option>
+ {/foreach}
+ </select>
+ {/if}
+ </td>
+ </tr>
+{if $haveEvent}
+ <tr>
+ <th>Name for URLs:</th>
+ <td>{$event.fieldData.name_slug}</td>
+ </tr>
+ <tr>
+ <th>Created:</th>
+ <td>{$event.fieldData.created.datetime}</td>
+ </tr>
+ <tr>
+ <th>Last Updated:</th>
+ <td>{$event.fieldData.updated.datetime}</td>
+ </tr>
+ <tr>
+ <th>Last Approved:</th>
+ <td>{$event.fieldData.approved.datetime}</td>
+ </tr>
+{/if}
+ <tr>
+ <th>Status:</th>
+ <td>
+ <select name="status">
+ {foreach $event.fieldData.status.list as $v}
+ <option value="{$v.value}"{if $v.default} selected{/if}>{$v.name}</option>
+ {/foreach}
+ </select>
+ {if $event.fieldFail.status}<p>{$event.fieldFail.status}</p>{/if}
+ </td>
+ </tr>
+ <tr>
+ <th>Categories</th>
+ <td class="glm-item-container">
+
+ <!-- Add new category dialog -->
+
+ <div id="newCategoryButton" class="button button-secondary glm-right">Add a new Category</div>
+ <div id="newCategoryDialog" class="glm-dialog-box" title="Enter a New Category">
+ <table class="glm-admin-table">
+ <tr>
+ <th class="glm-required">Category Name:</th>
+ <td id="newCatNameTD">
+ <input id="newCatName" type="text" name="newCatName" class="glm-form-text-input">
+ <div id="newCatNameRequired"></div>
+ </td>
+ </tr>
+ <tr>
+ <th>Parent Category:</th>
+ <td>
+ <select id="newCatParent" name="newCatParent">
+ {if $categories}
+ <option value=""></option>
+ {foreach $categories as $t}
+ {if !$t.parent} <!-- don't show child categories -->
+ <option value="{$t.id}" data-parent="{$t.name}">{$t.name}</option>
+ {/if}
+ {/foreach}
+ {/if}
+ </select>
+ <br>OR<br>
+ <input id="newCatParentName" type="text" name="newCatParentName" placeholder="Enter a new parent name.">
+ </td>
+ </tr>
+ </table>
+ <p><span class="glm-required">*</span> Required</p>
+ <a id="newCategoryCancel" class="button button-primary glm-right">Cancel</a>
+ <input id="newCategorySubmit" type="submit" value="Add new Category">
+ </div>
+
+ <!-- Category Selection -->
+
+ <select name="categorySelect" id="categorySelect">
+ {if $categories}
+ <option id="categoryNone" value=""></option>
+ {foreach $categories as $v}
+ <option value="{$v.id}" data-parent="{$v.parent}">
+ {if $v.parent_id} {/if}{$v.name}
+ </option>
+ {/foreach}
+ {else}
+ <option id="" value="">(No Categories Listed - Select "Add a new Category" to the right. )</option>
+ {/if}
+ </select> Select a category to add to box below.<br>
+ <div id="activeCategories" class="glm-dynSelect-box">
+
+ {if isset($event.fieldData.categories) && $event.fieldData.categories}
+ {foreach $event.fieldData.categories as $c}
+ <div data-id="{$c.id}" class="glm-dynSelect-item glm-events-category">
+ {if $c.parent_name != ''}{$c.parent_name}: {/if}{$c.name}
+ <span data-id="{$c.id}" class="glm-dynSelect-delete catDelete">X</span>
+ <input type="hidden" name="category[{$c.id}]" value="{$c.id}">
+ </div>
+ {/foreach}
+ {/if}
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <th {if $event.fieldRequired.intro}class="glm-required"{/if}>Intro Text:</th>
+ <td {if $event.fieldFail.intro}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
+ <textarea name="intro" class="glm-form-textarea">{$event.fieldData.intro}</textarea>
+ {if $event.fieldFail.intro}<p>{$event.fieldFail.intro}</p>{/if}
+ </td>
+ </tr>
+ <tr>
+ <th {if $event.fieldRequired.descr}class="glm-required"{/if}>Description:</th>
+ <td {if $event.fieldFail.descr}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
+ {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}<p>{$event.fieldFail.descr}</p>{/if}
+ </td>
+ </tr>
+ <tr>
+ <th {if $event.fieldRequired.image}class="glm-required"{/if}>Image:</th>
+ <td {if $event.fieldFail.image}class="glm-form-bad-input"{/if}>
+ <table class="glm-admin-image-edit-table">
+ {if $event.fieldData.image}
+ <tr>
+ <td>
+ <div class="glm-galleryImage" data-id="image">
+ <img src="{$glmPluginMediaUrl}/images/small/{$event.fieldData.image}">
+ </div>
+ </td>
+ <td>
+ <input type="checkbox" name="image_delete"> Delete Image<br>
+ {$event.fieldData.image}<br>
+ </td>
+ </tr>
+ {/if}
+ <tr><td colspan="2"><b>New image:</b> <input type="file" name="image_new"></td></tr>
+ </table>
+ <div id="glm-galleryImageLarger_image" class="glm-imageDialog"><img src="{$glmPluginMediaUrl}/images/large/{$event.fieldData.image}"></div>
+ {if $event.fieldFail.image}<p>{$event.fieldFail.image}</p>{/if}
+ </td>
+ </tr>
+ <tr>
+ <th {if $event.fieldRequired.url}class="glm-required"{/if}>Web Address (URL):</th>
+ <td {if $event.fieldFail.url}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
+ <input type="text" name="url" value="{$event.fieldData.url}" class="glm-form-text-input-medium" placeholder="ex: http://www.gaslightmedia.com">
+ {if $event.fieldFail.url}<p>{$event.fieldFail.url}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $event.fieldRequired.ticket_url}class="glm-required"{/if}>Ticketing Address (URL):</th>
+ <td {if $event.fieldFail.ticket_url}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
+ <input type="text" name="ticket_url" value="{$event.fieldData.ticket_url}" class="glm-form-text-input-medium" placeholder="ex: http://www.gaslightmedia.com/ticketing/">
+ {if $event.fieldFail.ticket_url}<p>{$event.fieldFail.ticket_url}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $event.fieldRequired.cost}class="glm-required"{/if}>Description of Cost:</th>
+ <td {if $event.fieldFail.cost}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
+ <input type="text" name="cost" value="{$event.fieldData.cost}" class="glm-form-text-input-medium">
+ {if $event.fieldFail.cost}<p>{$event.fieldFail.cost}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $event.fieldRequired.notes}class="glm-required"{/if}>Notes:</th>
+ <td {if $event.fieldFail.notes}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
+ <textarea name="notes" class="glm-form-textarea">{$event.fieldData.notes}</textarea>
+ {if $event.fieldFail.notes}<p>{$event.fieldFail.notes}</p>{/if}
+ </td>
+ </tr>
+
+ </table>
+
+ </form>
+</div>
{include file='front/events/searchForm.html'}
{include file='front/events/shortCuts.html'}
</div>
+ {include file='front/events/add.html'}
<div id="glm-event-agenda-view" class="row">
<div class="small-12 column">
<form action="{$currentUrl}" method="post">
--- /dev/null
+<!DOCTYPE html>
+<!--
+To change this license header, choose License Headers in Project Properties.
+To change this template file, choose Tools | Templates
+and open the template in the editor.
+-->
+<html>
+ <head>
+ <title>TODO supply a title</title>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ </head>
+ <body>
+ <a class="glm-read-more" href="{$siteBaseUrl}event-detail/{$event.name_slug}/?glm_event_from={$fromDate|unescape:"html"}">Read More</a>
+ <div>TODO write content</div>
+ </body>
+</html>
<li><a href="{$currentUrl}?t=today" class="shortcuts-button">Today's Events</a></li>
<li><a href="{$currentUrl}?t=tomorrow" class="shortcuts-button">Tomorrow's Events</a></li>
<li><a href="{$currentUrl}?t=nextseven" class="shortcuts-button">Next 7 Days</a></li>
+ <li id="addEvent"><a href="#" class="shortcuts-button">Add an Event</a></li>
</ul>
</div>