/** * Constructor */ public function __construct() { if (t3lib_div::int_from_ver(TYPO3_version) < 6002000) { // Loads the cli_args array with command line arguments $this->cli_args = $this->cli_getArgIndex(); } else { // Loads the cli_args array with command line arguments $this->cli_setArguments($_SERVER['argv']); } $this->objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager'); $this->issueRepository = $this->objectManager->get('Tx_Smoothmigration_Domain_Repository_IssueRepository'); $this->messageBus = $this->objectManager->get('Tx_Smoothmigration_Service_MessageService'); // Adding options to help archive: $this->cli_options = array(); $this->cli_options[] = array('check', 'Check your code for needed migrations'); $this->cli_options[] = array('report', 'Detailed Report including extension, codeline and check'); $this->cli_options[] = array('executeAllChecks', 'Execute all checks and show a short summary'); $this->cli_options[] = array('migrate', 'Try to migrate your code'); $this->cli_options[] = array('help', 'Display this message'); // Setting help texts: $this->cli_help['name'] = 'CLI Smoothmigration Agent'; $this->cli_help['synopsis'] = 'cli_dispatch.phpsh smoothmigration {task}'; $this->cli_help['description'] = 'Executes the report of the smoothmigration extension on CLI Basis'; $this->cli_help['examples'] = './typo3/cli_dispatch.phpsh smoothmigration report'; $this->cli_help['author'] = 'Ingo Schmitt <*****@*****.**>'; }
function tslib_fe_checkAlternativeIdMethods($params, $ref) { $pObj =& $params['pObj']; if (t3lib_div::int_from_ver($GLOBALS["TYPO_VERSION"]) >= 3007000) { $siteScript = t3lib_div::getIndpEnv('TYPO3_SITE_SCRIPT'); } else { $siteScript = $GLOBALS["HTTP_SERVER_VARS"]["REQUEST_URI"]; } if ($siteScript && substr($siteScript, 0, 9) != 'index.php') { // If there has been a redirect (basically; we arrived here otherwise than via "index.php" in the URL) this can happend either due to a CGI-script or because of reWrite rule. Earlier we used $_SERVER['REDIRECT_URL'] to check but $uParts = parse_url($siteScript); // Parse the path: $requestFilename = trim(preg_replace('/.*\\//', '', $uParts['path'])); // This is the filename of the script/simulated pdf-file. $parts = explode('.', preg_replace('/.*\\//', '', $requestFilename)); $pCount = count($parts); if ($parts[$pCount - 1] == 'pdf') { if ($pCount > 2) { $pObj->type = intval($parts[$pCount - 2]); $pObj->id = $parts[$pCount - 3]; } else { $pObj->type = $GLOBALS['pdf_generator2_parameters']['typeNum']; $pObj->id = $parts[0]; } } } }
/** * Constructor */ public function __construct() { if (t3lib_div::int_from_ver(TYPO3_version) < 6001000) { $this->objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager'); } else { $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\\TYPO3\\CMS\\Extbase\\Object\\ObjectManager'); } }
/** * @param string $versionNumber * @return integer */ public static function convertVersionNumberToInteger($versionNumber) { if (class_exists('t3lib_utility_VersionNumber') && is_callable('t3lib_utility_VersionNumber::convertVersionNumberToInteger')) { return t3lib_utility_VersionNumber::convertVersionNumberToInteger($versionNumber); } else { return t3lib_div::int_from_ver($versionNumber); } }
/** * Renders an input element that allows to enter the charset to be used. * * @param array $params: Field information to be rendered * @param t3lib_tsStyleConfig $pObj: The calling parent object. * @return string The HTML input field */ public function buildCharsetField(array $params, t3lib_tsStyleConfig $pObj) { $fieldName = substr($params['fieldName'], 5, -1); $typo3Version = class_exists('t3lib_utility_VersionNumber') ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) : t3lib_div::int_from_ver(TYPO3_version); $readonly = ($typo3Version < 4007000) ? '' : ' readonly="readonly"'; $field = '<input id="' . $fieldName . '" name="' . $params['fieldName'] . '" value="utf-8"' . $readonly . ' />'; return $field; }
/** * Includes the locallang file for the 'newloginbox' extension * * @return array The LOCAL_LANG array */ function includeLocalLang() { $typoVersion = t3lib_div::int_from_ver($GLOBALS['TYPO_VERSION']); if ($typoVersion >= 3008000) { $LOCAL_LANG = $GLOBALS['LANG']->includeLLFile(t3lib_extMgm::extPath('newloginbox') . 'locallang.xml', FALSE); } else { include t3lib_extMgm::extPath('newloginbox') . 'locallang.php'; } return $LOCAL_LANG; }
/** * Initializes the controller before invoking an action method. * * @return void */ protected function initializeAction() { $this->pageRenderer->addCssFile(t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/StyleSheet/module.css'); $this->pageRenderer->addInlineLanguageLabelFile('EXT:smoothmigration/Resources/Private/Language/locallang.xml'); $this->pageRenderer->addJsLibrary('jquery', t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/JavaScript/jquery-1.10.1.min.js'); $this->pageRenderer->addJsLibrary('sprintf', t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/JavaScript/sprintf.min.js'); $this->pageRenderer->addJsFile(t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/JavaScript/General.js'); if (t3lib_div::int_from_ver(TYPO3_version) > 6001000) { $this->moduleToken = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get()->generateToken('moduleCall', 'tools_SmoothmigrationSmoothmigration'); } }
/** * Reads the [extDir]/locallang.xml and returns the $LOCAL_LANG array found in that file. * * @return The array with language labels */ function includeLocalLang() { $llFile = t3lib_extMgm::extPath('ods_osm') . 'locallang.xml'; $version = class_exists('t3lib_utility_VersionNumber') ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) : t3lib_div::int_from_ver(TYPO3_version); if ($version >= 4007000) { $object = t3lib_div::makeInstance('t3lib_l10n_parser_Llxml'); $LOCAL_LANG = $object->getParsedData($llFile, $GLOBALS['LANG']->lang); } else { $LOCAL_LANG = t3lib_div::readLLXMLfile($llFile, $GLOBALS['LANG']->lang); } return $LOCAL_LANG; }
/** * Returns TRUE if the current TYPO3 version is compatible to the input version * Notice that this function compares branches, not versions * (4.0.1 would be > 4.0.0 although they use the same compat_version) * * @param string $verNumberStr Minimum branch number: format "4.0" NOT "4.0.0" * @return boolean Returns TRUE if compatible with the provided version number */ public static function convertVersionNumberToInteger($verNumberStr) { $result = ''; if (self::isEqualOrHigherSixZero()) { $result = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($verNumberStr); } elseif (class_exists('t3lib_utility_VersionNumber')) { $result = t3lib_utility_VersionNumber::convertVersionNumberToInteger($verNumberStr); } else { $result = t3lib_div::int_from_ver($verNumberStr); } return $result; }
/** * Returns the current TYPO3 version number as an integer, eg. 4005000 for version 4.5 * * @return int */ public function getNumericTYPO3versionNumber() { if (class_exists(VersionNumberUtility)) { $numeric_typo3_version = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version); } else { if (class_exists('t3lib_utility_VersionNumber')) { $numeric_typo3_version = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version); } else { $numeric_typo3_version = t3lib_div::int_from_ver(TYPO3_version); } } return $numeric_typo3_version; }
/** * Reads the [extDir]/locallang.xml and returns the $LOCAL_LANG array found in that file. * * @return array The array with language labels */ protected function includeLocalLang() { $llFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('listfeusers') . 'locallang.xml'; $version = class_exists('\\TYPO3\\CMS\\Core\\Utility\\VersionNumberUtility') ? \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) : t3lib_div::int_from_ver(TYPO3_version); if ($version < 4006000) { $LOCAL_LANG = \TYPO3\CMS\Core\Utility\GeneralUtility::readLLXMLfile($llFile, $GLOBALS['LANG']->lang); } else { /** @var $llxmlParser t3lib_l10n_parser_Llxml */ $llxmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\Parser\\LocallangXmlParser'); $LOCAL_LANG = $llxmlParser->getParsedData($llFile, $GLOBALS['LANG']->lang); } return $LOCAL_LANG; }
/** * Reads the [extDir]/locallang.xml and returns the $LOCAL_LANG array found in that file. * * @return array The array with language labels */ protected function includeLocalLang() { $llFile = t3lib_extMgm::extPath('medfancyboxcontent') . 'locallang.xml'; $version = class_exists('t3lib_utility_VersionNumber') ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) : t3lib_div::int_from_ver(TYPO3_version); if ($version < 4006000) { $LOCAL_LANG = t3lib_div::readLLXMLfile($llFile, $GLOBALS['LANG']->lang); } else { /** @var $llxmlParser t3lib_l10n_parser_Llxml */ $llxmlParser = t3lib_div::makeInstance('t3lib_l10n_parser_Llxml'); $LOCAL_LANG = $llxmlParser->getParsedData($llFile, $GLOBALS['LANG']->lang); } return $LOCAL_LANG; }
public static function getTypoVersion() { $result = FALSE; $callingClassName = '\\TYPO3\\CMS\\Core\\Utility\\VersionNumberUtility'; if (class_exists($callingClassName) && method_exists($callingClassName, 'convertVersionNumberToInteger')) { $result = call_user_func($callingClassName . '::convertVersionNumberToInteger', TYPO3_version); } else { if (class_exists('t3lib_utility_VersionNumber') && method_exists('t3lib_utility_VersionNumber', 'convertVersionNumberToInteger')) { $result = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version); } else { if (class_exists('t3lib_div') && method_exists('t3lib_div', 'int_from_ver')) { $result = t3lib_div::int_from_ver(TYPO3_version); } } } return $result; }
/** * Initializes sidebar object. Checks if there any tables to display and * adds sidebar item if there are any. * * @param object $pObj Parent object * @return void */ function init(&$pObj) { if (t3lib_div::int_from_ver(TYPO3_version) >= 4000005) { $this->pObj =& $pObj; $this->tables = t3lib_div::trimExplode(',', $this->pObj->modTSconfig['properties']['recordDisplay_tables'], true); if ($this->tables) { // Get permissions $this->calcPerms = $GLOBALS['BE_USER']->calcPerms(t3lib_BEfunc::readPageAccess($this->pObj->id, $this->pObj->perms_clause)); foreach ($this->tables as $table) { if ($this->canDisplayTable($table)) { // At least one displayable table found! $this->pObj->sideBarObj->addItem('records', $this, 'sidebar_renderRecords', $GLOBALS['LANG']->getLL('records'), 25); break; } } } } }
/** * Reads the [extDir]/locallang.xml and returns the $LOCAL_LANG array found in that file. * * @return The array with language labels */ function includeLocalLang() { $version = class_exists('t3lib_utility_VersionNumber') ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) : t3lib_div::int_from_ver(TYPO3_version); if ($version >= 6000000) { $llFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('myquizpoll') . 'locallang.xml'; $localLanguageParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\Parser\\LocallangXmlParser'); $LOCAL_LANG = $localLanguageParser->getParsedData($llFile, $GLOBALS['LANG']->lang); } else { if ($version >= 4007000) { $llFile = t3lib_extMgm::extPath('myquizpoll') . 'locallang.xml'; $localizationParser = t3lib_div::makeInstance('t3lib_l10n_parser_Llxml'); $LOCAL_LANG = $localizationParser->getParsedData($llFile, $GLOBALS['LANG']->lang); } else { $llFile = t3lib_extMgm::extPath('myquizpoll') . 'locallang.xml'; $LOCAL_LANG = t3lib_div::readLLXMLfile($llFile, $GLOBALS['LANG']->lang); } } return $LOCAL_LANG; }
public function outputDebugLog() { $out = ''; foreach ($this->debugLog as $section => $logData) { $out .= Tx_Formhandler_Globals::$cObj->wrap($section, $this->settings['sectionHeaderWrap']); $sectionContent = ''; foreach ($logData as $messageData) { $message = str_replace("\n", '<br />', $messageData['message']); $message = Tx_Formhandler_Globals::$cObj->wrap($message, $this->settings['severityWrap.'][$messageData['severity']]); $sectionContent .= Tx_Formhandler_Globals::$cObj->wrap($message, $this->settings['messageWrap']); if ($messageData['data']) { if (t3lib_div::int_from_ver(TYPO3_branch) < t3lib_div::int_from_ver('4.5')) { $sectionContent .= t3lib_div::view_array($messageData['data']); } else { $sectionContent .= t3lib_utility_Debug::viewArray($messageData['data']); } $sectionContent .= '<br />'; } } $out .= Tx_Formhandler_Globals::$cObj->wrap($sectionContent, $this->settings['sectionWrap']); } print $out; }
/** * Get a list of installed extensions * * @return array of installed extensions */ public static function getInstalledExtensions() { if (self::$installedExtensions !== NULL) { return self::$installedExtensions; } if (t3lib_div::int_from_ver(TYPO3_version) < 6001000) { /** @var $extensionList tx_em_Extensions_List */ $extensionList = t3lib_div::makeInstance('tx_em_Extensions_List'); list($list, ) = $extensionList->getInstalledExtensions(); $list = array_keys($list); } else { $list = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray(); } self::$installedExtensions = $list; return $list; }
/** * Return the integer value of a version string * * @param string $versionString * @return integer */ function getIntFromVersion($versionString = NULL) { if (class_exists(t3lib_utility_VersionNumber)) { return t3lib_utility_VersionNumber::convertVersionNumberToInteger($versionString); } else { return t3lib_div::int_from_ver($versionString); } }
<?php /** * Predefined TCA entries for usage in own extension. * Part of the DAM (digital asset management) extension. * * @author Rene Fritz <*****@*****.**> * @package TYPO3-DAM * @subpackage tx_dam * @version $Id$ */ $GLOBALS['T3_VAR']['ext']['dam']['TCA']['media_config'] = array('form_type' => 'user', 'userFunc' => 'EXT:dam/lib/class.tx_dam_tcefunc.php:&tx_dam_tceFunc->getSingleField_typeMedia', 'userProcessClass' => 'EXT:mmforeign/class.tx_mmforeign_tce.php:tx_mmforeign_tce', 'type' => 'group', 'internal_type' => 'db', 'allowed' => 'tx_dam', 'prepend_tname' => 1, 'MM' => 'tx_dam_mm_ref', 'MM_foreign_select' => 1, 'MM_opposite_field' => 'file_usage', 'MM_match_fields' => array('ident' => 'relation_field_or_other_ident'), 'allowed_types' => '', 'disallowed_types' => 'php,php3', 'max_size' => 10000, 'show_thumbs' => 1, 'size' => 5, 'maxitems' => 200, 'minitems' => 0, 'autoSizeMax' => 30, 'softref' => 'dam_mm_ref'); $GLOBALS['T3_VAR']['ext']['dam']['TCA']['image_config'] = array('form_type' => 'user', 'userFunc' => 'EXT:dam/lib/class.tx_dam_tcefunc.php:&tx_dam_tceFunc->getSingleField_typeMedia', 'userProcessClass' => 'EXT:mmforeign/class.tx_mmforeign_tce.php:tx_mmforeign_tce', 'type' => 'group', 'internal_type' => 'db', 'allowed' => 'tx_dam', 'prepend_tname' => 1, 'MM' => 'tx_dam_mm_ref', 'MM_foreign_select' => 1, 'MM_opposite_field' => 'file_usage', 'MM_match_fields' => array('ident' => 'relation_field_or_other_ident'), 'allowed_types' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], 'max_size' => '1000', 'show_thumbs' => 1, 'size' => 5, 'maxitems' => 200, 'minitems' => 0, 'autoSizeMax' => 30, 'softref' => 'dam_mm_ref'); if (t3lib_div::int_from_ver(TYPO3_branch) >= t3lib_div::int_from_ver('4.1')) { unset($GLOBALS['T3_VAR']['ext']['dam']['TCA']['media_config']['userProcessClass']); unset($GLOBALS['T3_VAR']['ext']['dam']['TCA']['image_config']['userProcessClass']); } $GLOBALS['T3_VAR']['ext']['dam']['TCA']['media_field'] = array('label' => 'LLL:EXT:cms/locallang_ttc.php:media', 'config' => $GLOBALS['T3_VAR']['ext']['dam']['TCA']['media_config']); $GLOBALS['T3_VAR']['ext']['dam']['TCA']['image_field'] = array('label' => 'LLL:EXT:lang/locallang_general.php:LGL.images', 'config' => $GLOBALS['T3_VAR']['ext']['dam']['TCA']['image_config']); $GLOBALS['T3_VAR']['ext']['dam']['TCA']['category_config'] = array('type' => 'select', 'form_type' => 'user', 'userFunc' => 'EXT:dam/lib/class.tx_dam_tcefunc.php:&tx_dam_tceFunc->getSingleField_selectTree', 'treeViewBrowseable' => true, 'treeViewClass' => 'EXT:dam/components/class.tx_dam_selectionCategory.php:&tx_dam_selectionCategory', 'foreign_table' => 'tx_dam_cat', 'size' => 6, 'autoSizeMax' => 20, 'minitems' => 0, 'maxitems' => 2, 'default' => ''); $GLOBALS['T3_VAR']['ext']['dam']['TCA']['category_field'] = array('l10n_mode' => 'exclude', 'label' => 'LLL:EXT:dam/locallang_db.php:tx_dam_item.category', 'config' => $GLOBALS['T3_VAR']['ext']['dam']['TCA']['category_config']); // mountpoints field in be_groups, be_users $GLOBALS['T3_VAR']['ext']['dam']['TCA']['mountpoints_config'] = array('type' => 'passthrough', 'form_type' => 'user', 'userFunc' => 'EXT:dam/lib/class.tx_dam_tcefunc.php:&tx_dam_tceFunc->getSingleField_selectMounts', 'treeViewBrowseable' => true, 'size' => 10, 'autoSizeMax' => 30, 'minitems' => 0, 'maxitems' => 20); // for tx_dam allowed only $GLOBALS['T3_VAR']['ext']['dam']['TCA']['categories_mm_config'] = $GLOBALS['T3_VAR']['ext']['dam']['TCA']['category_config']; $GLOBALS['T3_VAR']['ext']['dam']['TCA']['categories_mm_config']['size'] = 6; $GLOBALS['T3_VAR']['ext']['dam']['TCA']['categories_mm_config']['maxitems'] = 25; $GLOBALS['T3_VAR']['ext']['dam']['TCA']['categories_mm_config']['MM'] = 'tx_dam_mm_cat'; $GLOBALS['T3_VAR']['ext']['dam']['TCA']['categories_mm_field'] = array('label' => 'LLL:EXT:dam/locallang_db.php:tx_dam_item.category', 'config' => $GLOBALS['T3_VAR']['ext']['dam']['TCA']['categories_mm_config']); /** * get TCA array for media fields/config
/** * Creates the TCA for fields * * @param array &$DBfields: array of fields (PASSED BY REFERENCE) * @param array $columns: $array of fields (PASSED BY REFERENCE) * @param array $fConf: field config * @param string $WOP: ??? * @param string $table: tablename * @param string $extKey: extensionkey * @return void */ function makeFieldTCA(&$DBfields, &$columns, $fConf, $WOP, $table, $extKey) { if (!(string) $fConf['type']) { return; } $id = $table . '_' . $fConf['fieldname']; $version = class_exists('t3lib_utility_VersionNumber') ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) : t3lib_div::int_from_ver(TYPO3_version); $configL = array(); $t = (string) $fConf['type']; switch ($t) { case 'input': case 'input+': $isString = true; $configL[] = '\'type\' => \'input\', ' . $this->WOPcomment('WOP:' . $WOP . '[type]'); if ($version < 4006000) { $configL[] = '\'size\' => \'' . t3lib_div::intInRange($fConf['conf_size'], 5, 48, 30) . '\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_size]'); if (intval($fConf['conf_max'])) { $configL[] = '\'max\' => \'' . t3lib_div::intInRange($fConf['conf_max'], 1, 255) . '\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_max]'); } } else { $configL[] = '\'size\' => \'' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_size'], 5, 48, 30) . '\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_size]'); if (intval($fConf['conf_max'])) { $configL[] = '\'max\' => \'' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_max'], 1, 255) . '\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_max]'); } } $evalItems = array(); if ($fConf['conf_required']) { $evalItems[0][] = 'required'; $evalItems[1][] = $WOP . '[conf_required]'; } if ($t == 'input+') { $isString = (bool) (!$fConf['conf_eval']) || t3lib_div::inList('alphanum,upper,lower', $fConf['conf_eval']); $isDouble2 = (bool) (!$fConf['conf_eval']) || t3lib_div::inList('double2', $fConf['conf_eval']); if ($fConf['conf_varchar'] && $isString) { $evalItems[0][] = 'trim'; $evalItems[1][] = $WOP . '[conf_varchar]'; } if ($fConf['conf_eval'] === 'int+') { $configL[] = '\'range\' => array(\'lower\' => 0, \'upper\' => 1000), ' . $this->WOPcomment('WOP:' . $WOP . '[conf_eval] = int+ results in a range setting'); $fConf['conf_eval'] = 'int'; } if ($fConf['conf_eval']) { $evalItems[0][] = $fConf['conf_eval']; $evalItems[1][] = $WOP . '[conf_eval]'; } if ($fConf['conf_check']) { $configL[] = '\'checkbox\' => \'' . ($isString ? '' : '0') . '\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_check]'); } if ($fConf['conf_stripspace']) { $evalItems[0][] = 'nospace'; $evalItems[1][] = $WOP . '[conf_stripspace]'; } if ($fConf['conf_pass']) { $evalItems[0][] = 'password'; $evalItems[1][] = $WOP . '[conf_pass]'; } if ($fConf['conf_md5']) { $evalItems[0][] = 'md5'; $evalItems[1][] = $WOP . '[conf_md5]'; } if ($fConf['conf_unique']) { if ($fConf['conf_unique'] == 'L') { $evalItems[0][] = 'uniqueInPid'; $evalItems[1][] = $WOP . '[conf_unique] = Local (unique in this page (PID))'; } if ($fConf['conf_unique'] == 'G') { $evalItems[0][] = 'unique'; $evalItems[1][] = $WOP . '[conf_unique] = Global (unique in whole database)'; } } $wizards = array(); if ($fConf['conf_wiz_color']) { $wizards[] = trim($this->sPS(' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_wiz_color]') . ' \'color\' => array( \'title\' => \'Color:\', \'type\' => \'colorbox\', \'dim\' => \'12x12\', \'tableStyle\' => \'border:solid 1px black;\', \'script\' => \'wizard_colorpicker.php\', \'JSopenParams\' => \'height=300,width=250,status=0,menubar=0,scrollbars=1\', ), ')); } if ($fConf['conf_wiz_link']) { $wizards[] = trim($this->sPS(' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_wiz_link]') . ' \'link\' => array( \'type\' => \'popup\', \'title\' => \'Link\', \'icon\' => \'link_popup.gif\', \'script\' => \'browse_links.php?mode=wizard\', \'JSopenParams\' => \'height=300,width=500,status=0,menubar=0,scrollbars=1\' ), ')); } if (count($wizards)) { $configL[] = trim($this->wrapBody(' \'wizards\' => array( \'_PADDING\' => 2, ', implode(chr(10), $wizards), ' ), ')); } } else { if ($fConf['conf_varchar']) { $evalItems[0][] = 'trim'; $evalItems[1][] = $WOP . '[conf_varchar]'; } } if (count($evalItems)) { $configL[] = '\'eval\' => \'' . implode(",", $evalItems[0]) . '\', ' . $this->WOPcomment('WOP:' . implode(' / ', $evalItems[1])); } if (!$isString && !$isDouble2) { $DBfields[] = $fConf['fieldname'] . ' int(11) DEFAULT \'0\' NOT NULL,'; } elseif (!$isString && $isDouble2) { $DBfields[] = $fConf["fieldname"] . " double(11,2) DEFAULT '0.00' NOT NULL,"; } elseif (!$fConf['conf_varchar']) { $DBfields[] = $fConf['fieldname'] . ' tinytext,'; } else { if ($version < 4006000) { $varCharLn = intval($fConf['conf_max']) ? t3lib_div::intInRange($fConf['conf_max'], 1, 255) : 255; } else { $varCharLn = intval($fConf['conf_max']) ? t3lib_utility_Math::forceIntegerInRange($fConf['conf_max'], 1, 255) : 255; } $DBfields[] = $fConf['fieldname'] . ' ' . ($varCharLn > $this->wizard->charMaxLng ? 'var' : '') . 'char(' . $varCharLn . ') DEFAULT \'\' NOT NULL,'; } break; case 'link': $DBfields[] = $fConf['fieldname'] . ' tinytext,'; $configL[] = trim($this->sPS(' \'type\' => \'input\', \'size\' => \'15\', \'max\' => \'255\', \'checkbox\' => \'\', \'eval\' => \'trim\', \'wizards\' => array( \'_PADDING\' => 2, \'link\' => array( \'type\' => \'popup\', \'title\' => \'Link\', \'icon\' => \'link_popup.gif\', \'script\' => \'browse_links.php?mode=wizard\', \'JSopenParams\' => \'height=300,width=500,status=0,menubar=0,scrollbars=1\' ) ) ')); break; case 'datetime': case 'date': $DBfields[] = $fConf['fieldname'] . ' int(11) DEFAULT \'0\' NOT NULL,'; $configL[] = trim($this->sPS(' \'type\' => \'input\', \'size\' => \'' . ($t == "datetime" ? 12 : 8) . '\', \'max\' => \'20\', \'eval\' => \'' . $t . '\', \'checkbox\' => \'0\', \'default\' => \'0\' ')); break; case 'integer': $DBfields[] = $fConf['fieldname'] . ' int(11) DEFAULT \'0\' NOT NULL,'; $configL[] = trim($this->sPS(' \'type\' => \'input\', \'size\' => \'4\', \'max\' => \'4\', \'eval\' => \'int\', \'checkbox\' => \'0\', \'range\' => array( \'upper\' => \'1000\', \'lower\' => \'10\' ), \'default\' => 0 ')); break; case 'textarea': case 'textarea_nowrap': $DBfields[] = $fConf['fieldname'] . ' text,'; $configL[] = '\'type\' => \'text\','; if ($t == 'textarea_nowrap') { $configL[] = '\'wrap\' => \'OFF\','; } if ($version < 4006000) { $configL[] = '\'cols\' => \'' . t3lib_div::intInRange($fConf['conf_cols'], 5, 48, 30) . '\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_cols]'); $configL[] = '\'rows\' => \'' . t3lib_div::intInRange($fConf['conf_rows'], 1, 20, 5) . '\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rows]'); } else { $configL[] = '\'cols\' => \'' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_cols'], 5, 48, 30) . '\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_cols]'); $configL[] = '\'rows\' => \'' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_rows'], 1, 20, 5) . '\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rows]'); } if ($fConf["conf_wiz_example"]) { $wizards = array(); $wizards[] = trim($this->sPS(' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_wiz_example]') . ' \'example\' => array( \'title\' => \'Example Wizard:\', \'type\' => \'script\', \'notNewRecords\' => 1, \'icon\' => t3lib_extMgm::extRelPath(\'' . $extKey . '\').\'' . $id . '/wizard_icon.gif\', \'script\' => t3lib_extMgm::extRelPath(\'' . $extKey . '\').\'' . $id . '/index.php\', ), ')); $cN = $this->returnName($extKey, 'class', $id . 'wiz'); $this->writeStandardBE_xMod($extKey, array('title' => 'Example Wizard title...'), $id . '/', $cN, 0, $id . 'wiz'); $this->addFileToFileArray($id . '/wizard_icon.gif', t3lib_div::getUrl(t3lib_extMgm::extPath('kickstarter') . 'res/notfound.gif')); $configL[] = trim($this->wrapBody(' \'wizards\' => array( \'_PADDING\' => 2, ', implode(chr(10), $wizards), ' ), ')); } break; case 'textarea_rte': $DBfields[] = $fConf['fieldname'] . ' text,'; $configL[] = '\'type\' => \'text\','; $configL[] = '\'cols\' => \'30\','; $configL[] = '\'rows\' => \'5\','; if ($fConf['conf_rte_fullscreen']) { $wizards = array(); $wizards[] = trim($this->sPS(' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_fullscreen]') . ' \'RTE\' => array( \'notNewRecords\' => 1, \'RTEonly\' => 1, \'type\' => \'script\', \'title\' => \'Full screen Rich Text Editing|Formatteret redigering i hele vinduet\', \'icon\' => \'wizard_rte2.gif\', \'script\' => \'wizard_rte.php\', ), ')); $configL[] = trim($this->wrapBody(' \'wizards\' => array( \'_PADDING\' => 2, ', implode(chr(10), $wizards), ' ), ')); } $rteImageDir = ''; if ($fConf['conf_rte_separateStorageForImages'] && t3lib_div::inList('moderate,basic,custom', $fConf['conf_rte'])) { $this->wizard->EM_CONF_presets['createDirs'][] = $this->ulFolder($extKey) . 'rte/'; $rteImageDir = '|imgpath=' . $this->ulFolder($extKey) . 'rte/'; } $transformation = 'ts_images-ts_reglinks'; if ($fConf['conf_mode_cssOrNot'] && t3lib_div::inList('moderate,custom', $fConf['conf_rte'])) { $transformation = 'ts_css'; } switch ($fConf['conf_rte']) { case 'tt_content': $typeP = 'richtext[]:rte_transform[mode=ts]'; break; case 'moderate': $typeP = 'richtext[]:rte_transform[mode=' . $transformation . '' . $rteImageDir . ']'; break; case 'basic': $typeP = 'richtext[]:rte_transform[mode=ts_css' . $rteImageDir . ']'; $this->wizard->ext_localconf[] = trim($this->wrapBody("\n\t\t\t\t\t\t\t\tt3lib_extMgm::addPageTSConfig('\n\n\t\t\t\t\t\t\t\t\t# ***************************************************************************************\n\t\t\t\t\t\t\t\t\t# CONFIGURATION of RTE in table \"" . $table . "\", field \"" . $fConf["fieldname"] . "\"\n\t\t\t\t\t\t\t\t\t# ***************************************************************************************\n\n\t\t\t\t\t\t\t\t\t", trim($this->slashValueForSingleDashes(str_replace(chr(9), " ", $this->sPS("\n\t\t\t\t\t\t\t\t\t\tRTE.config." . $table . "." . $fConf["fieldname"] . " {\n\t\t\t\t\t\t\t\t\t\t\thidePStyleItems = H1, H4, H5, H6\n\t\t\t\t\t\t\t\t\t\t\tproc.exitHTMLparser_db=1\n\t\t\t\t\t\t\t\t\t\t\tproc.exitHTMLparser_db {\n\t\t\t\t\t\t\t\t\t\t\t\tkeepNonMatchedTags=1\n\t\t\t\t\t\t\t\t\t\t\t\ttags.font.allowedAttribs= color\n\t\t\t\t\t\t\t\t\t\t\t\ttags.font.rmTagIfNoAttrib = 1\n\t\t\t\t\t\t\t\t\t\t\t\ttags.font.nesting = global\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t")))), "\n\t\t\t\t\t\t\t\t');\n\t\t\t\t\t\t", 0)); break; case 'none': $typeP = 'richtext[]'; break; case 'custom': $enabledButtons = array(); $traverseList = explode(',', 'cut,copy,paste,formatblock,class,fontstyle,fontsize,textcolor,bold,italic,underline,left,center,right,orderedlist,unorderedlist,outdent,indent,link,table,image,line,user,chMode'); $HTMLparser = array(); $fontAllowedAttrib = array(); $allowedTags_WOP = array(); $allowedTags = array(); while (list(, $lI) = each($traverseList)) { $nothingDone = 0; if ($fConf['conf_rte_b_' . $lI]) { $enabledButtons[] = $lI; switch ($lI) { case 'formatblock': case 'left': case 'center': case 'right': $allowedTags[] = 'div'; $allowedTags[] = 'p'; break; case 'class': $allowedTags[] = 'span'; break; case 'fontstyle': $allowedTags[] = 'font'; $fontAllowedAttrib[] = 'face'; break; case 'fontsize': $allowedTags[] = 'font'; $fontAllowedAttrib[] = 'size'; break; case 'textcolor': $allowedTags[] = 'font'; $fontAllowedAttrib[] = 'color'; break; case 'bold': $allowedTags[] = 'b'; $allowedTags[] = 'strong'; break; case 'italic': $allowedTags[] = 'i'; $allowedTags[] = 'em'; break; case 'underline': $allowedTags[] = 'u'; break; case 'orderedlist': $allowedTags[] = 'ol'; $allowedTags[] = 'li'; break; case 'unorderedlist': $allowedTags[] = 'ul'; $allowedTags[] = 'li'; break; case 'outdent': case 'indent': $allowedTags[] = 'blockquote'; break; case 'link': $allowedTags[] = 'a'; break; case 'table': $allowedTags[] = 'table'; $allowedTags[] = 'tr'; $allowedTags[] = 'td'; break; case 'image': $allowedTags[] = 'img'; break; case 'line': $allowedTags[] = 'hr'; break; default: $nothingDone = 1; break; } if (!$nothingDone) { $allowedTags_WOP[] = $WOP . '[conf_rte_b_' . $lI . ']'; } } } if (count($fontAllowedAttrib)) { $HTMLparser[] = 'tags.font.allowedAttribs = ' . implode(',', $fontAllowedAttrib); $HTMLparser[] = 'tags.font.rmTagIfNoAttrib = 1'; $HTMLparser[] = 'tags.font.nesting = global'; } if (count($enabledButtons)) { $typeP = 'richtext[' . implode('|', $enabledButtons) . ']:rte_transform[mode=' . $transformation . '' . $rteImageDir . ']'; } $rte_colors = array(); $setupUpColors = array(); for ($a = 1; $a <= 3; $a++) { if ($fConf['conf_rte_color' . $a]) { $rte_colors[$id . '_color' . $a] = trim($this->sPS(' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_color' . $a . ']') . ' ' . $id . '_color' . $a . ' { name = Color ' . $a . ' value = ' . $fConf['conf_rte_color' . $a] . ' } ')); $setupUpColors[] = trim($fConf['conf_rte_color' . $a]); } } $rte_classes = array(); for ($a = 1; $a <= 6; $a++) { if ($fConf['conf_rte_class' . $a]) { $rte_classes[$id . '_class' . $a] = trim($this->sPS(' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_class' . $a . ']') . ' ' . $id . '_class' . $a . ' { name = ' . $fConf['conf_rte_class' . $a] . ' value = ' . $fConf['conf_rte_class' . $a . '_style'] . ' } ')); } } $PageTSconfig = array(); if ($fConf['conf_rte_removecolorpicker']) { $PageTSconfig[] = ' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_removecolorpicker]'); $PageTSconfig[] = 'disableColorPicker = 1'; } if (count($rte_classes)) { $PageTSconfig[] = ' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_class*]'); $PageTSconfig[] = 'classesParagraph = ' . implode(', ', array_keys($rte_classes)); $PageTSconfig[] = 'classesCharacter = ' . implode(', ', array_keys($rte_classes)); if (in_array('p', $allowedTags) || in_array('div', $allowedTags)) { $HTMLparser[] = ' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_class*]'); if (in_array('p', $allowedTags)) { $HTMLparser[] = 'p.fixAttrib.class.list = ,' . implode(',', array_keys($rte_classes)); } if (in_array('div', $allowedTags)) { $HTMLparser[] = 'div.fixAttrib.class.list = ,' . implode(',', array_keys($rte_classes)); } } } if (count($rte_colors)) { $PageTSconfig[] = ' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_color*]'); $PageTSconfig[] = 'colors = ' . implode(', ', array_keys($rte_colors)); if (in_array('color', $fontAllowedAttrib) && $fConf['conf_rte_removecolorpicker']) { $HTMLparser[] = ' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_removecolorpicker]'); $HTMLparser[] = 'tags.font.fixAttrib.color.list = ,' . implode(',', $setupUpColors); $HTMLparser[] = 'tags.font.fixAttrib.color.removeIfFalse = 1'; } } if (!strcmp($fConf['conf_rte_removePdefaults'], 1)) { $PageTSconfig[] = ' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_removePdefaults]'); $PageTSconfig[] = 'hidePStyleItems = H1, H2, H3, H4, H5, H6, PRE'; } elseif ($fConf['conf_rte_removePdefaults'] == 'H2H3') { $PageTSconfig[] = ' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_removePdefaults]'); $PageTSconfig[] = 'hidePStyleItems = H1, H4, H5, H6'; } else { $allowedTags[] = 'h1'; $allowedTags[] = 'h2'; $allowedTags[] = 'h3'; $allowedTags[] = 'h4'; $allowedTags[] = 'h5'; $allowedTags[] = 'h6'; $allowedTags[] = 'pre'; } $allowedTags = array_unique($allowedTags); if (count($allowedTags)) { $HTMLparser[] = ' ' . $this->WOPcomment('WOP:' . implode(' / ', $allowedTags_WOP)); $HTMLparser[] = 'allowTags = ' . implode(', ', $allowedTags); } if ($fConf['conf_rte_div_to_p']) { $HTMLparser[] = ' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_div_to_p]'); $HTMLparser[] = 'tags.div.remap = P'; } if (count($HTMLparser)) { $PageTSconfig[] = trim($this->wrapBody(' proc.exitHTMLparser_db=1 proc.exitHTMLparser_db { ', implode(chr(10), $HTMLparser), ' } ')); } $finalPageTSconfig = array(); if (count($rte_colors)) { $finalPageTSconfig[] = trim($this->wrapBody(' RTE.colors { ', implode(chr(10), $rte_colors), ' } ')); } if (count($rte_classes)) { $finalPageTSconfig[] = trim($this->wrapBody(' RTE.classes { ', implode(chr(10), $rte_classes), ' } ')); } if (count($PageTSconfig)) { $finalPageTSconfig[] = trim($this->wrapBody(' RTE.config.' . $table . '.' . $fConf['fieldname'] . ' { ', implode(chr(10), $PageTSconfig), ' } ')); } if (count($finalPageTSconfig)) { $this->wizard->ext_localconf[] = trim($this->wrapBody("\n\t\t\t\t\t\t\t\tt3lib_extMgm::addPageTSConfig('\n\n\t\t\t\t\t\t\t\t\t# ***************************************************************************************\n\t\t\t\t\t\t\t\t\t# CONFIGURATION of RTE in table \"" . $table . "\", field \"" . $fConf["fieldname"] . "\"\n\t\t\t\t\t\t\t\t\t# ***************************************************************************************\n\n\t\t\t\t\t\t\t\t", trim($this->slashValueForSingleDashes(str_replace(chr(9), " ", implode(chr(10) . chr(10), $finalPageTSconfig)))), "\n\t\t\t\t\t\t\t\t');\n\t\t\t\t\t\t\t", 0)); } break; } $this->wizard->_typeP[$fConf['fieldname']] = $typeP; break; case 'check': case 'check_4': case 'check_10': $configL[] = '\'type\' => \'check\','; if ($t == 'check') { $DBfields[] = $fConf['fieldname'] . ' tinyint(3) DEFAULT \'0\' NOT NULL,'; if ($fConf['conf_check_default']) { $configL[] = '\'default\' => 1, ' . $this->WOPcomment('WOP:' . $WOP . '[conf_check_default]'); } } else { $DBfields[] = $fConf['fieldname'] . ' int(11) DEFAULT \'0\' NOT NULL,'; } if ($t == 'check_4' || $t == 'check_10') { $configL[] = '\'cols\' => 4,'; $cItems = array(); $aMax = intval($fConf["conf_numberBoxes"]); for ($a = 0; $a < $aMax; $a++) { $cItems[] = 'array(\'' . addslashes($this->getSplitLabels_reference($fConf, "conf_boxLabel_" . $a, $table . "." . $fConf["fieldname"] . ".I." . $a)) . '\', \'\'),'; } $configL[] = trim($this->wrapBody(' \'items\' => array( ', implode(chr(10), $cItems), ' ), ')); } break; case 'radio': case 'select': $configL[] = '\'type\' => \'' . ($t == 'select' ? 'select' : 'radio') . '\','; $notIntVal = 0; $len = array(); $numberOfItems = $version < 4006000 ? t3lib_div::intInRange($fConf['conf_select_items'], 1, 20) : t3lib_utility_Math::forceIntegerInRange($fConf['conf_select_items'], 1, 20); for ($a = 0; $a < $numberOfItems; $a++) { $val = $fConf["conf_select_itemvalue_" . $a]; if ($version < 4006000) { $notIntVal += t3lib_div::testInt($val) ? 0 : 1; } else { $notIntVal += t3lib_utility_Math::canBeInterpretedAsInteger($val) ? 0 : 1; } $len[] = strlen($val); if ($fConf["conf_select_icons"] && $t == "select") { $icon = ', t3lib_extMgm::extRelPath(\'' . $extKey . '\').\'' . 'selicon_' . $id . '_' . $a . '.gif' . '\''; // Add wizard icon $this->addFileToFileArray("selicon_" . $id . "_" . $a . ".gif", t3lib_div::getUrl(t3lib_extMgm::extPath("kickstarter") . "res/wiz.gif")); } else { $icon = ""; } // $cItems[]='Array("'.str_replace("\\'","'",addslashes($this->getSplitLabels($fConf,"conf_select_item_".$a))).'", "'.addslashes($val).'"'.$icon.'),'; $cItems[] = 'array(\'' . addslashes($this->getSplitLabels_reference($fConf, "conf_select_item_" . $a, $table . "." . $fConf["fieldname"] . ".I." . $a)) . '\', \'' . addslashes($val) . '\'' . $icon . '),'; } $configL[] = trim($this->wrapBody(' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_select_items]') . ' \'items\' => array( ', implode(chr(10), $cItems), ' ), ')); if ($fConf['conf_select_pro'] && $t == 'select') { $cN = $this->returnName($extKey, 'class', $id); $configL[] = '\'itemsProcFunc\' => \'' . $cN . '->main\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_select_pro]'); $classContent = $this->sPS('class ' . $cN . ' { /** * [Describe function...] * * @param [type] $$params: ... * @param [type] $pObj: ... * @return [type] ... */ function main(&$params,&$pObj) { /* debug(\'Hello World!\',1); debug(\'$params:\',1); debug($params); debug(\'$pObj:\',1); debug($pObj); */ // Adding an item! $params[\'items\'][] = array($pObj->sL(\'Added label by PHP function|Tilfjet Dansk tekst med PHP funktion\'), 999); // No return - the $params and $pObj variables are passed by reference, so just change content in then and it is passed back automatically... } } ', 0); $this->addFileToFileArray('class.' . $cN . '.php', $this->PHPclassFile($extKey, 'class.' . $cN . '.php', $classContent, 'Class/Function which manipulates the item-array for table/field ' . $id . '.')); $this->wizard->ext_tables[] = $this->sPS(' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_select_pro]:') . ' if (TYPO3_MODE === \'BE\') { include_once(t3lib_extMgm::extPath(\'' . $extKey . '\').\'' . 'class.' . $cN . '.php\'); } '); } $numberOfRelations = $version < 4006000 ? t3lib_div::intInRange($fConf['conf_relations'], 1, 100) : t3lib_utility_Math::forceIntegerInRange($fConf['conf_relations'], 1, 100); if ($t == 'select') { if ($version < 4006000) { $configL[] = '\'size\' => ' . t3lib_div::intInRange($fConf['conf_relations_selsize'], 1, 100) . ', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations_selsize]'); } else { $configL[] = '\'size\' => ' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_relations_selsize'], 1, 100) . ', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations_selsize]'); } $configL[] = '\'maxitems\' => ' . $numberOfRelations . ', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations]'); } if ($numberOfRelations > 1 && $t == "select") { if ($numberOfRelations * 4 < 256) { $DBfields[] = $fConf["fieldname"] . " varchar(" . $numberOfRelations * 4 . ") DEFAULT '' NOT NULL,"; } else { $DBfields[] = $fConf["fieldname"] . " text,"; } } elseif ($notIntVal) { $varCharLn = $version < 4006000 ? t3lib_div::intInRange(max($len), 1) : t3lib_utility_Math::forceIntegerInRange(max($len), 1); $DBfields[] = $fConf["fieldname"] . " " . ($varCharLn > $this->wizard->charMaxLng ? 'var' : '') . "char(" . $varCharLn . ") DEFAULT '' NOT NULL,"; } else { $DBfields[] = $fConf["fieldname"] . ' int(11) DEFAULT \'0\' NOT NULL,'; } break; case 'rel': if ($fConf["conf_rel_type"] == "group") { $configL[] = '\'type\' => \'group\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_type]'); $configL[] = '\'internal_type\' => \'db\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_type]'); } else { $configL[] = '\'type\' => \'select\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_type]'); } if ($fConf["conf_rel_type"] != "group" && $fConf["conf_relations"] == 1 && $fConf["conf_rel_dummyitem"]) { $configL[] = trim($this->wrapBody(' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_dummyitem]') . ' \'items\' => array( ', 'array(\'\', 0),', ' ), ')); } if (t3lib_div::inList("tt_content,fe_users,fe_groups", $fConf["conf_rel_table"])) { $this->wizard->EM_CONF_presets["dependencies"][] = "cms"; } if ($fConf["conf_rel_table"] == "_CUSTOM") { $fConf["conf_rel_table"] = $fConf["conf_custom_table_name"] ? $fConf["conf_custom_table_name"] : "NO_TABLE_NAME_AVAILABLE"; } if ($fConf["conf_rel_type"] == "group") { $configL[] = '\'allowed\' => \'' . ($fConf["conf_rel_table"] != "_ALL" ? $fConf["conf_rel_table"] : "*") . '\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_table]'); if ($fConf["conf_rel_table"] == "_ALL") { $configL[] = '\'prepend_tname\' => 1, ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_table]=_ALL'); } } else { switch ($fConf["conf_rel_type"]) { case "select_cur": $where = "AND " . $fConf["conf_rel_table"] . ".pid=###CURRENT_PID### "; break; case "select_root": $where = "AND " . $fConf["conf_rel_table"] . ".pid=###SITEROOT### "; break; case "select_storage": $where = "AND " . $fConf["conf_rel_table"] . ".pid=###STORAGE_PID### "; break; default: $where = ""; break; } $configL[] = '\'foreign_table\' => \'' . $fConf["conf_rel_table"] . '\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_table]'); $configL[] = '\'foreign_table_where\' => \'' . $where . 'ORDER BY ' . $fConf["conf_rel_table"] . '.uid\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_type]'); } if ($version < 4006000) { $configL[] = '\'size\' => ' . t3lib_div::intInRange($fConf['conf_relations_selsize'], 1, 100) . ', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations_selsize]'); $configL[] = '\'minitems\' => 0,'; $configL[] = '\'maxitems\' => ' . t3lib_div::intInRange($fConf['conf_relations'], 1, 100) . ', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations]'); $confRelations = t3lib_div::intInRange($fConf['conf_relations'], 1, 100); } else { $configL[] = '\'size\' => ' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_relations_selsize'], 1, 100) . ', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations_selsize]'); $configL[] = '\'minitems\' => 0,'; $configL[] = '\'maxitems\' => ' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_relations'], 1, 100) . ', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations]'); $confRelations = t3lib_utility_Math::forceIntegerInRange($fConf['conf_relations'], 1, 100); } if ($fConf["conf_relations_mm"]) { $mmTableName = $id . "_mm"; $configL[] = '"MM" => "' . $mmTableName . '", ' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations_mm]'); $DBfields[] = $fConf["fieldname"] . ' int(11) DEFAULT \'0\' NOT NULL,'; $createTable = $this->sPS("\n\t\t\t\t\t\t#\n\t\t\t\t\t\t# Table structure for table '" . $mmTableName . "'\n\t\t\t\t\t\t# " . $this->WOPcomment('WOP:' . $WOP . '[conf_relations_mm]') . "\n\t\t\t\t\t\t#\n\t\t\t\t\t\tCREATE TABLE " . $mmTableName . " (\n\t\t\t\t\t\t uid_local int(11) DEFAULT '0' NOT NULL,\n\t\t\t\t\t\t uid_foreign int(11) DEFAULT '0' NOT NULL,\n\t\t\t\t\t\t tablenames varchar(30) DEFAULT '' NOT NULL,\n\t\t\t\t\t\t sorting int(11) DEFAULT '0' NOT NULL,\n\t\t\t\t\t\t KEY uid_local (uid_local),\n\t\t\t\t\t\t KEY uid_foreign (uid_foreign)\n\t\t\t\t\t\t);\n\t\t\t\t\t"); $this->wizard->ext_tables_sql[] = chr(10) . $createTable . chr(10); } elseif ($confRelations > 1 || $fConf["conf_rel_type"] == "group") { $DBfields[] = $fConf["fieldname"] . " text,"; } else { $DBfields[] = $fConf["fieldname"] . ' int(11) DEFAULT \'0\' NOT NULL,'; } if ($fConf["conf_rel_type"] != "group") { $wTable = $fConf["conf_rel_table"]; $wizards = array(); if ($fConf["conf_wiz_addrec"]) { $wizards[] = trim($this->sPS(' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_wiz_addrec]') . ' \'add\' => array( \'type\' => \'script\', \'title\' => \'Create new record\', \'icon\' => \'add.gif\', \'params\' => array( \'table\' => \'' . $wTable . '\', \'pid\' => \'###CURRENT_PID###\', \'setValue\' => \'prepend\' ), \'script\' => \'wizard_add.php\', ), ')); } if ($fConf["conf_wiz_listrec"]) { $wizards[] = trim($this->sPS(' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_wiz_listrec]') . ' \'list\' => array( \'type\' => \'script\', \'title\' => \'List\', \'icon\' => \'list.gif\', \'params\' => array( \'table\' => \'' . $wTable . '\', \'pid\' => \'###CURRENT_PID###\', ), \'script\' => \'wizard_list.php\', ), ')); } if ($fConf["conf_wiz_editrec"]) { $wizards[] = trim($this->sPS(' ' . $this->WOPcomment('WOP:' . $WOP . '[conf_wiz_editrec]') . ' \'edit\' => array( \'type\' => \'popup\', \'title\' => \'Edit\', \'script\' => \'wizard_edit.php\', \'popup_onlyOpenIfSelected\' => 1, \'icon\' => \'edit2.gif\', \'JSopenParams\' => \'height=350,width=580,status=0,menubar=0,scrollbars=1\', ), ')); } if (count($wizards)) { $configL[] = trim($this->wrapBody(' \'wizards\' => array( \'_PADDING\' => 2, \'_VERTICAL\' => 1, ', implode(chr(10), $wizards), ' ), ')); } } break; case "files": $configL[] = '\'type\' => \'group\','; $configL[] = '\'internal_type\' => \'file\','; switch ($fConf["conf_files_type"]) { case "images": $configL[] = '\'allowed\' => $GLOBALS[\'TYPO3_CONF_VARS\'][\'GFX\'][\'imagefile_ext\'], ' . $this->WOPcomment('WOP:' . $WOP . '[conf_files_type]'); break; case "webimages": $configL[] = '\'allowed\' => \'gif,png,jpeg,jpg\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_files_type]'); // TODO use web images definition from install tool break; case "all": $configL[] = '\'allowed\' => \'\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_files_type]'); $configL[] = '\'disallowed\' => \'php,php3\', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_files_type]'); break; } $configL[] = '\'max_size\' => $GLOBALS[\'TYPO3_CONF_VARS\'][\'BE\'][\'maxFileSize\'], ' . $this->WOPcomment('WOP:' . $WOP . '[conf_max_filesize]'); $this->wizard->EM_CONF_presets["uploadfolder"] = 1; $ulFolder = 'uploads/tx_' . str_replace("_", "", $extKey); $configL[] = '\'uploadfolder\' => \'' . $ulFolder . '\','; if ($fConf['conf_files_thumbs']) { $configL[] = '\'show_thumbs\' => 1, ' . $this->WOPcomment('WOP:' . $WOP . '[conf_files_thumbs]'); } if ($version < 4006000) { $configL[] = '\'size\' => ' . t3lib_div::intInRange($fConf['conf_files_selsize'], 1, 100) . ', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_files_selsize]'); $configL[] = '\'minitems\' => 0,'; $configL[] = '\'maxitems\' => ' . t3lib_div::intInRange($fConf['conf_files'], 1, 100) . ', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_files]'); } else { $configL[] = '\'size\' => ' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_files_selsize'], 1, 100) . ', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_files_selsize]'); $configL[] = '\'minitems\' => 0,'; $configL[] = '\'maxitems\' => ' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_files'], 1, 100) . ', ' . $this->WOPcomment('WOP:' . $WOP . '[conf_files]'); } $DBfields[] = $fConf["fieldname"] . " text,"; break; case 'flex': $DBfields[] = $fConf['fieldname'] . ' mediumtext,'; $configL[] = trim($this->sPS(' \'type\' => \'flex\', \'ds\' => array( \'default\' => \'FILE:EXT:' . $extKey . '/flexform_' . $table . '_' . $fConf['fieldname'] . '.xml\', ), ')); $this->addFileToFileArray('flexform_' . $table . '_' . $fConf['fieldname'] . '.xml', $this->createFlexForm()); break; case "none": $DBfields[] = $fConf["fieldname"] . " tinytext,"; $configL[] = trim($this->sPS(' \'type\' => \'none\', ')); break; case "passthrough": $DBfields[] = $fConf["fieldname"] . " tinytext,"; $configL[] = trim($this->sPS(' \'type\' => \'passthrough\', ')); break; case 'inline': #$DBfields=$this->getInlineDBfields($fConf); if ($DBfields) { $DBfields = array_merge($DBfields, $this->getInlineDBfields($table, $fConf)); } $configL = $this->getInlineTCAconfig($table, $fConf); break; default: debug("Unknown type: " . (string) $fConf["type"]); break; } if ($t == "passthrough") { $columns[$fConf["fieldname"]] = trim($this->wrapBody(' \'' . $fConf["fieldname"] . '\' => array( ' . $this->WOPcomment('WOP:' . $WOP . '[fieldname]') . ' \'config\' => array( ', implode(chr(10), $configL), ' ) ), ', 2)); } else { $columns[$fConf["fieldname"]] = trim($this->wrapBody(' \'' . $fConf["fieldname"] . '\' => array( ' . $this->WOPcomment('WOP:' . $WOP . '[fieldname]') . ' \'exclude\' => ' . ($fConf["excludeField"] ? 1 : 0) . ', ' . $this->WOPcomment('WOP:' . $WOP . '[excludeField]') . ' \'label\' => \'' . addslashes($this->getSplitLabels_reference($fConf, "title", $table . "." . $fConf["fieldname"])) . '\', ' . $this->WOPcomment('WOP:' . $WOP . '[title]') . ' \'config\' => array( ', implode(chr(10), $configL), ' ) ), ', 2)); } }
/** * Checks if bidirectional MM Relations are active. * see extension mmforeign * * @return mixed Return true or error message */ function isMMForeignActive() { global $TYPO3_CONF_VARS; $error = 0; if (t3lib_div::int_from_ver(TYPO3_version) >= t3lib_div::int_from_ver('4.1')) { return true; } // is mmforeign loaded? if (!t3lib_extMgm::isLoaded('mmforeign')) { return 'Warning: DAM References are disabled! Install extension "mmforeign".'; } // this forces us to think all is fine if ($TYPO3_CONF_VARS['EXTCONF']['dam']['setup']['mmref']) { return true; } // XCLASS overwritten? if (!preg_match('#(/ext/mmforeign/)#', $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tcemain.php'])) { return 'Warning: DAM References are disabled by other extension! (overridden XCLASS):' . "\n" . $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tcemain.php']; } if (!preg_match('#(/ext/mmforeign/)#', $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_transferdata.php'])) { return 'Warning: DAM References are disabled by other extension! (overridden XCLASS):' . "\n" . $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_transferdata.php']; } return true; }
<?php # TYPO3 CVS ID: $Id: ext_localconf.php 43504 2011-02-12 13:31:28Z ohader $ if (!defined('TYPO3_MODE')) { die('Access denied.'); } define('PATH_tx_extdeveval', t3lib_extMgm::extPath('extdeveval')); if (TYPO3_MODE == 'BE') { $TYPO3_CONF_VARS['SC_OPTIONS']['typo3/alt_topmenu_dummy.php']['fetchContentTopmenu'][] = 'EXT:extdeveval/class.tx_extdeveval_fetchContentTopMenu.php:tx_extdeveval_altTopMenuDummy'; $TYPO3_CONF_VARS['SC_OPTIONS']['ext/extdeveval/class.ux_sc_alt_topmenu_dummy.php']['links'] = array(array('t3lib/', t3lib_extMgm::extRelPath($_EXTKEY) . 'apidocs/t3lib_api.html'), array('div', t3lib_extMgm::extRelPath($_EXTKEY) . 'apidocs/t3lib_div.html'), array('extMgm', t3lib_extMgm::extRelPath($_EXTKEY) . 'apidocs/t3lib_extmgm.html'), array('BEfunc', t3lib_extMgm::extRelPath($_EXTKEY) . 'apidocs/t3lib_befunc.html'), array('DB', t3lib_extMgm::extRelPath($_EXTKEY) . 'apidocs/t3lib_db.html'), array('template', t3lib_extMgm::extRelPath($_EXTKEY) . 'apidocs/typo3_template.html'), array('lang', t3lib_extMgm::extRelPath($_EXTKEY) . 'apidocs/typo3_lang.html'), array('pibase', t3lib_extMgm::extRelPath($_EXTKEY) . 'apidocs/tslib_pibase_api.html'), array('cObj', t3lib_extMgm::extRelPath($_EXTKEY) . 'apidocs/tslib_content_api.html'), array('TSref', 'http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/'), array('TYPO3.org', 'http://typo3.org/')); //integration in new backend ver 4.2 if (t3lib_div::int_from_ver(TYPO3_version) >= 4002000) { $GLOBALS['TYPO3_CONF_VARS']['typo3/backend.php']['additionalBackendItems'][] = t3lib_extMgm::extPath('extdeveval') . 'class.tx_extdeveval_additionalBackendItems.php'; } }
<?php if (!defined('TYPO3_MODE')) { die('Access denied.'); } t3lib_extMgm::allowTableOnStandardPages('tx_myquizpoll_question'); $TCA['tx_myquizpoll_question'] = array('ctrl' => array('title' => 'LLL:EXT:myquizpoll/locallang_db.xml:tx_myquizpoll_question', 'label' => 'title', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'versioningWS' => TRUE, 'origUid' => 't3_origuid', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', 'transOrigDiffSourceField' => 'l10n_diffsource', 'sortby' => 'sorting', 'delete' => 'deleted', 'enablecolumns' => array('disabled' => 'hidden', 'fe_group' => 'fe_group'), 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php', 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'icon_tx_myquizpoll_question.gif')); t3lib_extMgm::allowTableOnStandardPages('tx_myquizpoll_voting'); $TCA['tx_myquizpoll_voting'] = array('ctrl' => array('title' => 'LLL:EXT:myquizpoll/locallang_db.xml:tx_myquizpoll_voting', 'label' => 'answer_no', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', 'transOrigDiffSourceField' => 'l10n_diffsource', 'default_sortby' => 'ORDER BY crdate', 'enablecolumns' => array('disabled' => 'hidden'), 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php', 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'icon_tx_myquizpoll_voting.gif')); t3lib_extMgm::allowTableOnStandardPages('tx_myquizpoll_result'); $TCA['tx_myquizpoll_result'] = array('ctrl' => array('title' => 'LLL:EXT:myquizpoll/locallang_db.xml:tx_myquizpoll_result', 'label' => 'name', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', 'transOrigDiffSourceField' => 'l10n_diffsource', 'default_sortby' => 'ORDER BY crdate', 'enablecolumns' => array('disabled' => 'hidden'), 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php', 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'icon_tx_myquizpoll_result.gif')); t3lib_extMgm::allowTableOnStandardPages('tx_myquizpoll_relation'); $TCA['tx_myquizpoll_relation'] = array('ctrl' => array('title' => 'LLL:EXT:myquizpoll/locallang_db.xml:tx_myquizpoll_relation', 'label' => 'uid', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', 'transOrigDiffSourceField' => 'l10n_diffsource', 'default_sortby' => 'ORDER BY crdate', 'enablecolumns' => array('disabled' => 'hidden'), 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php', 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'icon_tx_myquizpoll_relation.gif')); t3lib_extMgm::allowTableOnStandardPages('tx_myquizpoll_category'); $TCA['tx_myquizpoll_category'] = array('ctrl' => array('title' => 'LLL:EXT:myquizpoll/locallang_db.xml:tx_myquizpoll_category', 'label' => 'name', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'default_sortby' => 'ORDER BY name', 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php', 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'icon_tx_myquizpoll_category.gif')); $version = class_exists('t3lib_utility_VersionNumber') ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) : t3lib_div::int_from_ver(TYPO3_version); if ($version < 4008000) { t3lib_div::loadTCA('tt_content'); } $TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY . '_pi1'] = 'layout,select_key,recursive'; $TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY . '_pi1'] = 'pi_flexform'; t3lib_extMgm::addPiFlexFormValue($_EXTKEY . '_pi1', 'FILE:EXT:' . $_EXTKEY . '/flexform.xml'); t3lib_extMgm::addPlugin(array('LLL:EXT:myquizpoll/locallang_db.xml:tt_content.list_type_pi1', $_EXTKEY . '_pi1', t3lib_extMgm::extRelPath($_EXTKEY) . 'ext_icon.gif'), 'list_type'); if (TYPO3_MODE == 'BE') { $TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']['tx_myquizpoll_pi1_wizicon'] = t3lib_extMgm::extPath($_EXTKEY) . 'pi1/class.tx_myquizpoll_pi1_wizicon.php'; } t3lib_extMgm::addStaticFile($_EXTKEY, 'pi1/static/', 'My quiz and poll: default styles'); t3lib_extMgm::addStaticFile($_EXTKEY, 'static/defaultsettings/', 'My quiz and poll: default settings'); t3lib_extMgm::addStaticFile($_EXTKEY, 'static/starrating/', 'My quiz and poll: star rating (question type)'); t3lib_extMgm::addStaticFile($_EXTKEY, 'static/uistars/', 'My quiz and poll: star rating (rating)'); $TCA['pages']['columns']['module']['config']['items'][] = array('My Quiz and Poll', 'myquizpoll', t3lib_extMgm::extRelPath($_EXTKEY) . 'ext_icon_myquizpoll_folder.gif');
/** * CLI engine * * @param array Command line arguments * @return string */ public function cli_main($argv) { $task = (string) $this->cli_args['_DEFAULT'][1]; if (!$task) { $this->cli_validateArgs(); $this->cli_help(); exit; } if ($task == 'update' || $task == 'get' || $task == 'ack' || $task == 'due') { $force = (bool) $this->readArgument('--force', '-f'); $return_status = (bool) $this->readArgument('-r'); $options = array('forceUpdate' => $force); $options = array_merge($options, $this->parseOptions($this->readArgument('--options', '-o'))); $node = FALSE; $node_repository = tx_caretaker_NodeRepository::getInstance(); $nodeId = $this->readArgument('--node', '-N'); if ((bool) $this->readArgument('--root', '-R')) { $node = $node_repository->getRootNode(); } else { if ($nodeId) { $node = $node_repository->id2node($nodeId); } } if ($node) { $this->cli_echo('node ' . $node->getCaretakerNodeId() . chr(10)); $result = FALSE; if ($task == 'update' || $task == 'ack' || $task == 'due') { try { $lockObj = t3lib_div::makeInstance('t3lib_lock', 'tx_caretaker_update_' . $node->getCaretakerNodeId(), $GLOBALS['TYPO3_CONF_VARS']['SYS']['lockingMode']); $lockIsAquired = $lockObj->acquire(); } catch (Exception $e) { $this->cli_echo('lock ' . 'tx_caretaker_update_' . $node->getCaretakerNodeId() . ' could not be aquired!' . chr(10) . $e->getMessage()); exit; } if ($lockIsAquired) { if ($task == 'update') { $result = $node->updateTestResult($options); } else { if ($task == 'ack' && is_a($node, 'tx_caretaker_TestNode')) { $result = $node->setModeAck(); } else { if ($task == 'due' && is_a($node, 'tx_caretaker_TestNode')) { $result = $node->setModeDue(); } } } $lockObj->release(); } else { $result = false; $this->cli_echo('node ' . $node->getCaretakerNodeId() . ' is locked because of other running update processes!' . chr(10)); exit; } } if ($task == 'get') { $result = $node->getTestResult(); $this->cli_echo($node->getTitle() . ' [' . $node->getCaretakerNodeId() . ']' . $infotext . ' ' . $event . chr(10)); $this->cli_echo($result->getLocallizedStateInfo() . ' ' . $event . ' [' . $node->getCaretakerNodeId() . ']' . chr(10)); } // send aggregated notifications $notificationServices = tx_caretaker_ServiceHelper::getAllCaretakerNotificationServices(); foreach ($notificationServices as $notificationService) { $notificationService->sendNotifications(); } if ($return_status) { exit((int) $result->getState()); } else { exit; } } else { $this->cli_echo('Node not found or inactive' . chr(10)); exit; } } elseif ($task == 'update-extension-list') { if (t3lib_div::int_from_ver(TYPO3_version) < t3lib_div::int_from_ver('4.5.0')) { $result = tx_caretaker_ExtensionManagerHelper::updateExtensionList(); $this->cli_echo('Extension list update result: ' . $result . chr(10)); exit; } else { $this->cli_echo('TYPO3 4.5.+ comes with a sceduler task for ter updates. The caretaker ter update is\'nt supportet any more.'); exit(2); } } elseif ($task == 'update-typo3-latest-version-list') { $result = tx_caretaker_LatestVersionsHelper::updateLatestTypo3VersionRegistry(); $this->cli_echo('TYPO3 latest version list update result: ' . $result . chr(10)); $versions = t3lib_div::makeInstance('t3lib_Registry')->get('tx_caretaker', 'TYPO3versions'); foreach ($versions as $key => $version) { $this->cli_echo($key . ' => ' . $version . chr(10)); } } if ($task == 'help') { $this->cli_validateArgs(); $this->cli_help(); exit; } }
/** * Print a set of permissions * * @param integer Permission integer (bits) * @return string HTML marked up x/* indications. */ function printPerms($int) { if (t3lib_div::int_from_ver(TYPO3_version) >= 4004000) { // use sprites for Typo3 V4.4 or later global $LANG; $permissions = array(1, 16, 2, 4, 8); foreach ($permissions as $permission) { if ($int & $permission) { $str .= t3lib_iconWorks::getSpriteIcon('status-status-permission-granted', array('tag' => 'a', 'title' => $LANG->getLL($permission, 1), 'onclick' => 'WebPermissions.setPermissions(' . $pageId . ', ' . $permission . ', \'delete\', \'' . $who . '\', ' . $int . ');')); } else { $str .= t3lib_iconWorks::getSpriteIcon('status-status-permission-denied', array('tag' => 'a', 'title' => $LANG->getLL($permission, 1), 'onclick' => 'WebPermissions.setPermissions(' . $pageId . ', ' . $permission . ', \'add\', \'' . $who . '\', ' . $int . ');')); } } return $str; } else { $str = ''; $str .= $int & 1 ? '*' : '<span class="perm-denied">x</span>'; $str .= $int & 16 ? '*' : '<span class="perm-denied">x</span>'; $str .= $int & 2 ? '*' : '<span class="perm-denied">x</span>'; $str .= $int & 4 ? '*' : '<span class="perm-denied">x</span>'; $str .= $int & 8 ? '*' : '<span class="perm-denied">x</span>'; return '<span class="perm-allowed">' . $str . '</span>'; } }
/** * Returns an integer from a three part version number, eg '4.12.3' -> 4012003 * Compatibility layer to make sure TV works in systems < 4.6 * * @see t3lib_utility_VersionNumber::convertVersionNumberToInteger * @param $versionNumber string Version number on format x.x.x * @return integer Integer version of version number (where each part can count to 999) */ public static function convertVersionNumberToInteger($version) { $result = 0; if (class_exists('t3lib_utility_VersionNumber')) { $result = t3lib_utility_VersionNumber::convertVersionNumberToInteger($version); } else { $result = t3lib_div::int_from_ver($version); } return $result; }
/** * Switch between the basic operations. Calls the different modules and puts * their content into a basic framework. * * @return HTML code for the kickstarter containing the module content */ function mgm_wizard() { $this->wizard =& $this; $this->initWizArray(); $this->sections = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['sections']; /* HOOK: Place a hook here, so additional things can be done */ if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['wizard_beforeSectionsHook'])) { foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['wizard_beforeSectionsHook'] as $_funcRef) { $conf = array('pObj' => $this); t3lib_div::callUserFunction($_funcRef, $conf, $this); } } foreach ($this->sections as $k => $v) { $this->options[$k] = array($v['title'], $v['description']); } $this->wizArray['save']['extension_key'] = str_replace('-', '_', $this->wizArray['save']['extension_key']); $saveKey = $this->saveKey = $this->wizArray['save']['extension_key'] = substr(strtolower(trim($this->wizArray['save']['extension_key'])), 0, 30); $this->outputWOP = $this->wizArray['save']['print_wop_comments'] ? 1 : 0; if ($saveKey) { $this->extKey = $saveKey; $this->extKey_nusc = str_replace('_', '', $saveKey); } if ($this->modData['viewResult'] || $this->modData['updateResult']) { $this->modData['wizAction'] = ''; $this->modData['wizSubCmd'] = ''; if ($saveKey) { $content = $this->view_result(); } else { $content = $this->fw('<strong>Error:</strong> Please enter an extension key first!<br /><br />'); } } elseif ($this->modData['WRITE']) { $this->modData['wizAction'] = ''; $this->modData['wizSubCmd'] = ''; if ($saveKey) { $this->makeFilesArray($this->saveKey); $uploadArray = $this->makeUploadArray($this->saveKey, $this->fileArray); $version = class_exists('t3lib_utility_VersionNumber') ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) : t3lib_div::int_from_ver(TYPO3_version); if ($version < 4000000) { // Syntax for TYPO3 3.8 and older $this->pObj->importExtFromRep(0, $this->modData['loc'], 0, $uploadArray, 0, 0, 1); } else { // TYPO3 4.0+ syntax $this->pObj->importExtFromRep('', '', $this->modData['loc'], 0, 1, $uploadArray); } } else { $content = $this->fw('<strong>Error:</strong> Please enter an extension key first!<br /><br />'); } } elseif ($this->modData['totalForm']) { $content = $this->totalForm(); } elseif ($this->modData['downloadAsFile']) { if ($saveKey) { $this->makeFilesArray($this->saveKey); $uploadArray = $this->makeUploadArray($this->saveKey, $this->fileArray); $backUpData = $this->makeUploadDataFromArray($uploadArray); $filename = 'T3X_' . $saveKey . '-' . str_replace('.', '_', '0.0.0') . '.t3x'; $mimeType = 'application/octet-stream'; Header('Content-Type: ' . $mimeType); Header('Content-Disposition: attachment; filename=' . $filename); echo $backUpData; exit; } else { $content = $this->fw('<strong>Error:</strong> Please enter an extension key first!<br /><br />'); } } else { $action = explode(':', $this->modData['wizAction']); if ((string) $action[0] == 'deleteEl') { unset($this->wizArray[$action[1]][$action[2]]); } $content = $this->getFormContent(); } $wasContent = $content ? 1 : 0; $content = ' <script language="javascript" type="text/javascript"> function setFormAnchorPoint(anchor) { document.' . $this->varPrefix . '_wizard.action = unescape("' . rawurlencode($this->linkThisCmd()) . '")+"#"+anchor; } </script> <table border="0" cellpadding="0" cellspacing="0"> <form action="' . $this->linkThisCmd() . '" method="POST" name="' . $this->varPrefix . '_wizard"> <tr> <td valign="top">' . $this->sidemenu() . '</td> <td> </td> <td valign="top">' . $content . ' <input type="hidden" name="' . $this->piFieldName("wizArray_ser") . '" value="' . htmlspecialchars(base64_encode(serialize($this->wizArray))) . '" /><br />'; if ((string) $this->modData['wizSubCmd']) { if ($wasContent) { $content .= '<input name="update2" type="submit" value="Update..." /> '; } } $content .= ' <input type="hidden" name="' . $this->piFieldName("wizAction") . '" value="' . $this->modData["wizAction"] . '" /> <input type="hidden" name="' . $this->piFieldName("wizSubCmd") . '" value="' . $this->modData["wizSubCmd"] . '" /> ' . $this->cmdHiddenField() . ' </td> </tr> </form> </table>' . $this->afterContent; return $content; }
<?php if (!defined('TYPO3_MODE')) { die('Access denied.'); } if (t3lib_extMgm::isLoaded('rtehtmlarea')) { if (t3lib_div::int_from_ver(TYPO3_version) < 4003000) { $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/mod4/class.tx_rtehtmlarea_select_image.php'] = PATH_txdam . 'compat/class.ux_tx_rtehtmlarea_select_image.php'; $TYPO3_CONF_VARS['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'][] = PATH_txdam . 'compat/class.tx_dam_rtehtmlarea_select_image.php:&tx_dam_rtehtmlarea_select_image'; $TYPO3_CONF_VARS['SC_OPTIONS']['ext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php']['browseLinksHook'][] = PATH_txdam . 'compat/class.tx_dam_rtehtmlarea_browse_links.php:&tx_dam_rtehtmlarea_browse_links'; } else { // Hooks for images and links $TYPO3_CONF_VARS['SC_OPTIONS']['ext/rtehtmlarea/mod4/class.tx_rtehtmlarea_select_image.php']['browseLinksHook'][] = PATH_txdam . 'compat/class.tx_dam_rtehtmlarea_browse_media.php:&tx_dam_rtehtmlarea_browse_media'; $TYPO3_CONF_VARS['SC_OPTIONS']['ext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php']['browseLinksHook'][] = PATH_txdam . 'compat/class.tx_dam_rtehtmlarea_browse_links.php:&tx_dam_rtehtmlarea_browse_links'; // Configure additional attributes on links // htmlArea RTE MUST be installed before DAM for this to work... if ($TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Link']['additionalAttributes']) { $TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Link']['additionalAttributes'] .= ',txdam,usedamcolumn'; } else { $TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Link']['additionalAttributes'] = 'txdam,usedamcolumn'; } } }
/** * Checks if mmforeign or T3 V 4.1 is installed and print a waring in EM when needed * * @return void */ function checkMMforeign() { $mmforeign = t3lib_extMgm::isLoaded('mmforeign'); $isFourOne = t3lib_div::int_from_ver(TYPO3_branch) >= t3lib_div::int_from_ver('4.1'); if (!$mmforeign and !$isFourOne) { $GLOBALS['SOBE']->content .= $GLOBALS['SOBE']->doc->section('WARNING: Extension \'mmforeign\' needs to be installed!', '', 0, 1, 3); } elseif ($mmforeign and $isFourOne) { $GLOBALS['SOBE']->content .= $GLOBALS['SOBE']->doc->section('NOTE: Extension \'mmforeign\' may not be needed with TYPO3 V4.1!', '', 0, 1, 1); } }
static protected function processTceCmdAndDataMap(array $cmd, array $data = array()) { if (t3lib_div::int_from_ver(TYPO3_version) <= 6000000) { $tce = t3lib_div::makeInstance('t3lib_TCEmain'); $tce->stripslashes_values = 0; $tce->start($data, $cmd); $tce->copyTree = t3lib_div::intInRange($GLOBALS['BE_USER']->uc['copyLevels'], 0, 100); if (count($cmd)) { $tce->process_cmdmap(); $returnValues = $tce->copyMappingArray_merged; } elseif (count($data)) { $tce->process_datamap(); $returnValues = $tce->substNEWwithIDs; } // check errors if (count($tce->errorLog)) { throw new Exception(implode(chr(10), $tce->errorLog)); } return $returnValues; } else if(t3lib_div::int_from_ver(TYPO3_version) > 6000000) { /** @var $tce \TYPO3\CMS\Core\DataHandling\DataHandler */ $tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler'); $tce->stripslashes_values = 0; $tce->start($data, $cmd); $tce->copyTree = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($GLOBALS['BE_USER']->uc['copyLevels'], 0, 100); if (count($cmd)) { $tce->process_cmdmap(); $returnValues = $tce->copyMappingArray_merged; } elseif (count($data)) { $tce->process_datamap(); $returnValues = $tce->substNEWwithIDs; } else { $returnValues = array(); } // check errors if (count($tce->errorLog)) { throw new \RuntimeException(implode(chr(10), $tce->errorLog), 1333754629); } return $returnValues; } }