Skip to content

Instantly share code, notes, and snippets.

@thetristan
thetristan / gist:1040707
Created June 22, 2011 18:05
AJAX in modules
//code to set up an action in my upd.module.php
$this->EE->load->dbforge();
$data = array(
'class' => 'Module',
'method' => 'api_get_hash',
);
$this->EE->db->insert('actions', $data);
{exp:channel:entries channel="forms" dynamic="no" entry_id="{embed:form_id}"}
{exp:nsm_transplant:body}
{!-- check if we're using the recipients feature of freeform, if so, set some variables needed for later --}
{if form_recipients}
{exp:nsm_transplant:content id="use_recipients"}yes{/exp:nsm_transplant:content}
{form_recipients}
{exp:nsm_transplant:content id="recipient{row_count}" parse="inwards"}{recipient_name}|{recipient_email}{/exp:nsm_transplant:content}
<?php
header("Content-Type: text/x-vCalendar");
header("Content-Disposition: inline; filename=MyvCalFile.vcs");
?>
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
X-WR-TIMEZONE:US/Eastern
X-WR-CALNAME:Presagis Event
X-WR-TIMEZONE:US/Eastern
<!--
Looks like they're locking down extensions to only
modify app logic w/ EE 2.0 so you can't inject CP JS
like you could in EE 1.6.x.Instead, add this snippet
just above the closing <body> tag in
/themes/cp_themes/default/_shared/footer.php
to enable the dropdowns via mouseover instead of click:
-->
<script type="text/javascript" charset="utf-8">//<!--