Detector
class Detector implements ApplicationAwareInterface, SiteAggregateInterface (View source)
Traits
Trait ApplicationAwareTrait A trait used with ApplicationAwareInterface
Properties
protected Application | $app | from ApplicationAwareTrait | |
protected bool | $enabled | ||
protected bool|Section | $preferredSection | ||
protected Site | $site | ||
protected RequestCache | $cache |
Methods
Returns all Multilingual Sections on the current site.
Returns a translated page based on the Page object.
Get a switch language link URL to redirect to the target section from the current page.
Returns the preferred section based on session, cookie, user object, default browser (if allowed), and finally site preferences.
Set the locale associated to the 'site' localization context.
Check if there's some multilingual section.
Check if we can set a session value.
Details
setApplication(Application $app)
Setter method for the application
__construct(RequestCache $cache)
No description
Site
getSite()
No description
Section|null
getActiveSection(Page $c)
Returns the Multilingual Page Section based on the Page object.
string
getActiveLocale(Page $c)
Returns the locale string (e.g. en_US) based on the Page object.
array
getAvailableSections()
Returns all Multilingual Sections on the current site.
Page
getRelatedPage(Page $currentPage, Section $targetSection)
Returns a translated page based on the Page object.
string
getSwitchLink(mixed $currentPageID, mixed $targetSectionID)
Get a switch language link URL to redirect to the target section from the current page.
Section|null
getPreferredSection()
Returns the preferred section based on session, cookie, user object, default browser (if allowed), and finally site preferences.
Since the user's language is not a locale but a language, attempts to determine best section for the given language.
setupSiteInterfaceLocalization(Page|null $c = null)
Set the locale associated to the 'site' localization context.
bool
isEnabled()
Check if there's some multilingual section.
protected bool
canSetSessionValue()
Check if we can set a session value.