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 code in your theme-leve eventHandler.cfc. | |
public any function onAfterFormSubmitSave($) output="true"{ | |
if(len($.event('CONFIRMATIONEMAIL')) and isValid('email',$.event('CONFIRMATIONEMAIL'))) { | |
local.formFields = deserializeJSON($.event('formbean').getbody()).form.fields; | |
local.mailSvc = new mail(); |
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
<!--- | |
A brief example on how to use the 'CustomUI' option when creating a class extension in Mura CMS. | |
This example assumes you have an extended attribute called 'Page/Book'. | |
It also assumes you have an attribute set using the 'CustomUI' container/tab assignment. | |
Any extended attributes you assign to the attribute set, you are responsible for collecting | |
that data using your own form fields. Make sure the 'name' and 'id' attributes match the | |
names you've used when you created the extended attributes! For example, if you have an | |
extended attribute with a name of 'bookPublisher', make sure you have a form field with an | |
'id' and 'name' attribute of 'bookPublisher'. Check your casing too! |
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 function in a plugin's eventHandler.cfc. It will redirect a member of "Plugin Users" to the plugin immediately upon logging in. | |
public any function onDashboardReplacement(required struct $){ | |
var returnString = ""; | |
//Does user have permission to the plugin? | |
if(application.permUtility.getModulePerm(application[variables.framework.applicationKey].pluginConfig.getModuleID(), session.siteid)){ | |
if($.currentUser().isInGroup("Plugin Users") && ! $.currentUser().isInGroup("Admin")){ | |
returnString = "<script> | |
location.href='#application.configBean.getContext()#/plugins/#variables.framework.package#/'; |
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
USE --DATABASE NAME | |
DECLARE @TableName varchar(255) | |
DECLARE @TableSchema varchar(255) | |
DECLARE @FULLNAME varchar(512) | |
DECLARE TableCursor CURSOR FOR |
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> | |
var APIUtility = getBean('settingsManager').getSite({siteid}).getAPI('json', 'v1'); | |
APIUtility.registerMethod(methodName='applyProperty', method=applyProperty); | |
public any function applyProperty() { | |
// do something | |
} | |
</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
/* | |
This borrows heavily from the work by Ray Camden | |
https://www.raymondcamden.com/2012/01/04/Converting-XML-to-JSON-My-exploration-into-madness | |
https://gist.github.com/cfjedimaster/4580449 | |
and redherring917 https://gist.github.com/redherring917/7929512 | |
I had noticed that if the ending leaf was an array that the first element would be returned properly, but the subsequent values in the array would be return as a struct. | |
*/ |
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
component | |
output="false" | |
hint="I help to parse large XML files by matching patterns and then only parsing sub-nodes of the document." { | |
public any function Init(required string Nodes, required string XmlFilePath, numeric BufferSize=(1024*1024*5)) { | |
/* | |
Create the regular expression pattern based on the | |
node list. We have to match both standard nodes and |
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
@echo off | |
REM This file relies on the existence of C:\my.ini with the following contents | |
REM [client] | |
REM user=[username] | |
REM password=[password] | |
REM Ask user for dbname | |
SET /p dbname="Database Name: " |