var inputParameters = application.ADF.data.duplicateStruct(arguments.parameters); var currentValue = arguments.value; // the field's current value var layoutOptions = ArrayNew(1); var newOption = structNew(); var currOptionName = ''; var i = 0; /* Establish the layout options with security access for specific users. The layoutOptions Array stores the option name, thumbnail image, and security groups that have permissions to select the option. Array contains the following substructures with the fields: name = Name of the layout option stored in the metadata form. description = Description for the layout option - Displayed to the user. security = Group Names image = Path to the image file After the newOption structure is built, it is appended into the layoutOptions Array. */ // Home Layout newOption = structNew(); newOption.name = "Home"; newOption.description = "Home"; newOption.security = ""; newOption.image = "/ADF/extensions/customfields/page_layout/thumbs/home.gif"; ArrayAppend(layoutOptions, newOption); // Landing Layout newOption = structNew(); newOption.name = "Landing"; newOption.description = "Landing Page"; newOption.security = ""; newOption.image = "/ADF/extensions/customfields/page_layout/thumbs/landing.gif"; ArrayAppend(layoutOptions, newOption); // Full Width Layout newOption = structNew(); newOption.name = "Full-Width"; newOption.description = "Full Width"; newOption.security = ""; newOption.image = "/ADF/extensions/customfields/page_layout/thumbs/full_width.gif"; ArrayAppend(layoutOptions, newOption); // Equal Width Layout newOption = structNew(); newOption.name = "Equal-Width"; newOption.description = "Equal Width"; newOption.security = ""; newOption.image = "/ADF/extensions/customfields/page_layout/thumbs/equal_width.gif"; ArrayAppend(layoutOptions, newOption); // Right Channel Layout newOption = structNew(); newOption.name = "Right-Channel"; newOption.description = "Right Channel"; newOption.security = ""; newOption.image = "/ADF/extensions/customfields/page_layout/thumbs/right_channel.gif"; ArrayAppend(layoutOptions, newOption); renderStyles(argumentCollection=arguments); renderJSFunctions(argumentCollection=arguments);

var showChoice = "true"; var itm = 1; var groupID = 0; if( listLen(arguments.securityGroups) ) { // reset value to false then determine if they have access showChoice = "false"; for( itm; itm lte listLen(arguments.securityGroups); itm = itm + 1 ) { if( listFind(request.user.groupList, listGetAt(arguments.securityGroups, itm) ) ) { showChoice = "true"; break; } } } // Requires a Build of CommonSpot 10 higher than 10.0.0.313 public numeric function getMinHeight() { if (structKeyExists(arguments.parameters, "heightValue") && isNumeric(arguments.parameters.heightValue) && arguments.parameters.heightValue > 0) return arguments.parameters.heightValue; // always px return 0; } // Requires a Build of CommonSpot 10 higher than 10.0.0.313 public numeric function getMinWidth() { if ( structKeyExists(arguments.parameters, "widthValue") && isNumeric(arguments.parameters.widthValue) && arguments.parameters.widthValue > 0) return arguments.parameters.widthValue + 160; // 150 is default label width, plus some slack // always px return 0; } private boolean function isMultiline() { return true; } /* IMPORTANT: Since loadResourceDependencies() is using ADF.scripts loadResources methods, getResourceDependencies() and loadResourceDependencies() must stay in sync by accounting for all of required resources for this Custom Field Type. */ public void function loadResourceDependencies() { // Load registered Resources via the ADF scripts_2_0 application.ADF.scripts.loadJQuery(); } public string function getResourceDependencies() { return "jQuery"; }