initial import
authordanp <danp@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 3 Jul 2008 09:35:00 +0000 (09:35 +0000)
committerdanp <danp@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 3 Jul 2008 09:35:00 +0000 (09:35 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/languagevisibility/trunk@10352 735d13b6-9817-0410-8766-e36946ffe9aa

51 files changed:
ChangeLog [new file with mode: 0644]
README.txt [new file with mode: 0644]
class.tx_languagevisibility_behooks.php [new file with mode: 0644]
class.tx_languagevisibility_beservices.php [new file with mode: 0644]
class.tx_languagevisibility_feservices.php [new file with mode: 0644]
class.tx_languagevisibility_fieldvisibility.php [new file with mode: 0644]
classes/class.tx_languagevisibility_celement.php [new file with mode: 0644]
classes/class.tx_languagevisibility_element.php [new file with mode: 0644]
classes/class.tx_languagevisibility_elementFactory.php [new file with mode: 0644]
classes/class.tx_languagevisibility_fceelement.php [new file with mode: 0644]
classes/class.tx_languagevisibility_fceoverlayelement.php [new file with mode: 0644]
classes/class.tx_languagevisibility_language.php [new file with mode: 0644]
classes/class.tx_languagevisibility_languagerepository.php [new file with mode: 0644]
classes/class.tx_languagevisibility_pageelement.php [new file with mode: 0644]
classes/class.tx_languagevisibility_recordelement.php [new file with mode: 0644]
classes/class.tx_languagevisibility_visibilityService.php [new file with mode: 0644]
classes/dao/class.tx_languagevisibility_daocommon.php [new file with mode: 0644]
classes/dao/class.tx_languagevisibility_daocommon_stub.php [new file with mode: 0644]
doc/wizard_form.dat [new file with mode: 0644]
doc/wizard_form.html [new file with mode: 0644]
ext_conf_template.txt [new file with mode: 0644]
ext_emconf.php [new file with mode: 0644]
ext_icon.gif [new file with mode: 0644]
ext_localconf.php [new file with mode: 0644]
ext_tables.php [new file with mode: 0644]
ext_tables.sql [new file with mode: 0644]
locallang_db.xml [new file with mode: 0644]
modfunc1/class.tx_languagevisibility_modfunc1.php [new file with mode: 0644]
modfunc1/locallang.xml [new file with mode: 0644]
patch/class.ux_SCalt_doc.php [new file with mode: 0644]
patch/class.ux_t3lib_beuserauth.php [new file with mode: 0644]
patch/class.ux_t3lib_page.php [new file with mode: 0644]
patch/class.ux_t3lib_tcemain.php [new file with mode: 0644]
patch/class.ux_tslib_fe.php [new file with mode: 0644]
patch/class.ux_tslib_menu.php [new file with mode: 0644]
patch/class.ux_ux_tslib_menu.php [new file with mode: 0644]
patch/tv/class.ux_tx_templavoila_api.php [new file with mode: 0644]
patch/tv/class.ux_tx_templavoila_module1.php [new file with mode: 0644]
patch/tv/class.ux_tx_templavoila_pi1.php [new file with mode: 0644]
res/nok.gif [new file with mode: 0644]
res/ok.gif [new file with mode: 0644]
tests/fixtures/fce_2col_datastructure.xml [new file with mode: 0644]
tests/fixtures/fce_2col_templateobject.dat [new file with mode: 0644]
tests/fixtures/fce_buttonelement_contentxml.xml [new file with mode: 0644]
tests/fixtures/fce_buttonelement_datastructure.xml [new file with mode: 0644]
tests/fixtures/fce_buttonelement_datastructure_useOverlay.xml [new file with mode: 0644]
tests/tx_elementFactory_testcase.php [new file with mode: 0644]
tests/tx_element_testcase.php [new file with mode: 0644]
tests/tx_language_testcase.php [new file with mode: 0644]
tests/tx_languagerepository_testcase.php [new file with mode: 0644]
tests/tx_visibilityService_testcase.php [new file with mode: 0644]

diff --git a/ChangeLog b/ChangeLog
new file mode 100644 (file)
index 0000000..d8f326f
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,6 @@
+13.03.2008
+       * modify templavoila pi1 patch: override visualId to not show the preview at all. New typoscript option "showVisualId"
+
+07-12-12   <>
+
+       * Initial release
diff --git a/README.txt b/README.txt
new file mode 100644 (file)
index 0000000..54b3726
--- /dev/null
@@ -0,0 +1,18 @@
+
+Add new translationMode for FCEs:
+       <langDatabaseOverlay>1</langDatabaseOverlay>:
+       
+       XML fields are merged with default record xml row if:
+       <TCEforms type="array">
+                       <l10n_mode>mergeIfNotBlank</l10n_mode>
+       <TCEforms type="array">
+                       <l10n_mode>exclude</l10n_mode>
+       (use this for container fields for example)
+       
+       
+       
+Performance:
+* add index to sys_language_uid  and l18n_parent 
+       
+       
+       
\ No newline at end of file
diff --git a/class.tx_languagevisibility_behooks.php b/class.tx_languagevisibility_behooks.php
new file mode 100644 (file)
index 0000000..44b38ed
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*  
+*  (c) 2007 Daniel P?tzinger (poetzinger@aoemedia.de)
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is 
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+* 
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+* 
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+/** 
+ * Class/Function which manipulates the item-array for the  listing (see piFlexform).
+ *
+ * @author     Daniel P?tzinger <poetzinger@aoemedia.de>
+ */
+
+/**
+ * SELECT box processing
+ * 
+ */
+class tx_languagevisibility_behooks {
+
+       
+       
+       /*
+       * store:
+       * 
+       */
+       function processDatamap_preProcessFieldArray(&$incomingFieldArray, $table, $id, &$reference) {
+                       $data=$incomingFieldArray;
+                       
+                       
+                       
+                       if(!is_array($data)) return; /* some strange DB situation */
+                       
+               /*      if ($id=="NEW")
+                                               return;                 
+                       */                                              
+                       switch ($table) {
+                               case 'pages': case 'tt_content': case 'tt_news':
+                                       if (isset($incomingFieldArray['tx_languagevisibility_visibility'])) {                                           
+                                               $incomingFieldArray['tx_languagevisibility_visibility']=serialize($incomingFieldArray['tx_languagevisibility_visibility']);
+                                       }
+                                       else {
+                                               //force visibility setting according to permissions                                             
+                                               if ($id=="NEW") {
+                                                       require_once(t3lib_extMgm::extPath("languagevisibility").'class.tx_languagevisibility_beservices.php');
+                                                       //print_r(tx_languagevisibility_beservices::getDefaultVisibilityArray());
+                                                       $incomingFieldArray['tx_languagevisibility_visibility']=serialize(tx_languagevisibility_beservices::getDefaultVisibilityArray());
+                                               }               
+                                               else {
+                                                       //die($id);
+                                               }                               
+                                       }
+                               break;
+                               default:
+                                       return;
+                               break;
+                       }
+                       
+                       
+                       
+               }
+       
+       /*
+       //      function processDatamap_postProcessFieldArray ($status, $table, $id, $fieldArray, &$reference) {
+       */
+}
+
+
+
+?>
diff --git a/class.tx_languagevisibility_beservices.php b/class.tx_languagevisibility_beservices.php
new file mode 100644 (file)
index 0000000..f77486b
--- /dev/null
@@ -0,0 +1,192 @@
+<?php
+
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_languagerepository.php');
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_elementFactory.php');
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_visibilityService.php');
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/dao/class.tx_languagevisibility_daocommon.php');
+
+
+class tx_languagevisibility_beservices {
+       
+       
+       function getVisibleFlagsForElement($uid,$table) {
+               $dao=t3lib_div::makeInstance('tx_languagevisibility_daocommon');
+               $elementfactoryName= t3lib_div::makeInstanceClassName('tx_languagevisibility_elementFactory');          
+               $elementfactory=new $elementfactoryName($dao);
+               try {
+                       $element=$elementfactory->getElementForTable($table,$uid);              
+         }
+         catch (Exception $e) {
+               return '-';
+         }             
+            
+    $languageRep=t3lib_div::makeInstance('tx_languagevisibility_languagerepository');  
+    $languageList=$languageRep->getLanguages();
+    
+    $visibility=t3lib_div::makeInstance('tx_languagevisibility_visibilityService');     
+               
+               $desc=$element->getInformativeDescription();
+               $visibleFlags=array();
+               foreach ($languageList as $language) {   
+                       if ($visibility->isVisible($language,$element)) {
+                               $visibleFlags[]=$language->getFlagImg($this->pageId);
+                       }                       
+               }
+               
+               return implode('',$visibleFlags);
+               
+               
+       }
+       
+       function isVisible($uid,$table,$languageUid) {
+               $rep=t3lib_div::makeInstance('tx_languagevisibility_languagerepository');
+               $language=$rep->getLanguageById($languageUid);
+               
+               $dao=t3lib_div::makeInstance('tx_languagevisibility_daocommon');
+               $elementfactoryName= t3lib_div::makeInstanceClassName('tx_languagevisibility_elementFactory');          
+               $elementfactory=new $elementfactoryName($dao);          
+               try {
+                       $element=$elementfactory->getElementForTable($table,$uid);      
+         }
+         catch (Exception $e) {
+               return false;
+         }             
+    
+      
+    $visibility=t3lib_div::makeInstance('tx_languagevisibility_visibilityService');     
+                       
+               return $visibility->isVisible($language,$element);              
+               
+       }
+       
+       /**
+       * checks if the current BE_USER has access to the page record:
+       *  that is the case if:
+       *                       a) new page created -> always because then the languagevisibility is set to never for all languages where the user has no access
+       *                       b) edit page record: only if the record is only visible in languages where the user has access to
+       *                       b.1) also if the languages taht are visibile and falls back to allowed languages
+       *                       c) delete: same as for edit (only if user has access to all visible languages)
+       **/
+       function hasUserAccessToPageRecord($id,$cmd='edit') {
+               
+               global $BE_USER;
+               if ($cmd=='new') {
+                       return true;
+               }
+               if (!is_numeric($id)) {
+                       return false;
+               }
+               $rep=t3lib_div::makeInstance('tx_languagevisibility_languagerepository');
+               $languages=$rep->getLanguages();
+               foreach ($languages as $language) {
+                       //echo 'check '.$language->getUid();
+                       if ($this->isVisible($id,'pages',$language->getUid())) {
+                               if (!$BE_USER->checkLanguageAccess($language->getUid())) {
+                                       //no access to a visible language: check fallbacks
+                                       $isInFallback=FALSE;
+                                       $fallbacks=$language->getFallbackOrder();
+                                       foreach ($fallbacks as $lId) {
+                                               if ($GLOBALS['BE_USER']->checkLanguageAccess($lId)) {
+                                                       $isInFallback=TRUE;
+                                                       continue;
+                                               }
+                                       }
+                                       if (!$isInFallback)
+                                               return false;
+                               }
+                       }
+               }
+               return true;            
+       }
+       
+       /**
+       * checks if the current BE_USER has access to a record:
+       *  that is the case if:
+       *                       a) new page created -> always because then the languagevisibility is set to never for all languages where the user has no access
+       *                       b) edit page record: only if the record is only visible in languages where the user has access to
+       **/
+       function hasUserAccessToEditRecord($table,$id) {
+               global $BE_USER;
+               
+               if (!is_numeric($id)) {
+                       return false;
+               }
+               $rep=t3lib_div::makeInstance('tx_languagevisibility_languagerepository');
+               $languages=$rep->getLanguages();
+               foreach ($languages as $language) {
+                       if (tx_languagevisibility_beservices::isVisible($id,$table,$language->getUid())) {
+                                       if (!$BE_USER->checkLanguageAccess($language->getUid())) {
+                                               //no access to a visible language: check fallbacks
+                                               $isInFallback=FALSE;
+                                               $fallbacks=$language->getFallbackOrder();
+                                               foreach ($fallbacks as $lId) {
+                                                       if ($GLOBALS['BE_USER']->checkLanguageAccess($lId)) {
+                                                               $isInFallback=TRUE;
+                                                               continue;
+                                                       }
+                                               }
+                                               if (!$isInFallback)
+                                                       return false;                                           
+                                       }                               
+                       }                       
+               }
+               return true;            
+       }
+       
+       function getAvailableOptionsForLanguage($language) {
+               $uid=$language->getUid();               
+               $select=array();                
+               if ($uid==0) {
+                       $select['-']='-';
+                       $select['yes']='yes';   
+                       $select['no']='no';     
+               }
+               else {
+                       $select['-']='-';       
+                       $select['yes']='yes';   
+                       $select['no']='no';
+                       $select['t']='t';
+                       $select['f']='f';
+                       
+               }
+               if (is_object($GLOBALS['LANG'])) {
+                       //get value from locallang:
+                       foreach ($select as $k=>$v) {
+                                       $select[$k]=$GLOBALS['LANG']->sl('LLL:EXT:languagevisibility/locallang_db.xml:tx_languagevisibility_visibility.I.'.$v);
+                       }
+               }
+               //check permissions, if user has no permission only no for the language is allowed
+               // if the user has permissions for languages that act as fallbacklanguage: then the languages that falls back can have "-" in the options!
+               if (!$GLOBALS['BE_USER']->checkLanguageAccess($uid)) {
+                       //check if the language falls back to one of the languages the user has permissions:
+                       $isInFallback=FALSE;
+                       $fallbacks=$language->getFallbackOrder();
+                       foreach ($fallbacks as $lId) {
+                               if ($GLOBALS['BE_USER']->checkLanguageAccess($lId)) {
+                                       $isInFallback=TRUE;
+                                       continue;
+                               }
+                       }
+                       $select=array();
+                       if ($isInFallback) {
+                               $select['-']='-';
+                       }
+                       $select['no']='no';
+               }
+               return $select;         
+       }
+       
+       function getDefaultVisibilityArray() {
+               $languageRep=t3lib_div::makeInstance('tx_languagevisibility_languagerepository');       
+    $languageList=$languageRep->getLanguages();
+    $default=array();
+    foreach ($languageList as $language) {     
+       $options=tx_languagevisibility_beservices::getAvailableOptionsForLanguage($language);           
+       $default[$language->getUid()]=array_shift($options);    
+    }
+    return $default;
+   }
+       
+}
+
+?>
\ No newline at end of file
diff --git a/class.tx_languagevisibility_feservices.php b/class.tx_languagevisibility_feservices.php
new file mode 100644 (file)
index 0000000..2859859
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_languagerepository.php');
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_elementFactory.php');
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_visibilityService.php');
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/dao/class.tx_languagevisibility_daocommon.php');
+
+
+/**
+* exceptions are not handled here.
+* This class just provides simple services and uses the domainmodel in classes directory!
+*
+* Methods can be used uninstanciated
+**/
+class tx_languagevisibility_feservices {
+       
+       
+       function checkVisiblityForElement($uid,$table,$lUid) {
+               $dao=t3lib_div::makeInstance('tx_languagevisibility_daocommon');
+               $elementfactoryName= t3lib_div::makeInstanceClassName('tx_languagevisibility_elementFactory');          
+               $elementfactory=new $elementfactoryName($dao);          
+    $element=$elementfactory->getElementForTable($table,$uid);        
+    $languageRep=t3lib_div::makeInstance('tx_languagevisibility_languagerepository');  
+    $language=$languageRep->getLanguageById($lUid);
+   
+    $visibility=t3lib_div::makeInstance('tx_languagevisibility_visibilityService');     
+               
+               return $visibility->isVisible($language,$element);                              
+       }
+       function getElement($uid,$table) {
+               $dao=t3lib_div::makeInstance('tx_languagevisibility_daocommon');
+               $elementfactoryName= t3lib_div::makeInstanceClassName('tx_languagevisibility_elementFactory');          
+               $elementfactory=new $elementfactoryName($dao);          
+    $element=$elementfactory->getElementForTable($table,$uid);        
+    return $element;
+       }
+       function getOverlayLanguageIdForElement($element,$lUid) {               
+    $languageRep=t3lib_div::makeInstance('tx_languagevisibility_languagerepository');  
+    $language=$languageRep->getLanguageById($lUid);
+   
+    $visibility=t3lib_div::makeInstance('tx_languagevisibility_visibilityService');     
+               return $visibility->getOverlayLanguageIdForLanguageAndElement($language,$element);
+               
+       }
+       
+       function getOverlayLanguageIdForElementRecord($uid,$table,$lUid) {
+               $dao=t3lib_div::makeInstance('tx_languagevisibility_daocommon');
+               $elementfactoryName= t3lib_div::makeInstanceClassName('tx_languagevisibility_elementFactory');          
+               $elementfactory=new $elementfactoryName($dao);          
+    $element=$elementfactory->getElementForTable($table,$uid);        
+    $languageRep=t3lib_div::makeInstance('tx_languagevisibility_languagerepository');  
+    $language=$languageRep->getLanguageById($lUid);
+   
+    $visibility=t3lib_div::makeInstance('tx_languagevisibility_visibilityService');     
+               return $visibility->getOverlayLanguageIdForLanguageAndElement($language,$element);
+               
+       }
+       
+       
+}
+
+?>
\ No newline at end of file
diff --git a/class.tx_languagevisibility_fieldvisibility.php b/class.tx_languagevisibility_fieldvisibility.php
new file mode 100644 (file)
index 0000000..620428f
--- /dev/null
@@ -0,0 +1,253 @@
+<?php
+
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_languagerepository.php');
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_elementFactory.php');
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_visibilityService.php');
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/dao/class.tx_languagevisibility_daocommon.php');
+require_once(t3lib_extMgm::extPath("languagevisibility").'class.tx_languagevisibility_beservices.php');
+
+class user_tx_languagevisibility_fieldvisibility {
+       
+       function init() {
+               $this->calcPerms = $GLOBALS['BE_USER']->calcPerms($pageInfoArr);
+       }
+       
+       public function user_fieldvisibility($PA, $fobj)    {
+               
+       
+               $this->init();
+               
+               $this->pageId=$PA['row']['pid'];
+               
+               $value=$PA['row'][$PA['field']];
+               if ($PA['row']['l18n_parent'] !=0) {
+                       return 'this is an overlayelement: Visibility is controled in the default language!';
+               }
+               
+               $visivilitySetting=@unserialize($value);
+               //print_r($visivilitySetting);
+               if (!is_array($visivilitySetting) && $value!='') {
+                       $content.='Visibility Settings seems to be corrupt:'.$value;
+               }
+               
+               //print_r($PA);
+               $dao=t3lib_div::makeInstance('tx_languagevisibility_daocommon');
+               $elementfactoryName= t3lib_div::makeInstanceClassName('tx_languagevisibility_elementFactory');          
+               $elementfactory=new $elementfactoryName($dao);
+               $uid=$PA['row']['uid'];
+               try {
+                       $element=$elementfactory->getElementForTable($PA['table'],$uid);                
+         }
+         catch (Exception $e) {
+               return 'sorry this element supports no visibility settings';
+         }
+       
+    
+
+    $content.=$element->getInformativeDescription();
+    
+    $languageRep=t3lib_div::makeInstance('tx_languagevisibility_languagerepository');  
+    $languageList=$languageRep->getLanguages();
+    
+    $visibility=t3lib_div::makeInstance('tx_languagevisibility_visibilityService');        
+    $infosStruct=array();
+    foreach ($languageList as $language) {     
+       
+               $infoitem=array('visible'=>$visibility->isVisible($language,$element),
+                                                                       'languageTitle'=>$language->getTitle($this->pageId),
+                                                                       'languageFlag'=>$language->getFlagImg($this->pageId),                                                                   
+                                                                       'hasTranslation'=>$element->hasTranslation($language->getUid()),
+                                                                       'isVisible'=>$visibility->isVisible($language,$element)
+                                                                       );
+               //if there is no access to language - and localsettings exist, then do not show select box
+               //this is to not be able as an translator to override languagesetting
+               $currentSetting=$element->getLocalVisibilitySetting($language->getUid());
+               $currentOptionsForUserAndLanguage=tx_languagevisibility_beservices::getAvailableOptionsForLanguage($language);
+               if ($currentSetting=='' || isset($currentOptionsForUserAndLanguage[$currentSetting])) {
+               //if ($currentSetting=='' || $GLOBALS['BE_USER']->checkLanguageAccess($language->getUid())) {
+                       $infoitem['options']=$this->_getSelectBox($language->getUid(),
+                                                                                                                                                                                               $this->_getSelectOptionsForLanguage($language),
+                                                                                                                                                                                               $element->getLocalVisibilitySetting($language->getUid()),
+                                                                                                                                                                                               $PA['itemFormElName']);
+               }
+               else {                  
+                       $infoitem['options']='<input type="hidden" name="'.$PA['itemFormElName'].'['.$language->getUid().']" value="'.$currentSetting.'" ></input>('.$currentSetting.')';                       
+               }
+               
+               $infosStruct[]=$infoitem;           
+    }
+       $content.=$this->_renderLanguageInfos($infosStruct);
+    
+               /*
+               $content.=$PA['row']['table'];
+               $content.='<hr>';
+               $content.=$PA['itemFormElValue'];
+               $content.='<hr>';
+               $content.=$value;
+               $content.='<hr>';               
+               */
+               
+               
+               
+               $languagerepository= t3lib_div::makeInstance('tx_languagevisibility_languagerepository');
+               $languagerepository->getLanguages();            
+               
+               //typo3conf/ext/templavoila/mod1/db_new_content_el.php?id=6&parentRecord=pages%3A6%3AsDEF%3AlDEF%3Afield_content%3AvDEF%3A2
+    //$content.= '<input type="hidden" id="sortingorderinput"   name="'.$PA['itemFormElName'].'"    value="'.htmlspecialchars($PA['itemFormElValue']).'" onchange="'.htmlspecialchars(implode('',$PA['fieldChangeFunc'])).'"  '.$PA['onFocus'].'>';
+  
+               return '<div id="fieldvisibility">'.$content.'<a href="#" onclick="resetSelectboxes()">reset</a></div>'.$this->_javascript();
+       }
+       
+       function _getSelectOptionsForLanguage($language) {
+               return tx_languagevisibility_beservices::getAvailableOptionsForLanguage($language);
+       }
+       
+       function _getSelectBox($languageid,$select,$current,$name) {
+               if (count($select)==1)
+                       $addClassName=' oneitem';
+               $content.='<select class="fieldvisibility_selects'.$addClassName.'" name="'.$name.'['.$languageid.']">';
+               foreach ($select as $skey=>$svalue) {
+                       if ($current==$skey) {
+                                       $selected=' selected="selected"';
+                       }
+                       else {
+                               $selected='';
+                       }                               
+                       $content.='<option class="'.$skey.'" value="'.$skey.'"'.$selected.'>'.$svalue.'</option>';
+               }               
+               $content.='</select>';
+               return $content;                
+               
+       }
+
+       function _renderLanguageInfos($infosStruct) {
+               $content='<style type="text/css">
+               .visibilitytable  {margin: 10px 0 0 0}
+               .visibilitytable  .bgColor4 {background-color: #C9B88B}         
+               .visibilitytable  .bgColor {background-color: #FFEED4}  
+               .visibilitytable  .lastcell {background-color: #DEEAB5}
+               .visibilitytable  .bgColor .lastcell {background-color: #E8EAB5}
+               .visibilitytable  .bgColor4 .lastcell {border-bottom: 1px solid #333333; background-color: #C9B88B}             
+               .visibilitytable th {padding: 2px 5px 2px 2px; text-align: left}
+               .visibilitytable select {width: 100px}
+               .visibilitytable select.oneitem {background-color: #999999}
+               .visibilitytable select option {background-color: #83FF73}              
+               .visibilitytable select .yes {background-color: #E0FF81}
+               .visibilitytable select .no {background-color: #FFCE81}
+               .visibilitytable select .t {background-color: #BFFFB7}  
+               .visibilitytable select .f {background-color: #BFFFB7}          
+               .visibilitytable td {padding: 0 5px 2px 2px}
+               </'.'style>';
+               $content.='<table style="border-collapse: collapse;" class="visibilitytable">';
+               $content.='<tr class="bgColor4"><th >'.$this->getLLL('language').'</th><th >'.$this->getLLL('visibility').'</th><th>'.$this->getLLL('hastranslation').'</th><th class="lastcell">'.$this->getLLL('isshown').'</th></tr>';
+               foreach ($infosStruct as $info) {
+                       $i++;
+                       if ($i%2)
+                               $class=' class="bgColor"';
+                       else
+                               $class='';
+                       $content.='<tr'.$class.'><td>'.$info['languageFlag'].$info['languageTitle'].'</td><td>'.$info['options'].'</td><td style="text-align: center">'.$this->_getStatusImage($info['hasTranslation']).'</td><td style="text-align: center"  class="lastcell">'.$this->_getStatusImage($info['isVisible']).'</td></tr>';
+               }
+               $content.='</table>';                   
+               return $content;
+       }
+       
+       function getLLL($key) {
+               return $GLOBALS['LANG']->sl('LLL:EXT:languagevisibility/locallang_db.xml:'.$key);
+       }
+       function _getStatusImage($stat) {
+               if ($stat) {
+                       return '<img src="../typo3conf/ext/languagevisibility/res/ok.gif">';
+               }
+               else {
+                       return '<img src="../typo3conf/ext/languagevisibility/res/nok.gif">';
+               }
+       }
+       function _link_edit($table, $id)        {
+                                               global $BACK_PATH;
+                                                       $params = '&table='.$table.'&edit['.$table.']['.$id.']=edit';
+                                                       //$retUrl = 'returnUrl='.($requestUri==-1?"'+T3_THIS_LOCATION+'":rawurlencode($requestUri?$requestUri:t3lib_div::getIndpEnv('REQUEST_URI')));
+                                                       $url= $BACK_PATH."alt_doc.php?id=".$id.$params;                                         
+                                               return '<a href="'.$url.'" target="blank">[edit]</a>';
+       }
+       
+
+       
+       /*******************************************
+        *
+        * Link functions (protected)
+        *
+        *******************************************/
+
+       /**
+        * Returns an HTML link for editing
+        *
+        * @param       string          $label: The label (or image)
+        * @param       string          $table: The table, fx. 'tt_content'
+        * @param       integer         $uid: The uid of the element to be edited
+        * @param       boolean         $forced: By default the link is not shown if translatorMode is set, but with this boolean it can be forced anyway.
+        * @return      string          HTML anchor tag containing the label and the correct link
+        * @access protected
+        */
+       function link_edit($label, $table, $uid, $forced=FALSE) {
+               if ($label) {
+                       if (($table == 'pages' && ($this->calcPerms & 2) ||
+                               $table != 'pages' && ($this->calcPerms & 16)) ) {
+                                       
+                                               $params = '&edit['.$table.']['.$uid.']=edit';
+                                               $retUrl = 'returnUrl='.($requestUri==-1?"'+T3_THIS_LOCATION+'":rawurlencode($requestUri?$requestUri:t3lib_div::getIndpEnv('REQUEST_URI')));
+                                               $url= "alt_doc.php?".$retUrl.$params;
+                                               $onClick="window.open('".$url."','editpopup','scrollbars=no,status=no,toolbar=no,location=no,directories=no,resizable=no,menubar=no,width=700,height=500,top=10,left=10')";
+                                               return '<a style="text-decoration: none;" href="#" onclick="'.htmlspecialchars($onClick).'">'.$label.'</a>';
+                               
+                               } else {
+                                       return $label;
+                               }
+               }
+               return '';
+       }
+       
+       function _javascript() {
+
+
+               return '
+<script type="text/javascript"> 
+
+function resetSelectboxes() {
+       var obj=getElementsByClassName("fieldvisibility_selects");
+       for(i=0;i<obj.length;i++)
+  {
+    obj[i].selectedIndex=0;    
+  }    
+}
+
+function getElementsByClassName(class_name)
+{
+  var all_obj,ret_obj=new Array(),j=0,teststr;
+
+  if(document.all)all_obj=document.all;
+  else if(document.getElementsByTagName && !document.all)
+    all_obj=document.getElementsByTagName("*");
+
+  for(i=0;i<all_obj.length;i++)
+  {
+    if(all_obj[i].className.indexOf(class_name)!=-1)
+    {
+      teststr=","+all_obj[i].className.split(" ").join(",")+",";
+      if(teststr.indexOf(","+class_name+",")!=-1)
+      {
+        ret_obj[j]=all_obj[i];
+        j++;
+      }
+    }
+  }
+  return ret_obj;
+}
+
+</script>';
+               
+       }
+       
+}
+
+?>
\ No newline at end of file
diff --git a/classes/class.tx_languagevisibility_celement.php b/classes/class.tx_languagevisibility_celement.php
new file mode 100644 (file)
index 0000000..d85bd46
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_recordelement.php');
+
+class tx_languagevisibility_celement extends tx_languagevisibility_recordelement {     
+       /**
+       * init table
+       **/
+       protected function initialisations() {
+               $this->setTable('tt_content');
+       }       
+}
+
+?>
\ No newline at end of file
diff --git a/classes/class.tx_languagevisibility_element.php b/classes/class.tx_languagevisibility_element.php
new file mode 100644 (file)
index 0000000..5218a01
--- /dev/null
@@ -0,0 +1,101 @@
+<?php
+
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_languagerepository.php');
+
+
+
+abstract class tx_languagevisibility_element {
+       private $visibilitySetting;
+       
+       public function __construct($row)    {
+               $this->row=$row;
+               $this->visibilitySetting=@unserialize($this->row['tx_languagevisibility_visibility']);          
+               if (!is_array($this->visibilitySetting)) {
+                               $this->visibilitySetting=array();               
+               }
+               $this->initialisations();
+       }
+       
+       /**
+       * possibility to add inits in subclasses
+       **/
+       protected function initialisations() {
+               
+       }
+       
+       function isLanguageSetToAll() {
+               if ($this->row['sys_language_uid']      == '-1')
+                       return true;
+               
+               return false;           
+       }
+       
+       function getInformativeDescription() {
+               return 'this is a normal content element (translations are managed with overlay records)';              
+       }
+       
+       /**
+       * returns the local settings for this element (saved in the element itself)
+       **/
+       function getLocalVisibilitySetting($languageid) {
+               return $this->visibilitySetting[$languageid];
+               
+       }
+       
+       /** 
+       * checks if this element has a translation, therefor several DB accesses are required   
+       **/     
+       function hasTranslation($languageid) {
+               if (!is_numeric($languageid)) 
+                       return false;
+               //check if overlay exist:
+               if ($languageid==0)
+                       return true;
+                       
+               if ($this->_hasOverlayRecordForLanguage($languageid)) {
+                       return true;
+               }
+               else {
+                       return false;
+               }               
+       }
+       
+       protected function _hasOverlayRecordForLanguage($langid) {
+               $row=$this->getOverLayRecordForCertainLanguage($langid,true);
+               if ($row['uid'] != '')
+       return true;
+    else
+       return false;           
+       }
+       
+       abstract function getOverLayRecordForCertainLanguage($languageId,$onlyUid=FALSE);
+       
+       protected function _getLiveRowIfWorkspace($row,$table) {
+               if (!isset($row['pid']) || !isset($row['uid'])) {
+                       return false;
+               }
+               if ($row['pid']==-1) {                  
+                                       return t3lib_BEfunc::getLiveVersionOfRecord($table,$row['uid']);                                                                                                
+               }               
+               return $row;
+               
+       }
+       protected function _getLiveUIDIfWorkspace($row) {
+               if (!isset($row['pid']) ||!isset($row['t3ver_oid']) || !isset($row['uid'])) {
+                       return false;
+               }
+               return $row['t3ver_oid'];               
+       }
+       
+       /**
+       *returns which field in the language should be used to read the default visibility
+       *
+       *@return string (blank=default / page=page)
+       **/
+       function getFieldToUseForDefaultVisibility() {
+               return '';
+       }
+       
+}
+
+?>
\ No newline at end of file
diff --git a/classes/class.tx_languagevisibility_elementFactory.php b/classes/class.tx_languagevisibility_elementFactory.php
new file mode 100644 (file)
index 0000000..5c4e289
--- /dev/null
@@ -0,0 +1,123 @@
+<?php
+
+
+require_once(PATH_t3lib.'class.t3lib_page.php');
+
+class tx_languagevisibility_elementFactory {
+       
+       var $dao;
+       
+       /**
+       *       Dependency is injected, this object needs a simple Data Access Object (can be replaced in testcase)
+       */
+       function tx_languagevisibility_elementFactory($dao) {
+               $this->dao=$dao;                
+       }
+       
+       /**
+       * Returns ready initialised "element" object. Depending on the element the correct element class is used. (e.g. page/content/fce)
+       *
+       * @params $table        table
+       * @params $uid  identifier
+       *
+       * @throws Unknown_Element_Exception 
+       **/     
+       function getElementForTable($table,$uid) {
+               /*      
+               echo $uid.'-';
+               echo $uid=t3lib_BEfunc::wsMapId($table,$uid);
+               echo '<hr>';            
+               */
+               if (!is_numeric($uid)) {
+                       //no uid => maybe NEW element in BE
+                       $row=array();
+               }
+               else {                          
+                               /***
+                               ** WORKSPACE NOTE
+                               * the diffrent usecases has to be defined and checked..
+                               **/
+                               if (is_object($GLOBALS['BE_USER']) && $GLOBALS['BE_USER']->workspace !=0) {                             
+                                       //$uid=t3lib_BEfunc::wsMapId($table,$uid);                                              
+                                       $row=$this->dao->getRecord($uid,$table);                                                
+                                       if ($row['pid']!=-1) {
+                                               $uid=t3lib_BEfunc::wsMapId($table,$uid);
+                                               $row=$this->dao->getRecord($uid,$table);                                                        
+                                       }
+                               }
+                               else {
+                                       $row=$this->dao->getRecord($uid,$table);
+                               }
+                       }
+               
+               
+               switch ($table) {
+                               case 'pages':
+                                       require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_pageelement.php');
+                                       $elementclass=t3lib_div::makeInstanceClassName('tx_languagevisibility_pageelement');                                    
+                                       $element=new $elementclass($row);
+                                       return $element;
+                               break;
+                               case 'tt_news':
+                                       require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_recordelement.php');
+                                       $elementclass=t3lib_div::makeInstanceClassName('tx_languagevisibility_recordelement');                                  
+                                       $element=new $elementclass($row);
+                                       $element->setTable($table);
+                                       return $element;
+                               break;
+                               case 'tt_content':                                      
+                                       if ($row['CType']=='templavoila_pi1') {
+                                               //read DS:
+                                               $srcPointer = $row['tx_templavoila_ds'];
+                                               $DS=$this->_getTVDS($srcPointer);
+                                               if (is_array($DS)) {
+                                                       if ($DS['meta']['langDisable']==1 && $DS['meta']['langDatabaseOverlay']==1) {
+                                                               //handle as special FCE with normal tt_content overlay:
+                                                               require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_fceoverlayelement.php');
+                                                               $elementclass=t3lib_div::makeInstanceClassName('tx_languagevisibility_fceoverlayelement');                                      
+                                                               $element=new $elementclass($row);
+                                                       }
+                                                       else {
+                                                               require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_fceelement.php');
+                                                               $elementclass=t3lib_div::makeInstanceClassName('tx_languagevisibility_fceelement');
+                                                               $element=new $elementclass($row,$DS);
+                                                       }
+                                               }
+                                               else {
+                                                       throw new UnexpectedValueException($table.' uid:'.$row['uid'].' has no valid Datastructure ', 1195039394);
+                                               }
+                                       }
+                                       else {
+                                               require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_celement.php');
+                                               $elementclass=t3lib_div::makeInstanceClassName('tx_languagevisibility_celement');                                       
+                                               $element=new $elementclass($row);
+                                       }                                       
+                                       return $element;
+                                       
+                               break;
+                               default: 
+                                       throw new UnexpectedValueException($table.' not supported ', 1195039394);
+                               break;
+               }
+       }
+       
+       function _getTVDS($srcPointer) {
+       
+               $sys_page=t3lib_div::makeInstance('t3lib_pageSelect');          
+               $DS=array();
+               if (t3lib_div::testInt($srcPointer))    {       // If integer, then its a record we will look up:
+                       $DSrec=$sys_page->getRawRecord('tx_templavoila_datastructure',$srcPointer,'dataprot');                  
+                       $DS = t3lib_div::xml2array($DSrec['dataprot']);                 
+               } else {        // Otherwise expect it to be a file:
+                       $file = t3lib_div::getFileAbsFileName($srcPointer);
+                       if ($file && @is_file($file))   {
+                               $DS = t3lib_div::xml2array(t3lib_div::getUrl($file));
+                       }
+               }
+               return $DS;
+               
+       }
+       
+}
+
+?>
\ No newline at end of file
diff --git a/classes/class.tx_languagevisibility_fceelement.php b/classes/class.tx_languagevisibility_fceelement.php
new file mode 100644 (file)
index 0000000..32f5cad
--- /dev/null
@@ -0,0 +1,167 @@
+<?php
+
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_element.php');
+
+require_once(PATH_t3lib.'class.t3lib_flexformtools.php');
+
+class tx_languagevisibility_fceelement extends tx_languagevisibility_element {
+       
+       private $langIsoCodeForFlexFormCallback='';
+       private $langChildren;
+       private $langDisabled;
+       private $disabledIsVisible;
+       
+       //flags which are set during processings        
+       private $_callBackFoundOverlay=FALSE;
+       
+       
+       public function __construct($row,$DS)    {
+               parent::__construct($row);
+               
+               
+               $this->langChildren = $DS['meta']['langChildren'] ? 1 : 0;
+               $this->langDisabled = $DS['meta']['langDisable'] ? 1 : 0;
+               $this->disabledIsVisible = $DS['meta']['disabledIsVisible'] ? 1 : 0;
+               
+       }
+       
+       function getInformativeDescription() {
+               if ($this->langDisabled==1) {
+                       if ($this->disabledIsVisible==1) {
+                               return 'FCE is in mode langDisabled, therefore cannot be translated. But it is configured to be handled as translated per Default.';
+                       }
+                       else {
+                               return 'FCE is in mode langDisabled, therefore cannot be translated.';
+                       }
+               }
+               if ($this->langChildren == 1) {
+                       return 'FCE is in mode inheritance';
+               }
+               else {
+                       return 'FCE is in mode seperate';
+               }
+       }
+       
+       function _hasOverlayRecordForLanguage($id) {            
+               $languageRep=t3lib_div::makeInstance('tx_languagevisibility_languagerepository');       
+    $language=$languageRep->getLanguageById($id);
+               $this->langIsoCodeForFlexFormCallback=strtoupper($language->getIsoCode());
+               $this->_callBackFoundOverlay=FALSE;
+               //$data=t3lib_div::xml2array($this->row['tx_templavoila_flex']);
+               
+               
+               // Get data structure:
+               
+               if ($this->langDisabled==1) {
+                       //the FCE has langDisabled: this means there is no overlay
+                       if ($this->disabledIsVisible==1) 
+                               return true;
+                       else
+                               return false;
+               }
+               if ($GLOBALS['TSFE']) {
+                       $GLOBALS['TSFE']->includeTCA('tt_content');             
+               }
+               if ($this->langChildren == 1) {
+                       //the FCE has real overlay record 
+                       
+                       $flexObj = t3lib_div::makeInstance('t3lib_flexformtools');
+                       if ($this->row['tx_templavoila_flex']) {
+                                               $return=$flexObj->traverseFlexFormXMLData('tt_content','tx_templavoila_flex',$this->row,$this,'_hasOverlayRecordForLanguage_Inheritance_flexFormCallBack');                                             
+                                               if ($return!==TRUE && strlen($return)>0) {                              
+                                                       debug('FCE: _hasOverlayRecordForLanguage has error:'.$return);
+                                               }
+                                               return $this->_callBackFoundOverlay;
+                       }
+                       else {
+                                       //in case no xml yet (new created?)
+                                       return false;
+                       }
+               }
+               else  {
+                       //the FCE has no real overlay record
+                       $flexObj = t3lib_div::makeInstance('t3lib_flexformtools');                      
+                       $flexObj->traverseFlexFormXMLData('tt_content','tx_templavoila_flex',$this->row,$this,'_hasOverlayRecordForLanguage_Seperate_flexFormCallBack');                        
+                       return $this->_callBackFoundOverlay;
+                       
+               }
+               
+               //list ($dataStruct, $sheet, $singleSheet) = t3lib_div::resolveSheetDefInDS($DS,$renderSheet);
+               
+               
+       }
+       /**
+       *TODO
+       **/
+       function getOverLayRecordForCertainLanguage($languageId,$onlyUid=FALSE) {
+       }
+       
+       
+       /**
+        * FlexForm call back function, see _hasOverlayRecordForLanguage
+        *
+        * @param       array           Data Structure of current field
+        * @param       string          Data value of current field
+        * @param       array           Various stuff in an array
+        * @param       string          path to location in flexform for current field
+        * @param       object          Reference to parent object
+        * @return      void
+        */
+       function _hasOverlayRecordForLanguage_Inheritance_flexFormCallBack($dsArr, $dataValue, $PA, $structurePath, &$pObj)     {
+               
+               if ($this->langIsoCodeForFlexFormCallback=='') {                        
+                       return false;
+               }
+               
+               // Only take lead from default values (since this is "Inheritance" localization we parse for)
+               if (substr($structurePath,-5)=='/vDEF') {               
+                       $baseStructPath = substr($structurePath,0,-3);          
+                        $structurePath = $baseStructPath.$this->langIsoCodeForFlexFormCallback;
+                       $translValue = $pObj->getArrayValueByPath($structurePath, $pObj->traverseFlexFormXMLData_Data);
+                       if ($this->_isFlexFieldFilled($dsArr['TCEforms']['config'],$translValue)) {                             
+                               $this->_callBackFoundOverlay=TRUE;                              
+                       }               
+               }
+       }
+       
+       function _isFlexFieldFilled($cfg,$translValue) {
+               if ( ($cfg['type']=='check' && $translValue!=0) ||
+                                        ($cfg['type']!='check' && $translValue!='')
+                                       ) {
+                               return true;                    
+               }       
+               else {
+                       return false;
+               }
+               
+       }
+       
+       /**
+        * FlexForm call back function, see _hasOverlayRecordForLanguage
+        *
+        * @param       array           Data Structure of current field
+        * @param       string          Data value of current field
+        * @param       array           Various stuff in an array
+        * @param       string          path to location in flexform for current field
+        * @param       object          Reference to parent object
+        * @return      void
+        */
+       function _hasOverlayRecordForLanguage_Seperate_flexFormCallBack($dsArr, $dataValue, $PA, $structurePath, &$pObj)        {
+               if ($this->langIsoCodeForFlexFormCallback=='')
+                       return false;           
+               //path like: data/sDEF/lDEF/field_links/el/1/field_link/el/field_link_text/vDEF                         
+               if (strpos($structurePath,'/lDEF/'))    {                               
+                       $structurePath = str_replace('/lDEF/','/l'.$this->langIsoCodeForFlexFormCallback.'/',$structurePath);
+                       $translValue = $pObj->getArrayValueByPath($structurePath, $pObj->traverseFlexFormXMLData_Data);         
+                       if ($this->_isFlexFieldFilled($dsArr['TCEforms']['config'],$translValue)) {
+                               $this->_callBackFoundOverlay=TRUE;
+                       }
+                               
+               }
+       }
+       
+       
+       
+}
+
+?>
\ No newline at end of file
diff --git a/classes/class.tx_languagevisibility_fceoverlayelement.php b/classes/class.tx_languagevisibility_fceoverlayelement.php
new file mode 100644 (file)
index 0000000..ca7e5ff
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_celement.php');
+
+class tx_languagevisibility_fceoverlayelement extends tx_languagevisibility_celement {
+       
+       
+       function getInformativeDescription() {
+               return 'this is a flexible content element but translations are handled with overlay records.';         
+       }
+       
+}
+
+?>
\ No newline at end of file
diff --git a/classes/class.tx_languagevisibility_language.php b/classes/class.tx_languagevisibility_language.php
new file mode 100644 (file)
index 0000000..e240259
--- /dev/null
@@ -0,0 +1,96 @@
+<?php
+
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_languagerepository.php');
+
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/dao/class.tx_languagevisibility_daocommon.php');
+
+
+class tx_languagevisibility_language {
+       var $row;
+       
+       function setData($row)    {
+               $this->row=$row;                
+       }
+       
+       function getFallbackOrder() {
+               //unfortunatly defaultlangauge is 999 instead of 0 (reason in formrendering of typo3):
+               $tx_languagevisibility_fallbackorder=str_replace('999','0',$this->row['tx_languagevisibility_fallbackorder']);
+               return t3lib_div::trimExplode(',',$tx_languagevisibility_fallbackorder);
+       }
+       function getDefaultVisibilityForPage() {
+               return $this->row['tx_languagevisibility_defaultvisibility'];
+       }
+       
+       function getDefaultVisibilityForElement() {
+               return $this->row['tx_languagevisibility_defaultvisibilityel'];
+       }
+       
+       function getUid() {
+               return $this->row['uid'];
+       }
+       function getIsoCode() {
+               // Finding the ISO code:
+               $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('lg_iso_2', 'static_languages', 'uid='.intval($this->row['static_lang_isocode']),'','');
+    $static_languages_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);    
+               return $static_languages_row['lg_iso_2'];
+               
+       }
+       function getTitle($pidForDefault='') {
+               if ($this->getUid()=='0') {
+                       if ($pidForDefault=='')
+                               $pidForDefault=$this->_guessCurrentPid();
+                       $sharedTSconfig = t3lib_BEfunc::getModTSconfig($pidForDefault, 'mod.SHARED');
+                       
+                       return strlen ($sharedTSconfig['properties']['defaultLanguageLabel']) ? $sharedTSconfig['properties']['defaultLanguageLabel'] : 'Default';
+               }
+               else {
+                       return $this->row['title'];
+               }
+       }
+       
+       function _guessCurrentPid() {
+               return t3lib_div::_GP('id');
+       }
+       
+       /**
+       * @param  Optional the pid of the page. This can be used to get the correct flag for default language (which is set in tsconfig)
+       **/
+       function getFlagImg($pidForDefault='') {
+               global $BACK_PATH;
+               return '<img src="'.$this->getFlagImgPath($pidForDefault).'" title="'.$this->getTitle($pidForDefault).'-'.$this->getIsoCode().' ['.$this->getUid().']">';
+       }
+
+       /**
+       * @param Optional the pid of the page. This can be used to get the correct flagpath for default language (which is set in tsconfig)
+       **/
+       function getFlagImgPath($pidForDefault='') {
+               $flagAbsPath = t3lib_div::getFileAbsFileName($GLOBALS['TCA']['sys_language']['columns']['flag']['config']['fileFolder']);
+               $flagIconPath = $BACK_PATH.'../'.substr($flagAbsPath, strlen(PATH_site));
+               if ($this->getUid()=='0') {
+                       if ($pidForDefault=='') {
+                               $pidForDefault=$this->_guessCurrentPid();
+                       }
+                       $sharedTSconfig = t3lib_BEfunc::getModTSconfig($pidForDefault, 'mod.SHARED');
+                       $img=strlen($sharedTSconfig['properties']['defaultLanguageFlag']) && @is_file($flagAbsPath.$sharedTSconfig['properties']['defaultLanguageFlag']) ? $flagIconPath.$sharedTSconfig['properties']['defaultLanguageFlag'] : null;
+               }
+               else {
+                       $path=$flagIconPath.$this->row['flag'];
+               }
+               return $path;
+       }
+
+       
+       /**
+       * checks if the given languageid is part of the fallback of this language
+       * (used for permission options in the backend)
+       **/
+       function isLanguageUidInFallbackOrder($uid) {
+               $fallbacks=$this->getFallbackOrder();
+               return in_array($uid,$fallbacks);
+       }
+       
+       
+}
+
+?>
\ No newline at end of file
diff --git a/classes/class.tx_languagevisibility_languagerepository.php b/classes/class.tx_languagevisibility_languagerepository.php
new file mode 100644 (file)
index 0000000..284ff02
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_language.php');
+
+
+
+class tx_languagevisibility_languagerepository {
+       
+       
+       function getLanguages()    {
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','sys_language','','','','');
+               $return=array();
+               $return[]=$this->getDefaultLanguage();
+                       while ($row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {                              
+                               $language= t3lib_div::makeInstance('tx_languagevisibility_language');   
+                               $language->setData($row);
+                               $return[]=$language;
+                       }
+                       return $return;
+       }
+       
+       function getLanguagesForBEUser()    {
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','sys_language','','','','');
+               $return=array();
+               if ($GLOBALS['BE_USER']->checkLanguageAccess(0)) {
+                       $return[]=$this->getDefaultLanguage();
+               }
+                       while ($row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {                              
+                               if ($GLOBALS['BE_USER']->checkLanguageAccess($row['uid'])) {
+                                       $language= t3lib_div::makeInstance('tx_languagevisibility_language');   
+                                       $language->setData($row);
+                                       $return[]=$language;
+                               }
+                       }
+                       return $return;
+       }
+       
+       
+       function getDefaultLanguage() {
+               $language= t3lib_div::makeInstance('tx_languagevisibility_language');   
+               $row['uid']=0;
+               $row['title']='Default';
+               
+               $language->setData($row);
+               return $language;
+               
+       }
+       
+       function getLanguageById($id) {
+               if ($id==0) {
+                       return $this->getDefaultLanguage();
+               }
+               else {
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','sys_language','uid='.intval($id),'','','');                  
+                       $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);                       
+                       $language= t3lib_div::makeInstance('tx_languagevisibility_language');   
+                       $language->setData($row);
+                       return $language;               
+               }
+       }
+       
+       
+}
+
+?>
\ No newline at end of file
diff --git a/classes/class.tx_languagevisibility_pageelement.php b/classes/class.tx_languagevisibility_pageelement.php
new file mode 100644 (file)
index 0000000..411d223
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_element.php');
+
+
+
+class tx_languagevisibility_pageelement extends tx_languagevisibility_element {
+       
+       
+       
+       
+       
+       function getInformativeDescription() {
+               return 'this is a normal page element (translations are managed with seperate overlay records)';                
+       }
+       
+       function getOverLayRecordForCertainLanguage($id,$onlyUid=FALSE) {
+               $row=$this->row;
+               $useUid=$row['uid'];
+               
+               
+               if ($row['pid']==-1) {                          
+                       //      $liveRow=t3lib_BEfunc::getLiveVersionOfRecord('pages',$useUid);
+                               //print_r($row);                                                                        
+                               $useUid=$row['t3ver_oid'];                      
+               }
+               if ($GLOBALS['BE_USER']->workspace==0) {
+                               $addWhere=' AND t3ver_state!=1'; //// Shadow state for new items MUST be ignored                        
+                       }
+               $where='sys_language_uid='.intval($id).' AND pid='.intval($useUid).     $addWhere;
+               $fields='*';
+               if ($onlyUid)
+                       $fields='uid';
+               $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, 'pages_language_overlay', $where, '','');
+               //echo $GLOBALS['TYPO3_DB']->SELECTquery($fields, 'pages_language_overlay', $where, '','');
+    $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);     
+      
+               return $row;
+       }
+       
+       /**
+       *returns which field in the language should be used to read the default visibility
+       *
+       *@return string (blank=default / page=page)
+       **/
+       function getFieldToUseForDefaultVisibility() {
+               return 'page';
+       }
+       
+}
+
+?>
\ No newline at end of file
diff --git a/classes/class.tx_languagevisibility_recordelement.php b/classes/class.tx_languagevisibility_recordelement.php
new file mode 100644 (file)
index 0000000..5fc5e7c
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+
+
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_element.php');
+
+class tx_languagevisibility_recordelement extends tx_languagevisibility_element {
+       
+       protected $table;
+       
+       function setTable($table) {
+               $this->table=$table;
+       }
+       
+       
+       /** 
+       * workspace aware check of overlay records for tt_content
+       **/
+       function getOverLayRecordForCertainLanguage($languageId,$onlyUid=FALSE) {
+                       global $TCA;
+                       $table=$this->table;
+                       //actual row in live WS                 
+                       
+                       $row=$this->_getLiveRowIfWorkspace($this->row,$table);
+                       if ($row===false) {
+                               return false;
+                       }                                               
+                       
+                       $useUid=$row['uid'];
+                       $usePid=$row['pid'];                    
+                       
+                       if ($GLOBALS['BE_USER']->workspace==0) {
+                               // Shadow state for new items MUST be ignored   in workspace
+                               $addWhere=' AND t3ver_state!=1'; 
+                       }
+                       else {
+                               //else search get workspace version
+                               $addWhere=' AND (t3ver_wsid=0 OR t3ver_wsid='.$GLOBALS['BE_USER']->workspace.')';
+                       }
+                       
+                       // Select overlay record:
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                                       '*',
+                                       $table,
+                                                       $TCA[$table]['ctrl']['languageField'].'='.intval($languageId).
+                                               ' AND '.$TCA[$table]['ctrl']['transOrigPointerField'].'='.intval($useUid).
+                                               ' AND hidden=0 AND deleted=0'.$addWhere,         
+                                       '',
+                                       '',
+                                       '1'
+                               );
+                               
+                               $olrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+                               if (is_object($GLOBALS['TSFE']->sys_page)) {
+                                       $GLOBALS['TSFE']->sys_page->versionOL($table,$olrow);
+                               }
+                               else {
+                                       t3lib_BEfunc::workspaceOL($table,$olrow);                                       
+                               }       
+                               return  $olrow;                                         
+       }       
+       
+       
+}
+
+?>
\ No newline at end of file
diff --git a/classes/class.tx_languagevisibility_visibilityService.php b/classes/class.tx_languagevisibility_visibilityService.php
new file mode 100644 (file)
index 0000000..90545e8
--- /dev/null
@@ -0,0 +1,109 @@
+<?php
+
+
+
+
+class tx_languagevisibility_visibilityService {
+       
+       /**
+       * returns relevant languageid for overlay record or false if element is not visible for guven language
+       **/
+       function getOverlayLanguageIdForLanguageAndElement(tx_languagevisibility_language $language,$element) {
+               if ($this->isVisible($language,$element)) {                     
+                       return $this->_relevantOverlayLanguageId;
+               }
+               else {                          
+                       return false;
+               }               
+       }
+       
+       
+       /**
+       * Returns true or false wether the element is visible in the certain language.
+       *  (sets for internal access only $this->_relevantOverlayLanguageId which holds the overlay languageid)
+       **/
+       function isVisible(tx_languagevisibility_language $language,$element)    {
+                       $this->_relevantOverlayLanguageId=$language->getUid();
+                       $visibility=$this->getVisibilitySetting($language,$element);
+                       
+                       if ($visibility=='yes') {
+                                       return true;
+                       }
+                       elseif ($visibility=='no') {
+                               return false;
+                       }
+                       elseif ($visibility=='t') {
+                               if ($element->hasTranslation($language->getUid())) {
+                                       return true;
+                               }
+                               else {
+                                       return false;
+                               }
+                       }
+                       elseif ($visibility=='f') {
+                               if ($element->hasTranslation($language->getUid())) {
+                                       return true;
+                               }
+                               else {
+                                       $fallBackOrder=$language->getFallbackOrder();
+                                       //echo 'checking..'.$element->row['uid'];
+                                       foreach ($fallBackOrder as $languageid) {
+                                               if ($element->hasTranslation($languageid)) {
+                                                       //echo 'found for !'.$languageid;
+                                                       $this->_relevantOverlayLanguageId=$languageid;
+                                                       return true;
+                                               }
+                                       }
+                                       /*
+                                       $languageRep=t3lib_div::makeInstance('tx_languagevisibility_languagerepository');                               
+                                       foreach ($fallBackOrder as $languageid) {
+                                               $fallbackLanguage=$languageRep->getById($languageid);
+                                               if ($this->isVisible($fallbackLanguage,$element)) {
+                                                       return true;
+                                               }
+                                       }
+                                       */
+                                       return false;
+                               }
+                       }
+                       else {
+                               //no setting or default:
+                               if ($language->getUid() == '0') 
+                                       return true;
+                               else
+                                       return false;
+                       }
+       }
+       
+       /**
+       * return the accumulated visibility setting: reads default for language then reads local for element and merges them.
+       *  if local is default, then the global is used or it is forced to be "yes" if the language was set to all.
+       *        If nothing is set the hardcoded default "t" (translated) is returned
+       */      
+       function getVisibilitySetting(tx_languagevisibility_language $language,$element) {              
+               $local=$element->getLocalVisibilitySetting($language->getUid());
+               if ($local !='' && $local !='-') {
+                       return $local;
+               }
+               else {
+                       if ($element->isLanguageSetToAll()) {
+                               return 'yes';   
+                       }
+                       
+                       if ($element->getFieldToUseForDefaultVisibility()=='page') {
+                               $global=$language->getDefaultVisibilityForPage();
+                       }
+                       else {
+                               $global=$language->getDefaultVisibilityForElement();
+                       }
+                       if ($global =='')
+                               return 't';
+                       else
+                               return $global;
+               }               
+       }
+       
+       
+}
+
+?>
\ No newline at end of file
diff --git a/classes/dao/class.tx_languagevisibility_daocommon.php b/classes/dao/class.tx_languagevisibility_daocommon.php
new file mode 100644 (file)
index 0000000..4451e21
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+
+
+
+class tx_languagevisibility_daocommon {        
+       
+       
+       function getRecord($uid,$table) {
+               // fix settings
+    $fields = '*';
+    $table = $table;
+    $groupBy = null;
+    $orderBy = '';
+    $where = 'uid='.intval($uid);
+    
+               $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $table, $where, $groupBy, $orderBy);
+    $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
+    return $row;
+               
+       }
+       
+       
+}
+
+?>
\ No newline at end of file
diff --git a/classes/dao/class.tx_languagevisibility_daocommon_stub.php b/classes/dao/class.tx_languagevisibility_daocommon_stub.php
new file mode 100644 (file)
index 0000000..c0c4f13
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+
+/** used to test the objects which needs simple database access:
+ just replace the real daocommon with this stub.
+ Then set the expected results before passing this stub dao to the object you want to test
+**/
+
+class tx_languagevisibility_daocommon_stub {   
+       var $row;
+       
+       function stub_setRow($row,$table) {
+               $this->row[$table]=$row;
+       }
+       function getRecord($uid,$table) {
+               
+    return $this->row[$table];
+               
+       }
+       
+       
+}
+1578
+?>
\ No newline at end of file
diff --git a/doc/wizard_form.dat b/doc/wizard_form.dat
new file mode 100644 (file)
index 0000000..f5c1aaf
--- /dev/null
@@ -0,0 +1 @@
+a:2:{s:4:"save";a:3:{s:13:"extension_key";s:18:"languagevisibility";s:18:"print_wop_comments";s:1:"0";s:15:"overwrite_files";a:8:{s:9:"ChangeLog";s:1:"1";s:10:"README.txt";s:1:"1";s:12:"ext_icon.gif";s:1:"1";s:14:"ext_tables.php";s:1:"1";s:14:"ext_tables.sql";s:1:"1";s:16:"locallang_db.xml";s:1:"1";s:19:"doc/wizard_form.dat";s:1:"1";s:20:"doc/wizard_form.html";s:1:"1";}}s:6:"fields";a:3:{i:1;a:3:{s:11:"which_table";s:12:"sys_language";s:5:"title";s:31:"sys_language (Website Language)";s:6:"fields";a:2:{i:1;a:14:{s:9:"fieldname";s:13:"fallbackorder";s:5:"title";s:14:"fallback order";s:4:"type";s:3:"rel";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";s:14:"conf_rel_table";s:5:"pages";s:13:"conf_rel_type";s:11:"select_root";s:18:"conf_rel_dummyitem";s:1:"0";s:14:"conf_relations";s:2:"10";s:22:"conf_relations_selsize";s:2:"10";s:17:"conf_relations_mm";s:1:"0";s:15:"conf_wiz_addrec";s:1:"0";s:16:"conf_wiz_listrec";s:1:"0";s:16:"conf_wiz_editrec";s:1:"0";}i:2;a:18:{s:9:"fieldname";s:17:"defaultvisibility";s:5:"title";s:0:"";s:4:"type";s:6:"select";s:12:"excludeField";s:1:"0";s:7:"_DELETE";s:1:"0";s:18:"conf_select_item_0";s:0:"";s:23:"conf_select_itemvalue_0";s:1:"0";s:18:"conf_select_item_1";s:0:"";s:23:"conf_select_itemvalue_1";s:1:"1";s:18:"conf_select_item_2";s:0:"";s:23:"conf_select_itemvalue_2";s:1:"2";s:18:"conf_select_item_3";s:0:"";s:23:"conf_select_itemvalue_3";s:1:"3";s:17:"conf_select_items";s:1:"4";s:17:"conf_select_icons";s:1:"0";s:14:"conf_relations";s:1:"1";s:22:"conf_relations_selsize";s:1:"1";s:15:"conf_select_pro";s:1:"0";}}}i:2;a:3:{s:11:"which_table";s:5:"pages";s:5:"title";s:13:"pages (Pages)";s:6:"fields";a:1:{i:1;a:9:{s:9:"fieldname";s:10:"visibility";s:5:"title";s:19:"language visibility";s:4:"type";s:5:"input";s:12:"excludeField";s:1:"1";s:7:"_DELETE";s:1:"0";s:9:"conf_size";s:0:"";s:8:"conf_max";s:0:"";s:13:"conf_required";s:1:"0";s:12:"conf_varchar";s:1:"0";}}}i:3;a:3:{s:11:"which_table";s:10:"tt_content";s:5:"title";s:20:"tt_content (Content)";s:6:"fields";a:1:{i:1;a:9:{s:9:"fieldname";s:10:"visibility";s:5:"title";s:19:"language visibility";s:4:"type";s:5:"input";s:12:"excludeField";s:1:"1";s:7:"_DELETE";s:1:"0";s:9:"conf_size";s:0:"";s:8:"conf_max";s:0:"";s:13:"conf_required";s:1:"0";s:12:"conf_varchar";s:1:"0";}}}}}
\ No newline at end of file
diff --git a/doc/wizard_form.html b/doc/wizard_form.html
new file mode 100644 (file)
index 0000000..36df4d7
--- /dev/null
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+       <html>
+       <head>
+               <title>Untitled</title>
+       </head>
+
+       <body>
+
+               <table border="0" cellpadding="2" cellspacing="2"><tr bgcolor=""><td><strong><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Extend existing Tables</span></strong></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Add custom fields to existing tables, such as the "pages", "tt_content", "fe_users" or "be_users" table.</span></td></tr><tr><td></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Which table:<br /></strong><a name="17a138ea6c"></a><select name="kickstarter[wizArray_upd][fields][1][which_table]" onchange="setFormAnchorPoint('17a138ea6c');" title="WOP: [fields][1][which_table]"><option value="be_groups">be_groups (Backend Groups)</option><option value="be_users">be_users (Backend Users)</option><option value="fe_groups">fe_groups (Frontend Groups)</option><option value="fe_users">fe_users (Frontend Users)</option><option value="index_config">index_config (Indexing Configuration)</option><option value="pages">pages (Pages)</option><option value="pages_language_overlay">pages_language_overlay (Alternative Page Language)</option><option value="static_countries">static_countries (Countries)</option><option value="static_country_zones">static_country_zones (Country subdivisions)</option><option value="static_currencies">static_currencies (Currencies)</option><option value="static_languages">static_languages (Languages)</option><option value="static_markets">static_markets (Markets)</option><option value="static_taxes">static_taxes (Static taxes)</option><option value="static_template">static_template (Static templates)</option><option value="static_territories">static_territories (Territory)</option><option value="sys_domain">sys_domain (Domain)</option><option value="sys_filemounts">sys_filemounts (Filemount)</option><option value="sys_language" selected="selected">sys_language (Website Language)</option><option value="sys_note">sys_note (Internal note)</option><option value="sys_template">sys_template (Template)</option><option value="sys_workspace">sys_workspace (Workspace)</option><option value="tt_content">tt_content (Content)</option><option value="tt_news">tt_news (News)</option><option value="tt_news_cat">tt_news_cat (News category)</option><option value="tx_aoewebex_regions">tx_aoewebex_regions (additional Regions)</option><option value="tx_ccdevlog">tx_ccdevlog (DevLog)</option><option value="tx_l10nmgr_cfg">tx_l10nmgr_cfg (L10N Manager Configuration)</option><option value="tx_l10nmgr_priorities">tx_l10nmgr_priorities (Localization Priority)</option><option value="tx_rtehtmlarea_acronym">tx_rtehtmlarea_acronym (Acronym)</option><option value="tx_templavoila_datastructure">tx_templavoila_datastructure (TemplaVoilà Data Structure)</option><option value="tx_templavoila_tmplobj">tx_templavoila_tmplobj (TemplaVoilà Template Object)</option></select> <a href="#" title="Select the table which should be extended with these extra fields." style="cursor:help" onclick="alert(String.fromCharCode(83,101,108,101,99,116,32,116,104,101,32,116,97,98,108,101,32,119,104,105,99,104,32,115,104,111,117,108,100,32,98,101,32,101,120,116,101,110,100,101,100,32,119,105,116,104,32,116,104,101,115,101,32,101,120,116,114,97,32,102,105,101,108,100,115,46));return false;">(What is this?)</a></span><input type="hidden" name="kickstarter[wizArray_upd][fields][1][title]" value="sys_language (Website Language)" /></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>FIELD:</strong> <em>fallbackorder</em></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><table border="0" cellpadding="0" cellspacing="0">
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field name:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="0bf4c30b40"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][1][fieldname]" value="fallbackorder" style="width:200px;" onchange="setFormAnchorPoint('0bf4c30b40');" title="WOP: [fields][1][fields][1][fieldname]"> (Remove:<a name="029161de68"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][1][fields][1][_DELETE]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][1][fields][1][_DELETE]" value="1" onclick="setFormAnchorPoint('029161de68');" title="WOP: [fields][1][fields][1][_DELETE]">)<input type="image" hspace="2" src="../../../../typo3/gfx/pil2up.gif" name="kickstarter_CMD_fallbackorder_UP" onclick="setFormAnchorPoint('0bf4c30b40');" /><input type="image" hspace="2" src="../../../../typo3/gfx/pil2down.gif" name="kickstarter_CMD_fallbackorder_DOWN" onclick="setFormAnchorPoint('0bf4c30b40');" /><input type="image" hspace="2" src="../../../../typo3/gfx/savesnapshot.gif" name="kickstarter_CMD_fallbackorder_SAVE" onclick="setFormAnchorPoint('0bf4c30b40');" title="Save this field setting as a preset." /></span></td></tr>
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field title:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="ef019e0013"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][1][title]" value="fallback order" style="width:200px;" onchange="setFormAnchorPoint('ef019e0013');" title="WOP: [fields][1][fields][1][title]"> [English]</span></td></tr>
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field type:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="10950e8f6c"></a><select name="kickstarter[wizArray_upd][fields][1][fields][1][type]" onchange="setFormAnchorPoint('10950e8f6c');" title="WOP: [fields][1][fields][1][type]"><option value=""></option><option value="input">String input</option><option value="input+">String input, advanced</option><option value="textarea">Text area</option><option value="textarea_rte">Text area with RTE</option><option value="textarea_nowrap">Text area, No wrapping</option><option value="check">Checkbox, single</option><option value="check_4">Checkbox, 4 boxes in a row</option><option value="check_10">Checkbox, 10 boxes in two rows (max)</option><option value="link">Link</option><option value="date">Date</option><option value="datetime">Date and time</option><option value="integer">Integer, 10-1000</option><option value="select">Selectorbox</option><option value="radio">Radio buttons</option><option value="rel" selected="selected">Database relation</option><option value="files">Files</option><option value="none">Not editable, only displayed</option><option value="passthrough">[Passthrough]</option></select><a name="fade33f50a"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][1][fields][1][excludeField]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][1][fields][1][excludeField]" value="1" onclick="setFormAnchorPoint('fade33f50a');" title="WOP: [fields][1][fields][1][excludeField]"> Is Exclude-field  <a href="#" title="If a field is marked &quot;Exclude-field&quot;, users can edit it ONLY if the field is specifically listed in one of the backend user groups of the user.\nIn other words, if a field is marked &quot;Exclude-field&quot; you can control which users can edit it and which cannot." style="cursor:help" onclick="alert(String.fromCharCode(73,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,44,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,79,78,76,89,32,105,102,32,116,104,101,32,102,105,101,108,100,32,105,115,32,115,112,101,99,105,102,105,99,97,108,108,121,32,108,105,115,116,101,100,32,105,110,32,111,110,101,32,111,102,32,116,104,101,32,98,97,99,107,101,110,100,32,117,115,101,114,32,103,114,111,117,112,115,32,111,102,32,116,104,101,32,117,115,101,114,46,92,110,73,110,32,111,116,104,101,114,32,119,111,114,100,115,44,32,105,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,32,121,111,117,32,99,97,110,32,99,111,110,116,114,111,108,32,119,104,105,99,104,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,97,110,100,32,119,104,105,99,104,32,99,97,110,110,111,116,46));return false;">(What is this?)</a><br /><img src="../../../../typo3conf/ext/kickstarter/res/t_rel_selmulti.png" width="433" height="67" vspace="5" border="1" style="border:solid 1px;" /><br /><blockquote><br />Create relation to table:<br /><a name="7683a2528e"></a><select name="kickstarter[wizArray_upd][fields][1][fields][1][conf_rel_table]" onchange="setFormAnchorPoint('7683a2528e');" title="WOP: [fields][1][fields][1][conf_rel_table]"><option value="pages" selected="selected">Pages table, (pages)</option><option value="fe_users">Frontend Users, (fe_users)</option><option value="fe_groups">Frontend Usergroups, (fe_groups)</option><option value="tt_content">Content elements, (tt_content)</option><option value="_CUSTOM">Custom table (enter name below)</option></select><br /><br />Type:<br /><a name="df09f40547"></a><select name="kickstarter[wizArray_upd][fields][1][fields][1][conf_rel_type]" onchange="setFormAnchorPoint('df09f40547');" title="WOP: [fields][1][fields][1][conf_rel_type]"><option value="group">Field with Element Browser</option><option value="select">Selectorbox, select global</option><option value="select_cur">Selectorbox, select from current page</option><option value="select_root" selected="selected">Selectorbox, select from root page</option><option value="select_storage">Selectorbox, select from storage page</option></select><br /><a name="1a467cbf0a"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][1][conf_relations]" value="10" style="width:50px;" onchange="setFormAnchorPoint('1a467cbf0a');" title="WOP: [fields][1][fields][1][conf_relations]"> Max number of relations<br /><a name="259b05829b"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][1][conf_relations_selsize]" value="10" style="width:50px;" onchange="setFormAnchorPoint('259b05829b');" title="WOP: [fields][1][fields][1][conf_relations_selsize]"> Size of selector box<br /><a name="44c44f96da"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][1][fields][1][conf_relations_mm]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][1][fields][1][conf_relations_mm]" value="1" onclick="setFormAnchorPoint('44c44f96da');" title="WOP: [fields][1][fields][1][conf_relations_mm]">True M-M relations (otherwise commalist of values)<br /><br /><a name="9efd7d5eb4"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][1][fields][1][conf_wiz_addrec]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][1][fields][1][conf_wiz_addrec]" value="1" onclick="setFormAnchorPoint('9efd7d5eb4');" title="WOP: [fields][1][fields][1][conf_wiz_addrec]">Add "Add record" link<br /><a name="d49e527ffe"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][1][fields][1][conf_wiz_listrec]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][1][fields][1][conf_wiz_listrec]" value="1" onclick="setFormAnchorPoint('d49e527ffe');" title="WOP: [fields][1][fields][1][conf_wiz_listrec]">Add "List records" link<br /><a name="781c12101b"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][1][fields][1][conf_wiz_editrec]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][1][fields][1][conf_wiz_editrec]" value="1" onclick="setFormAnchorPoint('781c12101b');" title="WOP: [fields][1][fields][1][conf_wiz_editrec]">Add "Edit record" link<br /><img src="../../../../typo3conf/ext/kickstarter/res/t_rel_wizards.png" width="71" height="62" hspace="20" vspace="5" border="1" style="border:solid 1px;" /><br /><br /></blockquote></span></td></tr>
+</table></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>FIELD:</strong> <em>defaultvisibility</em></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><table border="0" cellpadding="0" cellspacing="0">
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field name:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="f6347c858f"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][2][fieldname]" value="defaultvisibility" style="width:200px;" onchange="setFormAnchorPoint('f6347c858f');" title="WOP: [fields][1][fields][2][fieldname]"> (Remove:<a name="f148854720"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][1][fields][2][_DELETE]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][1][fields][2][_DELETE]" value="1" onclick="setFormAnchorPoint('f148854720');" title="WOP: [fields][1][fields][2][_DELETE]">)<input type="image" hspace="2" src="../../../../typo3/gfx/pil2up.gif" name="kickstarter_CMD_defaultvisibility_UP" onclick="setFormAnchorPoint('f6347c858f');" /><input type="image" hspace="2" src="../../../../typo3/gfx/pil2down.gif" name="kickstarter_CMD_defaultvisibility_DOWN" onclick="setFormAnchorPoint('f6347c858f');" /><input type="image" hspace="2" src="../../../../typo3/gfx/savesnapshot.gif" name="kickstarter_CMD_defaultvisibility_SAVE" onclick="setFormAnchorPoint('f6347c858f');" title="Save this field setting as a preset." /></span></td></tr>
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field title:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="c08282a61f"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][2][title]" value="" style="width:200px;" onchange="setFormAnchorPoint('c08282a61f');" title="WOP: [fields][1][fields][2][title]"> [English]</span></td></tr>
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field type:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="593c263afd"></a><select name="kickstarter[wizArray_upd][fields][1][fields][2][type]" onchange="setFormAnchorPoint('593c263afd');" title="WOP: [fields][1][fields][2][type]"><option value=""></option><option value="input">String input</option><option value="input+">String input, advanced</option><option value="textarea">Text area</option><option value="textarea_rte">Text area with RTE</option><option value="textarea_nowrap">Text area, No wrapping</option><option value="check">Checkbox, single</option><option value="check_4">Checkbox, 4 boxes in a row</option><option value="check_10">Checkbox, 10 boxes in two rows (max)</option><option value="link">Link</option><option value="date">Date</option><option value="datetime">Date and time</option><option value="integer">Integer, 10-1000</option><option value="select" selected="selected">Selectorbox</option><option value="radio">Radio buttons</option><option value="rel">Database relation</option><option value="files">Files</option><option value="none">Not editable, only displayed</option><option value="passthrough">[Passthrough]</option></select><a name="e51eb201e1"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][1][fields][2][excludeField]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][1][fields][2][excludeField]" value="1" onclick="setFormAnchorPoint('e51eb201e1');" title="WOP: [fields][1][fields][2][excludeField]"> Is Exclude-field  <a href="#" title="If a field is marked &quot;Exclude-field&quot;, users can edit it ONLY if the field is specifically listed in one of the backend user groups of the user.\nIn other words, if a field is marked &quot;Exclude-field&quot; you can control which users can edit it and which cannot." style="cursor:help" onclick="alert(String.fromCharCode(73,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,44,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,79,78,76,89,32,105,102,32,116,104,101,32,102,105,101,108,100,32,105,115,32,115,112,101,99,105,102,105,99,97,108,108,121,32,108,105,115,116,101,100,32,105,110,32,111,110,101,32,111,102,32,116,104,101,32,98,97,99,107,101,110,100,32,117,115,101,114,32,103,114,111,117,112,115,32,111,102,32,116,104,101,32,117,115,101,114,46,92,110,73,110,32,111,116,104,101,114,32,119,111,114,100,115,44,32,105,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,32,121,111,117,32,99,97,110,32,99,111,110,116,114,111,108,32,119,104,105,99,104,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,97,110,100,32,119,104,105,99,104,32,99,97,110,110,111,116,46));return false;">(What is this?)</a><br /><img src="../../../../typo3conf/ext/kickstarter/res/t_sel.png" width="73" height="84" vspace="5" border="1" style="border:solid 1px;" /><br /><blockquote><br /><strong>Define values:</strong><br /><table border="0" cellpadding="2" cellspacing="2"><tr>
+                               <td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Item label:</span></td>
+                               <td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Item value:</span></td>
+                       </tr><tr>
+                               <td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="a6b573d9e5"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][2][conf_select_item_0]" value="" style="width:200px;" onchange="setFormAnchorPoint('a6b573d9e5');" title="WOP: [fields][1][fields][2][conf_select_item_0]"> [English]</span></td>
+                               <td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="54a281d005"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][2][conf_select_itemvalue_0]" value="0" style="width:50px;" onchange="setFormAnchorPoint('54a281d005');" title="WOP: [fields][1][fields][2][conf_select_itemvalue_0]"></span></td>
+                       </tr><tr>
+                               <td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="37314c8daa"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][2][conf_select_item_1]" value="" style="width:200px;" onchange="setFormAnchorPoint('37314c8daa');" title="WOP: [fields][1][fields][2][conf_select_item_1]"> [English]</span></td>
+                               <td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="a74ce1d4f8"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][2][conf_select_itemvalue_1]" value="1" style="width:50px;" onchange="setFormAnchorPoint('a74ce1d4f8');" title="WOP: [fields][1][fields][2][conf_select_itemvalue_1]"></span></td>
+                       </tr><tr>
+                               <td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="59932d900a"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][2][conf_select_item_2]" value="" style="width:200px;" onchange="setFormAnchorPoint('59932d900a');" title="WOP: [fields][1][fields][2][conf_select_item_2]"> [English]</span></td>
+                               <td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="858ac515a2"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][2][conf_select_itemvalue_2]" value="2" style="width:50px;" onchange="setFormAnchorPoint('858ac515a2');" title="WOP: [fields][1][fields][2][conf_select_itemvalue_2]"></span></td>
+                       </tr><tr>
+                               <td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="9a79669d1e"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][2][conf_select_item_3]" value="" style="width:200px;" onchange="setFormAnchorPoint('9a79669d1e');" title="WOP: [fields][1][fields][2][conf_select_item_3]"> [English]</span></td>
+                               <td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="b044ab8ccd"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][2][conf_select_itemvalue_3]" value="3" style="width:50px;" onchange="setFormAnchorPoint('b044ab8ccd');" title="WOP: [fields][1][fields][2][conf_select_itemvalue_3]"></span></td>
+                       </tr></table><br /><a name="fb994dd260"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][2][conf_select_items]" value="4" style="width:50px;" onchange="setFormAnchorPoint('fb994dd260');" title="WOP: [fields][1][fields][2][conf_select_items]"> Number of values<br /><a name="6cc1468e43"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][1][fields][2][conf_select_icons]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][1][fields][2][conf_select_icons]" value="1" onclick="setFormAnchorPoint('6cc1468e43');" title="WOP: [fields][1][fields][2][conf_select_icons]">Add a dummy set of icons<br /><img src="../../../../typo3conf/ext/kickstarter/res/t_select_icons.png" width="131" height="58" hspace="20" vspace="5" border="1" style="border:solid 1px;" /><br /><br /><a name="0669acbd88"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][2][conf_relations]" value="1" style="width:50px;" onchange="setFormAnchorPoint('0669acbd88');" title="WOP: [fields][1][fields][2][conf_relations]"> Max number of relations<br /><a name="ded416cedb"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][2][conf_relations_selsize]" value="1" style="width:50px;" onchange="setFormAnchorPoint('ded416cedb');" title="WOP: [fields][1][fields][2][conf_relations_selsize]"> Size of selector box<br /><a name="032c7bd98a"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][1][fields][2][conf_select_pro]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][1][fields][2][conf_select_pro]" value="1" onclick="setFormAnchorPoint('032c7bd98a');" title="WOP: [fields][1][fields][2][conf_select_pro]">Add pre-processing with PHP-function<br /></blockquote></span></td></tr>
+</table></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>NEW FIELD:</strong></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><table border="0" cellpadding="0" cellspacing="0">
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field name:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="83adc8daad"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][3][fieldname]" value="" style="width:200px;" onchange="setFormAnchorPoint('83adc8daad');" title="WOP: [fields][1][fields][3][fieldname]"></span></td></tr>
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field title:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="a7d4e579a1"></a><input type="text" name="kickstarter[wizArray_upd][fields][1][fields][3][title]" value="" style="width:200px;" onchange="setFormAnchorPoint('a7d4e579a1');" title="WOP: [fields][1][fields][3][title]"> [English]</span></td></tr>
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field type:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="686c4afed4"></a><select name="kickstarter[wizArray_upd][fields][1][fields][3][type]" onchange="setFormAnchorPoint('686c4afed4');" title="WOP: [fields][1][fields][3][type]"><option value="" selected="selected"></option><option value="input">String input</option><option value="input+">String input, advanced</option><option value="textarea">Text area</option><option value="textarea_rte">Text area with RTE</option><option value="textarea_nowrap">Text area, No wrapping</option><option value="check">Checkbox, single</option><option value="check_4">Checkbox, 4 boxes in a row</option><option value="check_10">Checkbox, 10 boxes in two rows (max)</option><option value="link">Link</option><option value="date">Date</option><option value="datetime">Date and time</option><option value="integer">Integer, 10-1000</option><option value="select">Selectorbox</option><option value="radio">Radio buttons</option><option value="rel">Database relation</option><option value="files">Files</option><option value="none">Not editable, only displayed</option><option value="passthrough">[Passthrough]</option></select><a name="904eaf2903"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][1][fields][3][excludeField]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][1][fields][3][excludeField]" value="1" checked="checked" onclick="setFormAnchorPoint('904eaf2903');" title="WOP: [fields][1][fields][3][excludeField]"> Is Exclude-field  <a href="#" title="If a field is marked &quot;Exclude-field&quot;, users can edit it ONLY if the field is specifically listed in one of the backend user groups of the user.\nIn other words, if a field is marked &quot;Exclude-field&quot; you can control which users can edit it and which cannot." style="cursor:help" onclick="alert(String.fromCharCode(73,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,44,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,79,78,76,89,32,105,102,32,116,104,101,32,102,105,101,108,100,32,105,115,32,115,112,101,99,105,102,105,99,97,108,108,121,32,108,105,115,116,101,100,32,105,110,32,111,110,101,32,111,102,32,116,104,101,32,98,97,99,107,101,110,100,32,117,115,101,114,32,103,114,111,117,112,115,32,111,102,32,116,104,101,32,117,115,101,114,46,92,110,73,110,32,111,116,104,101,114,32,119,111,114,100,115,44,32,105,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,32,121,111,117,32,99,97,110,32,99,111,110,116,114,111,108,32,119,104,105,99,104,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,97,110,100,32,119,104,105,99,104,32,99,97,110,110,111,116,46));return false;">(What is this?)</a><br /></span></td></tr>
+</table></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><br /><br />Load preset fields: <br /><select name="kickstarter[_PRESET][]" size="5" multiple="multiple"><option value="">__Fields picked up in this session__:</option><option value="languagevisibility-fields-1.fallbackorder">languagevisibility-fields-1: fallback order (fallbackorder, type: rel)</option><option value="languagevisibility-fields-1.defaultvisibility">languagevisibility-fields-1:  (defaultvisibility, type: select)</option><option value="languagevisibility-fields-2.visibility">languagevisibility-fields-2: language visibility (visibility, type: input)</option><option value="languagevisibility-fields-3.visibility">languagevisibility-fields-3: language visibility (visibility, type: input)</option></select></span></td></tr></table><hr /><table border="0" cellpadding="2" cellspacing="2"><tr bgcolor=""><td><strong><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Extend existing Tables</span></strong></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Add custom fields to existing tables, such as the "pages", "tt_content", "fe_users" or "be_users" table.</span></td></tr><tr><td></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Which table:<br /></strong><a name="9f88443241"></a><select name="kickstarter[wizArray_upd][fields][2][which_table]" onchange="setFormAnchorPoint('9f88443241');" title="WOP: [fields][2][which_table]"><option value="be_groups">be_groups (Backend Groups)</option><option value="be_users">be_users (Backend Users)</option><option value="fe_groups">fe_groups (Frontend Groups)</option><option value="fe_users">fe_users (Frontend Users)</option><option value="index_config">index_config (Indexing Configuration)</option><option value="pages" selected="selected">pages (Pages)</option><option value="pages_language_overlay">pages_language_overlay (Alternative Page Language)</option><option value="static_countries">static_countries (Countries)</option><option value="static_country_zones">static_country_zones (Country subdivisions)</option><option value="static_currencies">static_currencies (Currencies)</option><option value="static_languages">static_languages (Languages)</option><option value="static_markets">static_markets (Markets)</option><option value="static_taxes">static_taxes (Static taxes)</option><option value="static_template">static_template (Static templates)</option><option value="static_territories">static_territories (Territory)</option><option value="sys_domain">sys_domain (Domain)</option><option value="sys_filemounts">sys_filemounts (Filemount)</option><option value="sys_language">sys_language (Website Language)</option><option value="sys_note">sys_note (Internal note)</option><option value="sys_template">sys_template (Template)</option><option value="sys_workspace">sys_workspace (Workspace)</option><option value="tt_content">tt_content (Content)</option><option value="tt_news">tt_news (News)</option><option value="tt_news_cat">tt_news_cat (News category)</option><option value="tx_aoewebex_regions">tx_aoewebex_regions (additional Regions)</option><option value="tx_ccdevlog">tx_ccdevlog (DevLog)</option><option value="tx_l10nmgr_cfg">tx_l10nmgr_cfg (L10N Manager Configuration)</option><option value="tx_l10nmgr_priorities">tx_l10nmgr_priorities (Localization Priority)</option><option value="tx_rtehtmlarea_acronym">tx_rtehtmlarea_acronym (Acronym)</option><option value="tx_templavoila_datastructure">tx_templavoila_datastructure (TemplaVoilà Data Structure)</option><option value="tx_templavoila_tmplobj">tx_templavoila_tmplobj (TemplaVoilà Template Object)</option></select> <a href="#" title="Select the table which should be extended with these extra fields." style="cursor:help" onclick="alert(String.fromCharCode(83,101,108,101,99,116,32,116,104,101,32,116,97,98,108,101,32,119,104,105,99,104,32,115,104,111,117,108,100,32,98,101,32,101,120,116,101,110,100,101,100,32,119,105,116,104,32,116,104,101,115,101,32,101,120,116,114,97,32,102,105,101,108,100,115,46));return false;">(What is this?)</a></span><input type="hidden" name="kickstarter[wizArray_upd][fields][2][title]" value="pages (Pages)" /></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>FIELD:</strong> <em>visibility</em></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><table border="0" cellpadding="0" cellspacing="0">
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field name:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="8f349b2cc4"></a><input type="text" name="kickstarter[wizArray_upd][fields][2][fields][1][fieldname]" value="visibility" style="width:200px;" onchange="setFormAnchorPoint('8f349b2cc4');" title="WOP: [fields][2][fields][1][fieldname]"> (Remove:<a name="982591feb7"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][2][fields][1][_DELETE]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][2][fields][1][_DELETE]" value="1" onclick="setFormAnchorPoint('982591feb7');" title="WOP: [fields][2][fields][1][_DELETE]">)<input type="image" hspace="2" src="../../../../typo3/gfx/pil2up.gif" name="kickstarter_CMD_visibility_UP" onclick="setFormAnchorPoint('8f349b2cc4');" /><input type="image" hspace="2" src="../../../../typo3/gfx/pil2down.gif" name="kickstarter_CMD_visibility_DOWN" onclick="setFormAnchorPoint('8f349b2cc4');" /><input type="image" hspace="2" src="../../../../typo3/gfx/savesnapshot.gif" name="kickstarter_CMD_visibility_SAVE" onclick="setFormAnchorPoint('8f349b2cc4');" title="Save this field setting as a preset." /></span></td></tr>
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field title:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="e0a16f2ddf"></a><input type="text" name="kickstarter[wizArray_upd][fields][2][fields][1][title]" value="language visibility" style="width:200px;" onchange="setFormAnchorPoint('e0a16f2ddf');" title="WOP: [fields][2][fields][1][title]"> [English]</span></td></tr>
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field type:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="c9516b188c"></a><select name="kickstarter[wizArray_upd][fields][2][fields][1][type]" onchange="setFormAnchorPoint('c9516b188c');" title="WOP: [fields][2][fields][1][type]"><option value=""></option><option value="input" selected="selected">String input</option><option value="input+">String input, advanced</option><option value="textarea">Text area</option><option value="textarea_rte">Text area with RTE</option><option value="textarea_nowrap">Text area, No wrapping</option><option value="check">Checkbox, single</option><option value="check_4">Checkbox, 4 boxes in a row</option><option value="check_10">Checkbox, 10 boxes in two rows (max)</option><option value="link">Link</option><option value="date">Date</option><option value="datetime">Date and time</option><option value="integer">Integer, 10-1000</option><option value="select">Selectorbox</option><option value="radio">Radio buttons</option><option value="rel">Database relation</option><option value="files">Files</option><option value="none">Not editable, only displayed</option><option value="passthrough">[Passthrough]</option></select><a name="9f063575e9"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][2][fields][1][excludeField]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][2][fields][1][excludeField]" value="1" checked="checked" onclick="setFormAnchorPoint('9f063575e9');" title="WOP: [fields][2][fields][1][excludeField]"> Is Exclude-field  <a href="#" title="If a field is marked &quot;Exclude-field&quot;, users can edit it ONLY if the field is specifically listed in one of the backend user groups of the user.\nIn other words, if a field is marked &quot;Exclude-field&quot; you can control which users can edit it and which cannot." style="cursor:help" onclick="alert(String.fromCharCode(73,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,44,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,79,78,76,89,32,105,102,32,116,104,101,32,102,105,101,108,100,32,105,115,32,115,112,101,99,105,102,105,99,97,108,108,121,32,108,105,115,116,101,100,32,105,110,32,111,110,101,32,111,102,32,116,104,101,32,98,97,99,107,101,110,100,32,117,115,101,114,32,103,114,111,117,112,115,32,111,102,32,116,104,101,32,117,115,101,114,46,92,110,73,110,32,111,116,104,101,114,32,119,111,114,100,115,44,32,105,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,32,121,111,117,32,99,97,110,32,99,111,110,116,114,111,108,32,119,104,105,99,104,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,97,110,100,32,119,104,105,99,104,32,99,97,110,110,111,116,46));return false;">(What is this?)</a><br /><img src="../../../../typo3conf/ext/kickstarter/res/t_input.png" width="297" height="32" vspace="5" border="1" style="border:solid 1px;" /><br /><blockquote><a name="0e63a6bc18"></a><input type="text" name="kickstarter[wizArray_upd][fields][2][fields][1][conf_size]" value="" style="width:50px;" onchange="setFormAnchorPoint('0e63a6bc18');" title="WOP: [fields][2][fields][1][conf_size]"> Field width (5-48 relative, 30 default)<br /><a name="cd237097a6"></a><input type="text" name="kickstarter[wizArray_upd][fields][2][fields][1][conf_max]" value="" style="width:50px;" onchange="setFormAnchorPoint('cd237097a6');" title="WOP: [fields][2][fields][1][conf_max]"> Max characters<br /><a name="e85eeae63c"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][2][fields][1][conf_required]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][2][fields][1][conf_required]" value="1" onclick="setFormAnchorPoint('e85eeae63c');" title="WOP: [fields][2][fields][1][conf_required]">Required<br /><img src="../../../../typo3conf/ext/kickstarter/res/t_input_required.png" width="129" height="34" hspace=20 vspace="5" border="1" style="border:solid 1px;" /><br /><br /><a name="942801eb09"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][2][fields][1][conf_varchar]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][2][fields][1][conf_varchar]" value="1" onclick="setFormAnchorPoint('942801eb09');" title="WOP: [fields][2][fields][1][conf_varchar]">Create VARCHAR, not TINYTEXT field<br /></blockquote></span></td></tr>
+</table></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>NEW FIELD:</strong></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><table border="0" cellpadding="0" cellspacing="0">
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field name:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="bbf3ce18c2"></a><input type="text" name="kickstarter[wizArray_upd][fields][2][fields][2][fieldname]" value="" style="width:200px;" onchange="setFormAnchorPoint('bbf3ce18c2');" title="WOP: [fields][2][fields][2][fieldname]"></span></td></tr>
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field title:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="7ea574dba7"></a><input type="text" name="kickstarter[wizArray_upd][fields][2][fields][2][title]" value="" style="width:200px;" onchange="setFormAnchorPoint('7ea574dba7');" title="WOP: [fields][2][fields][2][title]"> [English]</span></td></tr>
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field type:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="3f7d9f2467"></a><select name="kickstarter[wizArray_upd][fields][2][fields][2][type]" onchange="setFormAnchorPoint('3f7d9f2467');" title="WOP: [fields][2][fields][2][type]"><option value="" selected="selected"></option><option value="input">String input</option><option value="input+">String input, advanced</option><option value="textarea">Text area</option><option value="textarea_rte">Text area with RTE</option><option value="textarea_nowrap">Text area, No wrapping</option><option value="check">Checkbox, single</option><option value="check_4">Checkbox, 4 boxes in a row</option><option value="check_10">Checkbox, 10 boxes in two rows (max)</option><option value="link">Link</option><option value="date">Date</option><option value="datetime">Date and time</option><option value="integer">Integer, 10-1000</option><option value="select">Selectorbox</option><option value="radio">Radio buttons</option><option value="rel">Database relation</option><option value="files">Files</option><option value="none">Not editable, only displayed</option><option value="passthrough">[Passthrough]</option></select><a name="c0d40dad70"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][2][fields][2][excludeField]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][2][fields][2][excludeField]" value="1" checked="checked" onclick="setFormAnchorPoint('c0d40dad70');" title="WOP: [fields][2][fields][2][excludeField]"> Is Exclude-field  <a href="#" title="If a field is marked &quot;Exclude-field&quot;, users can edit it ONLY if the field is specifically listed in one of the backend user groups of the user.\nIn other words, if a field is marked &quot;Exclude-field&quot; you can control which users can edit it and which cannot." style="cursor:help" onclick="alert(String.fromCharCode(73,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,44,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,79,78,76,89,32,105,102,32,116,104,101,32,102,105,101,108,100,32,105,115,32,115,112,101,99,105,102,105,99,97,108,108,121,32,108,105,115,116,101,100,32,105,110,32,111,110,101,32,111,102,32,116,104,101,32,98,97,99,107,101,110,100,32,117,115,101,114,32,103,114,111,117,112,115,32,111,102,32,116,104,101,32,117,115,101,114,46,92,110,73,110,32,111,116,104,101,114,32,119,111,114,100,115,44,32,105,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,32,121,111,117,32,99,97,110,32,99,111,110,116,114,111,108,32,119,104,105,99,104,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,97,110,100,32,119,104,105,99,104,32,99,97,110,110,111,116,46));return false;">(What is this?)</a><br /></span></td></tr>
+</table></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><br /><br />Load preset fields: <br /><select name="kickstarter[_PRESET][]" size="5" multiple="multiple"><option value="">__Fields picked up in this session__:</option><option value="languagevisibility-fields-1.fallbackorder">languagevisibility-fields-1: fallback order (fallbackorder, type: rel)</option><option value="languagevisibility-fields-1.defaultvisibility">languagevisibility-fields-1:  (defaultvisibility, type: select)</option><option value="languagevisibility-fields-2.visibility">languagevisibility-fields-2: language visibility (visibility, type: input)</option><option value="languagevisibility-fields-3.visibility">languagevisibility-fields-3: language visibility (visibility, type: input)</option></select></span></td></tr></table><hr /><table border="0" cellpadding="2" cellspacing="2"><tr bgcolor=""><td><strong><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Extend existing Tables</span></strong></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Add custom fields to existing tables, such as the "pages", "tt_content", "fe_users" or "be_users" table.</span></td></tr><tr><td></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>Which table:<br /></strong><a name="06eef7379a"></a><select name="kickstarter[wizArray_upd][fields][3][which_table]" onchange="setFormAnchorPoint('06eef7379a');" title="WOP: [fields][3][which_table]"><option value="be_groups">be_groups (Backend Groups)</option><option value="be_users">be_users (Backend Users)</option><option value="fe_groups">fe_groups (Frontend Groups)</option><option value="fe_users">fe_users (Frontend Users)</option><option value="index_config">index_config (Indexing Configuration)</option><option value="pages">pages (Pages)</option><option value="pages_language_overlay">pages_language_overlay (Alternative Page Language)</option><option value="static_countries">static_countries (Countries)</option><option value="static_country_zones">static_country_zones (Country subdivisions)</option><option value="static_currencies">static_currencies (Currencies)</option><option value="static_languages">static_languages (Languages)</option><option value="static_markets">static_markets (Markets)</option><option value="static_taxes">static_taxes (Static taxes)</option><option value="static_template">static_template (Static templates)</option><option value="static_territories">static_territories (Territory)</option><option value="sys_domain">sys_domain (Domain)</option><option value="sys_filemounts">sys_filemounts (Filemount)</option><option value="sys_language">sys_language (Website Language)</option><option value="sys_note">sys_note (Internal note)</option><option value="sys_template">sys_template (Template)</option><option value="sys_workspace">sys_workspace (Workspace)</option><option value="tt_content" selected="selected">tt_content (Content)</option><option value="tt_news">tt_news (News)</option><option value="tt_news_cat">tt_news_cat (News category)</option><option value="tx_aoewebex_regions">tx_aoewebex_regions (additional Regions)</option><option value="tx_ccdevlog">tx_ccdevlog (DevLog)</option><option value="tx_l10nmgr_cfg">tx_l10nmgr_cfg (L10N Manager Configuration)</option><option value="tx_l10nmgr_priorities">tx_l10nmgr_priorities (Localization Priority)</option><option value="tx_rtehtmlarea_acronym">tx_rtehtmlarea_acronym (Acronym)</option><option value="tx_templavoila_datastructure">tx_templavoila_datastructure (TemplaVoilà Data Structure)</option><option value="tx_templavoila_tmplobj">tx_templavoila_tmplobj (TemplaVoilà Template Object)</option></select> <a href="#" title="Select the table which should be extended with these extra fields." style="cursor:help" onclick="alert(String.fromCharCode(83,101,108,101,99,116,32,116,104,101,32,116,97,98,108,101,32,119,104,105,99,104,32,115,104,111,117,108,100,32,98,101,32,101,120,116,101,110,100,101,100,32,119,105,116,104,32,116,104,101,115,101,32,101,120,116,114,97,32,102,105,101,108,100,115,46));return false;">(What is this?)</a></span><input type="hidden" name="kickstarter[wizArray_upd][fields][3][title]" value="tt_content (Content)" /></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>FIELD:</strong> <em>visibility</em></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><table border="0" cellpadding="0" cellspacing="0">
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field name:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="36228c274d"></a><input type="text" name="kickstarter[wizArray_upd][fields][3][fields][1][fieldname]" value="visibility" style="width:200px;" onchange="setFormAnchorPoint('36228c274d');" title="WOP: [fields][3][fields][1][fieldname]"> (Remove:<a name="1a67a8bbd8"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][3][fields][1][_DELETE]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][3][fields][1][_DELETE]" value="1" onclick="setFormAnchorPoint('1a67a8bbd8');" title="WOP: [fields][3][fields][1][_DELETE]">)<input type="image" hspace="2" src="../../../../typo3/gfx/pil2up.gif" name="kickstarter_CMD_visibility_UP" onclick="setFormAnchorPoint('36228c274d');" /><input type="image" hspace="2" src="../../../../typo3/gfx/pil2down.gif" name="kickstarter_CMD_visibility_DOWN" onclick="setFormAnchorPoint('36228c274d');" /><input type="image" hspace="2" src="../../../../typo3/gfx/savesnapshot.gif" name="kickstarter_CMD_visibility_SAVE" onclick="setFormAnchorPoint('36228c274d');" title="Save this field setting as a preset." /></span></td></tr>
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field title:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="c8d9c54018"></a><input type="text" name="kickstarter[wizArray_upd][fields][3][fields][1][title]" value="language visibility" style="width:200px;" onchange="setFormAnchorPoint('c8d9c54018');" title="WOP: [fields][3][fields][1][title]"> [English]</span></td></tr>
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field type:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="970c8df5fb"></a><select name="kickstarter[wizArray_upd][fields][3][fields][1][type]" onchange="setFormAnchorPoint('970c8df5fb');" title="WOP: [fields][3][fields][1][type]"><option value=""></option><option value="input" selected="selected">String input</option><option value="input+">String input, advanced</option><option value="textarea">Text area</option><option value="textarea_rte">Text area with RTE</option><option value="textarea_nowrap">Text area, No wrapping</option><option value="check">Checkbox, single</option><option value="check_4">Checkbox, 4 boxes in a row</option><option value="check_10">Checkbox, 10 boxes in two rows (max)</option><option value="link">Link</option><option value="date">Date</option><option value="datetime">Date and time</option><option value="integer">Integer, 10-1000</option><option value="select">Selectorbox</option><option value="radio">Radio buttons</option><option value="rel">Database relation</option><option value="files">Files</option><option value="none">Not editable, only displayed</option><option value="passthrough">[Passthrough]</option></select><a name="22a929a290"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][3][fields][1][excludeField]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][3][fields][1][excludeField]" value="1" checked="checked" onclick="setFormAnchorPoint('22a929a290');" title="WOP: [fields][3][fields][1][excludeField]"> Is Exclude-field  <a href="#" title="If a field is marked &quot;Exclude-field&quot;, users can edit it ONLY if the field is specifically listed in one of the backend user groups of the user.\nIn other words, if a field is marked &quot;Exclude-field&quot; you can control which users can edit it and which cannot." style="cursor:help" onclick="alert(String.fromCharCode(73,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,44,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,79,78,76,89,32,105,102,32,116,104,101,32,102,105,101,108,100,32,105,115,32,115,112,101,99,105,102,105,99,97,108,108,121,32,108,105,115,116,101,100,32,105,110,32,111,110,101,32,111,102,32,116,104,101,32,98,97,99,107,101,110,100,32,117,115,101,114,32,103,114,111,117,112,115,32,111,102,32,116,104,101,32,117,115,101,114,46,92,110,73,110,32,111,116,104,101,114,32,119,111,114,100,115,44,32,105,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,32,121,111,117,32,99,97,110,32,99,111,110,116,114,111,108,32,119,104,105,99,104,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,97,110,100,32,119,104,105,99,104,32,99,97,110,110,111,116,46));return false;">(What is this?)</a><br /><img src="../../../../typo3conf/ext/kickstarter/res/t_input.png" width="297" height="32" vspace="5" border="1" style="border:solid 1px;" /><br /><blockquote><a name="dc95634219"></a><input type="text" name="kickstarter[wizArray_upd][fields][3][fields][1][conf_size]" value="" style="width:50px;" onchange="setFormAnchorPoint('dc95634219');" title="WOP: [fields][3][fields][1][conf_size]"> Field width (5-48 relative, 30 default)<br /><a name="9dd67d9b69"></a><input type="text" name="kickstarter[wizArray_upd][fields][3][fields][1][conf_max]" value="" style="width:50px;" onchange="setFormAnchorPoint('9dd67d9b69');" title="WOP: [fields][3][fields][1][conf_max]"> Max characters<br /><a name="9ef6daaa7c"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][3][fields][1][conf_required]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][3][fields][1][conf_required]" value="1" onclick="setFormAnchorPoint('9ef6daaa7c');" title="WOP: [fields][3][fields][1][conf_required]">Required<br /><img src="../../../../typo3conf/ext/kickstarter/res/t_input_required.png" width="129" height="34" hspace=20 vspace="5" border="1" style="border:solid 1px;" /><br /><br /><a name="9e5b22b36f"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][3][fields][1][conf_varchar]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][3][fields][1][conf_varchar]" value="1" onclick="setFormAnchorPoint('9e5b22b36f');" title="WOP: [fields][3][fields][1][conf_varchar]">Create VARCHAR, not TINYTEXT field<br /></blockquote></span></td></tr>
+</table></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><strong>NEW FIELD:</strong></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><table border="0" cellpadding="0" cellspacing="0">
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field name:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="922f3eb3c1"></a><input type="text" name="kickstarter[wizArray_upd][fields][3][fields][2][fieldname]" value="" style="width:200px;" onchange="setFormAnchorPoint('922f3eb3c1');" title="WOP: [fields][3][fields][2][fieldname]"></span></td></tr>
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field title:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="dcc7b1d034"></a><input type="text" name="kickstarter[wizArray_upd][fields][3][fields][2][title]" value="" style="width:200px;" onchange="setFormAnchorPoint('dcc7b1d034');" title="WOP: [fields][3][fields][2][title]"> [English]</span></td></tr>
+       <tr><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;">Field type:</span></td><td valign="top"><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><a name="97d5b45b10"></a><select name="kickstarter[wizArray_upd][fields][3][fields][2][type]" onchange="setFormAnchorPoint('97d5b45b10');" title="WOP: [fields][3][fields][2][type]"><option value="" selected="selected"></option><option value="input">String input</option><option value="input+">String input, advanced</option><option value="textarea">Text area</option><option value="textarea_rte">Text area with RTE</option><option value="textarea_nowrap">Text area, No wrapping</option><option value="check">Checkbox, single</option><option value="check_4">Checkbox, 4 boxes in a row</option><option value="check_10">Checkbox, 10 boxes in two rows (max)</option><option value="link">Link</option><option value="date">Date</option><option value="datetime">Date and time</option><option value="integer">Integer, 10-1000</option><option value="select">Selectorbox</option><option value="radio">Radio buttons</option><option value="rel">Database relation</option><option value="files">Files</option><option value="none">Not editable, only displayed</option><option value="passthrough">[Passthrough]</option></select><a name="ea341ef41b"></a><input type="hidden" name="kickstarter[wizArray_upd][fields][3][fields][2][excludeField]" value="0"><input type="checkbox" name="kickstarter[wizArray_upd][fields][3][fields][2][excludeField]" value="1" checked="checked" onclick="setFormAnchorPoint('ea341ef41b');" title="WOP: [fields][3][fields][2][excludeField]"> Is Exclude-field  <a href="#" title="If a field is marked &quot;Exclude-field&quot;, users can edit it ONLY if the field is specifically listed in one of the backend user groups of the user.\nIn other words, if a field is marked &quot;Exclude-field&quot; you can control which users can edit it and which cannot." style="cursor:help" onclick="alert(String.fromCharCode(73,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,44,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,79,78,76,89,32,105,102,32,116,104,101,32,102,105,101,108,100,32,105,115,32,115,112,101,99,105,102,105,99,97,108,108,121,32,108,105,115,116,101,100,32,105,110,32,111,110,101,32,111,102,32,116,104,101,32,98,97,99,107,101,110,100,32,117,115,101,114,32,103,114,111,117,112,115,32,111,102,32,116,104,101,32,117,115,101,114,46,92,110,73,110,32,111,116,104,101,114,32,119,111,114,100,115,44,32,105,102,32,97,32,102,105,101,108,100,32,105,115,32,109,97,114,107,101,100,32,34,69,120,99,108,117,100,101,45,102,105,101,108,100,34,32,121,111,117,32,99,97,110,32,99,111,110,116,114,111,108,32,119,104,105,99,104,32,117,115,101,114,115,32,99,97,110,32,101,100,105,116,32,105,116,32,97,110,100,32,119,104,105,99,104,32,99,97,110,110,111,116,46));return false;">(What is this?)</a><br /></span></td></tr>
+</table></span></td></tr><tr bgcolor=""><td><span style="font-family:verdana,arial,sans-serif; font-size:10px;"><br /><br />Load preset fields: <br /><select name="kickstarter[_PRESET][]" size="5" multiple="multiple"><option value="">__Fields picked up in this session__:</option><option value="languagevisibility-fields-1.fallbackorder">languagevisibility-fields-1: fallback order (fallbackorder, type: rel)</option><option value="languagevisibility-fields-1.defaultvisibility">languagevisibility-fields-1:  (defaultvisibility, type: select)</option><option value="languagevisibility-fields-2.visibility">languagevisibility-fields-2: language visibility (visibility, type: input)</option><option value="languagevisibility-fields-3.visibility">languagevisibility-fields-3: language visibility (visibility, type: input)</option></select></span></td></tr></table>
+       </body>
+       </html>
\ No newline at end of file
diff --git a/ext_conf_template.txt b/ext_conf_template.txt
new file mode 100644 (file)
index 0000000..0f8ff2e
--- /dev/null
@@ -0,0 +1,3 @@
+
+  # cat=basic//10; type=boolean; label= Add PATCH to TemplaVoila PageModul
+applyPatchTV = 1
diff --git a/ext_emconf.php b/ext_emconf.php
new file mode 100644 (file)
index 0000000..8ae8030
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+
+########################################################################
+# Extension Manager/Repository config file for ext: "languagevisibility"
+#
+# Auto generated 03-07-2008 11:28
+#
+# Manual updates:
+# Only the data in the array - anything else is removed by next write.
+# "version" and "dependencies" must not be touched!
+########################################################################
+
+$EM_CONF[$_EXTKEY] = array(
+       'title' => 'Multilanguage Projects: Language Visibility',
+       'description' => '',
+       'category' => '',
+       'author' => '',
+       'author_email' => '',
+       'shy' => '',
+       'dependencies' => 'cms',
+       'conflicts' => 'danp_languagefallback_patch',
+       'priority' => '',
+       'module' => '',
+       'state' => '',
+       'internal' => '',
+       'uploadfolder' => 0,
+       'createDirs' => '',
+       'modify_tables' => '',
+       'clearCacheOnLoad' => 0,
+       'lockType' => '',
+       'author_company' => '',
+       'version' => '0.1.12',
+       'constraints' => array(
+               'depends' => array(
+                       'cms' => '',
+               ),
+               'conflicts' => array(
+                       'danp_languagefallback_patch' => '',
+               ),
+               'suggests' => array(
+               ),
+       ),
+       '_md5_values_when_last_written' => 'a:50:{s:9:"ChangeLog";s:4:"4dd9";s:10:"README.txt";s:4:"fc7c";s:39:"class.tx_languagevisibility_behooks.php";s:4:"1dc0";s:42:"class.tx_languagevisibility_beservices.php";s:4:"04e0";s:42:"class.tx_languagevisibility_feservices.php";s:4:"c562";s:47:"class.tx_languagevisibility_fieldvisibility.php";s:4:"857a";s:21:"ext_conf_template.txt";s:4:"bfdc";s:12:"ext_icon.gif";s:4:"1bdc";s:17:"ext_localconf.php";s:4:"3933";s:14:"ext_tables.php";s:4:"8bf6";s:14:"ext_tables.sql";s:4:"0d80";s:16:"locallang_db.xml";s:4:"6a54";s:48:"classes/class.tx_languagevisibility_celement.php";s:4:"6ed0";s:47:"classes/class.tx_languagevisibility_element.php";s:4:"1577";s:54:"classes/class.tx_languagevisibility_elementFactory.php";s:4:"02e6";s:50:"classes/class.tx_languagevisibility_fceelement.php";s:4:"f681";s:57:"classes/class.tx_languagevisibility_fceoverlayelement.php";s:4:"5b1f";s:48:"classes/class.tx_languagevisibility_language.php";s:4:"3fc9";s:58:"classes/class.tx_languagevisibility_languagerepository.php";s:4:"b586";s:51:"classes/class.tx_languagevisibility_pageelement.php";s:4:"ac9d";s:53:"classes/class.tx_languagevisibility_recordelement.php";s:4:"9db4";s:57:"classes/class.tx_languagevisibility_visibilityService.php";s:4:"9ba7";s:53:"classes/dao/class.tx_languagevisibility_daocommon.php";s:4:"756d";s:58:"classes/dao/class.tx_languagevisibility_daocommon_stub.php";s:4:"5249";s:19:"doc/wizard_form.dat";s:4:"ecbf";s:20:"doc/wizard_form.html";s:4:"5a09";s:49:"modfunc1/class.tx_languagevisibility_modfunc1.php";s:4:"76c2";s:22:"modfunc1/locallang.xml";s:4:"25f7";s:28:"patch/class.ux_SCalt_doc.php";s:4:"7ab2";s:35:"patch/class.ux_t3lib_beuserauth.php";s:4:"f7f8";s:29:"patch/class.ux_t3lib_page.php";s:4:"b2c5";s:32:"patch/class.ux_t3lib_tcemain.php";s:4:"1ff7";s:27:"patch/class.ux_tslib_fe.php";s:4:"0e9f";s:29:"patch/class.ux_tslib_menu.php";s:4:"dab7";s:32:"patch/class.ux_ux_tslib_menu.php";s:4:"d859";s:40:"patch/tv/class.ux_tx_templavoila_api.php";s:4:"62f7";s:44:"patch/tv/class.ux_tx_templavoila_module1.php";s:4:"68bc";s:40:"patch/tv/class.ux_tx_templavoila_pi1.php";s:4:"6ece";s:11:"res/nok.gif";s:4:"ce40";s:10:"res/ok.gif";s:4:"4705";s:36:"tests/tx_elementFactory_testcase.php";s:4:"ef14";s:29:"tests/tx_element_testcase.php";s:4:"78e0";s:30:"tests/tx_language_testcase.php";s:4:"f4fc";s:40:"tests/tx_languagerepository_testcase.php";s:4:"fdca";s:39:"tests/tx_visibilityService_testcase.php";s:4:"4326";s:41:"tests/fixtures/fce_2col_datastructure.xml";s:4:"d349";s:42:"tests/fixtures/fce_2col_templateobject.dat";s:4:"18ee";s:47:"tests/fixtures/fce_buttonelement_contentxml.xml";s:4:"8776";s:50:"tests/fixtures/fce_buttonelement_datastructure.xml";s:4:"e3b3";s:61:"tests/fixtures/fce_buttonelement_datastructure_useOverlay.xml";s:4:"2c43";}',
+       'suggests' => array(
+       ),
+);
+
+?>
\ No newline at end of file
diff --git a/ext_icon.gif b/ext_icon.gif
new file mode 100644 (file)
index 0000000..b993e8a
Binary files /dev/null and b/ext_icon.gif differ
diff --git a/ext_localconf.php b/ext_localconf.php
new file mode 100644 (file)
index 0000000..b85ff80
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+
+
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['languagevisibility'] = 'EXT:languagevisibility/class.tx_languagevisibility_behooks.php:tx_languagevisibility_behooks';
+
+
+require_once(t3lib_extMgm::extPath($_EXTKEY) . 'class.tx_languagevisibility_fieldvisibility.php');
+
+
+$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_page.php']=t3lib_extMgm::extPath($_EXTKEY) . 'patch/class.ux_t3lib_page.php';
+include_once(t3lib_extMgm::extPath($_EXTKEY) . 'patch/class.ux_t3lib_page.php');
+if ($TYPO3_CONF_VARS['FE']['XCLASS']['tslib/class.tslib_menu.php']) {  
+       $TYPO3_CONF_VARS['FE']['XCLASS']['tslib/class.ux_tslib_menu.php']=t3lib_extMgm::extPath($_EXTKEY) . 'patch/class.ux_ux_tslib_menu.php';
+}
+else {
+       $TYPO3_CONF_VARS['FE']['XCLASS']['tslib/class.tslib_menu.php']=t3lib_extMgm::extPath($_EXTKEY) . 'patch/class.ux_tslib_menu.php';
+}
+if (TYPO3_MODE=='FE') {
+       //include_once($TYPO3_CONF_VARS['FE']['XCLASS']['tslib/class.tslib_menu.php']);
+}
+
+$TYPO3_CONF_VARS['FE']['XCLASS']['tslib/class.tslib_fe.php']=t3lib_extMgm::extPath($_EXTKEY) . 'patch/class.ux_tslib_fe.php';
+
+$confArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['languagevisibility']);
+if ($confArr['applyPatchTV']==1) {
+       //$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/templavoila/mod1/index.php']=t3lib_extMgm::extPath($_EXTKEY) . 'patch/tv/class.ux_tx_templavoila_module1.php';    
+       
+}
+$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/templavoila/pi1/class.tx_templavoila_pi1.php']=t3lib_extMgm::extPath($_EXTKEY) . 'patch/tv/class.ux_tx_templavoila_pi1.php';       
+//$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/templavoila/class.tx_templavoila_api.php']=t3lib_extMgm::extPath($_EXTKEY) . 'patch/tv/class.ux_tx_templavoila_api.php';
+
+//modify permission check for creating pages
+$GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/alt_doc.php']=t3lib_extMgm::extPath($_EXTKEY) . 'patch/class.ux_SCalt_doc.php';       
+$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_beuserauth.php']=t3lib_extMgm::extPath($_EXTKEY) . 'patch/class.ux_t3lib_beuserauth.php';    
+$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tcemain.php']=t3lib_extMgm::extPath($_EXTKEY) . 'patch/class.ux_t3lib_tcemain.php';  
+?>
\ No newline at end of file
diff --git a/ext_tables.php b/ext_tables.php
new file mode 100644 (file)
index 0000000..064f4b7
--- /dev/null
@@ -0,0 +1,119 @@
+<?php
+if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+
+
+
+$tempColumns = Array (
+       "tx_languagevisibility_fallbackorder" => Array (                
+               "exclude" => 0,         
+               "label" => "LLL:EXT:languagevisibility/locallang_db.xml:sys_language.tx_languagevisibility_fallbackorder",              
+               'l10n_display'=>'hideDiff',
+               "config" => Array (
+                       "type" => "select",     
+                       "foreign_table" => "sys_language",      
+                       "foreign_table_where" => " ORDER BY sys_language.title",        
+                       "items" => Array (                              
+                               Array("default", "999"),                                
+                       ),
+                       "size" => 10,   
+                       "minitems" => 0,
+                       "maxitems" => 10,
+               )
+       ),
+       "tx_languagevisibility_defaultvisibility" => Array (            
+               "exclude" => 0,         
+               "label" => "LLL:EXT:languagevisibility/locallang_db.xml:sys_language.tx_languagevisibility_defaultvisibility",          
+               "config" => Array (
+                       "type" => "select",
+                       "items" => Array (      
+                               Array('',''),                                                                                                           
+                               Array("LLL:EXT:languagevisibility/locallang_db.xml:tx_languagevisibility_visibility.I.yes", "yes"),
+                               Array("LLL:EXT:languagevisibility/locallang_db.xml:tx_languagevisibility_visibility.I.no", "no"),
+                               Array("LLL:EXT:languagevisibility/locallang_db.xml:tx_languagevisibility_visibility.I.t", "t"),
+                               Array("LLL:EXT:languagevisibility/locallang_db.xml:tx_languagevisibility_visibility.I.f", "f"),
+                       ),
+                       'default'=>'f',
+                       "size" => 1,    
+                       "maxitems" => 1,
+               )
+       ),
+       "tx_languagevisibility_defaultvisibilityel" => Array (          
+               "exclude" => 0,         
+               "label" => "LLL:EXT:languagevisibility/locallang_db.xml:sys_language.tx_languagevisibility_defaultvisibilityel",                
+               "config" => Array (
+                       "type" => "select",
+                       "items" => Array (      
+                               Array('',''),                                                   
+                               Array("LLL:EXT:languagevisibility/locallang_db.xml:tx_languagevisibility_visibility.I.yes", "yes"),
+                               Array("LLL:EXT:languagevisibility/locallang_db.xml:tx_languagevisibility_visibility.I.no", "no"),
+                               Array("LLL:EXT:languagevisibility/locallang_db.xml:tx_languagevisibility_visibility.I.t", "t"),
+                               Array("LLL:EXT:languagevisibility/locallang_db.xml:tx_languagevisibility_visibility.I.f", "f"),
+                       ),
+                       'default'=>'f',
+                       "size" => 1,    
+                       "maxitems" => 1,
+               )
+       ),
+);
+
+
+t3lib_div::loadTCA("sys_language");
+t3lib_extMgm::addTCAcolumns("sys_language",$tempColumns,1);
+t3lib_extMgm::addToAllTCAtypes("sys_language","tx_languagevisibility_fallbackorder;;;;1-1-1, tx_languagevisibility_defaultvisibility, tx_languagevisibility_defaultvisibilityel");
+
+$tempColumns = Array (
+       "tx_languagevisibility_visibility" => Array (           
+               "exclude" => 1,         
+               "label" => "LLL:EXT:languagevisibility/locallang_db.xml:pages.tx_languagevisibility_visibility",                
+               "config" => Array (
+                       "type" => "user",       
+                       "size" => "30",
+                       "userFunc" => 'user_tx_languagevisibility_fieldvisibility->user_fieldvisibility',
+               )
+       ),
+);
+
+
+t3lib_div::loadTCA("pages");
+t3lib_extMgm::addTCAcolumns("pages",$tempColumns,1);
+t3lib_extMgm::addToAllTCAtypes("pages","--div--;LLL:EXT:languagevisibility/locallang_db.xml:tabname,tx_languagevisibility_visibility;;;;1-1-1");
+
+t3lib_div::loadTCA("tt_news");
+t3lib_extMgm::addTCAcolumns("tt_news",$tempColumns,1);
+t3lib_extMgm::addToAllTCAtypes("tt_news","--div--;LLL:EXT:languagevisibility/locallang_db.xml:tabname,tx_languagevisibility_visibility;;;;1-1-1");
+
+/*
+$tempColumns = Array (
+       "tx_languagevisibility_visibility" => Array (           
+               "exclude" => 1,         
+               "label" => "LLL:EXT:languagevisibility/locallang_db.xml:tt_content.tx_languagevisibility_visibility",           
+               "config" => Array (
+                       "type" => "user",                               
+                       "size" => "30",
+                       "userFunc" => 'user_tx_languagevisibility_fieldvisibility->user_fieldvisibility',
+               )
+       ),
+);
+*/
+
+t3lib_div::loadTCA("tt_content");
+t3lib_extMgm::addTCAcolumns("tt_content",$tempColumns,1);
+//t3lib_extMgm::addToAllTCAtypes("tt_content","--div--;LLL:EXT:languagevisibility/locallang_db.xml:tabname,tx_languagevisibility_visibility;;;;1-1-1");
+t3lib_extMgm::addToAllTCAtypes('tt_content', "--div--;LLL:EXT:languagevisibility/locallang_db.xml:tabname,tx_languagevisibility_visibility;;;;1-1-1,sys_language_uid,l18n_parent", '', 'before:sys_language_uid');
+
+
+//remove language related fields from pallete (instead show them in language tab)
+$GLOBALS['TCA']['tt_content']['palettes']['4']['showitem'] = str_replace('sys_language_uid,','',$GLOBALS['TCA']['tt_content']['palettes']['4']['showitem']);
+$GLOBALS['TCA']['tt_content']['palettes']['4']['showitem'] = str_replace('l18n_parent,','',$GLOBALS['TCA']['tt_content']['palettes']['4']['showitem']);
+$GLOBALS['TCA']['tt_content']['ctrl']['dividers2tabs']=TRUE;
+
+
+if (TYPO3_MODE=="BE")    {
+    t3lib_extMgm::insertModuleFunction(
+        "web_info",        
+        "tx_languagevisibility_modfunc1",
+        t3lib_extMgm::extPath($_EXTKEY)."modfunc1/class.tx_languagevisibility_modfunc1.php",
+        "LLL:EXT:languagevisibility/locallang_db.xml:moduleFunction.tx_languagevisibility_modfunc1"
+    );
+}
+?>
\ No newline at end of file
diff --git a/ext_tables.sql b/ext_tables.sql
new file mode 100644 (file)
index 0000000..48b807e
--- /dev/null
@@ -0,0 +1,34 @@
+#
+# Table structure for table 'sys_language'
+#
+CREATE TABLE sys_language (
+       tx_languagevisibility_fallbackorder blob NOT NULL,
+       tx_languagevisibility_defaultvisibility varchar(11) DEFAULT '0' NOT NULL,
+       tx_languagevisibility_defaultvisibilityel varchar(11) DEFAULT '0' NOT NULL
+);
+
+
+
+#
+# Table structure for table 'pages'
+#
+CREATE TABLE pages (
+       tx_languagevisibility_visibility text NOT NULL
+);
+
+
+
+#
+# Table structure for table 'tt_content'
+#
+CREATE TABLE tt_content (
+       tx_languagevisibility_visibility text NOT NULL
+);
+
+
+#
+# Table structure for table 'pages'
+#
+CREATE TABLE tt_news (
+       tx_languagevisibility_visibility text NOT NULL
+);
\ No newline at end of file
diff --git a/locallang_db.xml b/locallang_db.xml
new file mode 100644 (file)
index 0000000..0ada566
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3locallang>
+       <meta type="array">
+               <type>database</type>
+               <description>Language labels for database tables/fields belonging to extension 'languagevisibility'</description>
+       </meta>
+       <data type="array">
+               <languageKey index="default" type="array">
+                       <label index="sys_language.tx_languagevisibility_fallbackorder">fallback order</label>
+                       <label index="pages.tx_languagevisibility_visibility">language visibility</label>
+                       <label index="tt_content.tx_languagevisibility_visibility">language visibility</label>                  
+                       <label index="sys_language.tx_languagevisibility_defaultvisibility">default visibility for pages</label>
+                       <label index="sys_language.tx_languagevisibility_visibilityel">default visibility for elements</label>
+                       <label index="tx_languagevisibility_visibility.I.yes">forced to YES</label>
+                       <label index="tx_languagevisibility_visibility.I.no">forced to NO</label>
+                       <label index="tx_languagevisibility_visibility.I.f">if translation in fallback</label>
+                       <label index="tx_languagevisibility_visibility.I.t">if translated</label>       
+                       <label index="tabname">Language</label>                                         
+                       <label index="language">Language</label>                                                
+                       <label index="visibility">visibility setting</label>                                            
+                       <label index="hastranslation">translated</label>                                                
+                       <label index="isshown">visible</label>                                          
+                       <label index="default">-default-</label>                                                
+                       <label index="fallback">if a translation in fallback exists</label>                                             
+                       <label index="no">never</label>                                         
+                       <label index="yes">always</label>                                               
+                       <label index="translated">if translated</label>         
+                       <label index="moduleFunction.tx_languagevisibility_modfunc1">Language Visibility Overview</label>                                                               
+               </languageKey>
+       </data>
+</T3locallang>
\ No newline at end of file
diff --git a/modfunc1/class.tx_languagevisibility_modfunc1.php b/modfunc1/class.tx_languagevisibility_modfunc1.php
new file mode 100644 (file)
index 0000000..4e9b1b6
--- /dev/null
@@ -0,0 +1,424 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2008  <>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_languagerepository.php');
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_elementFactory.php');
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_visibilityService.php');
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/dao/class.tx_languagevisibility_daocommon.php');
+require_once(PATH_t3lib.'class.t3lib_extobjbase.php');
+/**
+ * Module extension (addition to function menu) 'Language Visibility Overview' for the 'testtt' extension.
+ *
+ * @author     <Daniel Pötzinger>
+ * @package    TYPO3
+ * @subpackage    tx_languagevisibility
+ */
+class tx_languagevisibility_modfunc1 extends t3lib_extobjbase {
+       /**
+        * Returns the menu array
+        *
+        * @return      array
+        */
+       function modMenu()      {
+               global $LANG;
+
+               $menuArray = array (
+                       'depth' => array(
+                               0 => $LANG->getLL('depth_0'),
+                               1 => $LANG->getLL('depth_1'),
+                               2 => $LANG->getLL('depth_2'),
+                               3 => $LANG->getLL('depth_3')
+                       ),
+               );
+
+                       // Languages:
+               
+               $languageRep=t3lib_div::makeInstance('tx_languagevisibility_languagerepository');       
+    $languageList=$languageRep->getLanguages();  
+               $menuArray['lang']=array(
+                       0 => '[All]'
+               );
+               foreach($languageList as $language)     {
+                       $menuArray['lang'][$language->getUid()] = $language->getTitle();
+               }
+
+               return $menuArray;
+       }
+
+       /**
+        * MAIN function for page information of localization
+        *
+        * @return      string          Output HTML for the module.
+        */
+       function main() {
+               global $BACK_PATH,$LANG,$SOBE;
+
+               if ($this->pObj->id)    {
+                       $theOutput = '';
+
+                               // Depth selector:
+                       $h_func = t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[depth]',$this->pObj->MOD_SETTINGS['depth'],$this->pObj->MOD_MENU['depth'],'index.php');
+                       $h_func.= t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[lang]',$this->pObj->MOD_SETTINGS['lang'],$this->pObj->MOD_MENU['lang'],'index.php');
+                       $theOutput.= $h_func;
+
+                               // Add CSH:
+                       $theOutput.= t3lib_BEfunc::cshItem('_MOD_web_info','lang',$GLOBALS['BACK_PATH'],'|<br/>');
+
+                               // Showing the tree:
+                               // Initialize starting point of page tree:
+                       $treeStartingPoint = intval($this->pObj->id);
+                       $treeStartingRecord = t3lib_BEfunc::getRecordWSOL('pages', $treeStartingPoint);
+                       $depth = $this->pObj->MOD_SETTINGS['depth'];
+
+                               // Initialize tree object:
+                       $tree = t3lib_div::makeInstance('t3lib_pageTree');
+                       $tree->init('AND '.$GLOBALS['BE_USER']->getPagePermsClause(1));
+                       $tree->addField('l18n_cfg');
+
+                               // Creating top icon; the current page
+                       $HTML = t3lib_iconWorks::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'],'align="top"');
+                       $tree->tree[] = array(
+                               'row' => $treeStartingRecord,
+                               'HTML'=>$HTML
+                       );
+
+                               // Create the tree from starting point:
+                       if ($depth)     $tree->getTree($treeStartingPoint, $depth, '');
+                       #debug($tree->tree);
+
+                               // Add CSS needed:
+                       $css_content = '
+                               TABLE#langTable {
+                                       margin-top: 10px;
+                               }
+                               TABLE#langTable TR TD {
+                                       padding-left : 2px;
+                                       padding-right : 2px;
+                                       white-space: nowrap;
+                               }
+                               TD.c-notvisible { background-color: red; }
+                               TD.c-visible { background-color: #669966; }
+                               TD.c-translated { background-color: #A8E95C; }
+                               TD.c-nottranslated { background-color: #E9CD5C; }
+                               TD.c-leftLine {border-left: 2px solid black; }
+                               .bgColor5 { font-weight: bold; }
+                       ';
+                       $marker = '/*###POSTCSSMARKER###*/';
+                       $this->pObj->content = str_replace($marker,$css_content.chr(10).$marker,$this->pObj->content);
+
+                               // Render information table:
+                       $theOutput.= $this->renderL10nTable($tree);
+               }
+
+               return $theOutput;
+       }
+
+       /**
+        * Rendering the localization information table.
+        *
+        * @param       array           The Page tree data
+        * @return      string          HTML for the localization information table.
+        */
+       function renderL10nTable(&$tree)        {
+               global $LANG;
+
+
+
+                       // Title length:
+               $titleLen = $GLOBALS['BE_USER']->uc['titleLen'];
+
+                       // Put together the TREE:
+               $output = '';
+               $newOL_js = array();
+               $langRecUids = array();
+               
+               //Init DDD
+               $dao=t3lib_div::makeInstance('tx_languagevisibility_daocommon');
+               $elementfactoryName= t3lib_div::makeInstanceClassName('tx_languagevisibility_elementFactory');          
+               $elementfactory=new $elementfactoryName($dao);  
+               
+    
+    $languageRep=t3lib_div::makeInstance('tx_languagevisibility_languagerepository');  
+    $languageList=$languageRep->getLanguages();  
+    
+    $visibility=t3lib_div::makeInstance('tx_languagevisibility_visibilityService');
+    
+    
+   
+    //traverse Tree:
+               foreach($tree->tree as $data)   {                       
+                       $tCells = array();
+                       
+                       $element=$elementfactory->getElementForTable('pages',$data['row']['uid']);
+                       
+                       //first cell (tree):
+                       // Page icons / titles etc.
+                       $tCells[] = '<td'.($data['row']['_CSSCLASS'] ? ' class="'.$data['row']['_CSSCLASS'].'"' : '').'>'.
+                                                       $data['HTML'].
+                                                       htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['title'],$titleLen)).
+                                                       (strcmp($data['row']['nav_title'],'') ? ' [Nav: <em>'.htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['nav_title'],$titleLen)).'</em>]' : '').
+                                                       '</td>';
+                       //language cells:
+           foreach ($languageList as $language) { 
+               $info = '';
+               $editUid = $data['row']['uid'];
+               $params = '&edit[pages]['.$editUid.']=edit';
+               $langId=$language->getUid();
+               if ($visibility->isVisible($language,$element)) {
+                       $isVisible=TRUE;
+                       $statusVis = 'c-visible';
+               }
+               else {
+                       $isVisible=FALSE;
+                       $statusVis = 'c-notvisible';
+               }
+               if ($element->hasTranslation($langId)) {                        
+                                       $statusTrans = 'c-translated';
+                               }
+                               else {
+                                       $statusTrans = 'c-nottranslated';                                       
+                               }
+                               
+               if ($language->getUid()==0) {
+                       //Default
+                       //"View page" link is created:
+                                       $viewPageLink= '<a href="#" onclick="'.
+                                                       htmlspecialchars(t3lib_BEfunc::viewOnClick($data['row']['uid'],$GLOBALS['BACK_PATH'],'','','','&L=###LANG_UID###')).'">'.
+                                                       '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/zoom.gif','width="12" height="12"').' title="'.$LANG->getLL('lang_renderl10n_viewPage','1').'" border="0" alt="" />'.
+                                                       '</a>';
+                                       $info.= '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'])).'">'.
+                                                       '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit2.gif','width="11" height="12"').' title="'.$LANG->getLL('lang_renderl10n_editDefaultLanguagePage','1').'" border="0" alt="" />'.
+                                                       '</a>';
+                                       $info.= '<a href="#" onclick="'.htmlspecialchars('top.loadEditId('.intval($data['row']['uid']).',"&SET[language]=0"); return false;').'">'.
+                                                       '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit_page.gif','width="12" height="12"').' title="'.$LANG->getLL('lang_renderl10n_editPage','1').'" border="0" alt="" />'.
+                                                       '</a>';
+                                       $info.= str_replace('###LANG_UID###','0',$viewPageLink);                                        
+                                       $info.= $data['row']['l18n_cfg']&1 ? '<span title="'.$LANG->sL('LLL:EXT:cms/locallang_tca.php:pages.l18n_cfg.I.1','1').'">D</span>' : '&nbsp;';
+                                               // Put into cell:
+                                       $tCells[] = '<td class="'.$statusTrans.' c-leftLine">'.$info.'</td>';
+                                       $tCells[] = '<td class="'.$statusTrans.'" title="'.$LANG->getLL('lang_renderl10n_CEcount','1').'" align="center">'.$this->getContentElementCount($data['row']['uid'],0).'</td>';
+                       
+               }
+               else {
+                       //Normal Language:
+                       if ($element->hasTranslation($langId)) {
+                               
+                                               $status = 'c-ok';
+                                               $overLayRow=$element->getOverLayRecordForCertainLanguage($langId);                                              
+                                               //add uid of overlay to list of editable records:
+                               $langRecUids[$langId][]=$overLayRow['uid'];
+                                               $icon = t3lib_iconWorks::getIconImage(
+                                                       'pages_language_overlay',
+                                                       $overLayRow,
+                                                       $GLOBALS['BACK_PATH'],
+                                                       'align="top" class="c-recIcon"'
+                                               );
+
+                                               $info = $icon.
+                                                                       htmlspecialchars(t3lib_div::fixed_lgd_cs($overLayRow['title'],$titleLen)).
+                                                                       (strcmp($overLayRow['nav_title'],'') ? ' [Nav: <em>'.htmlspecialchars(t3lib_div::fixed_lgd_cs($overLayRow['nav_title'],$titleLen)).'</em>]' : '').
+                                                                       ($row['_COUNT']>1 ? '<div>'.$LANG->getLL('lang_renderl10n_badThingThereAre','1').'</div>':'');
+                                               $tCells[] = '<td class="'.$statusTrans.' c-leftLine">'.
+                                                                               $info.
+                                                                               '</td>';
+
+                                                       // Edit whole record:
+                                               $info = '';
+                                               $editUid = $overLayRow['uid'];
+                                               $params = '&edit[pages_language_overlay]['.$editUid.']=edit';
+                                               $info.= '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'])).'">'.
+                                                               '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit2.gif','width="11" height="12"').' title="'.$LANG->getLL('lang_renderl10n_editLanguageOverlayRecord','1').'" border="0" alt="" />'.
+                                                               '</a>';
+
+                                               $info.= '<a href="#" onclick="'.htmlspecialchars('top.loadEditId('.intval($data['row']['uid']).',"&SET[language]='.$langId.'"); return false;').'">'.
+                                                               '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit_page.gif','width="12" height="12"').' title="'.$LANG->getLL('lang_renderl10n_editPageLang','1').'" border="0" alt="" />'.
+                                                               '</a>';
+                                               $info.= str_replace('###LANG_UID###',$langId,$viewPageLink);
+
+                                               $tCells[] = '<td class="'.$statusTrans.'">'.$info.'</td>';
+                                               $tCells[] = '<td class="'.$statusTrans.'" title="'.$LANG->getLL('lang_renderl10n_CEcount','1').'" align="center">'.$this->getContentElementCount($data['row']['uid'],$langId).'</td>';
+                       }
+                       else {
+                               $status = t3lib_div::hideIfNotTranslated($data['row']['l18n_cfg']) || $data['row']['l18n_cfg']&1 ? 'c-blocked' : 'c-fallback';
+                                               $tCells[] = '<td class="'.$statusTrans.' c-leftLine">&nbsp;</td>';                                              
+                                               $tCells[] = '<td class="'.$statusTrans.'">&nbsp;</td>';
+                               //add to JS
+                               $infoCell = '<input type="checkbox" name="newOL['.$langId.']['.$data['row']['uid'].']" value="1" />';
+                                               $newOL_js[$langId].= '
+                                                               +(document.webinfoForm[\'newOL['.$langId.']['.$data['row']['uid'].']\'].checked ? \'&edit[pages_language_overlay]['.$data['row']['uid'].']=new\' : \'\')
+                                                       ';
+                               $tCells[] = '<td class="'.$statusTrans.'">'.$infoCell.'</td>';
+                               
+                       }
+               }
+               //last cell show status
+                   $tCells[] = '<td class="'.$statusVis.'">'.$this->_getStatusImage($isVisible).'</td>';
+           }
+           $output .= '
+                       <tr class="bgColor5">
+                               '.implode('
+                               ',$tCells).'
+                       </tr>';
+               }
+                       
+               //first ROW:
+               //****************
+    $firstRowCells[] = '<td>'.$LANG->getLL('lang_renderl10n_page','1').':</td>';
+    foreach ($languageList as $language) { 
+       $langId=$language->getUid();
+       if ($this->pObj->MOD_SETTINGS['lang']==0 || (int)$this->pObj->MOD_SETTINGS['lang']===(int)$langId)      {
+               $firstRowCells[] = '<td class="c-leftLine">'.$language->getTitle().$language->getFlagImg().'</td>';
+               if ($langId==0) {
+                       $firstRowCells[]='<td></td>';
+                       $firstRowCells[]='<td></td>';
+               }
+               else {
+                                       // Title:
+                                       
+       
+                                               // Edit language overlay records:
+                                       if (is_array($langRecUids[$langId]))    {
+                                               $params = '&edit[pages_language_overlay]['.implode(',',$langRecUids[$langId]).']=edit&columnsOnly=title,nav_title,hidden';
+                                               $firstRowCells[] = '<td><a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'])).'">
+                                                       <img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit2.gif','width="11" height="12"').' title="'.$LANG->getLL('lang_renderl10n_editLangOverlays','1').'" border="0" alt="" />
+                                                       </a></td>';
+                                       } else {
+                                               $firstRowCells[] = '<td>&nbsp;</td>';
+                                       }
+       
+                                               // Create new overlay records:
+                                       $params = "'".$newOL_js[$langId]."+'&columnsOnly=title,hidden,sys_language_uid&defVals[pages_language_overlay][sys_language_uid]=".$langId;
+                                       $firstRowCells[] = '<td><a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'])).'">
+                                               <img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/new_el.gif','width="11" height="12"').' title="'.$LANG->getLL('lang_getlangsta_createNewTranslationHeaders','1').'" border="0" alt="" />
+                                               </a></td>';
+                                       $firstRowCells[]='<td></td>';
+                               }
+                       }
+    }
+                       
+                       
+
+               $output= '
+                       <tr class="bgColor4">
+                               '.implode('
+                               ',$firstRowCells).'
+                       </tr>'.$output;
+
+               
+
+               $output = '
+
+               <table border="0" cellspacing="0" cellpadding="0" id="langTable">'.$output.'
+               </table>';
+               return $output;
+       }
+
+       function _getStatusImage($stat) {
+               global $BACK_PATH;
+               if ($stat) {
+                       return '<img src="'.$BACK_PATH.'../typo3conf/ext/languagevisibility/res/ok.gif">';
+               }
+               else {
+                       return '<img src="'.$BACK_PATH.'../typo3conf/ext/languagevisibility/res/nok.gif">';
+               }
+       }
+       
+
+
+       /**
+        * Counting content elements for a single language on a page.
+        *
+        * @param       integer         Page id to select for.
+        * @param       integer         Sys language uid
+        * @return      integer         Number of content elements from the PID where the language is set to a certain value.
+        */
+       function getContentElementCount($pageId,$sysLang)       {
+               if ($sysLang==0) {
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                               'count(*)',
+                               'tt_content',
+                               'pid='.intval($pageId).
+                                       ' AND sys_language_uid='.intval($sysLang).
+                                       t3lib_BEfunc::deleteClause('tt_content').
+                                       t3lib_BEfunc::versioningPlaceholderClause('tt_content')
+                       );
+                       list($count) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
+               }
+               
+               return $count ? $count : '-';
+       }
+}
+
+/**
+ * Module extension (addition to function menu) 'Language Visibility Overview' for the 'testtt' extension.
+ *
+ * @author     <Daniel Pötzinger>
+ * @package    TYPO3
+ * @subpackage    tx_languagevisibility
+ */
+class sstx_languagevisibility_modfunc1 extends t3lib_extobjbase {
+
+                    /**
+                     * Returns the module menu
+                     *
+                     * @return    Array with menuitems
+                     */
+                    function modMenu()    {
+                        global $LANG;
+
+                        return Array (
+                            "tx_languagevisibility_modfunc1_check" => "",
+                        );
+                    }
+
+                    /**
+                     * Main method of the module
+                     *
+                     * @return    HTML
+                     */
+                    function main()    {
+                            // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
+                        global $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
+
+                        $theOutput.=$this->pObj->doc->spacer(5);
+                        $theOutput.=$this->pObj->doc->section($LANG->getLL("title"),"Dummy content here...",0,1);
+
+                        $menu=array();
+                        $menu[]=t3lib_BEfunc::getFuncCheck($this->wizard->pObj->id,"SET[tx_languagevisibility_modfunc1_check]",$this->wizard->pObj->MOD_SETTINGS["tx_languagevisibility_modfunc1_check"]).$LANG->getLL("checklabel");
+                        $theOutput.=$this->pObj->doc->spacer(5);
+                        $theOutput.=$this->pObj->doc->section("Menu",implode(" - ",$menu),0,1);
+
+                        return $theOutput;
+                    }
+                }
+
+
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/languagevisibility/modfunc1/class.tx_languagevisibility_modfunc1.php'])    {
+    include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/languagevisibility/modfunc1/class.tx_languagevisibility_modfunc1.php']);
+}
+
+?>
\ No newline at end of file
diff --git a/modfunc1/locallang.xml b/modfunc1/locallang.xml
new file mode 100644 (file)
index 0000000..3009bd4
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3locallang>
+       <meta type="array">
+               <type>database</type>
+               <description>Language labels for database tables/fields belonging to extension 'languagevisibility'</description>
+       </meta>
+       <data type="array">
+               <languageKey index="default" type="array">
+                       <label index="lang_renderl10n_viewPage">fallback order</label>
+                       <label index="page_title">Pagetree overview</label>
+                       <label index="page_sysnote">Internal notes</label>
+                       <label index="pageInformation">Page information</label>
+                       <label index="pages_0">Basic settings</label>
+                       <label index="pages_2">Cache and Age</label>
+                       <label index="pages_1">Record overview</label>
+                       <label index="stat_type_0">Page hits</label>
+                       <label index="stat_type_1">Total hits</label>
+                       <label index="stat_type_2">Hits in main sections</label>
+                       <label index="stat_period">Statistics in the period %s back to %s</label>
+                       <label index="pI_crUser">Created by</label>
+                       <label index="pI_crDate">Created date</label>
+                       <label index="pI_lastChange">Last change</label>
+                       <label index="pI_lastChangeContent">Last change, content</label>
+                       <label index="hits_title">Hit Statistics</label>
+                       <label index="lang_renderl10n_viewPage">View page</label>
+                       <label index="lang_renderl10n_editDefaultLanguagePage">Edit default language page properties</label>
+                       <label index="lang_renderl10n_editLangOverlays">Edit all language overlay records</label>
+                       <label index="lang_renderl10n_editPageProperties">Edit all page properties</label>
+                       <label index="lang_renderl10n_editPage">Edit page</label>
+                       <label index="lang_renderl10n_editPageLang">Edit page translation</label>
+                       <label index="lang_renderl10n_badThingThereAre">ERROR: there are two or more page overlay records for this language! Only one is allowed!</label>
+                       <label index="lang_renderl10n_editLanguageOverlayRecord">Edit language overlay record</label>
+                       <label index="lang_renderl10n_page">Page</label>
+                       <label index="lang_renderl10n_default">Default</label>
+                       <label index="lang_getlangsta_createNewTranslationHeaders">Create new translation headers</label>
+                       <label index="lang_renderl10n_CEcount">Content Element Count</label>    
+                       <label index="moduleFunction.tx_languagevisibility_modfunc1">Language Visibility Overview</label>                                                               
+               </languageKey>
+       </data>
+</T3locallang>
\ No newline at end of file
diff --git a/patch/class.ux_SCalt_doc.php b/patch/class.ux_SCalt_doc.php
new file mode 100644 (file)
index 0000000..3e3109a
--- /dev/null
@@ -0,0 +1,227 @@
+<?php
+
+/*
+ adds patch to disallow page editing without acces to default language
+*/
+class ux_SC_alt_doc extends SC_alt_doc {
+
+
+       /***************************
+        *
+        * Sub-content functions, rendering specific parts of the module content.
+        *
+        ***************************/
+
+       /**
+        * Creates the editing form with TCEforms, based on the input from GPvars.
+        *
+        * @return      string          HTML form elements wrapped in tables
+        */
+       function makeEditForm() {
+               global $BE_USER,$LANG,$TCA;
+
+                       // Initialize variables:
+               $this->elementsData=array();
+               $this->errorC=0;
+               $this->newC=0;
+               $thePrevUid='';
+               $editForm='';
+
+                       // Traverse the GPvar edit array
+               foreach($this->editconf as $table => $conf)     {       // Tables:
+                       if (is_array($conf) && $TCA[$table] && $BE_USER->check('tables_modify',$table)) {
+
+                                       // Traverse the keys/comments of each table (keys can be a commalist of uids)
+                               foreach($conf as $cKey => $cmd) {
+                                       if ($cmd=='edit' || $cmd=='new')        {
+
+                                                       // Get the ids:
+                                               $ids = t3lib_div::trimExplode(',',$cKey,1);
+
+                                                       // Traverse the ids:
+                                               foreach($ids as $theUid)        {
+
+                                                               // Checking if the user has permissions? (Only working as a precaution, because the final permission check is always down in TCE. But it's good to notify the user on beforehand...)
+                                                               // First, resetting flags.
+                                                       $hasAccess = 1;
+                                                       $deniedAccessReason = '';
+                                                       $deleteAccess = 0;
+                                                       $this->viewId = 0;
+
+                                                               // If the command is to create a NEW record...:
+                                                       if ($cmd=='new')        {
+                                                               if (intval($theUid))    {               // NOTICE: the id values in this case points to the page uid onto which the record should be create OR (if the id is negativ) to a record from the same table AFTER which to create the record.
+
+                                                                               // Find parent page on which the new record reside
+                                                                       if ($theUid<0)  {       // Less than zero - find parent page
+                                                                               $calcPRec=t3lib_BEfunc::getRecord($table,abs($theUid));
+                                                                               $calcPRec=t3lib_BEfunc::getRecord('pages',$calcPRec['pid']);
+                                                                       } else {        // always a page
+                                                                               $calcPRec=t3lib_BEfunc::getRecord('pages',abs($theUid));
+                                                                       }
+
+                                                                               // Now, calculate whether the user has access to creating new records on this position:
+                                                                       if (is_array($calcPRec))        {
+                                                                               $CALC_PERMS = $BE_USER->calcPerms($calcPRec);   // Permissions for the parent page
+                                                                               if ($table=='pages')    {       // If pages:
+                                                                                       $hasAccess = $CALC_PERMS&8 ? 1 : 0;
+                                                                                       $this->viewId = $calcPRec['pid'];
+                                                                               } else {
+                                                                                       $hasAccess = $CALC_PERMS&16 ? 1 : 0;
+                                                                                       $this->viewId = $calcPRec['uid'];
+                                                                               }
+                                                                       }
+                                                               }
+                                                               $this->dontStoreDocumentRef=1;          // Don't save this document title in the document selector if the document is new.
+                                                       } else {        // Edit:
+                                                               $calcPRec = t3lib_BEfunc::getRecord($table,$theUid);
+                                                               t3lib_BEfunc::fixVersioningPid($table,$calcPRec);
+                                                               if (is_array($calcPRec))        {
+                                                                       if ($table=='pages')    {       // If pages:
+                                                                               $CALC_PERMS = $BE_USER->calcPerms($calcPRec);
+                                                                               $hasAccess = $CALC_PERMS&2 ? 1 : 0;
+                                                                               $deleteAccess = $CALC_PERMS&4 ? 1 : 0;
+                                                                               $this->viewId = $calcPRec['uid'];
+                                                                       } else {
+                                                                               $CALC_PERMS = $BE_USER->calcPerms(t3lib_BEfunc::getRecord('pages',$calcPRec['pid']));   // Fetching pid-record first.
+                                                                               $hasAccess = $CALC_PERMS&16 ? 1 : 0;
+                                                                               $deleteAccess = $CALC_PERMS&16 ? 1 : 0;
+                                                                               $this->viewId = $calcPRec['pid'];
+
+                                                                                       // Adding "&L=xx" if the record being edited has a languageField with a value larger than zero!
+                                                                               if ($TCA[$table]['ctrl']['languageField'] && $calcPRec[$TCA[$table]['ctrl']['languageField']]>0)        {
+                                                                                       $this->viewId_addParams = '&L='.$calcPRec[$TCA[$table]['ctrl']['languageField']];
+                                                                               }
+                                                                       }
+
+                                                                               // Check internals regarding access:
+                                                                       if ($hasAccess) {
+                                                                               $hasAccess = $BE_USER->recordEditAccessInternals($table, $calcPRec);
+                                                                               $deniedAccessReason = $BE_USER->errorMsg;
+                                                                       }
+                                                               } else $hasAccess = 0;
+                                                       }
+
+                                                       // AT THIS POINT we have checked the access status of the editing/creation of records and we can now proceed with creating the form elements:
+                                                       
+                                                       //danielp: additional permission check:
+                                                       // if user wants to edit/create page record but has no access to default language!
+                                                       if ($table == 'pages' && !$BE_USER->checkLanguageAccess(0)) {
+                                                               if (t3lib_extMgm::isLoaded('languagevisibility')) {
+                                                                       require_once(t3lib_extMgm::extPath("languagevisibility").'class.tx_languagevisibility_beservices.php');                                                                 
+                                                                       $visibilityservice=t3lib_div::makeInstance('tx_languagevisibility_beservices');
+                                                                       if (!$visibilityservice->hasUserAccessToPageRecord($theUid,$cmd)) {
+                                                                               $hasAccess=FALSE;
+                                                                       }                                                                       
+                                                               }       
+                                                       }
+
+                                                       if ($hasAccess) {
+                                                               $prevPageID = is_object($trData)?$trData->prevPageID:'';
+                                                               $trData = t3lib_div::makeInstance('t3lib_transferData');
+                                                               $trData->addRawData = TRUE;
+                                                               $trData->defVals = $this->defVals;
+                                                               $trData->lockRecords=1;
+                                                               $trData->disableRTE = $this->MOD_SETTINGS['disableRTE'];
+                                                               $trData->prevPageID = $prevPageID;
+                                                               $trData->fetchRecord($table,$theUid,$cmd=='new'?'new':'');      // 'new'
+                                                               reset($trData->regTableItems_data);
+                                                               $rec = current($trData->regTableItems_data);
+                                                               $rec['uid'] = $cmd=='new' ? uniqid('NEW') : $theUid;
+                                                               if ($cmd=='new')        {
+                                                                       $rec['pid'] = $theUid=='prev'?$thePrevUid:$theUid;
+                                                               }
+                                                               $this->elementsData[]=array(
+                                                                       'table' => $table,
+                                                                       'uid' => $rec['uid'],
+                                                                       'pid' => $rec['pid'],
+                                                                       'cmd' => $cmd,
+                                                                       'deleteAccess' => $deleteAccess
+                                                               );
+
+                                                                       // Now, render the form:
+                                                               if (is_array($rec))     {
+
+                                                                               // Setting visual path / title of form:
+                                                                       $this->generalPathOfForm = $this->tceforms->getRecordPath($table,$rec);
+                                                                       if (!$this->storeTitle) {
+                                                                               $this->storeTitle = $this->recTitle ? htmlspecialchars($this->recTitle) : t3lib_BEfunc::getRecordTitle($table,$rec,TRUE);
+                                                                       }
+
+                                                                               // Setting variables in TCEforms object:
+                                                                       $this->tceforms->hiddenFieldList = '';
+                                                                       $this->tceforms->globalShowHelp = $this->disHelp ? 0 : 1;
+                                                                       if (is_array($this->overrideVals[$table]))      {
+                                                                               $this->tceforms->hiddenFieldListArr = array_keys($this->overrideVals[$table]);
+                                                                       }
+
+                                                                               // Register default language labels, if any:
+                                                                       $this->tceforms->registerDefaultLanguageData($table,$rec);
+
+                                                                               // Create form for the record (either specific list of fields or the whole record):
+                                                                       $panel = '';
+                                                                       if ($this->columnsOnly) {
+                                                                               if(is_array($this->columnsOnly)){
+                                                                                       $panel.= $this->tceforms->getListedFields($table,$rec,$this->columnsOnly[$table]);
+                                                                               } else {
+                                                                                       $panel.= $this->tceforms->getListedFields($table,$rec,$this->columnsOnly);
+                                                                               }
+                                                                       } else {
+                                                                               $panel.= $this->tceforms->getMainFields($table,$rec);
+                                                                       }
+                                                                       $panel = $this->tceforms->wrapTotal($panel,$rec,$table);
+
+                                                                               // Setting the pid value for new records:
+                                                                       if ($cmd=='new')        {
+                                                                               $panel.= '<input type="hidden" name="data['.$table.']['.$rec['uid'].'][pid]" value="'.$rec['pid'].'" />';
+                                                                               $this->newC++;
+                                                                       }
+
+                                                                               // Display "is-locked" message:
+                                                                       if ($lockInfo = t3lib_BEfunc::isRecordLocked($table,$rec['uid']))       {
+                                                                               $lockIcon = '
+
+                                                                                       <!--
+                                                                                               Warning box:
+                                                                                       -->
+                                                                                       <table border="0" cellpadding="0" cellspacing="0" class="warningbox">
+                                                                                               <tr>
+                                                                                                       <td><img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/recordlock_warning3.gif','width="17" height="12"').' alt="" /></td>
+                                                                                                       <td>'.htmlspecialchars($lockInfo['msg']).'</td>
+                                                                                               </tr>
+                                                                                       </table>
+                                                                               ';
+                                                                       } else $lockIcon = '';
+
+                                                                               // Combine it all:
+                                                                       $editForm.= $lockIcon.$panel;
+                                                               }
+
+                                                               $thePrevUid = $rec['uid'];
+                                                       } else {
+                                                               $this->errorC++;
+                                                               $editForm.=$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.noEditPermission',1).'<br /><br />'.
+                                                                                       ($deniedAccessReason ? 'Reason: '.htmlspecialchars($deniedAccessReason).'<br/><br/>' : '');
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               return $editForm;
+       }
+
+}
+
+// Include extension?
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_doc.php'])      {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_doc.php']);
+}
+
+
+
+
+
+
+?>
diff --git a/patch/class.ux_t3lib_beuserauth.php b/patch/class.ux_t3lib_beuserauth.php
new file mode 100644 (file)
index 0000000..1d889f4
--- /dev/null
@@ -0,0 +1,115 @@
+<?php
+
+class ux_t3lib_beUserAuth extends t3lib_beUserAuth {
+
+
+       /**
+        * Checking if a user has editing access to a record from a $TCA table.
+        * The checks does not take page permissions and other "environmental" things into account. It only deal with record internals; If any values in the record fields disallows it.
+        * For instance languages settings, authMode selector boxes are evaluated (and maybe more in the future).
+        * It will check for workspace dependent access.
+        * The function takes an ID (integer) or row (array) as second argument.
+        *
+        * @param       string          Table name
+        * @param       mixed           If integer, then this is the ID of the record. If Array this just represents fields in the record.
+        * @param       boolean         Set, if testing a new (non-existing) record array. Will disable certain checks that doesn't make much sense in that context.
+        * @return      boolean         True if OK, otherwise false
+        */
+       function recordEditAccessInternals($table,$idOrRow,$newRecord=FALSE)    {
+               global $TCA;
+
+               if (isset($TCA[$table]))        {
+                       t3lib_div::loadTCA($table);
+
+                               // Always return true for Admin users.
+                       if ($this->isAdmin())   return TRUE;
+
+                               // Fetching the record if the $idOrRow variable was not an array on input:
+                       if (!is_array($idOrRow))        {
+                               $idOrRow = t3lib_BEfunc::getRecord($table, $idOrRow);
+                               if (!is_array($idOrRow))        {
+                                       $this->errorMsg = 'ERROR: Record could not be fetched.';
+                                       return FALSE;
+                               }
+                       }
+
+                               // Checking languages:
+                       if ($TCA[$table]['ctrl']['languageField'])      {
+                               if (isset($idOrRow[$TCA[$table]['ctrl']['languageField']]))     {       // Language field must be found in input row - otherwise it does not make sense.                                        
+                                       $skipLanguageErrorMessage=FALSE;
+                                       //danielp allow default language for creating new elements as well as editing if languagevisibility allows it
+                                       if (!$this->checkLanguageAccess($idOrRow[$TCA[$table]['ctrl']['languageField']])) {
+                                               if ($idOrRow[$TCA[$table]['ctrl']['languageField']] ==0) {                                                      
+                                                       $editingIsAllowed=FALSE;
+                                                       require_once(t3lib_extMgm::extPath("languagevisibility").'class.tx_languagevisibility_beservices.php'); 
+                                                       $visibilityservice=t3lib_div::makeInstance('tx_languagevisibility_beservices');                                                 
+                                                       if ($visibilityservice->hasUserAccessToEditRecord($table,$idOrRow['uid'])) {
+                                                               $editingIsAllowed=TRUE;
+                                                       }                                                       
+                                                       if ($newRecord OR $editingIsAllowed) {
+                                                               $skipLanguageErrorMessage=TRUE;
+                                                       }
+                                               }
+                                               if (!$skipLanguageErrorMessage) {
+                                                       $this->errorMsg = 'ERROR: Language was not allowed.';
+                                                       return FALSE;
+                                               }
+                                       }
+                               } else {
+                                       $this->errorMsg = 'ERROR: The "languageField" field named "'.$TCA[$table]['ctrl']['languageField'].'" was not found in testing record!';
+                                       return FALSE;
+                               }
+                       }
+
+                               // Checking authMode fields:
+                       if (is_array($TCA[$table]['columns']))  {
+                               foreach($TCA[$table]['columns'] as $fN => $fV)  {
+                                       if (isset($idOrRow[$fN]))       {       //
+                                               if ($fV['config']['type']=='select' && $fV['config']['authMode'] && !strcmp($fV['config']['authMode_enforce'],'strict')) {
+                                                       if (!$this->checkAuthMode($table,$fN,$idOrRow[$fN],$fV['config']['authMode']))  {
+                                                               $this->errorMsg = 'ERROR: authMode "'.$fV['config']['authMode'].'" failed for field "'.$fN.'" with value "'.$idOrRow[$fN].'" evaluated';
+                                                               return FALSE;
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+
+                               // Checking "editlock" feature (doesn't apply to new records)
+                       if (!$newRecord && $TCA[$table]['ctrl']['editlock'])    {
+                               if (isset($idOrRow[$TCA[$table]['ctrl']['editlock']]))  {
+                                       if ($idOrRow[$TCA[$table]['ctrl']['editlock']]) {
+                                               $this->errorMsg = 'ERROR: Record was locked for editing. Only admin users can change this state.';
+                                               return FALSE;
+                                       }
+                               } else {
+                                       $this->errorMsg = 'ERROR: The "editLock" field named "'.$TCA[$table]['ctrl']['editlock'].'" was not found in testing record!';
+                                       return FALSE;
+                               }
+                       }
+
+                               // Checking record permissions
+                       // THIS is where we can include a check for "perms_" fields for other records than pages...
+
+                               // Process any hooks
+                       if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['recordEditAccessInternals']))    {
+                               foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['recordEditAccessInternals'] as $funcRef)     {
+                                       $params = array(
+                                               'table' => $table,
+                                               'idOrRow' => $idOrRow,
+                                               'newRecord' => $newRecord
+                                       );
+                                       if (!t3lib_div::callUserFunction($funcRef, $params, $this)) {
+                                               return FALSE;
+                                       }
+                               }
+                       }
+
+                               // Finally, return true if all is well.
+                       return TRUE;
+               }
+       }
+}
+
+
+?>
diff --git a/patch/class.ux_t3lib_page.php b/patch/class.ux_t3lib_page.php
new file mode 100644 (file)
index 0000000..1dfb449
--- /dev/null
@@ -0,0 +1,295 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 1999-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+/**
+ * Contains a class with "Page functions" mainly for the frontend
+ *
+ * $Id: class.t3lib_page.php 2470 2007-08-29 15:52:38Z typo3 $
+ * Revised for TYPO3 3.6 2/2003 by Kasper Skaarhoj
+ * XHTML-trans compliant
+ *
+ * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ */
+
+
+require_once(t3lib_extMgm::extPath("languagevisibility").'class.tx_languagevisibility_feservices.php');
+
+
+
+class ux_t3lib_pageSelect extends t3lib_pageSelect {
+       
+       
+               
+       /**
+        * Returns the relevant page overlay record fields
+        *
+        * @param       mixed           If $pageInput is an integer, it's the pid of the pageOverlay record and thus the page overlay record is returned. If $pageInput is an array, it's a page-record and based on this page record the language record is found and OVERLAYED before the page record is returned.
+        * @param       integer         Language UID if you want to set an alternative value to $this->sys_language_uid which is default. Should be >=0
+        * @return      array           Page row which is overlayed with language_overlay record (or the overlay record alone)
+        */
+       function getPageOverlay($pageInput,$lUid=-1)    {
+                               
+                       if ($lUid<0)    {
+                               $lUid = $this->sys_language_uid;
+                       }
+                       
+               
+                       /*echo t3lib_div::debug_trail();
+                       echo '<b>'.$pageInput.'##'.$pageInput['uid'].'</b>';
+                       echo '+++'.$lUid;
+                       echo '<hr>';
+                       */
+                       
+                       
+                       if (is_array($pageInput))       {                               
+                               $page_id = $pageInput['uid'];                           
+                       } else {
+                               return parent::getPageOverlay($pageInput,$lUid);
+                       }
+                       
+                                       
+                       //call service to know if element is visible and which overlay language to use
+                       $overlayLanguage=tx_languagevisibility_feservices::getOverlayLanguageIdForElementRecord($page_id,'pages',$lUid);
+           
+          
+           if ($overlayLanguage===false) {                             
+               //not visible, but this function is also used for rootline fillings -> so just mark this page as not visible!
+               $pageInput['_NOTVISIBLE'] = TRUE;
+               // $pageInput['title'].=' [[not visible]]';             
+               return $pageInput;
+       }
+       else {
+               //$pageInput['title'].='-allowed- '.$lUid.'-'.$page_id.'-'.$overlayLanguage;                    
+               
+                               return parent::getPageOverlay($pageInput,$overlayLanguage);                             
+                       }               
+                       return $passed;
+       }
+
+       /**
+        * Creates language-overlay for records in general (where translation is found in records from the same table)
+        *
+        * @param       string          Table name
+        * @param       array           Record to overlay. Must containt uid, pid and $table]['ctrl']['languageField']
+        * @param       integer         Pointer to the sys_language uid for content on the site.
+        * @param       string          Overlay mode. If "hideNonTranslated" then records without translation will not be returned un-translated but unset (and return value is false)
+        * @return      mixed           Returns the input record, possibly overlaid with a translation. But if $OLmode is "hideNonTranslated" then it will return false if no translation is found.
+        */
+       function getRecordOverlay($table,$row,$sys_language_content,$OLmode='') {
+               //echo $table.'--'.$row['uid'].'--'.$sys_language_content.'--'.$OLmode;
+               //echo '<hr>';
+               //return parent::getRecordOverlay($table,$row,$sys_language_content,$OLmode);
+       
+               global $TCA;
+               //echo $row['uid'].'-';  //39348
+               
+               //unset olmode
+               $OLmode='';
+       //      die('äää');
+               //call service to know if element is visible and which overlay language to use
+               try {
+                       $element=tx_languagevisibility_feservices::getElement($row['uid'],$table);
+               $overlayLanguage=tx_languagevisibility_feservices::getOverlayLanguageIdForElement($element,$sys_language_content);
+               
+         }
+         catch (Exception $e) {
+               //for any other tables:
+               return parent::getRecordOverlay($table,$row,$sys_language_content,$OLmode);
+         }
+               //debug($overlayLanguage);
+    if ($overlayLanguage===false) {  
+       //echo 'unset  '.$table.'  / '.$row['uid'];
+       //not visible:
+       unset($row);
+       return $row;
+    }
+    else {
+       //visible:      
+       if ($overlayLanguage!=0) {                      
+               
+               if ($element instanceof tx_languagevisibility_fceelement) {                     
+                       //for FCE the overlay processing is handled by templavoila module, so mark the row with additional infos:
+                       $languageRep=t3lib_div::makeInstance('tx_languagevisibility_languagerepository');       
+                       $overlayLanguageObj=$languageRep->getLanguageById($overlayLanguage);  
+                       $row['_OVERLAYLANGUAGEISOCODE']=$overlayLanguageObj->getIsoCode();
+                       return $row;
+               }
+               elseif ($element instanceof tx_languagevisibility_fceoverlayelement) {
+                       //now its getting tricky: we need to return overlay record with merged XML
+                       $olrow=$this->_getDatabaseTranslationOverlayRecord('tt_content',$row,$overlayLanguage);
+                       if ($GLOBALS['TSFE']) {
+                                               $GLOBALS['TSFE']->includeTCA('tt_content');             
+                                       }
+                       //parse fce xml, and where a xml field is empty in olrow -> use default one
+                       $flexObj = t3lib_div::makeInstance('t3lib_flexformtools');                              
+                       $this->_callbackVar_defaultXML=t3lib_div::xml2array($row['tx_templavoila_flex']);
+                       $this->_callbackVar_overlayXML=t3lib_div::xml2array($olrow['tx_templavoila_flex']);
+                                       $return=$flexObj->traverseFlexFormXMLData('tt_content','tx_templavoila_flex',$row,$this,'_callback_checkXMLFieldsForFallback');
+                                       
+                                       $row=parent::getRecordOverlay($table,$row,$overlayLanguage,$OLmode);
+                                       $row['tx_templavoila_flex']=t3lib_div::array2xml($this->_callbackVar_overlayXML);
+                                       return $row;
+               }
+               else {
+                       //for default elements just do TYPO3 default overlay                            
+                       return parent::getRecordOverlay($table,$row,$overlayLanguage,$OLmode);
+               }
+       }
+       else {
+               return $row;
+       }       
+    }    
+       }
+
+
+       /** It a callbackfunction (see getRecordOverlay)
+                function traverses default row XML and checks for fields with 'mergeIfNotBlank' l10n_mode.
+               then in the overlay record XML this field is replaced by default one.
+               TO-DO: replace in fallbackOrder
+       **/
+       
+       function _callback_checkXMLFieldsForFallback($dsArr, $dataValue, $PA, $structurePath, &$pObj) {         
+               if ($dataValue!='' && ($dsArr['TCEforms']['l10n_mode']=='mergeIfNotBlank' || $dsArr['TCEforms']['l10n_mode']=='exclude')) {                     
+                       //echo 'check '.$structurePath;
+                       if ($dsArr['TCEforms']['l10n_mode']=='exclude') {
+                               $pObj->setArrayValueByPath($structurePath,$this->_callbackVar_overlayXML,$dataValue);
+                       }
+                       else {
+                               $overlayValue = $pObj->getArrayValueByPath($structurePath, $this->_callbackVar_overlayXML);
+                               if ($overlayValue=='' && $dsArr['TCEforms']['l10n_mode']=='mergeIfNotBlank') {                          
+                                       $pObj->setArrayValueByPath($structurePath,$this->_callbackVar_overlayXML,$dataValue);                   
+                               }
+                       }
+               }               
+       }
+       
+       function _getDatabaseTranslationOverlayRecord($table,$row,$languageId) {
+               global $TCA;
+               // Select overlay record:
+                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                                       '*',
+                                       $table,
+                                       'pid='.intval($row['pid']).
+                                               ' AND '.$TCA[$table]['ctrl']['languageField'].'='.intval($languageId).
+                                               ' AND '.$TCA[$table]['ctrl']['transOrigPointerField'].'='.intval($row['uid']).
+                                               $this->enableFields($table),
+                                       '',
+                                       '',
+                                       '1'
+                               );
+                               $olrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+                               $this->versionOL($table,$olrow);
+                               return $olrow;
+       }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+       /*******************************************
+        *
+        * Page related: Menu, Domain record, Root line
+        *
+        ******************************************/
+
+       /**
+        * Returns an array with pagerows for subpages with pid=$uid (which is pid here!). This is used for menus.
+        * If there are mount points in overlay mode the _MP_PARAM field is set to the corret MPvar.
+        * If the $uid being input does in itself require MPvars to define a correct rootline these must be handled externally to this function.
+        *
+        * @param       integer         The page id for which to fetch subpages (PID)
+        * @param       string          List of fields to select. Default is "*" = all
+        * @param       string          The field to sort by. Default is "sorting"
+        * @param       string          Optional additional where clauses. Like "AND title like '%blabla%'" for instance.
+        * @param       boolean         check if shortcuts exist, checks by default
+        * @return      array           Array with key/value pairs; keys are page-uid numbers. values are the corresponding page records (with overlayed localized fields, if any)
+        * @see tslib_fe::getPageShortcut(), tslib_menu::makeMenu(), tx_wizardcrpages_webfunc_2, tx_wizardsortpages_webfunc_2
+        */
+       function getMenu($uid,$fields='*',$sortField='sorting',$addWhere='',$checkShortcuts=1)  {
+
+               $output = Array();
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, 'pages', 'pid='.intval($uid).$this->where_hid_del.$this->where_groupAccess.' '.$addWhere, '', $sortField);
+               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))      {
+                       $this->versionOL('pages',$row,TRUE);
+                       if (is_array($row))     {
+                                       // Keep mount point:
+                               $origUid = $row['uid'];
+                               $mount_info = $this->getMountPointInfo($origUid, $row); // $row MUST have "uid", "pid", "doktype", "mount_pid", "mount_pid_ol" fields in it
+                               if (is_array($mount_info) && $mount_info['overlay'])    {       // There is a valid mount point.
+                                       $mp_row = $this->getPage($mount_info['mount_pid']);             // Using "getPage" is OK since we need the check for enableFields AND for type 2 of mount pids we DO require a doktype < 200!
+                                       if (count($mp_row))     {
+                                               $row = $mp_row;
+                                               $row['_MP_PARAM'] = $mount_info['MPvar'];
+                                       } else unset($row);     // If the mount point could not be fetched with respect to enableFields, unset the row so it does not become a part of the menu!
+                               }
+
+                                       // if shortcut, look up if the target exists and is currently visible
+                               if ($row['doktype'] == 4 && ($row['shortcut'] || $row['shortcut_mode']) && $checkShortcuts)     {
+                                       if ($row['shortcut_mode'] == 0) {
+                                               $searchField = 'uid';
+                                               $searchUid = intval($row['shortcut']);
+                                       } else { // check subpages - first subpage or random subpage
+                                               $searchField = 'pid';
+                                                       // If a shortcut mode is set and no valid page is given to select subpags from use the actual page.
+                                               $searchUid = intval($row['shortcut'])?intval($row['shortcut']):$row['uid'];
+                                       }
+                                       $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', $searchField.'='.$searchUid.$this->where_hid_del.$this->where_groupAccess.' '.$addWhere, '', $sortField);
+                                       if (!$GLOBALS['TYPO3_DB']->sql_num_rows($res2)) {
+                                               unset($row);
+                                       }
+                                       $GLOBALS['TYPO3_DB']->sql_free_result($res2);
+                               } elseif ($row['doktype'] == 4 && $checkShortcuts)      {
+                                               // Neither shortcut target nor mode is set. Remove the page from the menu.
+                                       unset($row);
+                               }
+
+                                       // Add to output array after overlaying language:
+                               if (is_array($row))     {
+                                       $output[$origUid] = $this->getPageOverlay($row);
+                               }
+                       }
+               }
+               return $output;
+       }
+
+}
+
+
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.ux_t3lib_page.php'])  {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.ux_t3lib_page.php']);
+}
+?>
diff --git a/patch/class.ux_t3lib_tcemain.php b/patch/class.ux_t3lib_tcemain.php
new file mode 100644 (file)
index 0000000..c1ab5fd
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+
+class ux_t3lib_TCEmain extends t3lib_TCEmain   {
+
+       /**
+        * Used to evaluate if a page can be deleted
+        *
+        * @param       integer         Page id
+        * @return      mixed           If array: List of page uids to traverse and delete (means OK), if string: error code.
+        */
+       function canDeletePage($uid)    {
+               $return = parent::canDeletePage($uid);
+               if (is_array($return)) {                        
+                       if (t3lib_extMgm::isLoaded('languagevisibility')) {
+                                       require_once(t3lib_extMgm::extPath("languagevisibility").'class.tx_languagevisibility_beservices.php');                                                                 
+                                       $visibilityservice=t3lib_div::makeInstance('tx_languagevisibility_beservices');
+                                       if (!$visibilityservice->hasUserAccessToPageRecord($theUid,'delete')) {
+                                               return 'Attempt to delete records without access to the visible languages';
+                                       }                                                                       
+                               }       
+               }
+               return $return;
+       }
+
+}
+
+?>
diff --git a/patch/class.ux_tslib_fe.php b/patch/class.ux_tslib_fe.php
new file mode 100644 (file)
index 0000000..5ae5445
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+
+require_once(t3lib_extMgm::extPath("languagevisibility").'class.tx_languagevisibility_feservices.php');
+
+ class ux_tslib_fe extends tslib_fe    {
+
+
+       /**
+        * Setting the language key that'll be used by the current page.
+        * In this function it should be checked, 1) that this language exists, 2) that a page_overlay_record exists, .. and if not the default language, 0 (zero), should be set.
+        *
+        * @return      void
+        * @access private
+        */
+       function settingLanguage()      {
+                       // Get values from TypoScript:
+                       $lUid=intval($this->config['config']['sys_language_uid']);
+                       
+                       //works only with "ignore" setting
+                       //need to check access for current page and show error:
+                       if (!tx_languagevisibility_feservices::checkVisiblityForElement($this->page['uid'],'pages',$lUid)) {
+                                               $GLOBALS['TSFE']->pageNotFoundAndExit('Page is not visible in requested language ['.$lUid.'/'.$this->page['uid'].']');
+                       
+                       }
+                       
+                       //overlay of current page is handled in ux_t3lib_pageSelect::getPageOverlay
+                       parent::settingLanguage();
+                       
+                       
+                               
+       }
+
+}
+
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.ux_tslib_fe.php'])    {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.ux_tslib_fe.php']);
+}
+?>
diff --git a/patch/class.ux_tslib_menu.php b/patch/class.ux_tslib_menu.php
new file mode 100644 (file)
index 0000000..43357d1
--- /dev/null
@@ -0,0 +1,99 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+
+
+
+class ux_tslib_tmenu extends tslib_tmenu {
+       
+       /**
+        * Checks if a page is OK to include in the final menu item array. Pages can be excluded if the doktype is wrong, if they are hidden in navigation, have a uid in the list of banned uids etc.
+        *
+        * @param       array           Array of menu items
+        * @param       array           Array of page uids which are to be excluded
+        * @param       boolean         If set, then the page is a spacer.
+        * @return      boolean         Returns true if the page can be safely included.
+        */
+       function filterMenuPages(&$data,$banUidArray,$spacer)   {               
+               
+               if ($data['_NOTVISIBLE']) {
+                       return false;
+               }
+               else {
+                       return parent::filterMenuPages($data,$banUidArray,$spacer);
+               }               
+       }
+
+}
+
+class ux_tslib_gmenu extends tslib_gmenu {     
+       
+       function filterMenuPages(&$data,$banUidArray,$spacer)   {               
+               
+               if ($data['_NOTVISIBLE']) {
+                       return false;
+               }
+               else {
+                       return parent::filterMenuPages($data,$banUidArray,$spacer);
+               }               
+       }
+
+}
+
+class ux_tslib_imgmenu extends tslib_imgmenu { 
+       
+       function filterMenuPages(&$data,$banUidArray,$spacer)   {               
+               
+               if ($data['_NOTVISIBLE']) {
+                       return false;
+               }
+               else {
+                       return parent::filterMenuPages($data,$banUidArray,$spacer);
+               }               
+       }
+
+}
+class ux_tslib_jsmenu extends tslib_jsmenu {   
+       
+       function filterMenuPages(&$data,$banUidArray,$spacer)   {               
+               
+               if ($data['_NOTVISIBLE']) {
+                       return false;
+               }
+               else {
+                       return parent::filterMenuPages($data,$banUidArray,$spacer);
+               }               
+       }
+
+}
+
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['languagevisibility/class.ux_tslib_menu.php'])     {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['languagevisibility/class.ux_tslib_menu.php']);
+}
+
+?>
diff --git a/patch/class.ux_ux_tslib_menu.php b/patch/class.ux_ux_tslib_menu.php
new file mode 100644 (file)
index 0000000..3d6cad8
--- /dev/null
@@ -0,0 +1,99 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+
+
+
+class ux_ux_tslib_tmenu extends ux_tslib_tmenu {
+       
+       /**
+        * Checks if a page is OK to include in the final menu item array. Pages can be excluded if the doktype is wrong, if they are hidden in navigation, have a uid in the list of banned uids etc.
+        *
+        * @param       array           Array of menu items
+        * @param       array           Array of page uids which are to be excluded
+        * @param       boolean         If set, then the page is a spacer.
+        * @return      boolean         Returns true if the page can be safely included.
+        */
+       function filterMenuPages(&$data,$banUidArray,$spacer)   {               
+               
+               if ($data['_NOTVISIBLE']) {
+                       return false;
+               }
+               else {
+                       return parent::filterMenuPages($data,$banUidArray,$spacer);
+               }               
+       }
+
+}
+
+class ux_ux_tslib_gmenu extends ux_tslib_gmenu {       
+       
+       function filterMenuPages(&$data,$banUidArray,$spacer)   {               
+               
+               if ($data['_NOTVISIBLE']) {
+                       return false;
+               }
+               else {
+                       return parent::filterMenuPages($data,$banUidArray,$spacer);
+               }               
+       }
+
+}
+
+class ux_ux_tslib_imgmenu extends ux_tslib_imgmenu {   
+       
+       function filterMenuPages(&$data,$banUidArray,$spacer)   {               
+               
+               if ($data['_NOTVISIBLE']) {
+                       return false;
+               }
+               else {
+                       return parent::filterMenuPages($data,$banUidArray,$spacer);
+               }               
+       }
+
+}
+class ux_ux_tslib_jsmenu extends ux_tslib_jsmenu {     
+       
+       function filterMenuPages(&$data,$banUidArray,$spacer)   {               
+               
+               if ($data['_NOTVISIBLE']) {
+                       return false;
+               }
+               else {
+                       return parent::filterMenuPages($data,$banUidArray,$spacer);
+               }               
+       }
+
+}
+
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['languagevisibility/class.ux_ux_tslib_menu.php'])  {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['languagevisibility/class.ux_ux_tslib_menu.php']);
+}
+
+?>
diff --git a/patch/tv/class.ux_tx_templavoila_api.php b/patch/tv/class.ux_tx_templavoila_api.php
new file mode 100644 (file)
index 0000000..21989a8
--- /dev/null
@@ -0,0 +1,87 @@
+<?php\r
+\r
+/**\r
+ * Public API class for proper handling of content elements and other useful TemplaVoila related functions\r
+ *\r
+ * @author             Robert Lemke <robert@typo3.org>\r
+ * @package            TYPO3\r
+ * @subpackage tx_templavoila\r
+ */\r
+class ux_tx_templavoila_api extends tx_templavoila_api {\r
+\r
+\r
+       /**\r
+        * Returns information about localization of traditional content elements (non FCEs).\r
+        * It will be added to the content tree by getContentTree().\r
+        *\r
+        * @param       array           $contentTreeArr: Part of the content tree of the element to create the localization information for.\r
+        * @param       array           $tt_content_elementRegister: Array of sys_language UIDs with some information as the value\r
+        * @return      array           Localization information\r
+        * @access      protected\r
+        * @see getContentTree_element()\r
+        */\r
+       function getContentTree_getLocalizationInfoForElement($contentTreeArr, &$tt_content_elementRegister) {\r
+               global $TYPO3_DB;\r
+\r
+               $localizationInfoArr = array();\r
+               if ($contentTreeArr['el']['table']=='tt_content' && $contentTreeArr['el']['sys_language_uid']<=0)       {\r
+\r
+                               // Finding translations of this record and select overlay record:\r
+                       $fakeElementRow = array ('uid' => $contentTreeArr['el']['uid'], 'pid' => $contentTreeArr['el']['pid']);\r
+                       t3lib_beFunc::fixVersioningPID('tt_content', $fakeElementRow);\r
+\r
+                       $res = $TYPO3_DB->exec_SELECTquery(\r
+                               '*',\r
+                               'tt_content',\r
+                               'pid='.$fakeElementRow['pid'].\r
+                                       ' AND sys_language_uid>0'.\r
+                                       ' AND l18n_parent='.intval($contentTreeArr['el']['uid']).\r
+                                       t3lib_BEfunc::deleteClause('tt_content')\r
+                       );\r
+\r
+                       $attachedLocalizations = array();\r
+                       while(TRUE == ($olrow = $TYPO3_DB->sql_fetch_assoc($res)))      {\r
+                               t3lib_BEfunc::workspaceOL('tt_content',$olrow);\r
+                               if (!isset($attachedLocalizations[$olrow['sys_language_uid']])) {\r
+                                       $attachedLocalizations[$olrow['sys_language_uid']] = $olrow['uid'];\r
+                               }\r
+                       }\r
+\r
+                               // Traverse the available languages of the page (not default and [All])\r
+                       if (is_array($this->allSystemWebsiteLanguages) && is_array($this->allSystemWebsiteLanguages['rows'])) {\r
+                               foreach(array_keys($this->allSystemWebsiteLanguages['rows']) as $sys_language_uid)      {\r
+                                       if ($sys_language_uid > 0)      {\r
+                                               if (isset($attachedLocalizations[$sys_language_uid]))   {\r
+                                                       $localizationInfoArr[$sys_language_uid] = array();\r
+                                                       $localizationInfoArr[$sys_language_uid]['mode'] = 'exists';\r
+                                                       $localizationInfoArr[$sys_language_uid]['localization_uid'] = $attachedLocalizations[$sys_language_uid];\r
+       \r
+                                                       $tt_content_elementRegister[$attachedLocalizations[$sys_language_uid]]++;\r
+                                               } elseif ($contentTreeArr['el']['CType']!='templavoila_pi1') {  // Only localize content elements with "Default" langauge set\r
+                                                       if ((int)$contentTreeArr['el']['sys_language_uid']===0) {\r
+                                                               $localizationInfoArr[$sys_language_uid] = array();\r
+                                                               $localizationInfoArr[$sys_language_uid]['mode'] = 'localize';\r
+                                                       }\r
+                                               } elseif(!$contentTreeArr['ds_meta']['langDisable']  && ((int)$contentTreeArr['el']['sys_language_uid']===-1 ||\r
+                                                                                                       (int)$contentTreeArr['el']['sys_language_uid']===0))\r
+                                                                                               {       \r
+                                                       $localizationInfoArr[$sys_language_uid] = array();\r
+                                                       $localizationInfoArr[$sys_language_uid]['mode'] = 'localizedFlexform';\r
+                                               } else {\r
+                                                       $localizationInfoArr[$sys_language_uid] = array();\r
+                                                       $localizationInfoArr[$sys_language_uid]['mode'] = 'no_localization';\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+               return $localizationInfoArr;\r
+       }\r
+\r
+}\r
+\r
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/templavoila/class.ux_tx_templavoila_api.php'])    {\r
+    include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/templavoila/class.ux_tx_templavoila_api.php']);\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/patch/tv/class.ux_tx_templavoila_module1.php b/patch/tv/class.ux_tx_templavoila_module1.php
new file mode 100644 (file)
index 0000000..5c11fe5
--- /dev/null
@@ -0,0 +1,161 @@
+<?php\r
+\r
+class ux_tx_templavoila_module1 extends tx_templavoila_module1 {\r
+       function init() {\r
+               parent::init();\r
+               $this->translatorMode=FALSE;\r
+       }\r
+       \r
+       \r
+       /**\r
+        * Renders the display framework of a single sheet. Calls itself recursively\r
+        *\r
+        * @param       array           $contentTreeArr: DataStructure info array (the whole tree)\r
+        * @param       string          $languageKey: Language key for the display\r
+        * @param       string          $sheet: The sheet key of the sheet which should be rendered\r
+        * @param       array           $parentPointer: Flexform pointer to parent element\r
+        * @param       array           $parentDsMeta: Meta array from parent DS (passing information about parent containers localization mode)\r
+        * @return      string          HTML\r
+        * @access protected\r
+        * @see render_framework_singleSheet()\r
+        */\r
+       function render_framework_singleSheet($contentTreeArr, $languageKey, $sheet, $parentPointer=array(), $parentDsMeta=array()) {\r
+               global $LANG, $TYPO3_CONF_VARS;\r
+\r
+               $elementBelongsToCurrentPage = $contentTreeArr['el']['table'] == 'pages' || $contentTreeArr['el']['pid'] == $this->rootElementUid_pidForContent;\r
+\r
+               $canEditPage = $GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'edit');\r
+               $canEditContent = $GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'editcontent');\r
+\r
+               // Prepare the record icon including a content sensitive menu link wrapped around it:\r
+               $recordIcon = '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,$contentTreeArr['el']['icon'],'').' style="text-align: center; vertical-align: middle;" width="18" height="16" border="0" title="'.htmlspecialchars('['.$contentTreeArr['el']['table'].':'.$contentTreeArr['el']['uid'].']').'" alt="" />';\r
+               $menuCommands = array();\r
+               if ($GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'new')) {\r
+                       $menuCommands[] = 'new';\r
+               }\r
+               if ($canEditContent) {\r
+                       $menuCommands[] = 'copy,cut,pasteinto,pasteafter,delete';\r
+               }\r
+               $titleBarLeftButtons = $this->translatorMode ? $recordIcon : (count($menuCommands) == 0 ? $recordIcon : $this->doc->wrapClickMenuOnIcon($recordIcon,$contentTreeArr['el']['table'], $contentTreeArr['el']['uid'], 1,'&amp;callingScriptId='.rawurlencode($this->doc->scriptID), implode(',', $menuCommands)));\r
+               unset($menuCommands);\r
+\r
+                       // Prepare table specific settings:\r
+               switch ($contentTreeArr['el']['table']) {\r
+\r
+                       case 'pages' :\r
+                               $wrap='|';\r
+                               $titleBarLeftButtons .= $this->translatorMode || !$canEditPage ? '' : $this->link_edit('<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/edit2.gif','').' title="'.htmlspecialchars($LANG->sL('LLL:EXT:lang/locallang_mod_web_list.xml:editPage')).'" alt="" style="text-align: center; vertical-align: middle; border:0;" />',$contentTreeArr['el']['table'],$contentTreeArr['el']['uid']);\r
+                               $titleBarRightButtons = '';\r
+\r
+                               $addGetVars = ($this->currentLanguageUid?'&L='.$this->currentLanguageUid:'');\r
+                               $viewPageOnClick = 'onclick= "'.htmlspecialchars(t3lib_BEfunc::viewOnClick($contentTreeArr['el']['uid'], $this->doc->backPath, t3lib_BEfunc::BEgetRootLine($contentTreeArr['el']['uid']),'','',$addGetVars)).'"';\r
+                               $viewPageIcon = '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/zoom.gif','width="12" height="12"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.showPage',1).'" hspace="3" alt="" style="text-align: center; vertical-align: middle;" />';\r
+                               $titleBarLeftButtons .= '<a href="#" '.$viewPageOnClick.'>'.$viewPageIcon.'</a>';\r
+                       break;\r
+\r
+                       case 'tt_content' :\r
+                               $wrap='<div style="border: 1px solid #FFD8A9">|</div>';\r
+                               $elementTitlebarColor = ($elementBelongsToCurrentPage ? $this->doc->bgColor5 : $this->doc->bgColor6);\r
+                               $elementTitlebarStyle = 'background-color: '.$elementTitlebarColor;\r
+\r
+                               $languageUid = $contentTreeArr['el']['sys_language_uid'];\r
+\r
+                               if (!$this->translatorMode && $canEditContent) {\r
+                                               // Create CE specific buttons:\r
+                                       $linkMakeLocal = !$elementBelongsToCurrentPage ? $this->link_makeLocal('<img'.t3lib_iconWorks::skinImg($this->doc->backPath,t3lib_extMgm::extRelPath('templavoila').'mod1/makelocalcopy.gif','').' title="'.$LANG->getLL('makeLocal').'" border="0" alt="" />', $parentPointer) : '';\r
+                                       $linkUnlink = $this->link_unlink('<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/garbage.gif','').' title="'.$LANG->getLL('unlinkRecord').'" border="0" alt="" />', $parentPointer, FALSE);\r
+                                       if ($GLOBALS['BE_USER']->recordEditAccessInternals('tt_content', $contentTreeArr['previewData']['fullRow'])) {\r
+                                               $linkEdit = ($elementBelongsToCurrentPage ? $this->link_edit('<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/edit2.gif','').' title="'.$LANG->getLL('editrecord').'" border="0" alt="" />',$contentTreeArr['el']['table'],$contentTreeArr['el']['uid']) : '');\r
+                                       }\r
+                                       else {\r
+                                               $linkEdit = '';\r
+                                       }\r
+                                       $titleBarRightButtons = $linkEdit . $this->clipboardObj->element_getSelectButtons($parentPointer) . $linkMakeLocal . $linkUnlink;\r
+                               }\r
+                               else {\r
+                                       $titleBarRightButtons = '';\r
+                               }\r
+                       break;\r
+               }\r
+\r
+                       // Prepare the language icon:\r
+               $languageLabel = htmlspecialchars ($this->allAvailableLanguages[$contentTreeArr['el']['sys_language_uid']]['title']);\r
+               $languageIcon = $this->allAvailableLanguages[$languageUid]['flagIcon'] ? '<img src="'.$this->allAvailableLanguages[$languageUid]['flagIcon'].'" title="'.$languageLabel.'" alt="'.$languageLabel.'" style="text-align: center; vertical-align: middle;" />' : ($languageLabel && $languageUid ? '['.$languageLabel.']' : '');\r
+\r
+                       // If there was a language icon and the language was not default or [all] and if that langauge is accessible for the user, then wrap the  flag with an edit link (to support the "Click the flag!" principle for translators)\r
+               if ($languageIcon && $languageUid>0 && $GLOBALS['BE_USER']->checkLanguageAccess($languageUid) && $contentTreeArr['el']['table']==='tt_content') {\r
+                       $languageIcon = $this->link_edit($languageIcon, 'tt_content', $contentTreeArr['el']['uid'], TRUE);\r
+               }\r
+\r
+                       // Create warning messages if neccessary:\r
+               $warnings = '';\r
+               if ($this->global_tt_content_elementRegister[$contentTreeArr['el']['uid']] > 1 && $this->rootElementLangParadigm !='free') {\r
+                       $warnings .= '<br/>'.$this->doc->icons(2).' <em>'.htmlspecialchars(sprintf($LANG->getLL('warning_elementusedmorethanonce',''), $this->global_tt_content_elementRegister[$contentTreeArr['el']['uid']], $contentTreeArr['el']['uid'])).'</em>';\r
+               }\r
+\r
+                       // Displaying warning for container content (in default sheet - a limitation) elements if localization is enabled:\r
+               $isContainerEl = count($contentTreeArr['sub']['sDEF']);\r
+               if (!$this->modTSconfig['properties']['disableContainerElementLocalizationWarning'] && $this->rootElementLangParadigm !='free' && $isContainerEl && $contentTreeArr['el']['table'] === 'tt_content' && $contentTreeArr['el']['CType'] === 'templavoila_pi1' && !$contentTreeArr['ds_meta']['langDisable'])      {\r
+                       if ($contentTreeArr['ds_meta']['langChildren']) {\r
+                               if (!$this->modTSconfig['properties']['disableContainerElementLocalizationWarning_warningOnly']) {\r
+                                       $warnings .= '<br/>'.$this->doc->icons(2).' <b>'.$LANG->getLL('warning_containerInheritance').'</b>';\r
+                               }\r
+                       } else {\r
+                               $warnings .= '<br/>'.$this->doc->icons(3).' <b>'.$LANG->getLL('warning_containerSeparate').'</b>';\r
+                       }\r
+               }\r
+\r
+                       // Preview made:\r
+               $previewContent = $this->render_previewData($contentTreeArr['previewData'], $contentTreeArr['el'], $contentTreeArr['ds_meta'], $languageKey, $sheet);\r
+\r
+                       // Wrap workspace notification colors:\r
+               if ($contentTreeArr['el']['_ORIG_uid']) {\r
+                       $previewContent = '<div class="ver-element">'.($previewContent ? $previewContent : '<em>[New version]</em>').'</div>';\r
+               }\r
+\r
+\r
+//visibility\r
+                               require_once(t3lib_extMgm::extPath("languagevisibility").'class.tx_languagevisibility_beservices.php');\r
+                               $service=t3lib_div::makeInstance('tx_languagevisibility_beservices');\r
+                               $flags=$elementContentTreeArr['el']['uid'].$service->getVisibleFlagsForElement($contentTreeArr['el']['uid'],$contentTreeArr['el']['table']);\r
+                               \r
+                       // Finally assemble the table:\r
+               $finalContent ='\r
+               \r
+                       <table cellpadding="0" cellspacing="0" style="width: 100%; border: 1px solid black; margin:5px;">\r
+                       <tr class="languagevisibility" style="background: #FFE3C1; ">\r
+                                       <td style="vertical-align:top; padding: 2px; color: #4B3B27;"  colspan="2">'.\r
+                                               '<span class="nobr">Visibility:'.\r
+                                               $flags.\r
+                                               '</span>'.                                              \r
+                                       '</td>                                  \r
+                               </tr>\r
+                               <tr style="background: #FFAC4B; ">\r
+                                       <td style="vertical-align:top;">'.\r
+                                               '<span class="nobr">'.\r
+                                               $languageIcon.\r
+                                               $titleBarLeftButtons.\r
+                                               ($elementBelongsToCurrentPage?'':'<em>').htmlspecialchars($contentTreeArr['el']['title']).($elementBelongsToCurrentPage ? '' : '</em>').\r
+                                               '</span>'.\r
+                                               $warnings.\r
+                                       '</td>\r
+                                       <td nowrap="nowrap" style="text-align:right; vertical-align:top;">'.\r
+                                               $titleBarRightButtons.\r
+                                       '</td>\r
+                               </tr>\r
+                               <tr>\r
+                                       <td colspan="2">'.\r
+                                               $this->render_framework_subElements($contentTreeArr, $languageKey, $sheet).\r
+                                               $previewContent.\r
+                                               '<div style="margin-left: 10px">'.$this->render_localizationInfoTable($contentTreeArr, $parentPointer, $parentDsMeta).'</div>'.\r
+                                       '</td>\r
+                               </tr>\r
+                       </table>\r
+               \r
+               ';\r
+\r
+               return str_replace('|',$finalContent,$wrap);\r
+       }\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/patch/tv/class.ux_tx_templavoila_pi1.php b/patch/tv/class.ux_tx_templavoila_pi1.php
new file mode 100644 (file)
index 0000000..69f6968
--- /dev/null
@@ -0,0 +1,287 @@
+<?php\r
+/***************************************************************\r
+*  Copyright notice\r
+*\r
+*  (c) 2003, 2004 Kasper Skaarhoj (kasper@typo3.com)\r
+*  All rights reserved\r
+*\r
+*  This script is part of the TYPO3 project. The TYPO3 project is\r
+*  free software; you can redistribute it and/or modify\r
+*  it under the terms of the GNU General Public License as published by\r
+*  the Free Software Foundation; either version 2 of the License, or\r
+*  (at your option) any later version.\r
+*\r
+*  The GNU General Public License can be found at\r
+*  http://www.gnu.org/copyleft/gpl.html.\r
+*\r
+*  This script is distributed in the hope that it will be useful,\r
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+*  GNU General Public License for more details.\r
+*\r
+*  This copyright notice MUST APPEAR in all copies of the script!\r
+***************************************************************/\r
+\r
+class ux_tx_templavoila_pi1 extends tx_templavoila_pi1 {\r
+   \r
+\r
+       /**\r
+        * Common function for rendering of the Flexible Content / Page Templates.\r
+        * For Page Templates the input row may be manipulated to contain the proper reference to a data structure (pages can have those inherited which content elements cannot).\r
+        *\r
+        * @param       array           Current data record, either a tt_content element or page record.\r
+        * @param       string          Table name, either "pages" or "tt_content".\r
+        * @return      string          HTML output.\r
+        */\r
+       function renderElement($row,$table)     {\r
+               global $TYPO3_CONF_VARS;\r
+\r
+                       // First prepare user defined objects (if any) for hooks which extend this function:\r
+               $hookObjectsArr = array();\r
+               if (is_array ($TYPO3_CONF_VARS['EXTCONF']['templavoila']['pi1']['renderElementClass'])) {\r
+                       foreach ($TYPO3_CONF_VARS['EXTCONF']['templavoila']['pi1']['renderElementClass'] as $classRef) {\r
+                               $hookObjectsArr[] = &t3lib_div::getUserObj($classRef);\r
+                       }\r
+               }\r
+\r
+                       // Hook: renderElement_preProcessRow\r
+               foreach($hookObjectsArr as $hookObj)    {\r
+                       if (method_exists ($hookObj, 'renderElement_preProcessRow')) {\r
+                               $hookObj->renderElement_preProcessRow($row, $table, $this);\r
+                       }\r
+               }\r
+\r
+                       // Get data structure:\r
+               $srcPointer = $row['tx_templavoila_ds'];\r
+               if (t3lib_div::testInt($srcPointer))    {       // If integer, then its a record we will look up:\r
+                       $DSrec = $GLOBALS['TSFE']->sys_page->checkRecord('tx_templavoila_datastructure', $srcPointer);\r
+                       $DS = t3lib_div::xml2array($DSrec['dataprot']);\r
+               } else {        // Otherwise expect it to be a file:\r
+                       $file = t3lib_div::getFileAbsFileName($srcPointer);\r
+                       if ($file && @is_file($file))   {\r
+                               $DS = t3lib_div::xml2array(t3lib_div::getUrl($file));\r
+                       }\r
+               }\r
+\r
+                       // If a Data Structure was found:\r
+               if (is_array($DS))      {\r
+\r
+                               // Sheet Selector:\r
+                       if ($DS['meta']['sheetSelector'])       {\r
+                                       // <meta><sheetSelector> could be something like "EXT:user_extension/class.user_extension_selectsheet.php:&amp;user_extension_selectsheet"\r
+                               $sheetSelector = &t3lib_div::getUserObj($DS['meta']['sheetSelector']);\r
+                               $renderSheet = $sheetSelector->selectSheet();\r
+                       } else {\r
+                               $renderSheet = 'sDEF';\r
+                       }\r
+\r
+                               // Initialize:\r
+                       $langChildren = $DS['meta']['langChildren'] ? 1 : 0;\r
+                       $langDisabled = $DS['meta']['langDisable'] ? 1 : 0;\r
+                       list ($dataStruct, $sheet, $singleSheet) = t3lib_div::resolveSheetDefInDS($DS,$renderSheet);\r
+\r
+                               // Data from FlexForm field:\r
+                       $data = t3lib_div::xml2array($row['tx_templavoila_flex']);\r
+\r
+                       $lKey = ($GLOBALS['TSFE']->sys_language_isocode && !$langDisabled && !$langChildren) ? 'l'.$GLOBALS['TSFE']->sys_language_isocode : 'lDEF';\r
+                       //danielp\r
+                       if ($row['_OVERLAYLANGUAGEISOCODE'] && !$langDisabled && !$langChildren) {\r
+                               $lKey='l'.$row['_OVERLAYLANGUAGEISOCODE'];                              \r
+                               \r
+                       }\r
+                       \r
+                       $dataValues = is_array($data['data']) ? $data['data'][$sheet][$lKey] : '';\r
+                       if (!is_array($dataValues))     $dataValues = array();\r
+\r
+                               // Init mark up object.\r
+                       $this->markupObj = t3lib_div::makeInstance('tx_templavoila_htmlmarkup');\r
+                       $this->markupObj->htmlParse = t3lib_div::makeInstance('t3lib_parsehtml');\r
+\r
+                               // Get template record:\r
+                       if ($row['tx_templavoila_to'])  {\r
+\r
+                                       // Initialize rendering type:\r
+                               if ($this->conf['childTemplate'])       {\r
+                                       $renderType = $this->conf['childTemplate'];\r
+                               } else {        // Default:\r
+                                       $renderType = t3lib_div::GPvar('print') ? 'print' : '';\r
+                               }\r
+\r
+                                       // Get Template Object record:\r
+                               $TOrec = $this->markupObj->getTemplateRecord($row['tx_templavoila_to'], $renderType, $GLOBALS['TSFE']->sys_language_uid);\r
+                               if (is_array($TOrec))   {\r
+\r
+                                               // Get mapping information from Template Record:\r
+                                       $TO = unserialize($TOrec['templatemapping']);\r
+                                       if (is_array($TO))      {\r
+\r
+                                                       // Get local processing:\r
+                                               $TOproc = t3lib_div::xml2array($TOrec['localprocessing']);\r
+                                               if (!is_array($TOproc)) $TOproc=array();\r
+\r
+                                                       // Processing the data array:\r
+                                               if ($GLOBALS['TT']->LR) $GLOBALS['TT']->push('Processing data');\r
+                                                       $vKey = ($GLOBALS['TSFE']->sys_language_isocode && !$langDisabled && $langChildren) ? 'v'.$GLOBALS['TSFE']->sys_language_isocode : 'vDEF';\r
+                                                       //Danielp\r
+                                                       if ($row['_OVERLAYLANGUAGEISOCODE'] && !$langDisabled && $langChildren) {\r
+                                                               $vKey='v'.$row['_OVERLAYLANGUAGEISOCODE'];\r
+                                                                                       \r
+                                                       }\r
+                                                       $TOlocalProc = $singleSheet ? $TOproc['ROOT']['el'] : $TOproc['sheets'][$sheet]['ROOT']['el'];\r
+                                                       $this->processDataValues($dataValues,$dataStruct['ROOT']['el'],$TOlocalProc,$vKey);\r
+                                               if ($GLOBALS['TT']->LR) $GLOBALS['TT']->pull();\r
+\r
+                                                       // Merge the processed data into the cached template structure:\r
+                                               if ($GLOBALS['TT']->LR) $GLOBALS['TT']->push('Merge data and TO');\r
+                                                               // Getting the cached mapping data out (if sheets, then default to "sDEF" if no mapping exists for the specified sheet!)\r
+                                                       $mappingDataBody = $singleSheet ? $TO['MappingData_cached'] : (is_array($TO['MappingData_cached']['sub'][$sheet]) ? $TO['MappingData_cached']['sub'][$sheet] : $TO['MappingData_cached']['sub']['sDEF']);\r
+                                                       $content = $this->markupObj->mergeFormDataIntoTemplateStructure($dataValues,$mappingDataBody,'',$vKey);\r
+                                                       $this->markupObj->setHeaderBodyParts($TO['MappingInfo_head'],$TO['MappingData_head_cached'],$TO['BodyTag_cached']);\r
+                                               if ($GLOBALS['TT']->LR) $GLOBALS['TT']->pull();\r
+\r
+                                                       // Edit icon (frontend editing):\r
+                                               $eIconf = array('styleAttribute'=>'position:absolute;');\r
+                                               if ($table=='pages')    $eIconf['beforeLastTag']=-1;    // For "pages", set icon in top, not after.\r
+                                               $content = $this->pi_getEditIcon($content,'tx_templavoila_flex','Edit element',$row,$table,$eIconf);\r
+\r
+                                                       // Visual identification aids:\r
+                                               if ($GLOBALS['TSFE']->fePreview && $GLOBALS['TSFE']->beUserLogin && !$GLOBALS['TSFE']->workspacePreview && !$this->conf['disableExplosivePreview'])     {\r
+                                                       $content = $this->visualID($content,$srcPointer,$DSrec,$TOrec,$row,$table);\r
+                                               }\r
+                                       } else {\r
+                                               $content = $this->formatError('Template Object could not be unserialized successfully.\r
+                                                       Are you sure you saved mapping information into Template Object with UID "'.$row['tx_templavoila_to'].'"?');\r
+                                       }\r
+                               } else {\r
+                                       $content = $this->formatError('Couldn\'t find Template Object with UID "'.$row['tx_templavoila_to'].'".\r
+                                               Please make sure a Template Object is accessible.');\r
+                               }\r
+                       } else {\r
+                               $content = $this->formatError('You haven\'t selected a Template Object yet for table/uid "'.$table.'/'.$row['uid'].'".\r
+                                       Without a Template Object TemplaVoila cannot map the XML content into HTML.\r
+                                       Please select a Template Object now.');\r
+                       }\r
+               } else {\r
+                       $content = $this->formatError('\r
+                               cCouldn\'t find a Data Structure set for table/row "'.$table.':'.$row['uid'].'".\r
+                               Please select a Data Structure and Template Object first.');\r
+               }\r
+\r
+               return $content;\r
+       }\r
+       \r
+       \r
+       /**\r
+        * Creates a visual response to the TemplaVoila blocks on the page.\r
+        *\r
+        * @param       [type]          $content: ...\r
+        * @param       [type]          $srcPointer: ...\r
+        * @param       [type]          $DSrec: ...\r
+        * @param       [type]          $TOrec: ...\r
+        * @param       [type]          $row: ...\r
+        * @param       [type]          $table: ...\r
+        * @return      [type]          ...\r
+        */\r
+       function visualID($content,$srcPointer,$DSrec,$TOrec,$row,$table)       {\r
+\r
+                       // Create table rows:\r
+               $tRows = array();\r
+\r
+               switch ($table) {\r
+                       case 'pages':\r
+                               $tRows[] = '<tr style="background-color: #ABBBB4;">\r
+                                               <td colspan="2"><b>Page:</b> '.htmlspecialchars(t3lib_div::fixed_lgd_cs($row['title'],30)).' <em>[UID:'.$row['uid'].']</em></td>\r
+                                       </tr>';\r
+                       break;\r
+                       case 'tt_content':\r
+                               $tRows[] = '<tr style="background-color: #ABBBB4;">\r
+                                               <td colspan="2"><b>Flexible Content:</b> '.htmlspecialchars(t3lib_div::fixed_lgd_cs($row['header'],30)).' <em>[UID:'.$row['uid'].']</em></td>\r
+                                       </tr>';\r
+                       break;\r
+                       default:\r
+                               $tRows[] = '<tr style="background-color: #ABBBB4;">\r
+                                               <td colspan="2">Table "'.$table.'" <em>[UID:'.$row['uid'].']</em></td>\r
+                                       </tr>';\r
+                       break;\r
+               }\r
+\r
+                       // Draw data structure:\r
+               if (is_numeric($srcPointer))    {\r
+                       $tRows[] = '<tr>\r
+                                       <td valign="top"><b>Data Structure:</b></td>\r
+                                       <td>'.htmlspecialchars(t3lib_div::fixed_lgd_cs($DSrec['title'],30)).' <em>[UID:'.$srcPointer.']</em>'.\r
+                                               ($DSrec['previewicon'] ? '<br/><img src="uploads/tx_templavoila/'.$DSrec['previewicon'].'" alt="" />' : '').\r
+                                               '</td>\r
+                               </tr>';\r
+               } else {\r
+                       $tRows[] = '<tr>\r
+                                       <td valign="top"><b>Data Structure:</b></td>\r
+                                       <td>'.htmlspecialchars($srcPointer).'</td>\r
+                               </tr>';\r
+               }\r
+\r
+                       // Template Object:\r
+               $tRows[] = '<tr>\r
+                               <td valign="top"><b>Template Object:</b></td>\r
+                               <td>'.htmlspecialchars(t3lib_div::fixed_lgd_cs($TOrec['title'],30)).' <em>[UID:'.$TOrec['uid'].']</em>'.\r
+                                       ($TOrec['previewicon'] ? '<br/><img src="uploads/tx_templavoila/'.$TOrec['previewicon'].'" alt="" />' : '').\r
+                                       '</td>\r
+                       </tr>';\r
+               if ($TOrec['description'])      {\r
+                       $tRows[] = '<tr>\r
+                                       <td valign="top" nowrap="nowrap">&nbsp; &nbsp; &nbsp; Description:</td>\r
+                                       <td>'.htmlspecialchars($TOrec['description']).'</td>\r
+                               </tr>';\r
+               }\r
+               $tRows[] = '<tr>\r
+                               <td valign="top" nowrap="nowrap">&nbsp; &nbsp; &nbsp; Template File:</td>\r
+                               <td>'.htmlspecialchars($TOrec['fileref']).'</td>\r
+                       </tr>';\r
+               $tRows[] = '<tr>\r
+                               <td valign="top" nowrap="nowrap">&nbsp; &nbsp; &nbsp; Render type:</td>\r
+                               <td>'.htmlspecialchars($TOrec['rendertype'] ? $TOrec['rendertype'] : 'Normal').'</td>\r
+                       </tr>';\r
+               $tRows[] = '<tr>\r
+                               <td valign="top" nowrap="nowrap">&nbsp; &nbsp; &nbsp; Language:</td>\r
+                               <td>'.htmlspecialchars($TOrec['sys_language_uid'] ? $TOrec['sys_language_uid'] : 'Default').'</td>\r
+                       </tr>';\r
+               $tRows[] = '<tr>\r
+                               <td valign="top" nowrap="nowrap">&nbsp; &nbsp; &nbsp; Local Proc.:</td>\r
+                               <td>'.htmlspecialchars($TOrec['localprocessing'] ? 'Yes' : '-').'</td>\r
+                       </tr>';\r
+\r
+                       // Compile information table:\r
+               $infoArray = '<table style="border:1px solid black; background-color: #D9D5C9; font-family: verdana,arial; font-size: 10px;" border="0" cellspacing="1" cellpadding="1">\r
+                                               '.implode('',$tRows).'\r
+                                               </table>';\r
+\r
+                       // Compile information:\r
+                       //danielp\r
+               $id = 'templavoila-preview-'.t3lib_div::shortMD5(microtime());\r
+               if ($this->conf['showVisualId']) {\r
+                       $content = '<div style="text-align: left; position: absolute; display:none; filter: alpha(Opacity=90);" id="'.$id.'">\r
+                                               '.$infoArray.'\r
+                                       </div>\r
+                                       <div id="'.$id.'-wrapper" style=""\r
+                                               onmouseover="\r
+                                                       document.getElementById(\''.$id.'\').style.display=\'block\';\r
+                                                       document.getElementById(\''.$id.'-wrapper\').attributes.getNamedItem(\'style\').nodeValue = \'border: 2px dashed #333366;\';\r
+                                                               "\r
+                                               onmouseout="\r
+                                                       document.getElementById(\''.$id.'\').style.display=\'none\';\r
+                                                       document.getElementById(\''.$id.'-wrapper\').attributes.getNamedItem(\'style\').nodeValue = \'\';\r
+                                                               ">'.\r
+                                               $content.\r
+                                       '</div>';\r
+               }\r
+               \r
+               return $content ;\r
+       }\r
+\r
+}\r
+\r
+\r
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/templavoila/pi1/class.ux_tx_templavoila_pi1.php'])    {\r
+    include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/templavoila/pi1/class.ux_tx_templavoila_pi1.php']);\r
+}\r
+?>
\ No newline at end of file
diff --git a/res/nok.gif b/res/nok.gif
new file mode 100644 (file)
index 0000000..3ae9e1c
Binary files /dev/null and b/res/nok.gif differ
diff --git a/res/ok.gif b/res/ok.gif
new file mode 100644 (file)
index 0000000..620022a
Binary files /dev/null and b/res/ok.gif differ
diff --git a/tests/fixtures/fce_2col_datastructure.xml b/tests/fixtures/fce_2col_datastructure.xml
new file mode 100644 (file)
index 0000000..d30b473
--- /dev/null
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>\r
+<T3DataStructure>\r
+    <meta type="array">\r
+        <langChildren type="integer">1</langChildren>\r
+        <langDisable type="integer">1</langDisable>\r
+    </meta>\r
+    <ROOT type="array">\r
+        <tx_templavoila type="array">\r
+            <title>ROOT</title>\r
+            <description>Select the HTML element on the page which you want to be the overall container element for the template.</description>\r
+        </tx_templavoila>\r
+        <type>array</type>\r
+        <el type="array">\r
+            <field_leftcolumn type="array">\r
+                <tx_templavoila type="array">\r
+                    <title>Left column</title>\r
+                    <sample_data type="array">\r
+                        <numIndex index="0">Left col</numIndex>\r
+                    </sample_data>\r
+                    <eType>ce</eType>\r
+                    <TypoScript>\r
+       10= RECORDS\r
+       10.source.current=1\r
+       10.tables = tt_content\r
+       10.wrap = &lt;!--TYPO3SEARCH_begin--&gt; | &lt;!--TYPO3SEARCH_end--&gt;\r
+                                                       </TypoScript>\r
+                </tx_templavoila>\r
+                <TCEforms type="array">\r
+                    <config type="array">\r
+                        <type>group</type>\r
+                        <internal_type>db</internal_type>\r
+                        <allowed>tt_content</allowed>\r
+                        <size>5</size>\r
+                        <maxitems>200</maxitems>\r
+                        <minitems>0</minitems>\r
+                        <multiple>1</multiple>\r
+                        <show_thumbs>1</show_thumbs>\r
+                    </config>\r
+                    <label>Left column</label>\r
+                </TCEforms>\r
+            </field_leftcolumn>\r
+            <field_rightcolumn type="array">\r
+                <tx_templavoila type="array">\r
+                    <title>Right column</title>\r
+                    <sample_data type="array">\r
+                        <numIndex index="0">The right column</numIndex>\r
+                    </sample_data>\r
+                    <eType>ce</eType>\r
+                    <TypoScript>\r
+       10= RECORDS\r
+       10.source.current=1\r
+       10.tables = tt_content\r
+       10.wrap = &lt;!--TYPO3SEARCH_begin--&gt; | &lt;!--TYPO3SEARCH_end--&gt;\r
+                                                       </TypoScript>\r
+                </tx_templavoila>\r
+                <TCEforms type="array">\r
+                    <config type="array">\r
+                        <type>group</type>\r
+                        <internal_type>db</internal_type>\r
+                        <allowed>tt_content</allowed>\r
+                        <size>5</size>\r
+                        <maxitems>200</maxitems>\r
+                        <minitems>0</minitems>\r
+                        <multiple>1</multiple>\r
+                        <show_thumbs>1</show_thumbs>\r
+                    </config>\r
+                    <label>Right column</label>\r
+                </TCEforms>\r
+            </field_rightcolumn>\r
+        </el>\r
+    </ROOT>\r
+</T3DataStructure>
\ No newline at end of file
diff --git a/tests/fixtures/fce_2col_templateobject.dat b/tests/fixtures/fce_2col_templateobject.dat
new file mode 100644 (file)
index 0000000..4042fca
--- /dev/null
@@ -0,0 +1,6 @@
+a:5:{s:16:"MappingInfo_head";a:0:{}s:11:"MappingInfo";a:1:{s:4:"ROOT";a:2:{s:6:"MAP_EL";s:14:"body[1] div[1]";s:2:"el";a:2:{s:16:"field_leftcolumn";a:1:{s:6:"MAP_EL";s:19:"div[1] div[1]/INNER";}s:17:"field_rightcolumn";a:1:{s:6:"MAP_EL";s:19:"div[1] div[2]/INNER";}}}}s:18:"MappingData_cached";a:2:{s:6:"cArray";a:5:{i:0;s:45:"<div name="2columns">
+                       <div name="leftcol">";s:16:"field_leftcolumn";s:11:"Left column";i:2;s:31:"</div>
+                       <div name="rightcol">";s:17:"field_rightcolumn";s:12:"Right column";i:4;s:15:"</div>
+               </div>";}s:3:"sub";a:0:{}}s:23:"MappingData_head_cached";a:2:{s:6:"cArray";a:1:{i:0;s:45:"
+               <title>Fixture for FCE 2 columns</title>
+       ";}s:3:"sub";a:0:{}}s:14:"BodyTag_cached";s:0:"";}
\ No newline at end of file
diff --git a/tests/fixtures/fce_buttonelement_contentxml.xml b/tests/fixtures/fce_buttonelement_contentxml.xml
new file mode 100644 (file)
index 0000000..9fa56ed
--- /dev/null
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>\r
+<T3FlexForms>\r
+    <data>\r
+        <sheet index="sDEF">\r
+            <language index="lDEF">\r
+                <field index="field_text">\r
+                    <value index="vDEF">buttontext</value>\r
+                    <value index="vEN">buttontext_translated</value>\r
+                    <value index="vPT"></value>\r
+                    <value index="v_2"></value>\r
+                    <value index="vZH"></value>\r
+                    <value index="vFR"></value>\r
+                    <value index="vDE"></value>\r
+                    <value index="vJA"></value>\r
+                    <value index="vES"></value>\r
+                </field>\r
+                <field index="field_smalltext">\r
+                    <value index="vDEF"></value>\r
+                    <value index="vEN"></value>\r
+                    <value index="vPT"></value>\r
+                    <value index="v_2"></value>\r
+                    <value index="vZH"></value>\r
+                    <value index="vFR"></value>\r
+                    <value index="vDE"></value>\r
+                    <value index="vJA"></value>\r
+                    <value index="vES"></value>\r
+                </field>\r
+                <field index="field_link">\r
+                    <value index="vDEF">1</value>\r
+                    <value index="vEN"></value>\r
+                    <value index="vPT"></value>\r
+                    <value index="v_2"></value>\r
+                    <value index="vZH"></value>\r
+                    <value index="vFR"></value>\r
+                    <value index="vDE"></value>\r
+                    <value index="vJA"></value>\r
+                    <value index="vES"></value>\r
+                </field>\r
+            </language>\r
+        </sheet>\r
+    </data>\r
+</T3FlexForms>
\ No newline at end of file
diff --git a/tests/fixtures/fce_buttonelement_datastructure.xml b/tests/fixtures/fce_buttonelement_datastructure.xml
new file mode 100644 (file)
index 0000000..4aab718
--- /dev/null
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>\r
+<T3DataStructure>\r
+       <meta type="array">\r
+               <langDisable>0</langDisable>\r
+               <langChildren>1</langChildren>\r
+       </meta>\r
+       <ROOT type="array">\r
+               <tx_templavoila type="array">\r
+                       <title>ROOT</title>\r
+                       <description>Select the HTML element on the page which you want to be the overall container element for the template.</description>\r
+               </tx_templavoila>\r
+               <type>array</type>\r
+               <el type="array">\r
+                       <field_text type="array">\r
+                               <tx_templavoila type="array">\r
+                                       <title>Button Text</title>\r
+                                       <sample_data type="array">\r
+                                               <numIndex index="0"></numIndex>\r
+                                       </sample_data>\r
+                                       <eType>input</eType>\r
+                                       <TypoScript><![CDATA[\r
+                                       \r
+                                       10 = COA\r
+                                       10 {\r
+                                               10 = TEXT\r
+                                               10.current = 1\r
+                                               10.htmlSpecialChars = 1\r
+                                               \r
+                                               20 = TEXT\r
+                                               20.field = field_smalltext\r
+                                               20.required = 1\r
+                                               20.htmlSpecialChars = 1\r
+                                               20.wrap=<br/><small>|</small>\r
+                                       }\r
+                                       10.stdWrap.typolink.parameter.field=field_link\r
+                                       10.stdWrap.typolink.ATagParams = \r
+                                       10.stdWrap.typolink.ATagParams.stdWrap.cObject = COA\r
+                                       10.stdWrap.typolink.ATagParams.stdWrap.cObject {\r
+                                               wrap = class="|"\r
+                                               10 = TEXT \r
+                                               10.value = btn-big\r
+                                               20 = TEXT\r
+                                               20.value = btn-double-text\r
+                                               20.noTrimWrap = | ||\r
+                                               20.if.isTrue.field = field_smalltext\r
+                                       }       \r
+                                       10.stdWrap.outerWrap = <p>|</p>                         \r
+                                       ]]></TypoScript>\r
+                                       <proc type="array">\r
+                                               <HSC type="integer">0</HSC>\r
+                                       </proc>\r
+                               </tx_templavoila>\r
+                               <TCEforms type="array">\r
+                                       <config type="array">\r
+                                               <type>input</type>\r
+                                               <size>48</size>\r
+                                               <eval>trim</eval>\r
+                                       </config>\r
+                                       <label>Button Text</label>\r
+                               </TCEforms>\r
+                       </field_text>\r
+                       <field_smalltext type="array">\r
+                               <type>no_map</type>\r
+                               <tx_templavoila type="array">\r
+                                       <title>Button Text [small]</title>\r
+                                       <sample_data type="array">\r
+                                               <numIndex index="0"></numIndex>\r
+                                       </sample_data>\r
+                                       <eType>input</eType>\r
+                                       <proc type="array">\r
+                                               <HSC type="integer">1</HSC>\r
+                                       </proc>\r
+                               </tx_templavoila>\r
+                               <TCEforms type="array">\r
+                                       <config type="array">\r
+                                               <type>input</type>\r
+                                               <size>48</size>\r
+                                               <eval>trim</eval>\r
+                                       </config>\r
+                                       <label>Button [small]</label>\r
+                               </TCEforms>\r
+                       </field_smalltext>\r
+                       <field_link type="array">\r
+                               <type>no_map</type>\r
+                               <tx_templavoila type="array">\r
+                                       <title>Button Target</title>\r
+                                       <sample_data type="array">\r
+                                               <numIndex index="0"></numIndex>\r
+                                       </sample_data>\r
+                                       <eType>link</eType>\r
+                                       <TypoScript>\r
+       10 = TEXT\r
+       10.typolink.parameter.current = 1\r
+                                                       </TypoScript>\r
+                               </tx_templavoila>\r
+                               <TCEforms type="array">\r
+                                       <config type="array">\r
+                                               <type>input</type>\r
+                                               <size>15</size>\r
+                                               <max>256</max>\r
+                                               <checkbox></checkbox>\r
+                                               <eval>trim</eval>\r
+                                               <wizards type="array">\r
+                                                       <_PADDING type="integer">2</_PADDING>\r
+                                                       <link type="array">\r
+                                                               <type>popup</type>\r
+                                                               <title>Link</title>\r
+                                                               <icon>link_popup.gif</icon>\r
+                                                               <script>browse_links.php?mode=wizard</script>\r
+                                                               <JSopenParams>height=300,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>\r
+                                                       </link>\r
+                                               </wizards>\r
+                                       </config>\r
+                                       <label>Button Target</label>\r
+                               </TCEforms>\r
+                       </field_link>\r
+               </el>\r
+       </ROOT>\r
+</T3DataStructure>
\ No newline at end of file
diff --git a/tests/fixtures/fce_buttonelement_datastructure_useOverlay.xml b/tests/fixtures/fce_buttonelement_datastructure_useOverlay.xml
new file mode 100644 (file)
index 0000000..ccb2bc5
--- /dev/null
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>\r
+<T3DataStructure>\r
+       <meta type="array">\r
+               <langDisable>1</langDisable>\r
+               <langDatabaseOverlay>1</langDatabaseOverlay>\r
+       </meta>\r
+       <ROOT type="array">\r
+               <tx_templavoila type="array">\r
+                       <title>ROOT</title>\r
+                       <description>Select the HTML element on the page which you want to be the overall container element for the template.</description>\r
+               </tx_templavoila>\r
+               <type>array</type>\r
+               <el type="array">\r
+                       <field_text type="array">\r
+                               <tx_templavoila type="array">\r
+                                       <title>Button Text</title>\r
+                                       <sample_data type="array">\r
+                                               <numIndex index="0"></numIndex>\r
+                                       </sample_data>\r
+                                       <eType>input</eType>\r
+                                       <TypoScript><![CDATA[\r
+                                       \r
+                                       10 = COA\r
+                                       10 {\r
+                                               10 = TEXT\r
+                                               10.current = 1\r
+                                               10.htmlSpecialChars = 1\r
+                                               \r
+                                               20 = TEXT\r
+                                               20.field = field_smalltext\r
+                                               20.required = 1\r
+                                               20.htmlSpecialChars = 1\r
+                                               20.wrap=<br/><small>|</small>\r
+                                       }\r
+                                       10.stdWrap.typolink.parameter.field=field_link\r
+                                       10.stdWrap.typolink.ATagParams = \r
+                                       10.stdWrap.typolink.ATagParams.stdWrap.cObject = COA\r
+                                       10.stdWrap.typolink.ATagParams.stdWrap.cObject {\r
+                                               wrap = class="|"\r
+                                               10 = TEXT \r
+                                               10.value = btn-big\r
+                                               20 = TEXT\r
+                                               20.value = btn-double-text\r
+                                               20.noTrimWrap = | ||\r
+                                               20.if.isTrue.field = field_smalltext\r
+                                       }       \r
+                                       10.stdWrap.outerWrap = <p>|</p>                         \r
+                                       ]]></TypoScript>\r
+                                       <proc type="array">\r
+                                               <HSC type="integer">0</HSC>\r
+                                       </proc>\r
+                               </tx_templavoila>\r
+                               <TCEforms type="array">\r
+                                       <config type="array">\r
+                                               <type>input</type>\r
+                                               <size>48</size>\r
+                                               <eval>trim</eval>\r
+                                       </config>\r
+                                       <label>Button Text</label>\r
+                               </TCEforms>\r
+                       </field_text>\r
+                       <field_smalltext type="array">\r
+                               <type>no_map</type>\r
+                               <tx_templavoila type="array">\r
+                                       <title>Button Text [small]</title>\r
+                                       <sample_data type="array">\r
+                                               <numIndex index="0"></numIndex>\r
+                                       </sample_data>\r
+                                       <eType>input</eType>\r
+                                       <proc type="array">\r
+                                               <HSC type="integer">1</HSC>\r
+                                       </proc>\r
+                               </tx_templavoila>\r
+                               <TCEforms type="array">\r
+                                       <config type="array">\r
+                                               <type>input</type>\r
+                                               <size>48</size>\r
+                                               <eval>trim</eval>\r
+                                       </config>\r
+                                       <label>Button [small]</label>\r
+                               </TCEforms>\r
+                       </field_smalltext>\r
+                       <field_link type="array">\r
+                               <type>no_map</type>\r
+                               <tx_templavoila type="array">\r
+                                       <title>Button Target</title>\r
+                                       <sample_data type="array">\r
+                                               <numIndex index="0"></numIndex>\r
+                                       </sample_data>\r
+                                       <eType>link</eType>\r
+                                       <TypoScript>\r
+       10 = TEXT\r
+       10.typolink.parameter.current = 1\r
+                                                       </TypoScript>\r
+                               </tx_templavoila>\r
+                               <TCEforms type="array">\r
+                                       <config type="array">\r
+                                               <type>input</type>\r
+                                               <size>15</size>\r
+                                               <max>256</max>\r
+                                               <checkbox></checkbox>\r
+                                               <eval>trim</eval>\r
+                                               <wizards type="array">\r
+                                                       <_PADDING type="integer">2</_PADDING>\r
+                                                       <link type="array">\r
+                                                               <type>popup</type>\r
+                                                               <title>Link</title>\r
+                                                               <icon>link_popup.gif</icon>\r
+                                                               <script>browse_links.php?mode=wizard</script>\r
+                                                               <JSopenParams>height=300,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>\r
+                                                       </link>\r
+                                               </wizards>\r
+                                       </config>\r
+                                       <label>Button Target</label>\r
+                               </TCEforms>\r
+                       </field_link>\r
+               </el>\r
+       </ROOT>\r
+</T3DataStructure>
\ No newline at end of file
diff --git a/tests/tx_elementFactory_testcase.php b/tests/tx_elementFactory_testcase.php
new file mode 100644 (file)
index 0000000..c66b6cf
--- /dev/null
@@ -0,0 +1,106 @@
+<?php\r
+/***************************************************************\r
+ *  Copyright notice\r
+ *\r
+ *  (c) 2007 Kasper Ligaard (ligaard@daimi.au.dk)\r
+ *  All rights reserved\r
+ *\r
+ *  This script is part of the TYPO3 project. The TYPO3 project is\r
+ *  free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU General Public License as published by\r
+ *  the Free Software Foundation; either version 2 of the License, or\r
+ *  (at your option) any later version.\r
+ *\r
+ *  The GNU General Public License can be found at\r
+ *  http://www.gnu.org/copyleft/gpl.html.\r
+ *\r
+ *  This script is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU General Public License for more details.\r
+ *\r
+ *  This copyright notice MUST APPEAR in all copies of the script!\r
+ ***************************************************************/\r
+\r
+/**\r
+ * Test case for checking the PHPUnit 3.1.9\r
+ *\r
+ * WARNING: Never ever run a unit test like this on a live site!\r
+ *\r
+ *\r
+ * @author     Daniel Pötzinger\r
+ */\r
+\r
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/class.tx_languagevisibility_elementFactory.php');\r
+require_once(t3lib_extMgm::extPath("languagevisibility").'classes/dao/class.tx_languagevisibility_daocommon_stub.php');\r
+\r
+// require_once (t3lib_extMgm::extPath('phpunit').'class.tx_phpunit_test.php');\r
+require_once (PATH_t3lib.'class.t3lib_tcemain.php');\r
+\r
+class tx_elementFactory_testcase extends tx_phpunit_testcase {\r
+\r
+       \r
+       public function test_getElementForTable_pageelement()\r
+       {\r
+               // Create the Array fixture.\r
+               $_uid=1;\r
+               $_table='pages';                \r
+               $fixture = array('uid'=>$_uid);\r
+               $daostub=new tx_languagevisibility_daocommon_stub;\r
+               $daostub->stub_setRow($fixture,$_table);                \r
+               \r
+               //get element from factory:\r
+               $factoryClass=t3lib_div::makeInstanceClassName('tx_languagevisibility_elementFactory'); \r
+               $factory=new $factoryClass($daostub);           \r
+    $element=$factory->getElementForTable($_table,$_uid);\r
+    \r
+   \r
+    $this->assertTrue($element instanceof tx_languagevisibility_element, "not object of type tx_languagevisibility_element returned!");    \r
+    $this->assertTrue($element instanceof tx_languagevisibility_pageelement, "not object of type tx_languagevisibility_pageelement returned!");    \r
+    \r
+       }\r
+       \r
+       public function test_getElementForTable_celement()\r
+       {\r
+               // Create the Array fixture.\r
+               $_uid=1;\r
+               $_table='tt_content';\r
+               \r
+               $fixture = array('uid'=>$_uid);\r
+               $daostub=new tx_languagevisibility_daocommon_stub;\r
+               $daostub->stub_setRow($fixture,$_table);\r
+               \r
+               $factoryClass=t3lib_div::makeInstanceClassName('tx_languagevisibility_elementFactory'); \r
+               $factory=new $factoryClass($daostub);\r
+               \r
+    $element=$factory->getElementForTable($_table,$_uid);\r
+    \r
+    $this->assertTrue($element instanceof tx_languagevisibility_element, "not object of type tx_languagevisibility_element returned!");    \r
+    $this->assertTrue($element instanceof tx_languagevisibility_celement, "not object of type tx_languagevisibility_celement returned!");    \r
+    \r
+       }\r
+       \r
+       public function test_getElementForTable_fcelement()\r