_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q245000 | NameAndDescriptionListener.buildWidget | validation | public function buildWidget(BuildWidgetEvent $event)
{
if (!($this->wantToHandle($event) && \in_array($event->getProperty()->getName(), ['name', 'description']))) {
return;
}
$metaModel = $this->getMetaModelByModelPid($event->getModel());
Helper::prepareLanguageAwareWid... | php | {
"resource": ""
} |
q245001 | SubPaletteSubscriber.createConditionsForPalette | validation | private function createConditionsForPalette(PaletteInterface $palette, array $typeLegends)
{
$conditions = [];
foreach ($typeLegends as $value => $legends) {
// We use an immutable implementation. Using the same condition is save here.
$valueCondition = new FilterSettingType... | php | {
"resource": ""
} |
q245002 | SubPaletteSubscriber.getLegend | validation | private function getLegend(PaletteInterface $palette, $legendName)
{
if ($palette->hasLegend($legendName)) {
return $palette->getLegend($legendName);
}
$legend = new Legend($legendName);
$palette->addLegend($legend);
return $legend;
} | php | {
"resource": ""
} |
q245003 | SubPaletteSubscriber.getConditionChain | validation | private function getConditionChain(LegendInterface $legend, $propertyName, array &$conditions)
{
// Cache condition chain for each legend property.
if (isset($conditions[$legend->getName()][$propertyName])) {
return $conditions[$legend->getName()][$propertyName];
}
$prop... | php | {
"resource": ""
} |
q245004 | SubPaletteSubscriber.getLegendProperty | validation | private function getLegendProperty(LegendInterface $legend, $propertyName)
{
if ($legend->hasProperty($propertyName)) {
$property = $legend->getProperty($propertyName);
} else {
$property = new Property($propertyName);
$legend->addProperty($property);
}
... | php | {
"resource": ""
} |
q245005 | SubPaletteSubscriber.getVisibleCondition | validation | private function getVisibleCondition($property)
{
$condition = $property->getVisibleCondition();
if ($condition instanceof PropertyConditionChain) {
return $condition;
}
$conditionChain = new PropertyConditionChain();
$property->setVisibleCondition($conditionChai... | php | {
"resource": ""
} |
q245006 | TranslatorPopulator.mapTranslations | validation | private function mapTranslations($array, $domain, StaticTranslator $translator, $baseKey = '')
{
foreach ($array as $key => $value) {
$newKey = ($baseKey ? $baseKey . '.' : '') . $key;
if (is_array($value)) {
$this->mapTranslations($value, $domain, $translator, $newKe... | php | {
"resource": ""
} |
q245007 | TranslatorPopulator.addInputScreenTranslations | validation | private function addInputScreenTranslations(StaticTranslator $translator, $inputScreen, $containerName)
{
$currentLocale = $GLOBALS['TL_LANGUAGE'];
foreach ($inputScreen['legends'] as $legendName => $legendInfo) {
foreach ($legendInfo['label'] as $langCode => $label) {
$... | php | {
"resource": ""
} |
q245008 | DefaultOptionListener.getOptions | validation | private function getOptions($attribute, $onlyUsed)
{
// Remove empty values.
$options = [];
foreach ($attribute->getFilterOptions(null, $onlyUsed) as $key => $value) {
// Remove html/php tags.
$value = trim(strip_tags($value));
if (!empty($value)) {
... | php | {
"resource": ""
} |
q245009 | Configuration.resolvePath | validation | private function resolvePath($value)
{
$path = Path::canonicalize($value);
if ('\\' === DIRECTORY_SEPARATOR) {
$path = str_replace('/', '\\', $path);
}
return $path;
} | php | {
"resource": ""
} |
q245010 | RenderSettingFactory.collectAttributeSettings | validation | public function collectAttributeSettings(IMetaModel $metaModel, $renderSetting)
{
$attributeRows = $this
->database
->createQueryBuilder()
->select('*')
->from('tl_metamodel_rendersetting')
->where('pid=:pid')
->andWhere('enabled=1')
... | php | {
"resource": ""
} |
q245011 | RenderSettingFactory.internalCreateRenderSetting | validation | protected function internalCreateRenderSetting(IMetaModel $metaModel, $settingId)
{
$row = $this
->database
->createQueryBuilder()
->select('*')
->from('tl_metamodel_rendersettings')
->where('pid=:pid')
->andWhere('id=:id')
... | php | {
"resource": ""
} |
q245012 | FixupUserGroupModules.fixupModules | validation | public function fixupModules(DataContainer $dataContainer)
{
if (!class_exists('tl_user_group', false)) {
throw new \RuntimeException('data container is not loaded!');
}
$original = new \tl_user_group();
$modules = $original->getModules();
// 1. remove all Meta... | php | {
"resource": ""
} |
q245013 | FixupUserGroupModules.buildLanguageString | validation | private function buildLanguageString($name, $screen, $locale)
{
if (isset($screen['label'][$locale])) {
$GLOBALS['TL_LANG']['MOD'][$name] = $screen['label'][$locale];
return;
}
$GLOBALS['TL_LANG']['MOD'][$name] = $screen['label'][''];
} | php | {
"resource": ""
} |
q245014 | PaletteRestrictionListener.buildMetaPaletteConditions | validation | private function buildMetaPaletteConditions($palette, $metaPalettes)
{
foreach ($metaPalettes as $typeName => $paletteInfo) {
if ('default' === $typeName) {
continue;
}
if (preg_match('#^(\w+) extends (\w+)$#', $typeName, $matches)) {
$typ... | php | {
"resource": ""
} |
q245015 | PropertyConditionFactory.getTypeNames | validation | public function getTypeNames()
{
$names = $this->factories->ids();
if ([] !== $fallback = $this->fallbackFactory->getIds()) {
$names = array_unique(array_merge($fallback, $names));
}
return $names;
} | php | {
"resource": ""
} |
q245016 | PropertyConditionFactory.maxChildren | validation | public function maxChildren($conditionType)
{
$factory = $this->factories->has($conditionType) ? $this->getFactory($conditionType) : null;
if (!$factory instanceof NestablePropertyConditionFactoryInterface) {
if (null !== $value = $this->fallbackFactory->maxChildren($conditionType)) {
... | php | {
"resource": ""
} |
q245017 | PickerWidget.run | validation | public function run()
{
$template = new BackendTemplate('be_dcastylepicker');
$template->main = '';
$template->headline = $GLOBALS['TL_LANG']['MSC']['metamodelspicker'];
$inputName = Input::get('inputName');
if (!preg_match('~^[a-z\-_0-9]+$~i', $inputName)) {
... | php | {
"resource": ""
} |
q245018 | SimpleLookup.getParamName | validation | protected function getParamName()
{
if ($this->get('urlparam')) {
return $this->get('urlparam');
}
$objAttribute = $this->getFilteredAttribute();
if ($objAttribute) {
return $objAttribute->getColName();
}
return null;
} | php | {
"resource": ""
} |
q245019 | SimpleLookup.getLabel | validation | protected function getLabel()
{
if (null === ($attribute = $this->getFilteredAttribute())) {
return null;
}
if ($label = $this->get('label')) {
return $label;
}
return $attribute->getName();
} | php | {
"resource": ""
} |
q245020 | SimpleLookup.getParameterFilterOptions | validation | protected function getParameterFilterOptions($objAttribute, $arrIds, &$arrCount = null)
{
$arrOptions = $objAttribute->getFilterOptions(
$this->get('onlypossible') ? $arrIds : null,
(bool) $this->get('onlyused'),
$arrCount
);
// Remove empty values.
... | php | {
"resource": ""
} |
q245021 | SimpleLookup.getFilteredAttribute | validation | protected function getFilteredAttribute()
{
if (!($attributeId = $this->get('attr_id'))) {
return null;
}
if ($attribute = $this->getMetaModel()->getAttributeById($attributeId)) {
return $attribute;
}
return null;
} | php | {
"resource": ""
} |
q245022 | SimpleLookup.determineFilterValue | validation | private function determineFilterValue($filterValues, $valueName)
{
if (!isset($filterValues[$valueName]) && $this->get('defaultid')) {
return $this->get('defaultid');
}
return $filterValues[$valueName];
} | php | {
"resource": ""
} |
q245023 | AttributeRendererListener.modelToLabel | validation | public function modelToLabel(ModelToLabelEvent $event)
{
if (!$this->wantToHandle($event)) {
return;
}
$model = $event->getModel();
$type = $model->getProperty('type');
$image = '<img src="' . $this->attributeFactory->getIconForType($type) . '" />';
... | php | {
"resource": ""
} |
q245024 | BreadcrumbDcaSettingConditionListener.getConditionAttribute | validation | private function getConditionAttribute($settingId)
{
$setting = $this->getRow($settingId, 'tl_metamodel_dcasetting');
if ($setting->dcatype == 'attribute') {
$attribute = (object) $this->getRow($setting->attr_id, 'tl_metamodel_attribute');
$metaModelName = $this->factory... | php | {
"resource": ""
} |
q245025 | FixTypeSafetyListener.handle | validation | public function handle(EncodePropertyValueFromWidgetEvent $event)
{
if (('tl_metamodel_dca_combine' !== $event->getEnvironment()->getDataDefinition()->getName())
|| ('rows' !== $event->getProperty())) {
return;
}
$environment = $event->getEnvironment();
$dat... | php | {
"resource": ""
} |
q245026 | FixTypeSafetyListener.updateValues | validation | private function updateValues(
array &$values,
PropertiesDefinitionInterface $properties,
DataProviderInterface $dataProvider
) {
foreach ($values as $propertyName => $propertyValue) {
if (($dataProvider->getIdProperty() === $propertyName)
|| ($dataProvide... | php | {
"resource": ""
} |
q245027 | BaseSubscriber.addListener | validation | public function addListener($eventName, $listener, $priority = 200)
{
$dispatcher = $this->getServiceContainer()->getEventDispatcher();
$dispatcher->addListener($eventName, $listener, $priority);
return $this;
} | php | {
"resource": ""
} |
q245028 | BaseSubscriber.getMetaModelById | validation | protected function getMetaModelById($modelId)
{
$services = $this->getServiceContainer();
$modelFactory = $services->getFactory();
$name = $modelFactory->translateIdToMetaModelName($modelId);
return $modelFactory->getMetaModel($name);
} | php | {
"resource": ""
} |
q245029 | AbstractConditionBuilder.calculateConditions | validation | public static function calculateConditions(IMetaModelDataDefinition $container, array $inputScreen)
{
if ($container->hasDefinition(ModelRelationshipDefinitionInterface::NAME)) {
$definition = $container->getDefinition(ModelRelationshipDefinitionInterface::NAME);
} else {
$de... | php | {
"resource": ""
} |
q245030 | TranslatedReference.getSetValues | validation | protected function getSetValues($arrValue, $intId, $strLangCode)
{
if (($arrValue !== null) && !is_array($arrValue)) {
throw new \InvalidArgumentException(sprintf('Invalid value provided: %s', var_export($arrValue, true)));
}
return array
(
'tstamp' => time()... | php | {
"resource": ""
} |
q245031 | TranslatedReference.determineLanguages | validation | private function determineLanguages()
{
$languages = $this->getMetaModel()->getAvailableLanguages();
if ($languages === null) {
throw new \RuntimeException(
'MetaModel ' . $this->getMetaModel()->getName() . ' does not seem to be translated.'
);
}
... | php | {
"resource": ""
} |
q245032 | TranslatedReference.fetchExistingIdsFor | validation | protected function fetchExistingIdsFor($idList, $langCode)
{
$queryBuilder = $this
->connection
->createQueryBuilder()
->select('item_id')
->from($this->getValueTable());
$this->buildWhere($queryBuilder, $idList, $langCode);
$statement = $quer... | php | {
"resource": ""
} |
q245033 | PasteButtonListener.getModelById | validation | private function getModelById($modelId)
{
if ($modelId === null) {
return null;
}
$provider = $this->environment->getDataProvider();
$config = $provider
->getEmptyConfig()
->setId($modelId);
return $provider->fetch($config);
} | php | {
"resource": ""
} |
q245034 | PasteButtonListener.hasVariants | validation | private function hasVariants()
{
$metaModel = $this->factory->getMetaModel($this->providerName);
if ($metaModel === null) {
throw new \RuntimeException(sprintf('Could not find a MetaModels with the name %s', $this->providerName));
}
return $metaModel->hasVariants();
... | php | {
"resource": ""
} |
q245035 | PasteButtonListener.checkForAction | validation | private function checkForAction($clipboard, $action)
{
// Make a filter for the given action.
$filter = new Filter();
$filter->andActionIs($action);
$items = $clipboard->fetch($filter);
// Check if there are items.
if ($items === null) {
return;
}... | php | {
"resource": ""
} |
q245036 | PasteButtonListener.checkEmpty | validation | private function checkEmpty($action)
{
if ($this->hasVariants() && $this->currentModel !== null) {
$this->disablePA = false;
} elseif ($action == 'create') {
$this->disablePA = false;
$this->disablePI = false;
}
} | php | {
"resource": ""
} |
q245037 | PasteButtonListener.checkForRoot | validation | private function checkForRoot($containedModel, $action)
{
if ($this->hasVariants() && $action == 'cut' && $containedModel->getProperty('varbase') == 0) {
$this->disablePI = true;
}
} | php | {
"resource": ""
} |
q245038 | PasteButtonListener.checkForModel | validation | private function checkForModel($containedModel, $action)
{
if (!$this->circularReference) {
if ($this->hasVariants()) {
$this->checkModelWithVariants($containedModel);
}
$this->checkModelWithoutVariants($containedModel);
} elseif ($this->currentMod... | php | {
"resource": ""
} |
q245039 | PasteButtonListener.checkModelWithVariants | validation | private function checkModelWithVariants($containedModel)
{
// Item and variant support.
$isVarbase = (bool) $containedModel->getProperty('varbase');
$vargroup = $containedModel->getProperty('vargroup');
$isCurrentVarbase = (bool) $this->currentModel->getProperty('varba... | php | {
"resource": ""
} |
q245040 | PasteButtonListener.checkModelWithoutVariants | validation | private function checkModelWithoutVariants($containedModel)
{
$parentDefinition = $this->environment->getDataDefinition()->getBasicDefinition()->getParentDataProvider();
$this->disablePA = ($this->currentModel->getId() == $containedModel->getId())
|| ($parentDefinition && $this->current... | php | {
"resource": ""
} |
q245041 | AbstractListener.getMetaModel | validation | public function getMetaModel(EnvironmentInterface $interface)
{
$metaModelId = $this->connection->createQueryBuilder()
->select('d.pid')
->from('tl_metamodel_dca', 'd')
->leftJoin('d', 'tl_metamodel_dcasetting', 's', '(d.id=s.pid)')
->where('(s.id=:id)')
... | php | {
"resource": ""
} |
q245042 | MetaModelsServiceContainer.getCache | validation | public function getCache()
{
// @codingStandardsIgnoreStart
@trigger_error(
'"' .__METHOD__ . '" is deprecated as the service container will get removed.',
E_USER_DEPRECATED
);
// @codingStandardsIgnoreEnd
if (\is_callable($this->cache)) {
... | php | {
"resource": ""
} |
q245043 | PaletteBuilder.getOrCreatePaletteDefinition | validation | private function getOrCreatePaletteDefinition(IMetaModelDataDefinition $container)
{
if ($container->hasDefinition(PalettesDefinitionInterface::NAME)) {
return $container->getDefinition(PalettesDefinitionInterface::NAME);
}
$container->setDefinition(
PalettesDefinitio... | php | {
"resource": ""
} |
q245044 | PaletteBuilder.createProperty | validation | private function createProperty(
PropertyInterface $property,
$propertyName,
$variantHandling,
ConditionInterface $condition = null,
ConditionInterface $legendCondition = null
) {
$paletteProperty = new Property($propertyName);
$extra = $property->getExtra();... | php | {
"resource": ""
} |
q245045 | PaletteBuilder.buildCondition | validation | private function buildCondition($condition, $metaModel)
{
if (null === $condition) {
return null;
}
return $this->conditionFactory->createCondition($condition, $metaModel);
} | php | {
"resource": ""
} |
q245046 | Module.generate | validation | public function generate()
{
$GLOBALS['TL_CSS'][] = 'bundles/metamodelscore/css/style.css';
$arrModule = $GLOBALS['BE_MOD']['metamodels']['metamodels'];
// Custom action (if key is not defined in config.php the default action will be called).
if (\Input::get('key') && isset... | php | {
"resource": ""
} |
q245047 | AttributeSavedListener.isAttributeNameOrTypeChanged | validation | private function isAttributeNameOrTypeChanged(ModelInterface $new, ModelInterface $old)
{
return ($old->getProperty('type') !== $new->getProperty('type'))
|| ($old->getProperty('colname') !== $new->getProperty('colname'));
} | php | {
"resource": ""
} |
q245048 | InputScreen.translateLegend | validation | protected function translateLegend($legend, $metaModel)
{
$arrLegend = StringUtil::deserialize($legend['legendtitle']);
if (is_array($arrLegend)) {
// Try to use the language string from the array.
$strLegend = $arrLegend[$GLOBALS['TL_LANGUAGE']];
if (!$strLegend)... | php | {
"resource": ""
} |
q245049 | InputScreen.translateProperty | validation | protected function translateProperty($property, $metaModel, $legend)
{
$attribute = $metaModel->getAttributeById($property['attr_id']);
// Dead meat.
if (!$attribute) {
return false;
}
$propName = $attribute->getColName();
$this->legends[$legend]['prope... | php | {
"resource": ""
} |
q245050 | InputScreen.applyLegendConditions | validation | protected function applyLegendConditions($attributeId, $activeLegendId)
{
// No conditions for legend defined.
if (!isset($this->conditions[$activeLegendId])) {
return;
}
if (!isset($this->conditions[$attributeId])) {
$this->conditions[$attributeId] = new Pro... | php | {
"resource": ""
} |
q245051 | InputScreen.translateRows | validation | protected function translateRows($rows)
{
$metaModel = $this->getMetaModel();
$activeLegend = $this->translateLegend(
array('legendtitle' => $metaModel->getName(), 'legendhide' => false),
$metaModel
);
$activeLegendId = null;
// First pass, fet... | php | {
"resource": ""
} |
q245052 | InputScreen.transformCondition | validation | protected function transformCondition($condition)
{
$dispatcher = $GLOBALS['container']['event-dispatcher'];
$event = new CreatePropertyConditionEvent($condition, $this->getMetaModel());
/** @var \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher */
$dispat... | php | {
"resource": ""
} |
q245053 | InputScreen.transformConditions | validation | protected function transformConditions($conditions)
{
// First pass, sort them into pid.
$sorted = array();
$byPid = array();
foreach ($conditions as $i => $condition) {
$sorted[$condition['id']] = $conditions[$i];
$byPid[$condition['pid']][] = $condition['... | php | {
"resource": ""
} |
q245054 | InputScreen.transformGroupSort | validation | protected function transformGroupSort($rows)
{
foreach ($rows as $row) {
$this->groupSort[] = new InputScreenGroupingAndSorting($row, $this);
}
} | php | {
"resource": ""
} |
q245055 | DataProviderPopulator.injectServiceContainerIntoDataDrivers | validation | private function injectServiceContainerIntoDataDrivers($providerDefinitions, $environment)
{
foreach ($providerDefinitions as $provider) {
$providerInstance = $environment->getDataProvider($provider->getName());
if ($providerInstance instanceof Driver) {
$initializati... | php | {
"resource": ""
} |
q245056 | AbstractAddAllController.process | validation | protected function process($table, $metaModelName, $parentId, Request $request)
{
$this->knownAttributes = $this->fetchExisting($table, $parentId);
$metaModel = $this->factory->getMetaModel($metaModelName);
if (!$metaModel) {
throw new \RuntimeException('Could not retrieve MetaM... | php | {
"resource": ""
} |
q245057 | AbstractAddAllController.render | validation | protected function render($table, $metaModel, Request $request)
{
$fields = $this->generateForm($table, $metaModel, $request);
return [
'action' => '',
'requestToken' => REQUEST_TOKEN,
'href' => $this->getReferer($request, $table, true),
... | php | {
"resource": ""
} |
q245058 | AbstractAddAllController.fetchExisting | validation | private function fetchExisting($table, $parentId)
{
// Keep the sorting value.
$this->startSort = 0;
$this->knownAttributes = [];
$alreadyExisting = $this
->connection
->createQueryBuilder()
->select('*')
->from($table)
... | php | {
"resource": ""
} |
q245059 | AbstractAddAllController.generateForm | validation | private function generateForm($table, $metaModel, Request $request)
{
$fields = [];
// Loop over all attributes now.
foreach ($metaModel->getAttributes() as $attribute) {
$attrId = $attribute->get('id');
if (!$this->accepts($attribute)) {
continue;
... | php | {
"resource": ""
} |
q245060 | AbstractAddAllController.checkboxCaption | validation | private function checkboxCaption($key, $table, IAttribute $attribute)
{
return $this->translator->trans($table . '.' . $key, [$attribute->getName()], 'contao_' . $table);
} | php | {
"resource": ""
} |
q245061 | AbstractAddAllController.perform | validation | private function perform($table, Request $request, $metaModel, $parentId)
{
$activate = (bool) $request->request->get('activate');
$query = $this
->connection
->createQueryBuilder()
->insert($table);
foreach ($metaModel->getAttributes() as $attribute) {
... | php | {
"resource": ""
} |
q245062 | AbstractAddAllController.getReferer | validation | private function getReferer(Request $request, $table, $encodeAmp = false)
{
$uri = $this->systemAdapter->getReferer($encodeAmp, $table);
// Make the location an absolute URL
if (!preg_match('@^https?://@i', $uri)) {
$uri = $request->getBasePath() . '/' . ltrim($uri, '/');
... | php | {
"resource": ""
} |
q245063 | PurgeCache.purge | validation | public function purge()
{
$fileSystem = new Filesystem();
$fileSystem->remove($this->cacheDir);
$this->logger->log(
LogLevel::INFO,
'Purged the MetaModels cache',
['contao' => new ContaoContext(__METHOD__, TL_CRON)]
);
} | php | {
"resource": ""
} |
q245064 | FilterUrl.setPageValue | validation | public function setPageValue(string $name, $value): self
{
if (empty($value)) {
unset($this->page[$name]);
return $this;
}
$this->page[$name] = $value;
return $this;
} | php | {
"resource": ""
} |
q245065 | HybridList.getFilterParameters | validation | protected function getFilterParameters($objItemRenderer)
{
$filterUrlBuilder = System::getContainer()->get('metamodels.filter_url');
$filterUrl = $filterUrlBuilder->getCurrentFilterUrl();
$result = [];
foreach ($objItemRenderer->getFilterSettings()->getParameters() as $name) ... | php | {
"resource": ""
} |
q245066 | HybridList.compile | validation | protected function compile()
{
$objItemRenderer = new ItemList();
$this->Template->searchable = !$this->metamodel_donotindex;
$sorting = $this->metamodel_sortby;
$direction = $this->metamodel_sortby_direction;
if ($this->metamodel_sort_override) {
if (\Input::... | php | {
"resource": ""
} |
q245067 | Simple.isActiveFrontendFilterValue | validation | protected function isActiveFrontendFilterValue($arrWidget, $arrFilterUrl, $strKeyOption)
{
// Special case, the "empty" value first.
if (empty($strKeyOption) && !isset($arrFilterUrl[$arrWidget['eval']['urlparam']])) {
return true;
}
$blnIsActive = isset($arrFilterUrl[$arr... | php | {
"resource": ""
} |
q245068 | Simple.getFrontendFilterValue | validation | protected function getFrontendFilterValue($arrWidget, $arrFilterUrl, $strKeyOption)
{
// Toggle if active.
if ($this->isActiveFrontendFilterValue($arrWidget, $arrFilterUrl, $strKeyOption)) {
return '';
}
return $strKeyOption;
} | php | {
"resource": ""
} |
q245069 | Simple.addUrlParameter | validation | protected function addUrlParameter($url, $name, $value)
{
// @codingStandardsIgnoreStart
@trigger_error(
sprintf('"%1$s" has been deprecated in favor of the "FilterUrlBuilder"', __METHOD__),
E_USER_DEPRECATED
);
// @codingStandardsIgnoreEnd
if (is_arr... | php | {
"resource": ""
} |
q245070 | Simple.buildFilterUrl | validation | protected function buildFilterUrl($fragments, $searchKey)
{
// @codingStandardsIgnoreStart
@trigger_error(
sprintf('"%1$s" has been deprecated in favor of the "FilterUrlBuilder"', __METHOD__),
E_USER_DEPRECATED
);
// @codingStandardsIgnoreEnd
$url =... | php | {
"resource": ""
} |
q245071 | Simple.prepareFrontendFilterOptions | validation | protected function prepareFrontendFilterOptions($arrWidget, $arrFilterUrl, $arrJumpTo, $blnAutoSubmit)
{
$arrOptions = array();
if (!isset($arrWidget['options'])) {
return $arrOptions;
}
$filterUrl = new FilterUrl($arrJumpTo);
foreach ($arrFilterUrl as $name => $... | php | {
"resource": ""
} |
q245072 | Simple.prepareFrontendFilterWidget | validation | protected function prepareFrontendFilterWidget(
$arrWidget,
$arrFilterUrl,
$arrJumpTo,
FrontendFilterOptions $objFrontendFilterOptions
) {
$strClass = $GLOBALS['TL_FFL'][$arrWidget['inputType']];
// No widget? no output! that's it.
if (!$strClass) {
... | php | {
"resource": ""
} |
q245073 | Simple.validateWidget | validation | protected function validateWidget($widget, $value)
{
if (null === $value) {
return;
}
$widget->setInputCallback(function () use ($value) {
return $value;
});
$widget->validate();
} | php | {
"resource": ""
} |
q245074 | Base.getLangValue | validation | protected function getLangValue($arrValues, $strLangCode = null)
{
if (!($this->getMetaModel()->isTranslated() && is_array($arrValues))) {
return $arrValues;
}
if ($strLangCode === null) {
return $this->getLangValue($arrValues, $this->getMetaModel()->getActiveLanguag... | php | {
"resource": ""
} |
q245075 | Base.hookAdditionalFormatters | validation | public function hookAdditionalFormatters($arrBaseFormatted, $arrRowData, $strOutputFormat, $objSettings)
{
$arrResult = $arrBaseFormatted;
if (isset($GLOBALS['METAMODEL_HOOKS']['parseValue']) && is_array($GLOBALS['METAMODEL_HOOKS']['parseValue'])) {
foreach ($GLOBALS['METAMODEL_HOOKS'][... | php | {
"resource": ""
} |
q245076 | Base.prepareTemplate | validation | protected function prepareTemplate(Template $objTemplate, $arrRowData, $objSettings)
{
$objTemplate->setData(array(
'attribute' => $this,
'settings' => $objSettings,
'row' => $arrRowData,
'raw' => $arrRowData[$this->get... | php | {
"resource": ""
} |
q245077 | Base.setLanguageStrings | validation | private function setLanguageStrings()
{
// Only overwrite the language if not already set.
if (empty($GLOBALS['TL_LANG'][$this->getMetaModel()->getTableName()][$this->getColName()])) {
$GLOBALS['TL_LANG'][$this->getMetaModel()->getTableName()][$this->getColName()] = array
(
... | php | {
"resource": ""
} |
q245078 | Base.getBaseDefinition | validation | private function getBaseDefinition()
{
$this->setLanguageStrings();
$tableName = $this->getMetaModel()->getTableName();
$definition = array();
if (isset($GLOBALS['TL_DCA'][$tableName]['fields'][$this->getColName()])) {
$definition = $GLOBALS['TL_DCA'][$tableName]['fields... | php | {
"resource": ""
} |
q245079 | PanelBuilder.build | validation | protected function build(IMetaModelDataDefinition $container)
{
$this->inputScreen = $this->viewCombination->getScreen($container->getName());
// Check if we have a BackendViewDef.
if ($container->hasDefinition(Contao2BackendViewDefinitionInterface::NAME)) {
/** @var Contao2Back... | php | {
"resource": ""
} |
q245080 | PanelBuilder.ensureSubmitElement | validation | private function ensureSubmitElement($panelRows)
{
// Check if we have a submit button.
$hasSubmit = false;
foreach ($panelRows as $panelRow) {
foreach ($panelRow as $element) {
if ($element instanceof SubmitElementInformationInterface) {
$hasS... | php | {
"resource": ""
} |
q245081 | PanelBuilder.parsePanelRow | validation | private function parsePanelRow($fields, PanelRowInterface $panelRow)
{
// Parse each type.
foreach ($fields as $field) {
switch ($field) {
case 'sort':
$this->parsePanelSort($panelRow);
break;
case 'limit':
... | php | {
"resource": ""
} |
q245082 | PanelBuilder.parsePanelFilter | validation | private function parsePanelFilter(PanelRowInterface $row)
{
foreach ($this->inputScreen['properties'] as $value) {
if (!empty($value['filter'])) {
$element = new DefaultFilterElementInformation();
$element->setPropertyName($value['col_name']);
if (... | php | {
"resource": ""
} |
q245083 | PanelBuilder.parsePanelSort | validation | private function parsePanelSort(PanelRowInterface $row)
{
if (!$row->hasElement('sort')) {
$element = new DefaultSortElementInformation();
$row->addElement($element);
}
} | php | {
"resource": ""
} |
q245084 | PanelBuilder.parsePanelSearch | validation | private function parsePanelSearch(PanelRowInterface $row)
{
if ($row->hasElement('search')) {
$element = $row->getElement('search');
} else {
$element = new DefaultSearchElementInformation();
}
if (!$element instanceof SearchElementInformationInterface) {
... | php | {
"resource": ""
} |
q245085 | UpgradeHandler.upgradeJumpTo | validation | protected static function upgradeJumpTo()
{
$objDB = self::DB();
if ($objDB->tableExists('tl_content', null, true)
&& !$objDB->fieldExists('metamodel_jumpTo', 'tl_content', true)
) {
// Create the column in the database and copy the data over.
TableManipul... | php | {
"resource": ""
} |
q245086 | UpgradeHandler.upgradeDcaSettingsPublished | validation | protected static function upgradeDcaSettingsPublished()
{
$objDB = self::DB();
if ($objDB->tableExists('tl_metamodel_dcasetting', null, true)
&& !$objDB->fieldExists('published', 'tl_metamodel_dcasetting', true)
) {
// Create the column in the database and copy the da... | php | {
"resource": ""
} |
q245087 | UpgradeHandler.changeSubPalettesToConditions | validation | protected static function changeSubPalettesToConditions()
{
$objDB = self::DB();
// Create the table.
if (!$objDB->tableExists('tl_metamodel_dcasetting_condition')) {
$objDB->execute(
'CREATE TABLE `tl_metamodel_dcasetting_condition` (
`id` int(10... | php | {
"resource": ""
} |
q245088 | UpgradeHandler.upgradeClosed | validation | protected static function upgradeClosed()
{
$objDB = self::DB();
// Change isclosed to iseditable, iscreatable and isdeleteable.
if ($objDB->tableExists('tl_metamodel_dca', null, true)
&& !$objDB->fieldExists('iseditable', 'tl_metamodel_dca')) {
// Create the column ... | php | {
"resource": ""
} |
q245089 | UpgradeHandler.perform | validation | public static function perform()
{
self::upgradeJumpTo();
self::upgradeDcaSettingsPublished();
self::changeSubPalettesToConditions();
self::upgradeClosed();
self::upgradeInputScreenMode();
self::upgradeInputScreenFlag();
} | php | {
"resource": ""
} |
q245090 | TableNamePrefixingListener.handle | validation | public function handle(EncodePropertyValueFromWidgetEvent $event)
{
if (!$this->wantToHandle($event) || ($event->getProperty() !== 'tableName')) {
return;
}
// See #49.
$tableName = strtolower($event->getValue());
if (!strlen($tableName)) {
throw new... | php | {
"resource": ""
} |
q245091 | ItemList.getServiceContainer | validation | public function getServiceContainer()
{
if (!$this->serviceContainer) {
$this->useDefaultServiceContainer();
}
if (is_callable($this->serviceContainer)) {
return $this->serviceContainer = $this->serviceContainer->__invoke();
}
return $this->serviceCon... | php | {
"resource": ""
} |
q245092 | ItemList.setLimit | validation | public function setLimit($blnUse, $intOffset, $intLimit)
{
$this
->paginationLimitCalculator
->setApplyLimitAndOffset($blnUse)
->setOffset($intOffset)
->setLimit($intLimit);
return $this;
} | php | {
"resource": ""
} |
q245093 | ItemList.setSorting | validation | public function setSorting($strSortBy, $strDirection = 'ASC')
{
$this->strSortBy = $strSortBy;
$this->strSortDirection = ($strDirection == 'DESC') ? 'DESC' : 'ASC';
return $this;
} | php | {
"resource": ""
} |
q245094 | ItemList.overrideOutputFormat | validation | public function overrideOutputFormat($strOutputFormat = null)
{
$strOutputFormat = strval($strOutputFormat);
if (strlen($strOutputFormat)) {
$this->strOutputFormat = $strOutputFormat;
} else {
unset($this->strOutputFormat);
}
return $this;
} | php | {
"resource": ""
} |
q245095 | ItemList.setMetaModel | validation | public function setMetaModel($intMetaModel, $intView)
{
$this->intMetaModel = $intMetaModel;
$this->intView = $intView;
$this->prepareMetaModel();
$this->prepareView();
return $this;
} | php | {
"resource": ""
} |
q245096 | ItemList.setMetaTags | validation | public function setMetaTags($strTitleAttribute, $strDescriptionAttribute)
{
$this->strDescriptionAttribute = $strDescriptionAttribute;
$this->strTitleAttribute = $strTitleAttribute;
return $this;
} | php | {
"resource": ""
} |
q245097 | ItemList.prepareMetaModel | validation | protected function prepareMetaModel()
{
$factory = $this->getFactory();
$this->objMetaModel = $factory->getMetaModel($factory->translateIdToMetaModelName($this->intMetaModel));
if (!$this->objMetaModel) {
throw new \RuntimeException('Could get metamodel id: ' . $this->... | php | {
"resource": ""
} |
q245098 | ItemList.prepareView | validation | protected function prepareView()
{
if ($this->renderSettingFactory) {
$this->objView = $this->renderSettingFactory->createCollection($this->objMetaModel, $this->intView);
} else {
$this->objView = $this->objMetaModel->getView($this->intView);
}
if ($this->obj... | php | {
"resource": ""
} |
q245099 | ItemList.setFilterSettings | validation | public function setFilterSettings($intFilter)
{
$this->intFilter = $intFilter;
$this->objFilterSettings = $this->getFilterFactory()->createCollection($this->intFilter);
if (!$this->objFilterSettings) {
throw new \RuntimeException('Error: no filter object defined.');
}
... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.