/**
  * Check if marketing information should be shown
  *
  * @param array $marketingInformation
  * @param array $settings TypoScript Configuration
  * @return bool
  */
 public function render($marketingInformation, $settings)
 {
     if (!empty($marketingInformation) && !empty($settings['marketing']['information']) && !ConfigurationUtility::isDisableMarketingInformationActive()) {
         return true;
     }
     return false;
 }
コード例 #2
0
ファイル: StringUtility.php プロジェクト: abeyl/powermail
 /**
  * Get all receiver emails in an array
  *
  * @param string $receiverString String with some emails
  * @param int $feGroup fe_groups Uid
  * @return array
  */
 public static function getReceiverEmails($receiverString, $feGroup)
 {
     $array = self::getEmailsFromString($receiverString);
     if ($feGroup) {
         $array = array_merge($array, self::getEmailsFromFeGroup($feGroup));
     }
     if (ConfigurationUtility::getDevelopmentContextEmail()) {
         $array = [ConfigurationUtility::getDevelopmentContextEmail()];
     }
     return $array;
 }
コード例 #3
0
 /**
  * Return uid from given field marker and form
  *
  * @param string $marker
  * @param int $formUid
  * @return Field
  */
 public function findByMarkerAndForm($marker, $formUid = 0)
 {
     if (ConfigurationUtility::isReplaceIrreWithElementBrowserActive()) {
         return $this->findByMarkerAndFormAlternative($marker, $formUid);
     }
     $query = $this->createQuery();
     $query->getQuerySettings()->setRespectStoragePage(false);
     $query->getQuerySettings()->setRespectSysLanguage(false);
     $query->matching($query->logicalAnd([$query->equals('marker', $marker), $query->equals('pages.forms.uid', $formUid)]));
     $query->setLimit(1);
     $result = $query->execute()->getFirst();
     return $result;
 }
コード例 #4
0
<?php

