Exemplo n.º 1
0
 /**
  * @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;
 }