Skip to content

Instantly share code, notes, and snippets.

View cameroncf's full-sized avatar

Cameron Childress cameroncf

  • Sumo Consulting
  • Atlanta, GA
View GitHub Profile
component
output = 'false'
accessors = 'true'
{
/* ENTITY SPECIFIC */
property name='messageType' type ='string';
property name='messageTitle' type ='string';
property name='messageText' type ='string';
/*** CONSTRUCTOR ********************************************************************************/
component
accessors = true
{
property name='someprop';
public function someMethod() {
error = h[;
}
<cffunction access="public" name="qry_ordersGet" output="no" returntype="query">
<cfargument name="orderKeyList" type="string" required="no" default="">
<cfargument name="personKeyList" type="string" required="no" default="">
<cftry>
<cfquery
name="qry_ordersGet"
datasource="#variables.datasource#">
SELECT o.tablePK
,o.tblPeopleFK
public any function onAdminHTMLFootRender($) {
var str = '';
savecontent variable='str' {
WriteOutput('<script>
jQuery(document).ready(function($){
$(".nav-site-inner .container>ul").append(''<li><a href="/plugins/#variables.framework.package#"><i class="icon-book"></i><span>Your Plugin Name</span></li>'');
});
</script>');
}
return str;
component
output="false"
{
public SingletonFactory function init()
output = 'false'
{ return this; }
public any function getObject(required String objectName)
output = 'false'
@cameroncf
cameroncf / gist:9979635
Created April 4, 2014 17:52
Typical SessionFacade
component
output = 'false'
{
public UserFacade function init() output = 'false'
{
//reset();
return this;
}
@cameroncf
cameroncf / file.cfm
Last active August 29, 2015 13:57 — forked from muracms/file.cfm
<plugin>
...
<ormcfclocation>path/to/entites</ormcfclocation>
...
<plugin>
<form id='myContext'>
<!--- bind property rule to form field --->
<cfset vt.aliasRule(
object = 'address',
property = 'countryCode'
fieldname = 'billingAddressCountry'
context = 'myContext' ) />
<input name="billingAddressCountry" />
In Permission.cfc:
property name="groups" fieldtype="many-to-many" cfc="Group"
type="array" singularname="Group"
fkcolumn="user_permission_id" inversejoincolumn="user_group_id"
linktable="user_permission_link" inverse="true";
public void function addGroup(required Group group) {
arguments.group.addPermission(this);
}
@cameroncf
cameroncf / gist:4974631
Last active December 13, 2015 21:08
In a Mura Plugin, drop this in [plugin]/includes/eventHandler.cfc:onApplicationLoad() to load plugin specific extension sets at application startup
local.rsSites = arguments.$.getBean('settingsManager').getList(); // all sites
local.rsPlugin = arguments.$.getBean('pluginManager').getPlugin( variables.framework.package ); // plugin record
local.pluginAssignments = arguments.$.getBean('pluginManager').getAssignedSites( local.rsPlugin.moduleID ); // recordset of sites this plugin belongs to
local.pluginXML = arguments.$.getBean('pluginManager').getPluginXML( local.rsPlugin.moduleID );
// loop assigned sites and make sure they are setup per the plugin requirements
for (site in local.pluginAssignments) {
// make sure all class (defined in plugin/config.xml.cfm) extentions exist
application.configBean.getClassExtensionManager().loadConfigXML( local.pluginXML, site.siteID );