use In2code\Powermail\Utility\ConfigurationUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
$typeDefault = 'crdate, receiver_mail, ' . '--palette--;LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.palette1;1, ' . 'subject, body, ' . '--div--;LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_fields.sheet1, ' . 'form, answers, feuser, spam_factor, time, sender_ip, user_agent, ' . '--div--;LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_fields.sheet2, ' . 'marketing_referer_domain, marketing_referer, marketing_country, marketing_mobile_device, ' . 'marketing_frontend_language, marketing_browser_language, marketing_page_funnel, ' . '--div--;LLL:EXT:cms/locallang_ttc.xml:tabs.access, hidden, starttime, endtime';
$rteIconPath = 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_rte.gif';
if (!GeneralUtility::compat_version('7.6')) {
    // todo remove condition for TYPO3 6.2 in upcoming major version
    $typeDefault = str_replace('body', 'body;;;richtext[]', $typeDefault);
    $rteIconPath = 'wizard_rte2.gif';
}
$mailsTca = array('ctrl' => array('title' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:tx_powermail_domain_model_mails', 'label' => 'sender_mail', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'dividers2tabs' => true, 'versioningWS' => 2, 'versioning_followPages' => true, 'origUid' => 't3_origuid', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', 'transOrigDiffSourceField' => 'l10n_diffsource', 'default_sortby' => 'ORDER BY crdate DESC', 'delete' => 'deleted', 'enablecolumns' => array('disabled' => 'hidden', 'starttime' => 'starttime', 'endtime' => 'endtime'), 'iconfile' => ConfigurationUtility::getIconPath('tx_powermail_domain_model_mails.gif'), 'searchFields' => 'sender_mail, sender_name, subject, body'), 'interface' => array('showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, ' . 'crdate, receiver_mail, sender_name, sender_mail, subject, form, answers, body, ' . 'feuser, spam_factor, time, sender_ip, user_agent, marketing_referer_domain, ' . 'marketing_referer, marketing_country, marketing_mobile_device, ' . 'marketing_frontend_language, marketing_browser_language, marketing_page_funnel'), 'types' => array('1' => array('showitem' => $typeDefault, 'columnsOverrides' => array('body' => array('defaultExtras' => 'richtext[]')))), 'palettes' => array('1' => array('showitem' => 'sender_name, sender_mail')), 'columns' => array('sys_language_uid' => array('exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.language', 'config' => array('type' => 'select', 'foreign_table' => 'sys_language', 'renderType' => 'selectSingle', 'foreign_table_where' => 'ORDER BY sys_language.title', 'items' => array(array('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1), array('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0)))), 'l10n_parent' => array('displayCond' => 'FIELD:sys_language_uid:>:0', 'exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent', 'config' => array('type' => 'select', 'renderType' => 'selectSingle', 'items' => array(array('', 0)), 'foreign_table' => 'tx_powermail_domain_model_mails', 'foreign_table_where' => 'AND tx_powermail_domain_model_mails.pid=###CURRENT_PID### AND ' . 'tx_powermail_domain_model_mails.sys_language_uid IN (-1,0)')), 'l10n_diffsource' => array('config' => array('type' => 'passthrough')), 't3ver_label' => array('label' => 'LLL:EXT:lang/locallang_general.xml:LGL.versionLabel', 'config' => array('type' => 'input', 'size' => 30, 'max' => 255)), 'hidden' => array('exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden', 'config' => array('type' => 'check')), 'starttime' => array('exclude' => 1, 'l10n_mode' => 'mergeIfNotBlank', 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.starttime', 'config' => array('type' => 'input', 'size' => 13, 'max' => 20, 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => array('lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))))), 'endtime' => array('exclude' => 1, 'l10n_mode' => 'mergeIfNotBlank', 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.endtime', 'config' => array('type' => 'input', 'size' => 13, 'max' => 20, 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => array('lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))))), 'crdate' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.crdate', 'config' => array('type' => 'input', 'size' => 30, 'eval' => 'datetime', 'readOnly' => 1)), 'receiver_mail' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.receiver_mail', 'config' => array('type' => 'text', 'cols' => '30', 'rows' => '5')), 'sender_mail' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.sender_mail', 'config' => array('type' => 'input', 'size' => 30, 'eval' => 'trim')), 'sender_name' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.sender_name', 'config' => array('type' => 'input', 'size' => 30, 'eval' => 'trim')), 'subject' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.subject', 'config' => array('type' => 'input', 'size' => 30, 'eval' => 'trim')), 'body' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.body', 'config' => array('type' => 'text', 'cols' => '30', 'rows' => '5', 'wizards' => array('_PADDING' => 2, 'RTE' => array('notNewRecords' => 1, 'RTEonly' => 1, 'type' => 'script', 'title' => 'RTE', 'icon' => $rteIconPath, 'module' => array('name' => 'wizard_rte'))))), 'form' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'x_powermail_domain_model_mails.form', 'config' => array('type' => 'select', 'renderType' => 'selectSingle', 'foreign_table' => 'tx_powermail_domain_model_forms', 'foreign_table_where' => 'AND tx_powermail_domain_model_forms.deleted = 0 AND ' . 'tx_powermail_domain_model_forms.hidden = 0 order by tx_powermail_domain_model_forms.title')), 'answers' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.answers', 'config' => array('type' => 'inline', 'foreign_table' => 'tx_powermail_domain_model_answers', 'foreign_field' => 'mail', 'maxitems' => 1000, 'appearance' => array('collapse' => 1, 'levelLinksPosition' => 'top', 'showSynchronizationLink' => 1, 'showPossibleLocalizationRecords' => 1, 'showAllLocalizationLink' => 1))), 'feuser' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.feuser', 'config' => array('type' => 'group', 'internal_type' => 'db', 'allowed' => 'fe_users', 'size' => 1, 'minitems' => 0, 'maxitems' => 1)), 'spam_factor' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.spam_factor', 'config' => array('type' => 'input', 'size' => 13, 'eval' => 'trim', 'readOnly' => 1)), 'time' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.time', 'config' => array('type' => 'input', 'size' => 13, 'max' => 20, 'eval' => 'timesec', 'checkbox' => 0, 'default' => 0, 'readOnly' => 1)), 'sender_ip' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.sender_ip', 'config' => array('type' => 'input', 'size' => 30, 'eval' => 'trim', 'readOnly' => 1)), 'user_agent' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.user_agent', 'config' => array('type' => 'input', 'size' => 30, 'eval' => 'trim', 'readOnly' => 1)), 'marketing_referer_domain' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.marketing_referer_domain', 'config' => array('type' => 'input', 'size' => 30, 'readOnly' => 1)), 'marketing_referer' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.marketing_referer', 'config' => array('type' => 'text', 'cols' => '30', 'rows' => '5', 'readOnly' => 1)), 'marketing_country' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.marketing_country', 'config' => array('type' => 'input', 'size' => 30, 'readOnly' => 1)), 'marketing_mobile_device' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.marketing_mobile_device', 'config' => array('type' => 'check', 'readOnly' => 1)), 'marketing_frontend_language' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.marketing_frontend_language', 'config' => array('type' => 'input', 'size' => 2, 'eval' => 'int', 'readOnly' => 1)), 'marketing_browser_language' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.marketing_browser_language', 'config' => array('type' => 'input', 'size' => 30, 'readOnly' => 1)), 'marketing_page_funnel' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_mails.marketing_page_funnel', 'config' => array('type' => 'text', 'cols' => '30', 'rows' => '5', 'readOnly' => 1)), 'uid' => array('exclude' => 1, 'label' => 'UID', 'config' => array('type' => 'none'))));
if (ConfigurationUtility::isDisableMarketingInformationActive()) {
    foreach (array_keys($mailsTca['columns']) as $columnName) {
        if (strpos($columnName, 'marketing_') === 0) {
            unset($mailsTca['columns'][$columnName]);
        }
    }
}
return $mailsTca;
コード例 #5
0
 /**
  * Check if form is cached
  *
  * @return bool
  */
 protected function isCachedForm()
 {
     return ConfigurationUtility::isEnableCachingActive();
 }
 /**
  * Check if showNote should be active or not
  *
  * @param array $params Config Array
  * @return bool
  */
 protected function showNoteActive($params)
 {
     if (!isset($params['row']['uid']) || !is_numeric($params['row']['uid']) || ConfigurationUtility::isReplaceIrreWithElementBrowserActive()) {
         return false;
     }
     return true;
 }
