MediaDirectoryCategory
extends MediaDirectoryLibrary
in package
Media Directory Category Class
Tags
Table of Contents
Properties
- $_objTpl : mixed
- $arrCategories : mixed
- $arrCommunityGroups : mixed
- $arrFrontendLanguages : mixed
- $arrSettings : mixed
- $moduleConstVar : mixed
- $moduleLangVar : mixed
- $moduleName : mixed
- $moduleNameLC : mixed
- $moduleTablePrefix : mixed
- $pageContent : mixed
- $strJavascript : mixed
- $category : mixed
- $currentFetchedEntryDataObject : MediaDirectoryEntry
- Holds the MediaDirectoryEntry object with the most recently loaded entries (using MediaDirectoryEntry::getEntries())
- $cx : mixed
- $defaultFieldTemplatetKey : string
- Key to reference the default component or context templates in {@see static::$fieldTemplates}.
- $fieldTemplates : array<string|int, mixed>
- List of templates to be used for parsing title and content data of entries.
- $fieldTemplateScopes : array<string|int, mixed>
- Available scopes to be used as field templates.
- $form : mixed
- $inputFieldMetaData : array<string|int, mixed>
- Temporary container for the meta-data of the input fields.
- $level : mixed
- $outputLocale : Locale
- The locale in which the output shall be parsed for
- $settings : array<string|int, mixed>
- List of the component's configuration
- $slugConversions : mixed
- $slugs : array<string|int, mixed>
- Contains a list of all existing slugs
- $usedFrontendLocales : array<string|int, mixed>
- Two-dimensional array of activated frontend locales
- $arrExpandedCategoryIds : mixed
- $arrSelectedCategories : mixed
- $bolGetChildren : mixed
- $intCategoriesSortCounter : mixed
- $intCategoryId : mixed
- $intNumEntries : mixed
- $intParentId : mixed
- $intRowCount : mixed
- $strNavigationPlaceholder : mixed
- $strNotSelectedOptions : mixed
- $strSelectedOptions : mixed
Methods
- __construct() : mixed
- Constructor
- buildDropdownmenu() : mixed
- checkAccess() : mixed
- checkDisplayduration() : mixed
- countEntries() : mixed
- createCategorieTree() : string
- Return HTML representing the Category tree with links
- deleteCategory() : mixed
- fetchMediaDirListConfigFromTemplate() : array<string|int, mixed>
- Identity functional placeholders in the block $block of template $templatet that will act as config options to be applied on the listing of entries. Placeholders can have the following form: - MEDIADIR_CONFIG_LIST_LATEST => Order by latest addition - MEDIADIR_CONFIG_LIST_LIMIT_<limit> => Limit the listing - MEDIADIR_CONFIG_LIST_OFFSET_<offset> => Start listing at offset - MEDIADIR_CONFIG_FILTER_FORM_<id> => filter by form - MEDIADIR_CONFIG_FILTER_CATEGORY_<id> => filter by category - MEDIADIR_CONFIG_FILTER_LEVEL_<id> => filter by level - MEDIADIR_CONFIG_FILTER_AUTO => filter by supplied arguments as default - MEDIADIR_CONFIG_SORT_POPULAR => order entries by popularity - MEDIADIR_CONFIG_SORT_ALPHABETICAL => order entries alphabetically
- findOneByName() : mixed
- findOneBySlug() : mixed
- generateEntrySlugs() : mixed
- Provides each entry (and the form it is based on) with a slug field and a slug value, both only if the entry/form doesn't already have it Is called when usePrettyUrls is activated or a form has been modified, to make sure the resolving of the entries works correctly.
- getApplicationPageByCategory() : mixed
- getApplicationPageByEntry() : mixed
- getApplicationPageByLevel() : mixed
- getApplicationPageByLevelAndCategory() : mixed
- getAutoSlugPath() : Url
- Get the human readable url for a mediadir location
- getCategories() : mixed
- getCategoryData() : mixed
- getCategorySlugPath() : mixed
- getCommunityGroups() : mixed
- getExpandedCategories() : mixed
- getFormData() : mixed
- getFormOnSubmit() : mixed
- getFrontendLanguages() : mixed
- getIdsWithPublishedData() : array<string|int, mixed>
- Returns a list with IDs of all visible categories that contain published data
- getJavascript() : mixed
- getLevelData() : mixed
- getLevelSlugPath() : mixed
- getMediaBrowserButton() : string
- Get mediabrowser button
- getNameFromSlug() : mixed
- getOutputLocale() : Locale
- Get locale in which output shall be parsed for
- getQueryToFindPrimaryInputFieldId() : string
- Get SQL statement to fetch the ID of the primary field of a form.
- getSelectorJavascript() : mixed
- getSelectorOrder() : mixed
- getSelectorSearch() : array<string|int, mixed>
- Get setting if levels or categories shall be included in extended search functionality of a specific form.
- getSettings() : mixed
- getSlugFromName() : mixed
- getThumbImage() : string
- Get the Thumbnail image path from given file Thumbnail will be created it is not exists
- getUploadedFilePath() : bool|string
- Get uploaded file path by using uploader id and file name
- listCategories() : mixed
- loadCategories() : mixed
- saveCategory() : mixed
- saveOrder() : mixed
- setJavascript() : mixed
- addSlugFieldToForm() : int
- Add a new inputfield to a form and set its context type to 'slug'.
- enforceUniqueSlug() : mixed
- Enforce uniqueness of a slug
- flushInputFieldMetaDataByFormId() : mixed
- Flush cache of input-field meta-data of a specific form
- flushSettings() : mixed
- flushUsedFrontendLocales() : mixed
- Flush cached list of used frontend locales
- getApplicationPageByForm() : mixed
- getCurrentFetchedEntryDataObject() : mixed
- getCustomFormatDefinition() : string
- Get the FieldTemplate (HTML-Code) (from {@see static::getCustomFormatTemplates()}) for $scope that best matches $component, $context and $formId.
- getCustomFormatTemplates() : array<string|int, mixed>
- Load and return the custom format templates
- getMainApplicationPage() : mixed
- getQueryToFindInputFieldIdByContextType() : string
- Get SQL statement to fetch the ID of the field of a form identified by its context.
- getSourceLocaleIdForTargetLocale() : int
- Get the source locale of a target locale
- initI18nEntryData() : void
- Initialize the multilingual data of all existing entries associated to form identified by `$formId`. This will insert empty datasets into the database for each inputfield of `$formId` that is a multilingual field (`type_multi_lang = 1`).
- initOutputLocale() : Locale
- Determine the locale in which the output shall be parsed for.
- loadAllSlugsFromDb() : mixed
- Fetch all slugs from the database
- parseGoogleMapPlaceholder() : mixed
- setCurrentFetchedEntryDataObject() : mixed
- slugify() : mixed
- Slugifies the given string and ensures its uniqueness
Properties
$_objTpl
public
mixed
$_objTpl
$arrCategories
public
mixed
$arrCategories
= array()
$arrCommunityGroups
public
mixed
$arrCommunityGroups
= array()
$arrFrontendLanguages
public
mixed
$arrFrontendLanguages
= array()
$arrSettings
public
mixed
$arrSettings
= array()
$moduleConstVar
public
mixed
$moduleConstVar
= "MEDIADIR"
$moduleLangVar
public
mixed
$moduleLangVar
= "MEDIADIR"
$moduleName
public
mixed
$moduleName
= ''
$moduleNameLC
public
mixed
$moduleNameLC
= ''
$moduleTablePrefix
public
mixed
$moduleTablePrefix
= "mediadir"
$pageContent
public
mixed
$pageContent
$strJavascript
public
mixed
$strJavascript
$category
protected
static mixed
$category
= null
$currentFetchedEntryDataObject
Holds the MediaDirectoryEntry object with the most recently loaded entries (using MediaDirectoryEntry::getEntries())
protected
static MediaDirectoryEntry
$currentFetchedEntryDataObject
= null
$cx
protected
mixed
$cx
$defaultFieldTemplatetKey
Key to reference the default component or context templates in {@see static::$fieldTemplates}.
protected
static string
$defaultFieldTemplatetKey
= 'default'
$fieldTemplates
List of templates to be used for parsing title and content data of entries.
protected
static array<string|int, mixed>
$fieldTemplates
= []
$fieldTemplateScopes
Available scopes to be used as field templates.
protected
static array<string|int, mixed>
$fieldTemplateScopes
= ['title', 'content']
Those are currently only title
(Title.html) and content
(Content.html).
$form
protected
static mixed
$form
= null
$inputFieldMetaData
Temporary container for the meta-data of the input fields.
protected
static array<string|int, mixed>
$inputFieldMetaData
= array()
This is used to reduce the amount of queries made to the database system.
$level
protected
static mixed
$level
= null
$outputLocale
The locale in which the output shall be parsed for
protected
static Locale
$outputLocale
$settings
List of the component's configuration
protected
static array<string|int, mixed>
$settings
= array()
$slugConversions
protected
mixed
$slugConversions
= array('_' => '', '-' => '_', ' ' => '-', '&' => '<and>')
$slugs
Contains a list of all existing slugs
protected
static array<string|int, mixed>
$slugs
= array()
Is being used to ensure uniqueness within slugs.
$usedFrontendLocales
Two-dimensional array of activated frontend locales
protected
static array<string|int, mixed>
$usedFrontendLocales
= array()
Contains array-data of the frontend locales that have been activated in the settings section.
$arrExpandedCategoryIds
private
mixed
$arrExpandedCategoryIds
= array()
$arrSelectedCategories
private
mixed
$arrSelectedCategories
$bolGetChildren
private
mixed
$bolGetChildren
$intCategoriesSortCounter
private
mixed
$intCategoriesSortCounter
= 0
$intCategoryId
private
mixed
$intCategoryId
$intNumEntries
private
mixed
$intNumEntries
$intParentId
private
mixed
$intParentId
$intRowCount
private
mixed
$intRowCount
$strNavigationPlaceholder
private
mixed
$strNavigationPlaceholder
$strNotSelectedOptions
private
mixed
$strNotSelectedOptions
$strSelectedOptions
private
mixed
$strSelectedOptions
Methods
__construct()
Constructor
public
__construct([mixed $intCategoryId = null ][, mixed $intParentId = null ][, mixed $bolGetChildren = 1 ], mixed $name) : mixed
Parameters
- $intCategoryId : mixed = null
- $intParentId : mixed = null
- $bolGetChildren : mixed = 1
- $name : mixed
buildDropdownmenu()
public
buildDropdownmenu(mixed $arrOptions[, mixed $intSelected = null ]) : mixed
Parameters
- $arrOptions : mixed
- $intSelected : mixed = null
checkAccess()
public
checkAccess(mixed $strAction) : mixed
Parameters
- $strAction : mixed
checkDisplayduration()
public
checkDisplayduration() : mixed
countEntries()
public
countEntries([mixed $intCategoryId = null ][, mixed $intLevelId = null ]) : mixed
Parameters
- $intCategoryId : mixed = null
- $intLevelId : mixed = null
createCategorieTree()
Return HTML representing the Category tree with links
public
createCategorieTree(array<string|int, mixed> $arrCategory, int $levelId) : string
Parameters
- $arrCategory : array<string|int, mixed>
- $levelId : int
Return values
stringdeleteCategory()
public
deleteCategory([mixed $intCategoryId = null ]) : mixed
Parameters
- $intCategoryId : mixed = null
fetchMediaDirListConfigFromTemplate()
Identity functional placeholders in the block $block of template $templatet that will act as config options to be applied on the listing of entries. Placeholders can have the following form: - MEDIADIR_CONFIG_LIST_LATEST => Order by latest addition - MEDIADIR_CONFIG_LIST_LIMIT_<limit> => Limit the listing - MEDIADIR_CONFIG_LIST_OFFSET_<offset> => Start listing at offset - MEDIADIR_CONFIG_FILTER_FORM_<id> => filter by form - MEDIADIR_CONFIG_FILTER_CATEGORY_<id> => filter by category - MEDIADIR_CONFIG_FILTER_LEVEL_<id> => filter by level - MEDIADIR_CONFIG_FILTER_AUTO => filter by supplied arguments as default - MEDIADIR_CONFIG_SORT_POPULAR => order entries by popularity - MEDIADIR_CONFIG_SORT_ALPHABETICAL => order entries alphabetically
public
static fetchMediaDirListConfigFromTemplate(string $block, Sigma $template[, int $formId = null ][, int $categoryId = null ][, int $levelId = null ]) : array<string|int, mixed>
Parameters
- $block : string
-
Name of the template block to look up for functional placeholders
- $template : Sigma
-
Template object where the block $block is located in
- $formId : int = null
-
If supplied and filter MEDIADIR_CONFIG_FILTER_AUTO is present, then do set filter 'form' to $formId
- $categoryId : int = null
-
If supplied and filter MEDIADIR_CONFIG_FILTER_AUTO is present, then do set filter 'category' to $categoryId
- $levelId : int = null
-
If supplied and filter MEDIADIR_CONFIG_FILTER_AUTO is present, then do set filter 'level' to $levelId
Return values
array<string|int, mixed> —2-dimensional array containing the identified config. It has the following structure:
array( 'list' => array( 'latest' => true, 'limit' => 10, 'offset' => 3 ), 'filter' => array( 'form' => 3, 'category' => 4, 'level' => 5 ), 'sort' => array( 'alphabetical' => true, ), )
Note: the sub entries in array 'list' and array 'filter' are optional. They will only be set in case the associated placeholder was found in the specified template block.
findOneByName()
public
findOneByName(mixed $name) : mixed
Parameters
- $name : mixed
findOneBySlug()
public
findOneBySlug(mixed $slug) : mixed
Parameters
- $slug : mixed
generateEntrySlugs()
Provides each entry (and the form it is based on) with a slug field and a slug value, both only if the entry/form doesn't already have it Is called when usePrettyUrls is activated or a form has been modified, to make sure the resolving of the entries works correctly.
public
generateEntrySlugs([int $formId = 0 ]) : mixed
Parameters
- $formId : int = 0
-
Limit slug generation to form identified by ID $formId.
getApplicationPageByCategory()
public
getApplicationPageByCategory(mixed &$categoryId, mixed $langId[, mixed $traverseUp = false ]) : mixed
Parameters
- $categoryId : mixed
- $langId : mixed
- $traverseUp : mixed = false
getApplicationPageByEntry()
public
getApplicationPageByEntry([mixed $formId = null ], mixed $langId) : mixed
Parameters
- $formId : mixed = null
- $langId : mixed
getApplicationPageByLevel()
public
getApplicationPageByLevel(mixed &$levelId, mixed $langId[, mixed $traverseUp = false ]) : mixed
Parameters
- $levelId : mixed
- $langId : mixed
- $traverseUp : mixed = false
getApplicationPageByLevelAndCategory()
public
getApplicationPageByLevelAndCategory(mixed &$levelId, mixed &$categoryId, mixed $langId[, mixed $traverseUp = false ]) : mixed
Parameters
- $levelId : mixed
- $categoryId : mixed
- $langId : mixed
- $traverseUp : mixed = false
getAutoSlugPath()
Get the human readable url for a mediadir location
public
getAutoSlugPath([array<string|int, mixed> $arrEntry = null ][, int $categoryId = null ][, int $levelId = null ][, bool $useRequestedPageAsFallback = false ][, bool $includeDetailApplicationPage = true ][, Locale $locale = null ]) : Url
URI-Slug scheme precedence
-
$levelId & $categoryId are set: Url will point to specific level & category application page (if existing). I.e.: section=MediaDir&cmd=4-2
-
$levelId is set: Url will point to specific level application page (if existing). I.e.: section=MediaDir&cmd=4
-
$categoryId is set: Url will point to specific category application page (if existing). I.e.: section=MediaDir&cmd=2
-
if $arrEntry is set: Url will point to specific form application page (if existing). I.e.: section=MediaDir&cmd=team
-
$categoryId is set: Url will point to main application page (if existing). I.e.: section=MediaDir
-
if $arrEntry is set: Url will point to specific form detail application page (if existing). I.e.: section=MediaDir&cmd=detail12
-
if $arrEntry is set: Url will point to generic detail application page (if existing). I.e.: section=MediaDir&cmd=detail
-
fallback #1 Url will point to main application page (if existing). I.e.: section=MediaDir
-
fallback #2 Lookup failed, NULL will be returned
Parameters
- $arrEntry : array<string|int, mixed> = null
-
(Optional) Array definition of the entry to locate
- $categoryId : int = null
-
(Optional) ID of the category to locate
- $levelId : int = null
-
(Optional) ID of the level to locate
- $useRequestedPageAsFallback : bool = false
-
(Optional) Whether or not to use the requested page as fallback in case no matching mediadir application could be found
- $includeDetailApplicationPage : bool = true
-
(Optional) Whether or not to include the detail application page as a feasible url target
- $locale : Locale = null
-
(Optional) Get slug-path from specific locale. the detail application page as a feasible url target
Return values
Url —Returns an Url object of the mediadir location. If location is invalid, method will return NULL.
getCategories()
public
getCategories([mixed $intCategoryId = null ][, mixed $intParentId = null ]) : mixed
Parameters
- $intCategoryId : mixed = null
- $intParentId : mixed = null
getCategoryData()
public
getCategoryData() : mixed
getCategorySlugPath()
public
getCategorySlugPath(int $categoryId[, int $offsetCategoryId = 0 ]) : mixed
Parameters
- $categoryId : int
-
ID of category to get the slug-path from
- $offsetCategoryId : int = 0
-
Set the ID of a parent category to only fetch the slug-path from that category downwards.
getCommunityGroups()
public
getCommunityGroups() : mixed
getExpandedCategories()
public
getExpandedCategories(mixed $intExpand, mixed $arrData) : mixed
Parameters
- $intExpand : mixed
- $arrData : mixed
getFormData()
public
getFormData() : mixed
getFormOnSubmit()
public
getFormOnSubmit(mixed $arrScripts) : mixed
Parameters
- $arrScripts : mixed
getFrontendLanguages()
public
getFrontendLanguages() : mixed
getIdsWithPublishedData()
Returns a list with IDs of all visible categories that contain published data
public
static getIdsWithPublishedData() : array<string|int, mixed>
Published data is identified as categories having any of the following options set to activated:
- categoryShowEntries
- categoryShowSubcategories
Return values
array<string|int, mixed> —List of IDs of categories
getJavascript()
public
getJavascript() : mixed
getLevelData()
public
getLevelData() : mixed
getLevelSlugPath()
public
getLevelSlugPath(int $levelId[, int $offsetLevelId = 0 ]) : mixed
Parameters
- $levelId : int
-
ID of level to get the slug-path from
- $offsetLevelId : int = 0
-
Set the ID of a parent level to only fetch the slug-path from that level downwards.
getMediaBrowserButton()
Get mediabrowser button
public
getMediaBrowserButton(string $buttonValue[, string $options = array() ][, string $callback = '' ]) : string
Parameters
- $buttonValue : string
-
Value of the button
- $options : string = array()
-
Input button options
- $callback : string = ''
-
Media browser callback function
Return values
string —html element of browse button
getNameFromSlug()
public
getNameFromSlug(mixed $slug) : mixed
Parameters
- $slug : mixed
getOutputLocale()
Get locale in which output shall be parsed for
public
static getOutputLocale() : Locale
Return values
LocalegetQueryToFindPrimaryInputFieldId()
Get SQL statement to fetch the ID of the primary field of a form.
public
getQueryToFindPrimaryInputFieldId([int $formId = 0 ]) : string
The SQL statement can be used as a sub-query in a query where contrexx_module_mediadir_entry is used and has been aliased as 'entry'
Parameters
- $formId : int = 0
-
Set to the ID of a form to restrict the query to a specific form.
Return values
string —The SQL statement to be used as sub-query
getSelectorJavascript()
public
getSelectorJavascript() : mixed
getSelectorOrder()
public
getSelectorOrder(mixed $intSelectorId) : mixed
Parameters
- $intSelectorId : mixed
getSelectorSearch()
Get setting if levels or categories shall be included in extended search functionality of a specific form.
public
getSelectorSearch(int $intSelectorId) : array<string|int, mixed>
Parameters
- $intSelectorId : int
-
Set to 9 to get the setting for category. set to 10 to get the setting for level.
Return values
array<string|int, mixed> —Array containung the setting if the levels or categories
shall be included in the extended seach functionality
for each form. Format: array(
getSettings()
public
getSettings() : mixed
getSlugFromName()
public
getSlugFromName(mixed $name) : mixed
Parameters
- $name : mixed
getThumbImage()
Get the Thumbnail image path from given file Thumbnail will be created it is not exists
public
getThumbImage(string $path) : string
Parameters
- $path : string
-
Relative path to the file
Return values
string —Thumbnail path
getUploadedFilePath()
Get uploaded file path by using uploader id and file name
public
getUploadedFilePath(string $uploaderId, string $fileName) : bool|string
Parameters
- $uploaderId : string
-
Uploader id
- $fileName : string
-
File name
Return values
bool|string —File path when File exists, false otherwise
listCategories()
public
listCategories(mixed $objTpl, mixed $intView[, mixed $intCategoryId = null ][, mixed $arrParentIds = array() ][, mixed $intEntryId = null ][, mixed $arrExistingBlocks = null ][, mixed $intStartLevel = 1 ][, mixed $cmd = null ]) : mixed
Parameters
- $objTpl : mixed
- $intView : mixed
- $intCategoryId : mixed = null
- $arrParentIds : mixed = array()
- $intEntryId : mixed = null
- $arrExistingBlocks : mixed = null
- $intStartLevel : mixed = 1
- $cmd : mixed = null
loadCategories()
public
loadCategories() : mixed
saveCategory()
public
saveCategory(mixed $arrData[, mixed $intCategoryId = null ]) : mixed
Parameters
- $arrData : mixed
- $intCategoryId : mixed = null
saveOrder()
public
saveOrder(mixed $arrData) : mixed
Parameters
- $arrData : mixed
setJavascript()
public
setJavascript(mixed $strJavascript) : mixed
Parameters
- $strJavascript : mixed
addSlugFieldToForm()
Add a new inputfield to a form and set its context type to 'slug'.
protected
addSlugFieldToForm(int $formId) : int
Parameters
- $formId : int
-
Id of form to add the inputfield to.
Return values
int —Id of the newly added inputfield.
enforceUniqueSlug()
Enforce uniqueness of a slug
protected
enforceUniqueSlug(string &$slug, int $entryId, int $slugLangId) : mixed
The supplied $slug will be made unqiue within the sopce of a locale (identified by the locale's ID through argument $slugLangId). This is achieved by adding a trailing (unique) integer to the slug in case its not yet unique. In case the option settingsShowEntriesInAllLang is set, then the slug will be made unique over all locales.
Parameters
- $slug : string
-
The slug to make unique.
- $entryId : int
-
The associated entry of the slug.
- $slugLangId : int
-
The ID of the locale the slug is from.
flushInputFieldMetaDataByFormId()
Flush cache of input-field meta-data of a specific form
protected
static flushInputFieldMetaDataByFormId(int $id) : mixed
Parameters
- $id : int
-
ID of form to flush the meta-data of its input fields from the cache.
flushSettings()
protected
static flushSettings() : mixed
flushUsedFrontendLocales()
Flush cached list of used frontend locales
protected
static flushUsedFrontendLocales() : mixed
getApplicationPageByForm()
protected
getApplicationPageByForm(mixed $formCmd, mixed $langId) : mixed
Parameters
- $formCmd : mixed
- $langId : mixed
getCurrentFetchedEntryDataObject()
protected
getCurrentFetchedEntryDataObject() : mixed
getCustomFormatDefinition()
Get the FieldTemplate (HTML-Code) (from {@see static::getCustomFormatTemplates()}) for $scope that best matches $component, $context and $formId.
protected
getCustomFormatDefinition(string $scope, string $component, string $context[, int $formId = 0 ]) : string
If there is no matching template for $context, then the default for $component will be returned. However if not even a default for $component exists, then the generic default template will be returned.
Parameters
- $scope : string
-
Either
title
orcontent
. - $component : string
-
The name of a component.
- $context : string
-
The specific context to use.
- $formId : int = 0
-
The ID of a form.
Return values
string —The HTML-code of the matching template.
getCustomFormatTemplates()
Load and return the custom format templates
protected
getCustomFormatTemplates() : array<string|int, mixed>
The custom format templates are defined in two locations:
- modules/MediaDir/View/Template/Generic/
.html - images/MediaDir/FieldTemplate/[<formId>/][<componentName>/[
/]] .html
Tags
Return values
array<string|int, mixed> —List of loaded field templates. The returned array has the following format:
[
<componentName> => [
<context> => [
<scope> => <template>,
...
],
...
],
...
],
If there are any form specific templates defined, then those are returned in the list of loaded field templates as follows:
[
<formId> => [
<componentName> => [
<context> => [
<scope> => <template>,
...
],
...
],
...
],
...
],
getMainApplicationPage()
protected
getMainApplicationPage(mixed $langId) : mixed
Parameters
- $langId : mixed
getQueryToFindInputFieldIdByContextType()
Get SQL statement to fetch the ID of the field of a form identified by its context.
protected
getQueryToFindInputFieldIdByContextType(string $type[, int $formId = 0 ][, bool $allowFallback = false ]) : string
The SQL statement can be used as a sub-query in a query where contrexx_module_mediadir_entry is used and has been aliased as 'entry'
Parameters
- $type : string
-
Context type (MediaDirectoryInputfields::getInputContexts()
- $formId : int = 0
-
Set to the ID of a form to restrict the query to a specific form. In case the form (identified by $formId) has a field set as context $type, then
$allowFallback = false
is implied. - $allowFallback : bool = false
-
Set to
true
to return the first inputfield (according to the set sort order of the inputfields) in case the form of the associated entry does not contain a field by the specified context $type.
Return values
string —The SQL statement to be used as sub-query
getSourceLocaleIdForTargetLocale()
Get the source locale of a target locale
protected
static getSourceLocaleIdForTargetLocale(int $localeId[, array<string|int, mixed> $usedFrontendLocales = array() ]) : int
The source locale is the fallback locale of a locale (the target locale) or the system's default locale.
Parameters
- $localeId : int
-
The ID of the target locale
- $usedFrontendLocales : array<string|int, mixed> = array()
-
List of available locales. One-dimensional array of locale IDs.
Return values
int —The ID of the source locale
initI18nEntryData()
Initialize the multilingual data of all existing entries associated to form identified by `$formId`. This will insert empty datasets into the database for each inputfield of `$formId` that is a multilingual field (`type_multi_lang = 1`).
protected
initI18nEntryData(int $formId) : void
Parameters
- $formId : int
-
ID of form to init the i18n entry data.
initOutputLocale()
Determine the locale in which the output shall be parsed for.
protected
static initOutputLocale() : Locale
Backend:
- Matching Locale of Backend language
- Selected Frontend Locale (of menu / if used by MediaDir)
- Default Frontend Locale (if used by MediaDir)
- Any Frontend Locale used by MediaDir
Any other mode: Currently requested frontend Locale
Return values
LocaleloadAllSlugsFromDb()
Fetch all slugs from the database
protected
loadAllSlugsFromDb() : mixed
Those will be used to ensure uniqueness within slugs (@see MediaDirectoryLibrary::enforceUniqueSlug()).
parseGoogleMapPlaceholder()
protected
parseGoogleMapPlaceholder(mixed $template, mixed $placeholder) : mixed
Parameters
- $template : mixed
- $placeholder : mixed
setCurrentFetchedEntryDataObject()
protected
setCurrentFetchedEntryDataObject(mixed $objEntry) : mixed
Parameters
- $objEntry : mixed
slugify()
Slugifies the given string and ensures its uniqueness
protected
slugify(int $entryId, string &$string, int $langId[, array<string|int, mixed> $titleData = array() ]) : mixed
Parameters
- $entryId : int
-
The ID of the associated entry
- $string : string
-
The string to slugify
- $langId : int
-
The ID of the locale the string $string comes from.
- $titleData : array<string|int, mixed> = array()
-
Array of strings to be used in case $string is an empty string. The array uses the IDs of available locales as keys for each string.