* locallang file in xml-format
authorivankartolo <ivankartolo@735d13b6-9817-0410-8766-e36946ffe9aa>
Mon, 21 Feb 2011 23:53:42 +0000 (23:53 +0000)
committerivankartolo <ivankartolo@735d13b6-9817-0410-8766-e36946ffe9aa>
Mon, 21 Feb 2011 23:53:42 +0000 (23:53 +0000)
* optimizing localized gender: localized gender can be overwrite per TS

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/direct_mail_subscription/trunk@43989 735d13b6-9817-0410-8766-e36946ffe9aa

ChangeLog
ext_typoscript_setup.txt
locallang_db.xml
pi/class.dmailsubscribe.php
pi/fe_admin_dmailsubscrip.tmpl
pi/locallang.php [deleted file]
pi/locallang.xml [new file with mode: 0644]

index c16fca7..54f68cb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-02-22 Ivan Kartolo <ivan.kartolo@dkd.de>
+       * locallang file in xml-format
+       * optimizing localized gender: localized gender can be overwrite per TS
+
 2011-02-18 Ivan Kartolo <ivan.kartolo@dkd.de>
        * code clean up captcha and html template
        
index 286f56e..edec145 100644 (file)
@@ -51,8 +51,8 @@ plugin.feadmin.dmailsubscription {
        // Edit setup
        edit = 1
        edit {
-               fields = name, email, module_sys_dmail_category, module_sys_dmail_html
-               required = name, email
+               fields = gender, name, email, module_sys_dmail_category, module_sys_dmail_html
+               required = gender, name, email
                evalValues.email = uniqueLocal, email
                userFunc_afterSave = user_dmailsubscribe->saveRecord            
        }
@@ -62,8 +62,8 @@ plugin.feadmin.dmailsubscription {
        create {
                userFunc_afterSave = user_dmailsubscribe->saveRecord
                preview = 0
-               fields = name, hidden, email, module_sys_dmail_category, module_sys_dmail_html, captcha
-               required = name, email, captcha
+               fields = gender, name, hidden, email, module_sys_dmail_category, module_sys_dmail_html, captcha
+               required = gender, name, email, captcha
                noSpecialLoginForm = 1
                # Initially hide the user until he approves!
                overrideValues.hidden = 1
index 191986c..43a829b 100644 (file)
@@ -2,7 +2,7 @@
 <T3locallang>\r
        <meta type="array">\r
                <type>database</type>\r
-               <description>Language labels for database tables/fields belonging to extension 'dkd_confextended'</description>\r
+               <description>Language labels for database tables/fields belonging to extension 'direct_mail_subscription'</description>\r
        </meta>\r
        <data type="array">\r
                <languageKey index="default" type="array">\r
index a029d90..99187b4 100644 (file)
@@ -16,18 +16,18 @@ class user_dmailsubscribe {
         */
        function user_dmailsubscribe()  {
                $this->cObj = t3lib_div::makeInstance('tslib_cObj');
-               
+               $this->conf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['feadmin.']['dmailsubscription.'];
                /** 
                 * IK 27.04.09 
                 * include Locallang 
                 */ 
-               if ($GLOBALS['TSFE']->config['config']['language'])     
+               if ($GLOBALS['TSFE']->config['config']['language']) { 
                        $this->LLkey = $GLOBALS['TSFE']->config['config']['language']; 
                        if ($GLOBALS['TSFE']->config['config']['language_alt']) { 
                                $this->altLLkey = $GLOBALS['TSFE']->config['config']['language_alt']; 
                        } 
                } 
-               $this->pi_loadLL(); 
+               $this->pi_loadLL();
        }
 
        /**
@@ -97,7 +97,13 @@ class user_dmailsubscribe {
                         * localized title in own field 
                         */ 
                        if (t3lib_div::inList('m,f', $conf['rec']['gender'])) { 
-                               $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tt_address','uid='.intval($conf['rec']['uid']),array('tx_directmailsubscription_localgender'=>$this->pi_getLL('tt_address.gender.'.$conf['rec']['gender'])));
+                               $GLOBALS['TYPO3_DB']->exec_UPDATEquery(
+                                       'tt_address',
+                                       'uid='.intval($conf['rec']['uid']),
+                                       array(
+                                               'tx_directmailsubscription_localgender' => $this->pi_getLL('tt_addressGender'.strtoupper($conf['rec']['gender']))
+                                       )
+                               );
                        } 
                }
                return;
@@ -143,7 +149,7 @@ class user_dmailsubscribe {
         */
        function pi_loadLL()    {
                if (!$this->LOCAL_LANG_loaded)  {
-                       $basePath = t3lib_extMgm::extPath('direct_mail_subscription').'pi/locallang.php';
+                       $basePath = t3lib_extMgm::extPath('direct_mail_subscription').'pi/locallang.xml';
 
                                // php or xml as source: In any case the charset will be that of the system language.
                                // However, this function guarantees only return output for default language plus the specified language (which is different from how 3.7.0 dealt with it)
index 54913c0..bad63ea 100644 (file)
 <br />
 ###GW2B###
 
-
-<b>Your name:</b><br />
+<b><label for="fe_ttaddress_gender_input" id="label-fe_ttaddress_gender">Title</label></b><br />
+<!--###SUB_REQUIRED_FIELD_gender### begin
+       This is shown only if the form is submitted and the field is configured to be "required" and at the same time not filled in.
+       The syntax is of the comment 'name' is:         SUB_REQUIRED_FIELD_[enter-the-field-name-here]
+-->
+       <font color=red><strong>You must fill in this field!</strong></font><br />
+<!--###SUB_REQUIRED_FIELD_gender### end -->
+       <div>
+               <select name="FE[tt_address][gender]">
+                       <option value="m">Mr.</option>
+                       <option value="f">Mrs.</option>
+               </select>
+       </div>
+
+<b><label for="fe_ttaddress_name_input">Your name:</label></b><br />
 <!--###SUB_REQUIRED_FIELD_name### begin
        This is shown only if the form is submitted and the field is configured to be "required" and at the same time not filled in.
        The syntax is of the comment 'name' is:         SUB_REQUIRED_FIELD_[enter-the-field-name-here]
 -->
        <font color=red><strong>You must fill in this field!</strong></font><br />
 <!--###SUB_REQUIRED_FIELD_name### end -->
-<input type="text" name="FE[tt_address][name]" />
+<input type="text" name="FE[tt_address][name]" id="fe_ttaddress_name_input" />
 <br />
 
 
 
 <br />
-<b>Email:</b><br />
+<b><label for="fe_ttaddress_email_input">Email:</label></b><br />
 <!--###SUB_REQUIRED_FIELD_email### begin
        Same as above...
        EVAL_ERROR_FIELD_email is in addition an error message defined in TypoScript in case an email address does not verify to be of correct syntax.
        <font color=red><strong>You must fill in this field!</strong></font><br />
        ###EVAL_ERROR_FIELD_email###<br />
 <!--###SUB_REQUIRED_FIELD_email### end-->
-<input type="text" name="FE[tt_address][email]" />
+<input type="text" name="FE[tt_address][email]" id="fe_ttaddress_email_input" />
 <br />
 
 ###CE_CATLIST###
 
 <br />
-<b>HTML emails?</b><br />
-<input type="checkbox" name="FE[tt_address][module_sys_dmail_html]" value=1 />
+<b><label for="fe_ttaddress_html_input">HTML emails?</label></b><br />
+<input type="checkbox" name="FE[tt_address][module_sys_dmail_html]" value=1 id="fe_ttaddress_html_input" />
 <br />
 ###CAPTCHA###
 <br />
@@ -186,7 +199,19 @@ You're now subscribed to our newsletter. An email has been sent to your email ad
 <br />
 <!-- ###SUB_REQUIRED_FIELDS_WARNING### end -->
 
-
+<b><label for="fe_ttaddress_gender_input" id="label-fe_ttaddress_gender">Title</label></b><br />
+<!--###SUB_REQUIRED_FIELD_gender### begin
+       This is shown only if the form is submitted and the field is configured to be "required" and at the same time not filled in.
+       The syntax is of the comment 'name' is:         SUB_REQUIRED_FIELD_[enter-the-field-name-here]
+-->
+       <font color=red><strong>You must fill in this field!</strong></font><br />
+<!--###SUB_REQUIRED_FIELD_gender### end -->
+       <div>
+               <select name="FE[tt_address][gender]">
+                       <option value="m">Mr.</option>
+                       <option value="f">Mrs.</option>
+               </select>
+       </div>
 
 
 <b>Your name:</b><br />
diff --git a/pi/locallang.php b/pi/locallang.php
deleted file mode 100644 (file)
index 2555173..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php\r
-$LOCAL_LANG = Array (\r
-       "default" => Array (\r
-               "tt_address.gender.m" => "Herr",\r
-               "tt_address.gender.f" => "Frau",\r
-       ),\r
-       "de" => Array (\r
-               "tt_address.gender.m" => "Herr",\r
-               "tt_address.gender.f" => "Frau",\r
-       )\r
-);\r
-?>\r
diff --git a/pi/locallang.xml b/pi/locallang.xml
new file mode 100644 (file)
index 0000000..48adc5b
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3locallang>
+       <meta type="array">
+               <type></type>
+               <description>Language labels for extension 'direct_mail_subscription'</description>
+       </meta>
+       <data type="array">
+               <languageKey index="default" type="array">
+                       <label index="tt_addressGenderM">Mr.</label>
+                       <label index="tt_addressGenderF">Mrs.</label>
+               </languageKey>
+               <languageKey index="de" type="array">
+                       <label index="tt_addressGenderM">Herr</label>
+                       <label index="tt_addressGenderF">Frau</label>
+               </languageKey>
+       </data>
+</T3locallang>