Class cms

From Snapp CMS Developer Documentation

Jump to: navigation, search

Usage in CMS

The CMS class is the construct for bringing together all the other base classes into a single object making the CMS easy to intergrate into almost any site

Class CRU_CMS_V2

Construction Configuration Options

Config Options Description
config : array (optional) Optional or Extra Options to be Passed the to the cmsConfig class

Available Variables

Config Options Description
config : object An Object Containing all the configuration options from the config.ini

Available Functions

buildURL(menuItem:array,urlOnly:bool)

Returns the HREF Link and title for the passed pages details from the sitemap Using the optional urlOnly will only return the url to the page only

Parameters

  • menuItem : array (required) from the sitemap tree
  • urlOnly : bool (optional)
checkDomain()

Check the Wesbite's domain name against the Domains Section of the configuration and updates the Sites Section with the appropriate changes

camelCase(string:string)

Converts a "_" separated string to a camel case string

checkOnlineStatus()
Checks to see if the site is set to be online or offline;

This function will set the sites template to "offline" if the site is marked as offline

getMetaTags()

Returns the Keywords, Description Meta Tags for the Current Page

getModuleCSS()

Returns the Path to the current pages module and associated template Style Sheet

getModulePath()

Returns the Path to the current pages module directory

getPageTitle()

Returns the current pages title

getServerAddress()

Returns the Address of the Server eg $_SERVER['SERVER_ADDR']

getSiteTemplate()

Returns the path to the current site's index file

getTemplateCSS(template:string)

Returns the url load the Master Templates Style Sheet

Parameters

  • template : string (optional)
getTemplatePath()

Returns the path load the Master Template ( for use with multi-site/template sites only)

loadBanner(zone_id)

Loads the Advertising Banner for a given zone and returns the html output

Parameters

  • zone_id : int (required)
loadJS(library:string)

Returns a URL to Loads a Javascript Library from the Global Repository

Parameters

  • library : string (required)
loadMenu(menuTypestring,cfg:array)

Alias for the Widget Engine for creating menus in a site based on a section out of the sitemap

Parameters

  • menuType : string (required) See the Widgets page for available options
  • cfg : array (required) configuration options passed directly to the appropriate Widget
loadModule()

Returns the path to the current page's module type for including into the Master Template

loadSite()

Load the Default Site Page or a page passed in the URL from the site's sitemap

loadWidget(widget:string,config:array)

Loads and executes a specified widget and returning a string containing the output of the widget

Parameters

  • widget : string (required)
  • widget : string (require)
pageTitle(type:int)

Returns the Current Page Title based on the type value passed to the function

Parameters

  • type : int (optional)
    • Type 1 : Custom Page Title
    • Type 2 : Use Title from Configuration File
    • Default : Page Title from Sitemap
processContent(content:string)

Removes escaped quotes

renderXML(data:array)

Renders a passed array as XML

setSiteTemplate(template:string)

Overrides the Default Site Template Set in the config.ini

Only available in multi site installations

Parameters

  • template : string (required)
varDump(object:object/array/string)

Explodes and Outputs the contents of a object/array to the screen for debugging purposes

Parameters

  • object : object/array/string (required)
Personal tools
Core Components
Standalone Installs