当前位置: 首页>>代码示例>>PHP>>正文


PHP ObjectManagerInterface::create方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Extbase\Object\ObjectManagerInterface::create方法的典型用法代码示例。如果您正苦于以下问题:PHP ObjectManagerInterface::create方法的具体用法?PHP ObjectManagerInterface::create怎么用?PHP ObjectManagerInterface::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Extbase\Object\ObjectManagerInterface的用法示例。


在下文中一共展示了ObjectManagerInterface::create方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getStandaloneView

 /**
  * @param array $variables
  * @param string $template
  *
  * @return \TYPO3\CMS\Fluid\View\StandaloneView
  */
 public function getStandaloneView(array $variables, $template)
 {
     $viewObject = $this->objectManager->create('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
     $viewObject->setFormat('html');
     $templatePathAndFilename = $this->templateRootPath . $template;
     $viewObject->setTemplatePathAndFilename($templatePathAndFilename);
     $viewObject->assignMultiple($variables);
     return $viewObject;
 }
开发者ID:kj187,项目名称:sharepoint_connector,代码行数:15,代码来源:View.php

示例2: loadModuleData

 /**
  * Loads module data for user settings or returns a fresh object initially
  *
  * @return \TYPO3\CMS\Beuser\Domain\Model\ModuleData
  */
 public function loadModuleData()
 {
     $moduleData = $GLOBALS['BE_USER']->getModuleData(self::KEY);
     if (empty($moduleData) || !$moduleData) {
         $moduleData = $this->objectManager->create('TYPO3\\CMS\\Beuser\\Domain\\Model\\ModuleData');
     } else {
         $moduleData = @unserialize($moduleData);
     }
     return $moduleData;
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:15,代码来源:ModuleDataStorageService.php

示例3: loadModuleData

 /**
  * Loads module data for user settings or returns a fresh object initially
  *
  * @return \ApacheSolrForTypo3\Solr\Domain\Model\ModuleData
  */
 public function loadModuleData()
 {
     $moduleData = $GLOBALS['BE_USER']->getModuleData(self::KEY);
     if (empty($moduleData) || !$moduleData) {
         $moduleData = $this->objectManager->create('ApacheSolrForTypo3\\Solr\\Domain\\Model\\ModuleData');
     } else {
         $moduleData = unserialize($moduleData);
     }
     return $moduleData;
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:15,代码来源:ModuleDataStorageService.php

示例4: findAll

 /**
  * Returns all objects of this repository.
  *
  * @return array
  */
 public function findAll()
 {
     if (!count($this->extensions)) {
         $availableExtensions = $this->listUtility->getAvailableExtensions();
         $availableAndInstalledExtensions = $this->listUtility->getAvailableAndInstalledExtensions($availableExtensions);
         $availableAndInstalledExtensions = $this->listUtility->enrichExtensionsWithEmConfAndTerInformation($availableAndInstalledExtensions);
         foreach ($availableAndInstalledExtensions as $entry) {
             /** @var $extension \TYPO3\CMS\Lang\Domain\Model\Extension */
             $extension = $this->objectManager->create('TYPO3\\CMS\\Lang\\Domain\\Model\\Extension', $entry['key'], $entry['title'], $this->getExtensionIconWithPath($entry));
             $extension->setVersionFromString($entry['version']);
             $this->extensions[$entry['key']] = $extension;
         }
         // Sort the list by extension key
         ksort($this->extensions);
     }
     return $this->extensions;
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:22,代码来源:ExtensionRepository.php

示例5: findAllLoaded

 /**
  * Finds all loaded extensions
  *
  * @return Tx_Extbase_Persistence_ObjectStorage<Tx_About_Domain_Model_Extension>
  */
 public function findAllLoaded()
 {
     $loadedExtensions = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\ObjectStorage');
     $loadedExtensionsArray = $GLOBALS['TYPO3_LOADED_EXT'];
     foreach ($loadedExtensionsArray as $extensionKey => $extension) {
         if (is_array($extension) && $extension['type'] != 'S') {
             $emconfPath = PATH_site . $extension['siteRelPath'] . 'ext_emconf.php';
             include $emconfPath;
             $extension = $this->objectManager->create('TYPO3\\CMS\\About\\Domain\\Model\\Extension');
             $extension->setKey($extensionKey);
             $extension->setTitle($EM_CONF['']['title']);
             $extension->setAuthor($EM_CONF['']['author']);
             $extension->setAuthorEmail($EM_CONF['']['author_email']);
             $loadedExtensions->attach($extension);
         }
     }
     return $loadedExtensions;
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:23,代码来源:ExtensionRepository.php

示例6: mergeColumnTypesWithColumnConfig

 /**
  * Merge $ColumnTypes with $ColumnConfig
  *
  * @param array $columnTypes Column types
  * @param string $columnConfiguration Column configuration
  * @return array $types
  */
 private function mergeColumnTypesWithColumnConfig($columnTypes, $columnConfiguration)
 {
     $languageUtility = $this->objectManager->create('Frohland\\Ezqueries\\Utility\\LanguageUtility');
     $types = $columnTypes;
     $config = explode('-->', $columnConfiguration);
     array_pop($config);
     foreach ($config as $conf) {
         $confColumn = trim(substr($conf, 0, strpos($conf, '<--')));
         $confValues = trim(substr($conf, strpos($conf, '<--') + 3, strlen($conf) - (strpos($conf, '<--') + 3)));
         $confValues = explode(';', $confValues);
         $confValue = array_shift($confValues);
         $confValue = trim(substr($confValue, strpos($confValue, ':') + 1, strlen($confValue) - (strpos($confValue, ':') + 1)));
         if ($types[$confColumn]['type'] == 'varchar' || $types[$confColumn]['type'] == 'text' || $types[$confColumn]['type'] == 'boolean') {
             $types[$confColumn]['render'] = $confValue;
         }
         if ($types[$confColumn]['type'] == 'int' || $types[$confColumn]['type'] == 'numeric') {
             $types[$confColumn]['numberformat'] = $confValue;
             $types[$confColumn]['decimals'] = intval($confValue[0]);
             if ($confValue[1] == 'x') {
                 $types[$confColumn]['dec_point'] = '';
             } else {
                 if ($confValue[1] == '_') {
                     $types[$confColumn]['dec_point'] = ' ';
                 } else {
                     $types[$confColumn]['dec_point'] = $confValue[1];
                 }
             }
             if ($confValue[2] == 'x') {
                 $types[$confColumn]['thousands_sep'] = '';
             } else {
                 if ($confValue[2] == '_') {
                     $types[$confColumn]['thousands_sep'] = ' ';
                 } else {
                     $types[$confColumn]['thousands_sep'] = $confValue[2];
                 }
             }
         }
         if ($types[$confColumn]['type'] == 'date') {
             $types[$confColumn]['dateformat'] = $confValue;
         }
         if ($types[$confColumn]['type'] == 'year') {
             $types[$confColumn]['yearformat'] = $confValue;
         }
         if (!isset($types[$confColumn]['type'])) {
             $types[$confColumn]['type'] = $confValue;
         }
         foreach ($confValues as $additionalConfig) {
             $additionalConfigName = trim(substr($additionalConfig, 0, strpos($additionalConfig, ':')));
             $additionalConfigValue = trim(substr($additionalConfig, strpos($additionalConfig, ':') + 1, strlen($additionalConfig) - (strpos($additionalConfig, ':') + 1)));
             if ($additionalConfigValue !== '') {
                 $additionalConfigValue = $languageUtility->translateValue($additionalConfigValue, TRUE);
                 $types[$confColumn][$additionalConfigName] = $additionalConfigValue;
             }
         }
     }
     return $types;
 }
开发者ID:WhistleWhite,项目名称:ezqueries,代码行数:64,代码来源:RecordManagement.php

示例7: getLocales

 /**
  * Get the typo3-supported locale options
  *
  * @return array An array of language objects
  */
 public function getLocales()
 {
     $localeArray = array();
     $locales = $this->objectManager->get('TYPO3\\CMS\\Core\\Localization\\Locales');
     $languages = $locales->getLanguages();
     foreach ($languages as $locale => $language) {
         // No language pack for English
         if ($locale != 'default') {
             $languageObject = $this->objectManager->create('SJBR\\StaticInfoTables\\Domain\\Model\\Language');
             $languageObject->setCollatingLocale($locale);
             $localizedLanguage = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('lang_' . $locale, $this->extensionName);
             $label = ($localizedLanguage ? $localizedLanguage : $language) . ' (' . $locale . ')';
             $languageObject->setNameEn($label);
             $localeArray[$label] = $languageObject;
         }
     }
     ksort($localeArray);
     return $localeArray;
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:24,代码来源:LocaleUtility.php

示例8: getModule

 /**
  * Instanciates a registered administration module.
  *
  * @param string $moduleName Administration module name
  * @return \ApacheSolrForTypo3\Solr\Backend\SolrModule\AdministrationModuleInterface Instance of the requested administration module
  * @throws \InvalidArgumentException if $moduleName is not a registered administration module
  * @throws \RuntimeException if the class registered for $moduleName is not an implementation of \ApacheSolrForTypo3\Solr\Backend\SolrModule\ModuleInterface
  */
 public function getModule($moduleName)
 {
     $this->validateModuleIsRegistered($moduleName);
     $module = $this->objectManager->create($this->getModuleControllerClassName($moduleName));
     $module->setExtensionKey(self::$modules[$moduleName]['extensionKey']);
     if (!$module instanceof AdministrationModuleInterface) {
         throw new \RuntimeException('Class ' . self::$modules[$moduleName] . ' must implement interface \\ApacheSolrForTypo3\\Solr\\Backend\\Module\\ModuleInterface', 1360373784);
     }
     return $module;
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:18,代码来源:AdministrationModuleManager.php

示例9: sendTemplateEmail

 /**
  * @param array $recipient recipient of the email in the format array('recipient@domain.tld' => 'Recipient Name')
  * @param array $sender sender of the email in the format array('sender@domain.tld' => 'Sender Name')
  * @param string $subject subject of the email
  * @param string $templateName template name (UpperCamelCase)
  * @param array $variables variables to be passed to the Fluid view
  * @return boolean TRUE on success, otherwise false
  */
 protected function sendTemplateEmail(array $recipient, array $sender, $subject, $templateName, array $variables = array())
 {
     $emailView = $this->objectManager->create('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
     $emailView->setFormat('html');
     $extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
     $templateRootPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($extbaseFrameworkConfiguration['view']['templateRootPath']);
     $templatePathAndFilename = $templateRootPath . '/Email/' . $templateName;
     $emailView->setTemplatePathAndFilename($templatePathAndFilename);
     $emailView->assignMultiple($variables);
     $emailBody = $emailView->render();
     $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_mail_Message');
     $message->setTo($recipient)->setFrom($sender)->setSubject($subject);
     // Plain text example
     #$message->setBody($emailBody, 'text/plain');
     // HTML Email
     $message->setBody($emailBody, 'text/html');
     $message->send();
     return $message->isSent();
 }
开发者ID:busynoggin,项目名称:cicregister,代码行数:27,代码来源:AbstractBehavior.php

示例10: checkEmail

 private function checkEmail($email)
 {
     $valid = true;
     if (strlen($email) == 0) {
         //echo 'Ein error ist aufgertererten.<br />';
         $valid = false;
         $this->addError('Sie müssen eine gültige Mailadresse eingeben', 1415260669);
     } else {
         /** @var  $validator \TYPO3\CMS\Extbase\Validation\Validator\EmailAddressValidator */
         $validator = $this->objectManager->create('TYPO3\\CMS\\Extbase\\Validation\\Validator\\EmailAddressValidator');
         $valid = $validator->isValid($email);
         if (!$valid) {
             $valid = false;
             $result = $validator->getErrors();
             $errors[] = $result[0]->getMessage();
             $this->addError($result[0]->getMessage(), 1415260302);
         }
     }
     return $valid;
 }
开发者ID:manfred-ursprung,项目名称:bjrfreizeit,代码行数:20,代码来源:OrganizationValidator.php

示例11: findAll

 /**
  * Returns all objects of this repository.
  *
  * @return array
  */
 public function findAll()
 {
     if (!count($this->languages)) {
         $languages = $this->locales->getLanguages();
         array_shift($languages);
         foreach ($languages as $locale => $language) {
             $label = htmlspecialchars($GLOBALS['LANG']->sL('LLL:EXT:setup/mod/locallang.xml:lang_' . $locale));
             if ($label === '') {
                 $label = htmlspecialchars($language);
             }
             $this->languages[$locale] = $this->objectManager->create('TYPO3\\CMS\\Lang\\Domain\\Model\\Language', $locale, $label, in_array($locale, $this->selectedLanguages));
         }
         usort($this->languages, function ($a, $b) {
             /** @var $a \TYPO3\CMS\Lang\Domain\Model\Language */
             /** @var $b \TYPO3\CMS\Lang\Domain\Model\Language */
             if ($a->getLanguage() == $b->getLanguage()) {
                 return 0;
             }
             return $a->getLanguage() < $b->getLanguage() ? -1 : 1;
         });
     }
     return $this->languages;
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:28,代码来源:LanguageRepository.php

示例12: generateValue

 /**
  * Generate value
  *
  * @param string $column Name of the column where to insert the value
  * @param array $record The record
  * @param array $columnTypes Column types
  * @param array $search Search arguments
  * @param UriBuilder $uriBuilder UriBuilder
  * @param \Frohland\Ezqueries\Utility\TemplateUtility $templateUtility TemplateUtility
  * @param \Frohland\Ezqueries\Domain\Repository\RecordManagementRepository $recordManagementRepository RecordManagementRepository
  * @param array $arguments Arguments
  * @return string $code
  */
 public function generateValue($column, $record, $columnTypes, $search, $uriBuilder, $templateUtility = NULL, $recordManagementRepository = NULL, $arguments = NULL)
 {
     $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     $conversionUtility = $this->objectManager->get('Frohland\\Ezqueries\\Utility\\ConversionUtility');
     $urlUtility = $this->objectManager->create('Frohland\\Ezqueries\\Utility\\URLUtility', $uriBuilder);
     if ($templateUtility == NULL) {
         $templateUtility = $this->objectManager->get('Frohland\\Ezqueries\\Utility\\TemplateUtility');
     }
     $languageUtility = $this->objectManager->get('Frohland\\Ezqueries\\Utility\\LanguageUtility');
     $code = '';
     // Value settings
     if (isset($columnTypes[$column]['value'])) {
         $value = $columnTypes[$column]['value'];
         if (!isset($columnTypes[$column]['valueType'])) {
             $value = $record[$value];
         }
         if (isset($columnTypes[$column]['valueFunction'])) {
             if ($columnTypes[$column]['valueFunction'] == 'convertUmlaute') {
                 $search = explode(",", "ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ë,ï,ÿ,â,ê,î,ô,û,å,e,i,ø,u");
                 $replace = explode(",", "c,ae,oe,a,e,i,o,u,a,e,i,o,u,e,i,y,a,e,i,o,u,a,e,i,o,u");
                 $value = str_replace($search, $replace, $value);
                 $search = array('ä', 'Ä', 'ö', 'Ö', 'ü', 'Ü', 'ß', ' ');
                 $replace = array('ae', 'Ae', 'oe', 'Oe', 'ue', 'Ue', 'ss', '');
                 $value = str_replace($search, $replace, $value);
                 $value = preg_replace('([^a-z^A-Z])', '_', $value);
             }
             if ($columnTypes[$column]['valueFunction'] == 'htmlentities') {
                 $value = htmlentities($value);
             }
             if ($columnTypes[$column]['valueFunction'] == 'htmlspecialchars') {
                 $value = htmlspecialchars($value);
             }
             if ($columnTypes[$column]['valueFunction'] == 'uppercase') {
                 $value = mb_strtoupper($value);
             }
         }
     } else {
         if (isset($columnTypes[$column]['valueSQL'])) {
             $data = array();
             foreach ($record as $recordColumn => $recordValue) {
                 if ($columnTypes[$recordColumn]['type'] != 'numeric' && $columnTypes[$recordColumn]['type'] != 'int' && $columnTypes[$recordColumn]['type'] != 'boolean') {
                     $data[$recordColumn]['value'] = $recordValue;
                     $data[$recordColumn]['type'] = 'text';
                 } else {
                     $data[$recordColumn]['value'] = $recordValue;
                     $data[$recordColumn]['type'] = 'numeric';
                 }
             }
             $sqlQuery = $templateUtility->fillMarkersInSQLStatement($columnTypes[$column]['valueSQL'], $arguments, $data, $recordManagementRepository);
             $records = $recordManagementRepository->getRecordsBySQLQuery($sqlQuery);
             if ($records !== FALSE) {
                 $value = $records[0][0];
             }
         } else {
             if (isset($columnTypes[$column]['filter'])) {
                 $data = array();
                 foreach ($record as $recordColumn => $recordValue) {
                     if ($columnTypes[$recordColumn]['type'] != 'numeric' && $columnTypes[$recordColumn]['type'] != 'int' && $columnTypes[$recordColumn]['type'] != 'boolean') {
                         $data[$recordColumn]['value'] = $recordValue;
                         $data[$recordColumn]['type'] = 'text';
                     } else {
                         $data[$recordColumn]['value'] = $recordValue;
                         $data[$recordColumn]['type'] = 'numeric';
                     }
                 }
                 $value = $record[$column];
             } else {
                 $value = $record[$column];
             }
         }
     }
     // Include hook to set a different value (return FALSE to hide value in template)
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ezqueries']['valueUtility']['hookSetValue'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ezqueries']['valueUtility']['hookSetValue'] as $_classRef) {
             $_procObj =& \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef);
             $value = $_procObj->hookSetValue($column, $record, $columnTypes, $value, $arguments);
         }
     }
     if ($value !== FALSE && $value !== '') {
         $value = $languageUtility->translateValue($value);
         $originalValue = $value;
         // Highlight search strings in $value
         $searchString = $search[$column]['value'];
         $searchString = str_replace('\\"', '"', $searchString);
         $searchString = preg_quote($searchString, '/');
         $searchArray = array('ä', 'Ä', 'ö', 'Ö', 'ü', 'Ü', 'ß');
         $replaceArray = array('a', 'A', 'o', 'O', 'u', 'U', 'ss');
//.........这里部分代码省略.........
开发者ID:WhistleWhite,项目名称:ezqueries,代码行数:101,代码来源:ValueUtility.php

示例13: generateFormElement

    /**
     * Generate form element
     *
     * @param string $column Column name
     * @param string $value Value
     * @param array $columnTypes Column types
     * @param string $view View
     * @param array $record The record
     * @return string $code
     */
    public function generateFormElement($column, $value, $columnTypes, $view, $record = NULL)
    {
        $code = '';
        $validationAttr = '';
        $primaryClass = '';
        $conversionUtility = $this->objectManager->get('Frohland\\Ezqueries\\Utility\\ConversionUtility');
        $valueUtility = $this->objectManager->get('Frohland\\Ezqueries\\Utility\\ValueUtility');
        $languageUtility = $this->objectManager->get('Frohland\\Ezqueries\\Utility\\LanguageUtility');
        $urlUtility = $this->objectManager->create('Frohland\\Ezqueries\\Utility\\URLUtility', $this->uriBuilder);
        $id = str_replace('.', '_', $column);
        $helpText = '';
        $placeholder = $languageUtility->translateValue($columnTypes[$column]['placeholder']);
        // Set default value
        if (isset($columnTypes[$column]['defaultValue']) && ($value === '' || $value === NULL || $value === '0000-00-00' || $columnTypes[$column]['defaultValueMode'] === 'overwrite')) {
            $value = $columnTypes[$column]['defaultValue'];
        }
        // Set type - when additional type is set
        if (isset($columnTypes[$column]['additionalType'])) {
            $columnTypes[$column]['type'] = $columnTypes[$column]['additionalType'];
        }
        // UserID form element
        if (isset($columnTypes[$column]['userID'])) {
            $code .= '<div class="tx_ezqueries_input">';
            $code .= '<input class="tx_ezqueries_input" id="' . $id . '" type="hidden" value="' . $columnTypes[$column]['userID'] . '" name="tx_ezqueries_ezqueriesplugin[' . $column . ']" />';
            $code .= '</div>';
            return $code;
        }
        $readOnly = FALSE;
        // Hook for setting form value
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ezqueries']['formUtilty']['hookSetFormValue'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ezqueries']['formUtilty']['hookSetFormValue'] as $_classRef) {
                $_procObj =& \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef);
                $value = $_procObj->hookSetFormValue($value, $column, $view, $record);
            }
        }
        // Hook for setting readonly status (return TRUE if the field status is readonly)
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ezqueries']['formUtilty']['hookSetReadOnlyStatus'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ezqueries']['formUtilty']['hookSetReadOnlyStatus'] as $_classRef) {
                $_procObj =& \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef);
                $readOnly = $_procObj->hookSetReadOnlyStatus($column, $view, $record);
            }
        }
        // Readonly form element
        if ($readOnly == TRUE || $columnTypes[$column]['readOnly'] == 'true' || $columnTypes[$column]['edit_readOnly'] == 'true' && $view == 'edit' || $columnTypes[$column]['new_readOnly'] == 'true' && $view == 'new') {
            if ($columnTypes[$column]['primary_key'] == TRUE) {
                $primaryClass .= ' tx_ezqueries_input_primary_key ';
            }
            if ($columnTypes[$column]['render'] == 'text_long' || $columnTypes[$column]['render'] == 'text_editor') {
                if ($columnTypes[$column]['render'] == 'text_long') {
                    $code .= '<div class="tx_ezqueries_input tx_ezqueries_disabled_element">';
                    $code .= '<textarea class="tx_ezqueries_textarea ' . $primaryClass . '" id="' . $id . '" readonly="readonly" disabled="disabled">' . $value . '</textarea>';
                    $value = htmlspecialchars($value);
                    $code .= '<input class="tx_ezqueries_input_hidden" type="hidden" value="' . $value . '" name="tx_ezqueries_ezqueriesplugin[' . $column . ']" />';
                    $code .= '<div class="tx_ezqueries_image_delete"></div></div>';
                    return $code;
                } else {
                    $code .= '<div class="tx_ezqueries_input tx_ezqueries_disabled_element">';
                    $code .= '<div class="tx_ezqueries_textarea_editor_disabled" id="' . $id . '">' . $value . '</div>';
                    $code .= '</div>';
                    return $code;
                }
            } else {
                // Checkbox
                if ($columnTypes[$column]['render'] == 'checkbox') {
                    $code .= '<div class="tx_ezqueries_checkbox_div tx_ezqueries_disabled_element">';
                    if ($value == 1) {
                        $code .= '<input class="tx_ezqueries_checkbox" id="' . $id . '" type="checkbox" value="' . $value . '" checked="checked" readonly="readonly" disabled="disabled" />';
                    } else {
                        $code .= '<input class="tx_ezqueries_checkbox" id="' . $id . '" type="checkbox" value="' . $value . '" readonly="readonly" disabled="disabled" />';
                    }
                    $code .= '<input class="tx_ezqueries_checkbox_hidden" type="hidden" value="' . $value . '" name="tx_ezqueries_ezqueriesplugin[' . $column . ']" />';
                    $code .= '</div>';
                    return $code;
                } else {
                    // Yes/No
                    if ($columnTypes[$column]['render'] == 'yesno') {
                        $code .= '<div class="tx_ezqueries_input tx_ezqueries_disabled_element">';
                        if ($value == 1) {
                            $code .= '<input class="tx_ezqueries_input ' . $primaryClass . '" id="' . $id . '" type="text" value="' . \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('form_bool_yes', 'ezqueries') . '" readonly="readonly" disabled="disabled" />';
                        } else {
                            $code .= '<input class="tx_ezqueries_input ' . $primaryClass . '" id="' . $id . '" type="text" value="' . \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('form_bool_no', 'ezqueries') . '" readonly="readonly" disabled="disabled" />';
                        }
                        $code .= '<input class="tx_ezqueries_input_hidden" type="hidden" value="' . $value . '" name="tx_ezqueries_ezqueriesplugin[' . $column . ']" />';
                        $code .= '</div>';
                        return $code;
                    } else {
                        if (isset($columnTypes[$column]['dropDownList'])) {
                            // Do nothing here
                        } else {
                            if ($columnTypes[$column]['type'] == 'date') {
//.........这里部分代码省略.........
开发者ID:WhistleWhite,项目名称:ezqueries,代码行数:101,代码来源:FormUtility.php

示例14: fillMarkers

 /**
  * Search for markers in a code (template) and replace them with content
  *
  * @param string $code Any code
  * @return string $code
  */
 public function fillMarkers($code)
 {
     // Markers
     $formValueMarkerStart = '<formelement';
     $formValueMarkerEnd = '</formelement>';
     $valueMarkerStart = '<value>';
     $valueMarkerEnd = '</value>';
     $sortMarkerStart = '<sort';
     $sortMarkerEnd = '</sort>';
     $submitMarkerStart = '<submit';
     $submitMarkerEnd = '</submit>';
     $detailMarkerStart = '<detail';
     $detailMarkerEnd = '</detail>';
     $editMarkerStart = '<edit';
     $editMarkerEnd = '</edit>';
     $previousMarkerStart = '<previous';
     $previousMarkerEnd = '</previous>';
     $nextMarkerStart = '<next';
     $nextMarkerEnd = '</next>';
     $closeMarkerStart = '<close';
     $closeMarkerEnd = '</close>';
     $deleteMarkerStart = '<delete';
     $deleteMarkerEnd = '</delete>';
     $newMarkerStart = '<new';
     $newMarkerEnd = '</new>';
     $searchMarkerStart = '<search';
     $searchMarkerEnd = '</search>';
     $listMarkerStart = '<list';
     $listMarkerEnd = '</list>';
     $parityMarker = '<parity />';
     $indexMarker = '<index />';
     $recordCountMarker = '<recordcount />';
     $contentMarkerStart = '<content';
     $contentMarkerEnd = '</content>';
     $labelMarkerStart = '<columnlabel>';
     $labelMarkerEnd = '</columnlabel>';
     $loclabelMarkerStart = '<locallang>';
     $loclabelMarkerEnd = '</locallang>';
     $argumentMarkerStart = '<parameter>';
     $argumentMarkerEnd = '</parameter>';
     $pageBrowserMarker = '<pagebrowser />';
     $conversionUtility = $this->objectManager->get('Frohland\\Ezqueries\\Utility\\ConversionUtility');
     $valueUtility = $this->objectManager->get('Frohland\\Ezqueries\\Utility\\ValueUtility');
     $languageUtility = $this->objectManager->get('Frohland\\Ezqueries\\Utility\\LanguageUtility');
     $filterUtility = $this->objectManager->get('Frohland\\Ezqueries\\Utility\\FilterUtility');
     $recordBrowser = $this->objectManager->get('Frohland\\Ezqueries\\ViewHelpers\\PageBrowserViewHelper');
     $urlUtility = $this->objectManager->create('Frohland\\Ezqueries\\Utility\\URLUtility', $this->uriBuilder);
     $formUtility = $this->objectManager->create('Frohland\\Ezqueries\\Utility\\FormUtility', $this->uriBuilder);
     $this->data = array();
     $this->primaryKeys = array();
     if ($this->record) {
         $this->data = $this->record->getData();
         $this->primaryKeys = $this->record->getPrimaryKeys();
     }
     // Template type?
     switch ($this->templateType) {
         // #### Edit ####
         case 'edit':
             // Form value
             if (strpos($code, $formValueMarkerStart) !== FALSE) {
                 $markerCode = substr($code, strpos($code, $formValueMarkerStart), strpos($code, $formValueMarkerEnd) + strlen($formValueMarkerEnd) - strpos($code, $formValueMarkerStart));
                 $formValueMarkerAttributes = $this->getMarkerAttributes($markerCode, $formValueMarkerStart);
                 $formValueMarkerValue = $this->getMarkerValue($markerCode, $formValueMarkerEnd);
                 $replaceCode = '';
                 // Form value without attributes
                 if ($formValueMarkerAttributes['type'] == NULL) {
                     if ($this->columnTypes[$formValueMarkerValue]['type'] !== 'additional' || isset($this->columnTypes[$formValueMarkerValue]['additionalType'])) {
                         $replaceCode .= $formUtility->generateFormElement($formValueMarkerValue, $this->data[$formValueMarkerValue], $this->columnTypes, 'edit', $this->data);
                     } else {
                         $replaceCode = $valueUtility->generateValue($formValueMarkerValue, $this->data, $this->columnTypes, $this->search, $this->uriBuilder, $this, $this->recordManagementRepository, $this->arguments);
                     }
                 } else {
                     // Form value with attributes
                     if ($formValueMarkerAttributes['type'] == 'select') {
                         $options = explode(',', $formValueMarkerAttributes['options']);
                         $replaceCode .= '<select class="tx_ezqueries_select" id="' . $formValueMarkerValue . '" size="1" name="tx_ezqueries_ezqueriesplugin[' . $formValueMarkerValue . ']">';
                         $replaceCode .= '<option selected="selected">' . $this->data[$formValueMarkerValue] . '</option>';
                         foreach ($options as $option) {
                             $replaceCode .= '<option>' . $option . '</option>';
                         }
                         $replaceCode .= '</select>';
                     }
                 }
                 $newCode = str_replace($markerCode, $replaceCode, $code);
                 $code = $this->fillMarkers($newCode);
                 return $code;
             } else {
                 // Edit submit
                 if (strpos($code, $submitMarkerStart) !== FALSE) {
                     $markerCode = substr($code, strpos($code, $submitMarkerStart), strpos($code, $submitMarkerEnd) + strlen($submitMarkerEnd) - strpos($code, $submitMarkerStart));
                     $submitMarkerAttributes = $this->getMarkerAttributes($markerCode, $submitMarkerStart);
                     $submitMarkerValue = $this->getMarkerValue($markerCode, $submitMarkerEnd);
                     $replaceCode = '';
                     $submitClass = '';
//.........这里部分代码省略.........
开发者ID:WhistleWhite,项目名称:ezqueries,代码行数:101,代码来源:TemplateUtility.php


注:本文中的TYPO3\CMS\Extbase\Object\ObjectManagerInterface::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。