コード例 #7
0
ファイル: Form.php プロジェクト: bernhardberger/powermail
 /**
  * Returns the pages
  *
  * @return ObjectStorage
  */
 public function getPages()
 {
     // if elementbrowser instead of IRRE (sorting workarround)
     if (ConfigurationUtility::isReplaceIrreWithElementBrowserActive()) {
         $formSorting = GeneralUtility::trimExplode(',', $this->formRepository->getPagesValue($this->uid), true);
         $formSorting = array_flip($formSorting);
         $pageArray = array();
         foreach ($this->pages as $page) {
             $pageArray[$formSorting[$page->getUid()]] = $page;
         }
         ksort($pageArray);
         return $pageArray;
     }
     return $this->pages;
 }
コード例 #8
0
ファイル: FormController.php プロジェクト: abeyl/powermail
 /**
  * Initializes this object
  *
  * @return void
  */
 public function initializeObject()
 {
     $this->contentObject = $this->configurationManager->getContentObject();
     $typoScriptSetup = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
     $this->conf = $typoScriptSetup['plugin.']['tx_powermail.']['settings.']['setup.'];
     ConfigurationUtility::mergeTypoScript2FlexForm($this->settings);
     $this->signalSlotDispatcher->dispatch(__CLASS__, __FUNCTION__ . 'Settings', [$this]);
     if ($this->settings['debug']['settings']) {
         GeneralUtility::devLog('Settings', $this->extensionName, 0, $this->settings);
     }
 }
