} // getImageByPagePath /// <summary> /// if nothing found, returns String.Empty /// </summary> /// <returns></returns> private string getRandomImage() { // -- get all the configured image vals string[] configKeys = CmsControlUtils.getControlParameterKeys(CmsContext.currentPage, this); ArrayList imgUrls = new ArrayList(); string notFoundValue = Guid.NewGuid().ToString(); foreach (string key in configKeys) { string val = CmsControlUtils.getControlParameterKeyValue(CmsContext.currentPage, this, key, notFoundValue); if (val != "" && val != notFoundValue && String.Compare(val, RandomImageKeyValue, true) != 0) { imgUrls.Add(val); } } // foreach // -- select the image at random if (imgUrls.Count > 0) { int randomUrlIndex = (new System.Random()).Next(0, imgUrls.Count - 1); return(imgUrls[randomUrlIndex].ToString()); } return(String.Empty); } // getRandomImage
public static string[] getParameterKeys(CmsPage page, CmsControlDefinition controlDefinition) { return(CmsControlUtils.getControlParameterKeys(page, controlDefinition)); } // getControlParameterKeys