This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// 1) Drop these methods into your Theme or Site contentRenderer.cfc | |
// 2) Create a component called 'Upcoming Events' and using the Mura tag, call [m]$.getUpcomingEvents(calendarid='Events')[/m] | |
// 3) You can also control how many months of data you wish to retrieve and the maxItems to return | |
// For example: [m]$.getUpcomingEvents(calendarid='Events', months=3, maxItems=3)[/m] | |
// NOTE: The code examples assume you have a 'Calendar' with a Title of 'Events' | |
public any function getUpcomingEvents( | |
string calendarid='' | |
, string feedid = '' | |
, numeric months=3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// Drop this in your Site or Theme eventHandler.cfc | |
public string function onCalendarDefaultBodyRender(event, $) { | |
var str = ''; | |
savecontent variable='str' { | |
WriteOutput(arguments.$.dspInclude('display_objects/fullcalendar/index.cfm')); | |
} | |
return str; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
/* | |
Assuming you have downloaded and extracted the OpenCSV project from http://opencsv.sourceforge.net | |
you will then need to grab the file from /deploy/opencsv-2.x.jar file, and add it to one of your | |
registered javaSettingsLoadPaths directories. | |
You _may_ have to restart CF for the libraries to get registered. | |
*/ | |
// full filesystem path to the file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
public any function onAfterContentSave($) { | |
// reference the new bean that was created | |
var newBean = arguments.$.event('contentBean'); | |
// reference to the OLD bean | |
var oldBean = arguments.$.event('activeBean'); // can also use 'currentBean' to access the same bean | |
// you can now reference any of the attributes of the new bean ... | |
WriteDump(var=newBean.getAllValues(), abort=true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfif Not StructKeyExists(server, 'railo')> | |
<cffunction name="esapiEncode" output="false" returntype="string"> | |
<cfargument name="encodeFor" type="string" default="html" hint="encode for what, valid values are: - css: for output inside Cascading Style Sheets (CSS) - dn: for output in LDAP Distinguished Names - html: for output inside HTML - html_attr: for output inside HTML Attributes - javascript: for output inside Javascript - ldap: for output in LDAP queries - url: for output in URL - vbscript: for output inside vbscript - xml: for output inside XML - xml_attr: for output inside XML Attributes - xpath: for output in XPath"> | |
<cfargument name="inputString" type="string" required="true" hint="Required. String to encode"> | |
<cfscript> | |
var lc = {}; | |
var encodedString = ''; | |
lc.encoder = CreateObject("java", "org.owasp.esapi.ESAPI").encoder(); | |
switch(arguments.encodeFor) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// drop this in your Site eventHandler.cfc | |
public any function onRenderStart(event, $) { | |
arguments.$.event('altTheme', 'MyTheme'); | |
} | |
// this assumes you have a theme directory called 'MyTheme' of course | |
</cfscript> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# ================================================================== | |
# ______ __ _____ | |
# /_ __/___ ____ ___ _________ _/ /_ /__ / | |
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / / | |
# / / / /_/ / / / / / / /__/ /_/ / /_ / / | |
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/ | |
# Multi-instance Apache Tomcat installation with a focus | |
# on best-practices as defined by Apache, SpringSource, and MuleSoft |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- | |
Place this method in your Site, Theme, or Plugin's eventHandler.cfc | |
See http://docs.getmura.com/v6/back-end/events/content-tab-events/ for more Content Tab Events | |
---> | |
<cffunction name="onContentTabBasicTopRender"> | |
<cfset var local = {} /> | |
<!--- This assumes you've created some extended attributes to account for each custom form field ---> | |
<cfsavecontent variable="local.str"> | |
<div class="fieldset"> | |
<div class="form-group control-group"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// Let's say you want to pass in some arguments to the file located under /includes/displayObjects.cfc. For example: | |
public any function dspMuraFW1App3($, someArg='', anotherArg='Something') { | |
param name='request.context' default='#{}#'; | |
StructAppend(request.context.myArgs, arguments); | |
// now they'll be available in your subapps as rc.myArgs.argName | |
return getApplication().doAction('app3:main.default'); | |
} | |
</cfscript> |