コード例 #9
0
 /**
  * Returns sendername from a couple of arguments
  *
  * @param Mail $mail Given Params
  * @param string|array $default String as default or cObject array
  * @param string $glue
  * @return string Sender Name
  */
 public function getSenderNameFromArguments(Mail $mail, $default = null, $glue = ' ')
 {
     $name = '';
     foreach ($mail->getAnswers() as $answer) {
         /** @var Answer $answer */
         if (method_exists($answer->getField(), 'getUid') && $answer->getField()->isSenderName()) {
             if (!is_array($answer->getValue())) {
                 $value = $answer->getValue();
             } else {
                 $value = implode($glue, $answer->getValue());
             }
             $name .= $value . $glue;
         }
     }
     if (!trim($name) && $default) {
         if (!is_array($default)) {
             $name = $default;
         } else {
             /** @var ContentObjectRenderer $contentObject */
             $contentObject = GeneralUtility::makeInstance(ObjectManager::class)->get(ContentObjectRenderer::class);
             $name = $contentObject->cObjGetSingle($default[0][$default[1]], $default[0][$default[1] . '.']);
         }
     }
     if (empty($name) && !empty(ConfigurationUtility::getDefaultMailFromName())) {
         $name = ConfigurationUtility::getDefaultMailFromName();
     }
     if (!trim($name)) {
         $name = LocalizationUtility::translate('error_no_sender_name');
     }
     return trim($name);
 }
 /**
  * Check if marketing information should be shown
  *
  * @return bool
  */
 public function render()
 {
     return !ConfigurationUtility::isDisableMarketingInformationActive();
 }
コード例 #11
0
ファイル: OutputController.php プロジェクト: abeyl/powermail
 /**
  * Object initialization
  *
  * @return void
  */
 public function initializeObject()
 {
     ConfigurationUtility::mergeTypoScript2FlexForm($this->settings, 'Pi2');
 }
コード例 #12
0
ファイル: Page.php プロジェクト: VladStawizki/ipl-logistik.de
 /**
  * @return Form
  */
 public function getForms()
 {
     // if elementbrowser instead of IRRE (get related form)
     if (ConfigurationUtility::isReplaceIrreWithElementBrowserActive()) {
         return $this->formRepository->findByPages($this->uid);
     }
     return $this->forms;
 }
コード例 #13
0
 /**
  * Set receiver mails
  *
  * @return void
  */
 public function setReceiverEmails()
 {
     // get mails from FlexForm
     $emailArray = $this->getEmailsFromFlexForm();
     // get mails from fe_group
     if ((int) $this->settings['receiver']['type'] === 1 && !empty($this->settings['receiver']['fe_group'])) {
         $emailArray = $this->getEmailsFromFeGroup($this->settings['receiver']['fe_group']);
     }
     // get mails from predefined emailconfiguration
     if ((int) $this->settings['receiver']['type'] === 2 && !empty($this->settings['receiver']['predefinedemail'])) {
         $emailArray = $this->getEmailsFromPredefinedEmail($this->settings['receiver']['predefinedemail']);
     }
     // get mails from overwrite typoscript settings
     $overwriteReceivers = $this->overWriteEmailsWithTypoScript();
     if (!empty($overwriteReceivers)) {
         $emailArray = $overwriteReceivers;
     }
     // get mail from development context
     if (ConfigurationUtility::getDevelopmentContextEmail()) {
         $emailArray = [ConfigurationUtility::getDevelopmentContextEmail()];
     }
     // overwrite with a signal if needed
     $this->signalSlotDispatcher->dispatch(__CLASS__, __FUNCTION__, [&$emailArray, $this]);
     $this->receiverEmails = $emailArray;
 }
