Bitrix Site Manager

CMain

The CMain class represents a page.

Every time a new page is created, system creates an instance of this class. You can access the CMain object via the $APPLICATION variable.

Methods

Page title

MethodDescription
ShowTitle Displays the page title.
GetTitle Returns the page title.
SetTitle Sets the page title.

CSS

MethodDescription
ShowCSS Emits the CSS of a page.
GetCSS Retrieves the CSS of the page.
SetTemplateCSS Assigns the CSS to the component.
SetAdditionalCSS Sets the CSS for the page.

Navigation chain

MethodDescription
ShowNavChain Emits the navigation chain
GetNavChain Returns the HTML code of the navigation chain
AddChainItem Adds an item to the end of the navigation chain

Menu

MethodDescription
GetMenu Returns an instance of the CMenu class.
GetMenuHtml Returns the HTML code which displays the menu of the specified type.
GetMenuHtmlEx Similar to GetMenuHtml but applies different menu template.

Page and section properties

MethodDescription
ShowProperty Displays page properties, with respect to the section properties.
GetProperty Returns the property value of the current page or section.
GetPageProperty Returns the value of a property of the current page.
GetDirProperty Returns the specified property of the current section.
GetPagePropertyList Returns an array of all page properties
GetDirPropertyList Returns an array of the section properties, collected recursively up to the site root.
SetPageProperty Sets the value of the specified property of the current page.
SetDirProperty Sets the value of the property for the current section.
ShowMeta Emits the page property as the META tag.
GetMeta Retrieves the page property decorated in the <meta> tag.

Files

MethodDescription
SaveFileContent Saves the page to disk.
GetFileContent Retrieves the file contents.
GetFileRecursive Searches for a file recursively up the folder hierarchy.
GetFileAccessPermission Retrieves the access permission of a file or folder
SetFileAccessPermission Sets the access permissions for a file or folder
CopyFileAccessPermission Opies the access permissions of one file or folder to another file or folder.
RemoveFileAccessPermission Deletes the access permissions of a file or folder

Module access permissions and roles

MethodDescription
GetUserRight Returns the access permission assigned to a number of groups.
GetUserRoles Returns array of roles (in the form of a string) assigned to a number of groups.

Current address of page

MethodDescription
GetCurUri Used to obtain the path and name of the current page relative to the site root
GetCurPage Used to obtain the path and name of the current page relative to the site root, without parameters.
GetCurPageParam Returns the path and name of the current page relative to the site root and optionally modifies (adds or removes) the URL parameters.
GetCurDir Returns the folder of the current page relative to the site root
SetCurPage Used to set the current page and its parameters in the instance of the CMain class.

Control toolbar

MethodDescription
ShowPanel Displays the control toolbar in the public section of the site.
GetPanel Returns the HTML code of the public section control toolbar.
AddPanelButton Adds a button to the control toolbar

Cookies

MethodDescription
set_cookie Sets the cookie.
get_cookie Returns the value of a cookie.
ShowSpreadCookieHTML Emits the HTML code indended for spreading cookies among domains.

Components

MethodDescription
IncludeFile Includes any files within the page body, prologue or epilogue
GetTemplatePath Creates the path to the component relative to the site root from the specified path to component.

Other methods

MethodDescription
IncludeAdminFile Includes the specified file with the administrative prologue and epilogue attached.
IncludeString Takes a string and returns the HTML code of the specified text bordered in the frame.
GetShowIncludeAreas Urns true if the button Show include areas is checked.
AddBufferContent Used to create delay functions
ShowBanner Includes the Advertising module and displays a banner of the specified type.
GetSiteByDir Returns an array describing the site defined by the specified path and domain.
AuthForm Displays the authorization form, or includes other components depending on the parameters passed.
IsHTTPS Determines if the current protocol is secured (HTTPS).