/** * Onload callback for tl_content * * Add language field to all content palettes * * @param DataContainer $dc */ public function appendGridComponents(DataContainer $dc = null) { $dc->loadDataContainer('tl_page'); $dc->loadDataContainer('tl_content'); // add grid to all palettes foreach ($GLOBALS['TL_DCA']['tl_content']['palettes'] as $key => $value) { // if element is '__selector__' OR 'default' OR the palette has already a language key if ($key == '__selector__' || $key == 'default' || strpos($value, ',grid(?=\\{|,|;|$)') !== false) { continue; } $GLOBALS['TL_DCA']['tl_content']['palettes'][$key] = $value . ';{grid_legend:hide},grid_xs,grid_sm,grid_md,grid_lg,grid_visible,grid_hidden,col_no_padding,col_centered,col_newline;{grid_order_legend:hide},pull_xs,pull_sm,pull_md,pull_lg,push_xs,push_sm,push_md,push_lg,offset_xs,offset_sm,offset_md,offset_lg'; } }
/** * Onload callback for tl_content * * Add language field to all content palettes * * @param DataContainer $dc */ public function appendLanguageInput(DataContainer $dc = null) { $this->loadLanguageFile('tl_content'); $dc->loadDataContainer('tl_page'); $dc->loadDataContainer('tl_content'); // add language section to all palettes foreach ($GLOBALS['TL_DCA']['tl_content']['palettes'] as $key => $value) { // if element is '__selector__' OR 'default' OR the palette has already a language key if ($key == '__selector__' || $key == 'default' || strpos($value, ',language(?=\\{|,|;|$)') !== false) { continue; } $GLOBALS['TL_DCA']['tl_content']['palettes'][$key] = $value . ';{i18nl10n_legend:hide},language'; } }
public function generate() { if (TL_MODE == 'BE') { $objTemplate = new \BackendTemplate('be_wildcard'); $objTemplate->wildcard = '### FRONTENDEDIT FORM VALIDATOR ###'; $objTemplate->title = $this->headline; $objTemplate->id = $this->id; $objTemplate->link = $this->name; $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id; return $objTemplate->parse(); } \DataContainer::loadDataContainer($this->formHybridDataContainer); \System::loadLanguageFile($this->formHybridDataContainer); $this->noIdBehavior = 'redirect'; return parent::generate(); }
public function generate() { if (TL_MODE == 'BE') { $objTemplate = new \BackendTemplate('be_wildcard'); $objTemplate->wildcard = '### FORMHYBRID READER ###'; $objTemplate->title = $this->headline; $objTemplate->id = $this->id; $objTemplate->link = $this->name; $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id; return $objTemplate->parse(); } \DataContainer::loadDataContainer($this->formHybridDataContainer); \System::loadLanguageFile($this->formHybridDataContainer); $this->strWrapperId .= $this->id; $this->dca = $GLOBALS['TL_DCA'][$this->formHybridDataContainer]; // Set the item from the auto_item parameter if (!isset($_GET['items']) && \Config::get('useAutoItem') && isset($_GET['auto_item'])) { \Input::setGet('items', \Input::get('auto_item')); } $this->intId = $this->intId ?: (\Input::get('items') ?: \Input::get('id')); if ($this->addExistanceConditions) { $arrConditions = deserialize($this->existanceConditions, true); $strItemClass = \Model::getClassFromTable($this->formHybridDataContainer); if (!empty($arrConditions)) { $arrColumns = array(); $arrValues = array(); foreach ($arrConditions as $arrCondition) { $arrColumns[] = $arrCondition['field'] . '=?'; $arrValues[] = $this->replaceInsertTags($arrCondition['value']); } if (($objItem = $strItemClass::findOneBy($arrColumns, $arrValues)) !== null) { $this->intId = $objItem->id; } } } // Do not index or cache the page if no item has been specified if (!$this->intId) { /** @var \PageModel $objPage */ global $objPage; $objPage->noSearch = 1; $objPage->cache = 0; } return parent::generate(); }
public function generate() { if (TL_MODE == 'BE') { $objTemplate = new \BackendTemplate('be_wildcard'); $objTemplate->wildcard = '### FORMHYBRID LIST ###'; $objTemplate->title = $this->headline; $objTemplate->id = $this->id; $objTemplate->link = $this->name; $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id; return $objTemplate->parse(); } \DataContainer::loadDataContainer($this->formHybridDataContainer); \System::loadLanguageFile($this->formHybridDataContainer); $this->dca = $GLOBALS['TL_DCA'][$this->formHybridDataContainer]; $this->strWrapperId .= $this->id; $this->strTemplate = $this->customTpl ?: ($this->strTemplate ?: ($this->isTableList ? 'mod_formhybrid_list_table' : 'mod_formhybrid_list')); $this->itemTemplate = $this->itemTemplate ?: ($this->isTableList ? 'formhybrid_list_item_table_default' : 'formhybrid_list_item_default'); return parent::generate(); }
/** * @param \DataContainer $dc * @return array */ protected function getParameters(\DataContainer $dc) { if (!$dc->activeRecord) { return array(); } $dc->loadDataContainer($dc->table); $strType = $this->getType($dc); $arrParameters = array(); $arrFields = $GLOBALS['TL_DCA'][$dc->table]['fields']; if (is_array($arrFields)) { foreach ($arrFields as $strField => $arrField) { if (isset($dc->activeRecord->{$strField})) { $arrParameters[$strField] = $this->renderParameterValue($dc->table, $this->getAccountLanguage($dc), $strField, $dc->activeRecord->{$strField}); } } } // Replace the password, because it's generated new $arrParameters['password'] = $this->getPostPassword($dc->id); // HOOK: replaceAccountMailParameters if (isset($GLOBALS['TL_HOOKS']['replaceAccountMailParameters']) && is_array($GLOBALS['TL_HOOKS']['replaceAccountMailParameters'])) { foreach ($GLOBALS['TL_HOOKS']['replaceAccountMailParameters'] as $callback) { if (is_array($callback)) { $this->import($callback[0]); $arrParameters = $this->{$callback}[0]->{$callback}[1]($strType, $arrParameters, $dc); } elseif (is_callable($callback)) { $arrParameters = $callback($strType, $arrParameters, $dc); } } } return $arrParameters; }