コード例 #14
0
 /**
  * Check View Backend
  *
  * @param string $email email address
  * @return void
  */
 public function checkBeAction($email = null)
 {
     $this->view->assign('pid', $this->id);
     if (GeneralUtility::validEmail($email)) {
         $body = 'New <b>Test Email</b> from User ' . BackendUtility::getPropertyFromBackendUser('username') . ' (' . GeneralUtility::getIndpEnv('HTTP_HOST') . ')';
         $senderEmail = '*****@*****.**';
         if (GeneralUtility::validEmail(ConfigurationUtility::getDefaultMailFromAddress())) {
             $senderEmail = ConfigurationUtility::getDefaultMailFromAddress();
         }
         $this->view->assignMultiple(['issent' => MailUtility::sendPlainMail($email, $senderEmail, 'New Powermail Test Email', $body), 'email' => $email]);
     }
 }
コード例 #15
0
 /**
  * Prepare variables for assignment in spam notifications
  *
  * @param Mail $mail
  * @return array
  */
 protected function getVariablesForSpamNotification(Mail $mail)
 {
     return array('mail' => $mail, 'pid' => FrontendUtility::getCurrentPageIdentifier(), 'calculatedMailSpamFactor' => $this->getCalculatedMailSpamFactor(true), 'messages' => $this->getMessages(), 'ipAddress' => !ConfigurationUtility::isDisableIpLogActive() ? GeneralUtility::getIndpEnv('REMOTE_ADDR') : '', 'time' => new \DateTime());
 }
コード例 #16
0
 /**
  * mergeTypoScript2FlexForm Test
  *
  * @param array $settings
  * @param string $level
  * @param array $expectedResult
  * @dataProvider mergeTypoScript2FlexFormReturnsVoidDataProvider
  * @return void
  * @test
  */
 public function mergeTypoScript2FlexFormReturnsVoid($settings, $level, $expectedResult)
 {
     ConfigurationUtility::mergeTypoScript2FlexForm($settings, $level);
     $this->assertSame($expectedResult, $settings);
 }
コード例 #17
0
 /**
  * Get HTML markup for development context Email
  *        if development context is active and
  *        development context email was set
  *
  * @param string $receiver overwrite regulare receiver email address
  * @return void
  */
 protected function getDevelopmentContextEmailMarkup(&$receiver)
 {
     if (!ConfigurationUtility::getDevelopmentContextEmail()) {
         return;
     }
     $originalReceiver = $receiver;
     $receiver = '<span style="color: red;"><strong>';
     $receiver .= ConfigurationUtility::getDevelopmentContextEmail();
     $receiver .= '</strong> &lt;Development context&gt;';
     $receiver .= '</span><br />';
     $receiver .= '<span style="color: #999;">' . $originalReceiver . '</span>';
 }
コード例 #18
0
 * Include TypoScript
 */
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript/Main', 'Main Template');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript/Powermail_Frontend', 'Powermail_Frontend');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript/CssDemo', 'Add Demo CSS');
if (!\In2code\Powermail\Utility\ConfigurationUtility::isDisableMarketingInformationActive()) {
    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript/Marketing', 'Marketing Information');
}
/**
 * Table Configuration
 */
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_powermail_domain_model_forms', 'EXT:powermail/Resources/Private/Language/locallang_csh_tx_powermail_domain_model_forms.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_powermail_domain_model_forms');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_powermail_domain_model_pages', 'EXT:powermail/Resources/Private/Language/locallang_csh_tx_powermail_domain_model_pages.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_powermail_domain_model_pages');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_powermail_domain_model_fields', 'EXT:powermail/Resources/Private/Language/locallang_csh_tx_powermail_domain_model_fields.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_powermail_domain_model_fields');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_powermail_domain_model_mails', 'EXT:powermail/Resources/Private/Language/locallang_csh_tx_powermail_domain_model_mails.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_powermail_domain_model_mails');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_powermail_domain_model_answers', 'EXT:powermail/Resources/Private/Language/locallang_csh_tx_powermail_domain_model_answers.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_powermail_domain_model_answers');
/**
 * Garbage Collector
 */
if (\In2code\Powermail\Utility\ConfigurationUtility::isEnableTableGarbageCollectionActive()) {
    $tgct = 'TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask';
    $table = 'tx_powermail_domain_model_mails';
    $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][$tgct]['options']['tables'][$table] = array('dateField' => 'tstamp', 'expirePeriod' => 30);
    $table = 'tx_powermail_domain_model_answers';
    $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][$tgct]['options']['tables'][$table] = array('dateField' => 'tstamp', 'expirePeriod' => 30);
}
コード例 #19
0
<?php

use In2code\Powermail\Utility\ConfigurationUtility;
$answersTca = array('ctrl' => array('title' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:tx_powermail_domain_model_answers', 'label' => 'value', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'dividers2tabs' => true, 'versioningWS' => 2, 'versioning_followPages' => true, 'origUid' => 't3_origuid', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', 'transOrigDiffSourceField' => 'l10n_diffsource', 'default_sortby' => 'ORDER BY crdate DESC', 'delete' => 'deleted', 'enablecolumns' => array('disabled' => 'hidden', 'starttime' => 'starttime', 'endtime' => 'endtime'), 'iconfile' => ConfigurationUtility::getIconPath('tx_powermail_domain_model_answers.gif')), 'interface' => array('showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, value, value_type, field, mail'), 'types' => array('1' => array('showitem' => 'value, value_type, field, mail')), 'columns' => array('sys_language_uid' => array('exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.language', 'config' => array('type' => 'select', 'renderType' => 'selectSingle', 'foreign_table' => 'sys_language', 'foreign_table_where' => 'ORDER BY sys_language.title', 'items' => array(array('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1), array('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0)))), 'l10n_parent' => array('displayCond' => 'FIELD:sys_language_uid:>:0', 'exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent', 'config' => array('type' => 'select', 'renderType' => 'selectSingle', 'items' => array(array('', 0)), 'foreign_table' => 'tx_powermail_domain_model_answers', 'foreign_table_where' => 'AND tx_powermail_domain_model_answers.pid=###CURRENT_PID### AND ' . 'tx_powermail_domain_model_answers.sys_language_uid IN (-1,0)')), 'l10n_diffsource' => array('config' => array('type' => 'passthrough')), 't3ver_label' => array('label' => 'LLL:EXT:lang/locallang_general.xml:LGL.versionLabel', 'config' => array('type' => 'input', 'size' => 30, 'max' => 255)), 'hidden' => array('exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden', 'config' => array('type' => 'check')), 'starttime' => array('exclude' => 1, 'l10n_mode' => 'mergeIfNotBlank', 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.starttime', 'config' => array('type' => 'input', 'size' => 13, 'max' => 20, 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => array('lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))))), 'endtime' => array('exclude' => 1, 'l10n_mode' => 'mergeIfNotBlank', 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.endtime', 'config' => array('type' => 'input', 'size' => 13, 'max' => 20, 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => array('lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))))), 'value' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:tx_powermail_domain_model_answers.value', 'config' => array('type' => 'text', 'cols' => '60', 'rows' => '3')), 'value_type' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_answers.value_type', 'config' => array('type' => 'select', 'renderType' => 'selectSingle', 'items' => array(array('LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_answers.value_type.0', '0'), array('LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_answers.value_type.1', '1'), array('LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_answers.value_type.2', '2'), array('LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_answers.value_type.3', '3')))), 'field' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_answers.field', 'config' => array('type' => 'group', 'internal_type' => 'db', 'allowed' => 'tx_powermail_domain_model_fields', 'size' => 1, 'maxitems' => 1, 'multiple' => 0)), 'mail' => array('exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_answers.mail', 'config' => array('type' => 'group', 'internal_type' => 'db', 'allowed' => 'tx_powermail_domain_model_mails', 'size' => 1, 'maxitems' => 1, 'multiple' => 0))));
return $answersTca;
 /**
  * Get developmentcontext email
  *
  * @return  false|string
  */
 public function render()
 {
     return ConfigurationUtility::getDevelopmentContextEmail();
 }
コード例 #21
0
 /**
  * Get array with related fields to a form
  *
  * @param int $uid
  * @return array
  */
 protected function getFieldsFromForm($uid)
 {
     if (ConfigurationUtility::isReplaceIrreWithElementBrowserActive()) {
         return $this->getFieldsFromFormAlternative($uid);
     }
     $result = array();
     $select = 'f.title';
     $from = 'tx_powermail_domain_model_forms fo ' . 'LEFT JOIN tx_powermail_domain_model_pages p ON p.forms = fo.uid ' . 'LEFT JOIN tx_powermail_domain_model_fields f ON f.pages = p.uid';
     $where = 'fo.uid = ' . (int) $uid . ' and p.deleted = 0 and f.deleted = 0';
     $groupBy = '';
     $orderBy = '';
     $limit = 1000;
     $res = $this->databaseConnection->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $limit);
     if ($res) {
         while ($row = $this->databaseConnection->sql_fetch_assoc($res)) {
             $result[] = $row['title'];
         }
     }
     return $result;
 }
コード例 #22
0
<?php

use In2code\Powermail\Utility\ConfigurationUtility;
$pagesTca = ['ctrl' => ['title' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:tx_powermail_domain_model_pages', 'label' => 'title', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', 'dividers2tabs' => true, 'versioningWS' => 2, 'versioning_followPages' => true, 'origUid' => 't3_origuid', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', 'transOrigDiffSourceField' => 'l10n_diffsource', 'sortby' => 'sorting', 'default_sortby' => 'ORDER BY sorting', 'delete' => 'deleted', 'enablecolumns' => ['disabled' => 'hidden', 'starttime' => 'starttime', 'endtime' => 'endtime'], 'iconfile' => ConfigurationUtility::getIconPath('tx_powermail_domain_model_pages.gif')], 'interface' => ['showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, css, fields'], 'types' => ['1' => ['showitem' => 'title, fields, --div--;LLL:EXT:powermail/Resources/Private/Language/' . 'locallang_db.xlf:tx_powermail_domain_model_fields.sheet1, css, --div--;LLL:EXT:' . 'powermail/Resources/Private/Language/locallang_db.xlf:tabs.access, forms, ' . 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, starttime, endtime']], 'columns' => ['sys_language_uid' => ['exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.language', 'config' => ['type' => 'select', 'renderType' => 'selectSingle', 'foreign_table' => 'sys_language', 'foreign_table_where' => 'ORDER BY sys_language.title', 'default' => 0, 'items' => [['LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1], ['LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0]]]], 'l10n_parent' => ['displayCond' => 'FIELD:sys_language_uid:>:0', 'exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent', 'config' => ['type' => 'select', 'renderType' => 'selectSingle', 'items' => [['', 0]], 'foreign_table' => 'tx_powermail_domain_model_pages', 'foreign_table_where' => 'AND tx_powermail_domain_model_pages.pid=###CURRENT_PID### AND ' . 'tx_powermail_domain_model_pages.sys_language_uid IN (-1,0)']], 'l10n_diffsource' => ['config' => ['type' => 'passthrough']], 't3ver_label' => ['label' => 'LLL:EXT:lang/locallang_general.xml:LGL.versionLabel', 'config' => ['type' => 'input', 'size' => 30, 'max' => 255]], 'hidden' => ['l10n_mode' => 'exclude', 'exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden', 'config' => ['type' => 'check']], 'starttime' => ['l10n_mode' => 'exclude', 'exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.starttime', 'config' => ['type' => 'input', 'size' => 13, 'max' => 20, 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => ['lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))]]], 'endtime' => ['l10n_mode' => 'exclude', 'exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.endtime', 'config' => ['type' => 'input', 'size' => 13, 'max' => 20, 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => ['lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))]]], 'title' => ['exclude' => 0, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_pages.title', 'config' => ['type' => 'input', 'size' => 30, 'eval' => 'trim,required']], 'css' => ['l10n_mode' => 'exclude', 'exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_pages.css', 'config' => ['type' => 'select', 'renderType' => 'selectSingle', 'items' => [['LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:pleaseChoose', ''], ['LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_pages.css.1', 'layout1'], ['LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_pages.css.2', 'layout2'], ['LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_pages.css.3', 'layout3'], ['LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_pages.css.4', 'nolabel']], 'size' => 1, 'maxitems' => 1, 'eval' => '']], 'fields' => ['exclude' => 0, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_pages.fields', 'config' => ['type' => 'inline', 'foreign_table' => 'tx_powermail_domain_model_fields', 'foreign_field' => 'pages', 'foreign_sortby' => 'sorting', 'maxitems' => 1000, 'appearance' => ['collapseAll' => 1, 'expandSingle' => 1, 'useSortable' => 1, 'newRecordLinkAddTitle' => 1, 'levelLinksPosition' => 'top', 'showSynchronizationLink' => 0, 'showAllLocalizationLink' => 1, 'showPossibleLocalizationRecords' => 1, 'showRemovedLocalizationRecords' => 1], 'behaviour' => ['localizeChildrenAtParentLocalization' => 1, 'localizationMode' => 'select']]], 'forms' => ['exclude' => 1, 'label' => 'LLL:EXT:powermail/Resources/Private/Language/locallang_db.xlf:' . 'tx_powermail_domain_model_pages.forms', 'config' => ['type' => 'select', 'renderType' => 'selectSingle', 'items' => [['', 0]], 'foreign_table' => 'tx_powermail_domain_model_forms', 'foreign_table_where' => 'AND tx_powermail_domain_model_forms.pid=###CURRENT_PID### ' . 'AND tx_powermail_domain_model_forms.sys_language_uid IN (-1,###REC_FIELD_sys_language_uid###)']], 'sorting' => ['label' => 'Sorting', 'config' => ['type' => 'none']]]];
/**
 * Switch from l10n_mode "exclude" to "mergeIfNotBlank"
 */
if (ConfigurationUtility::isL10nModeMergeActive()) {
    $pagesTca['columns']['css']['l10n_mode'] = 'mergeIfNotBlank';
}
return $pagesTca;
コード例 #23
0
<?php

if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}
/**
 * Enable caching for show action in form controller
 */
$uncachedFormActions = 'form';
if (\In2code\Powermail\Utility\ConfigurationUtility::isEnableCachingActive()) {
    $uncachedFormActions = '';
}
$uncachedFormActions .= ', create, confirmation, optinConfirm, marketing';
/**
 * Include Frontend Plugins for Powermail
 */
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin('In2code.' . $_EXTKEY, 'Pi1', array('Form' => 'form, create, confirmation, optinConfirm, marketing'), array('Form' => $uncachedFormActions));
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin('In2code.' . $_EXTKEY, 'Pi2', array('Output' => 'list, show, edit, update, export, rss, delete'), array('Output' => 'list, edit, update, export, rss, delete'));
/**
 * Hook to show PluginInfo
 */
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info'][$_EXTKEY . '_pi1'][$_EXTKEY] = 'EXT:' . $_EXTKEY . '/Classes/Utility/Hook/PluginInformation.php:' . 'In2code\\Powermail\\Utility\\Hook\\PluginInformation->build';
/**
 * Hook for first fill of marker field in backend
 */
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = 'EXT:' . $_EXTKEY . '/Classes/Utility/Hook/CreateMarker.php:In2code\\Powermail\\Utility\\Hook\\CreateMarker';
/**
 * JavaScript evaluation of TCA fields
 */
$TYPO3_CONF_VARS['SC_OPTIONS']['tce']['formevals']['\\In2code\\Powermail\\Utility\\Tca\\EvaluateEmail'] = 'EXT:powermail/Classes/Utility/Tca/EvaluateEmail.php';
/**
 /**
  * Check if IP information should be shown
  *
  * @return bool
  */
 public function render()
 {
     return !ConfigurationUtility::isDisableIpLogActive();
 }