Initial Upload of powermail_cond 2.0
authorwunschtacho <wunschtacho@735d13b6-9817-0410-8766-e36946ffe9aa>
Tue, 16 Oct 2012 14:15:26 +0000 (14:15 +0000)
committerwunschtacho <wunschtacho@735d13b6-9817-0410-8766-e36946ffe9aa>
Tue, 16 Oct 2012 14:15:26 +0000 (14:15 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/powermail_cond/trunk@67130 735d13b6-9817-0410-8766-e36946ffe9aa

28 files changed:
.idea/.name [new file with mode: 0644]
.idea/codeStyleSettings.xml [new file with mode: 0644]
.idea/dictionaries/einpraegsam.xml [new file with mode: 0644]
.idea/encodings.xml [new file with mode: 0644]
.idea/misc.xml [new file with mode: 0644]
.idea/modules.xml [new file with mode: 0644]
.idea/powermail_cond@powermailt347.in2code.de.iml [new file with mode: 0644]
.idea/scopes/scope_settings.xml [new file with mode: 0644]
.idea/vcs.xml [new file with mode: 0644]
.idea/workspace.xml [new file with mode: 0644]
doc/manual.sxw [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]
files/js/powermail_cond.js [new file with mode: 0644]
files/static/constants.txt [new file with mode: 0644]
files/static/setup.txt [new file with mode: 0644]
icon_tx_powermailcond_conditions.gif [new file with mode: 0644]
icon_tx_powermailcond_rules.gif [new file with mode: 0644]
lib/class.tx_powermailcond_ajaxFieldList_eid.php [new file with mode: 0644]
lib/class.tx_powermailcond_ajaxWriteInSession_eid.php [new file with mode: 0644]
lib/class.tx_powermailcond_div.php [new file with mode: 0644]
lib/class.tx_powermailcond_fields_be.php [new file with mode: 0644]
lib/class.tx_powermailcond_pidContainer.php [new file with mode: 0644]
locallang_db.xml [new file with mode: 0644]
tca.php [new file with mode: 0644]

diff --git a/.idea/.name b/.idea/.name
new file mode 100644 (file)
index 0000000..6317635
--- /dev/null
@@ -0,0 +1 @@
+powermail_cond@powermailt347.in2code.de
\ No newline at end of file
diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml
new file mode 100644 (file)
index 0000000..d63a15e
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project version="4">\r
+  <component name="ProjectCodeStyleSettingsManager">\r
+    <option name="PER_PROJECT_SETTINGS">\r
+      <value>\r
+        <XML>\r
+          <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />\r
+        </XML>\r
+      </value>\r
+    </option>\r
+  </component>\r
+</project>\r
+\r
diff --git a/.idea/dictionaries/einpraegsam.xml b/.idea/dictionaries/einpraegsam.xml
new file mode 100644 (file)
index 0000000..19ec1db
--- /dev/null
@@ -0,0 +1,3 @@
+<component name="ProjectDictionaryState">\r
+  <dictionary name="einpraegsam" />\r
+</component>
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644 (file)
index 0000000..7c62b52
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project version="4">\r
+  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />\r
+</project>\r
+\r
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644 (file)
index 0000000..2aae329
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project version="4">\r
+  <component name="ProjectInspectionProfilesVisibleTreeState">\r
+    <entry key="Project Default">\r
+      <profile-state>\r
+        <expanded-state>\r
+          <State>\r
+            <id />\r
+          </State>\r
+        </expanded-state>\r
+        <selected-state>\r
+          <State>\r
+            <id>CSS</id>\r
+          </State>\r
+        </selected-state>\r
+      </profile-state>\r
+    </entry>\r
+  </component>\r
+  <component name="ProjectResources">\r
+    <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>\r
+  </component>\r
+  <component name="ProjectRootManager" version="2" />\r
+</project>\r
+\r
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644 (file)
index 0000000..4af62dc
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project version="4">\r
+  <component name="ProjectModuleManager">\r
+    <modules>\r
+      <module fileurl="file://$PROJECT_DIR$/.idea/powermail_cond@powermailt347.in2code.de.iml" filepath="$PROJECT_DIR$/.idea/powermail_cond@powermailt347.in2code.de.iml" />\r
+    </modules>\r
+  </component>\r
+</project>\r
+\r
diff --git a/.idea/powermail_cond@powermailt347.in2code.de.iml b/.idea/powermail_cond@powermailt347.in2code.de.iml
new file mode 100644 (file)
index 0000000..3b09ca3
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<module type="WEB_MODULE" version="4">\r
+  <component name="NewModuleRootManager">\r
+    <content url="file://$MODULE_DIR$" />\r
+    <orderEntry type="inheritedJdk" />\r
+    <orderEntry type="sourceFolder" forTests="false" />\r
+  </component>\r
+</module>\r
+\r
diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml
new file mode 100644 (file)
index 0000000..0d5175c
--- /dev/null
@@ -0,0 +1,5 @@
+<component name="DependencyValidationManager">\r
+  <state>\r
+    <option name="SKIP_IMPORT_STATEMENTS" value="false" />\r
+  </state>\r
+</component>
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644 (file)
index 0000000..d2d96f2
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project version="4">\r
+  <component name="VcsDirectoryMappings">\r
+    <mapping directory="" vcs="" />\r
+  </component>\r
+</project>\r
+\r
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644 (file)
index 0000000..fc61fa3
--- /dev/null
@@ -0,0 +1,350 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project version="4">\r
+  <component name="ChangeListManager">\r
+    <list default="true" id="500e5988-e13b-4ba1-8a60-e63a97f737a1" name="Default" comment="" />\r
+    <ignored path="powermail_cond@powermailt347.in2code.de.iws" />\r
+    <ignored path=".idea/workspace.xml" />\r
+    <option name="TRACKING_ENABLED" value="true" />\r
+    <option name="SHOW_DIALOG" value="false" />\r
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />\r
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />\r
+    <option name="LAST_RESOLUTION" value="IGNORE" />\r
+  </component>\r
+  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />\r
+  <component name="CreatePatchCommitExecutor">\r
+    <option name="PATCH_PATH" value="" />\r
+  </component>\r
+  <component name="DaemonCodeAnalyzer">\r
+    <disable_hints />\r
+  </component>\r
+  <component name="FavoritesManager">\r
+    <favorites_list name="powermail_cond@powermailt347.in2code.de" />\r
+  </component>\r
+  <component name="FileEditorManager">\r
+    <leaf>\r
+      <file leaf-file-name="ext_localconf.php" pinned="false" current="false" current-in-tab="false">\r
+        <entry file="file://$PROJECT_DIR$/ext_localconf.php">\r
+          <provider selected="true" editor-type-id="text-editor">\r
+            <state line="13" column="0" selection-start="265" selection-end="265" vertical-scroll-proportion="-8.5">\r
+              <folding />\r
+            </state>\r
+          </provider>\r
+        </entry>\r
+      </file>\r
+      <file leaf-file-name="ext_tables.php" pinned="false" current="true" current-in-tab="true">\r
+        <entry file="file://$PROJECT_DIR$/ext_tables.php">\r
+          <provider selected="true" editor-type-id="text-editor">\r
+            <state line="41" column="88" selection-start="1523" selection-end="1523" vertical-scroll-proportion="0.5558061">\r
+              <folding />\r
+            </state>\r
+          </provider>\r
+        </entry>\r
+      </file>\r
+    </leaf>\r
+  </component>\r
+  <component name="FindManager">\r
+    <FindUsagesManager>\r
+      <setting name="OPEN_NEW_TAB" value="false" />\r
+    </FindUsagesManager>\r
+  </component>\r
+  <component name="IdeDocumentHistory">\r
+    <option name="changedFiles">\r
+      <list>\r
+        <option value="$PROJECT_DIR$/ext_localconf.php" />\r
+        <option value="$PROJECT_DIR$/ext_tables.php" />\r
+      </list>\r
+    </option>\r
+  </component>\r
+  <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />\r
+  <component name="ProjectFrameBounds">\r
+    <option name="x" value="1592" />\r
+    <option name="y" value="-262" />\r
+    <option name="width" value="1936" />\r
+    <option name="height" value="1096" />\r
+  </component>\r
+  <component name="ProjectLevelVcsManager" settingsEditedManually="false">\r
+    <OptionsSetting value="true" id="Add" />\r
+    <OptionsSetting value="true" id="Remove" />\r
+    <OptionsSetting value="true" id="Checkout" />\r
+    <OptionsSetting value="true" id="Update" />\r
+    <OptionsSetting value="true" id="Status" />\r
+    <OptionsSetting value="true" id="Edit" />\r
+    <ConfirmationsSetting value="0" id="Add" />\r
+    <ConfirmationsSetting value="0" id="Remove" />\r
+  </component>\r
+  <component name="ProjectReloadState">\r
+    <option name="STATE" value="0" />\r
+  </component>\r
+  <component name="ProjectView">\r
+    <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">\r
+      <flattenPackages />\r
+      <showMembers />\r
+      <showModules />\r
+      <showLibraryContents ProjectPane="true" />\r
+      <hideEmptyPackages />\r
+      <abbreviatePackageNames />\r
+      <autoscrollToSource />\r
+      <autoscrollFromSource />\r
+      <sortByType />\r
+    </navigator>\r
+    <panes>\r
+      <pane id="Scope">\r
+        <subPane subId="Project Files">\r
+          <PATH>\r
+            <PATH_ELEMENT USER_OBJECT="Root">\r
+              <option name="myItemId" value="" />\r
+              <option name="myItemType" value="" />\r
+            </PATH_ELEMENT>\r
+          </PATH>\r
+        </subPane>\r
+      </pane>\r
+      <pane id="ProjectPane">\r
+        <subPane>\r
+          <PATH>\r
+            <PATH_ELEMENT>\r
+              <option name="myItemId" value="powermail_cond@powermailt347.in2code.de" />\r
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />\r
+            </PATH_ELEMENT>\r
+          </PATH>\r
+          <PATH>\r
+            <PATH_ELEMENT>\r
+              <option name="myItemId" value="powermail_cond@powermailt347.in2code.de" />\r
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />\r
+            </PATH_ELEMENT>\r
+            <PATH_ELEMENT>\r
+              <option name="myItemId" value="powermail_cond@powermailt347.in2code.de" />\r
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />\r
+            </PATH_ELEMENT>\r
+          </PATH>\r
+        </subPane>\r
+      </pane>\r
+    </panes>\r
+  </component>\r
+  <component name="PropertiesComponent">\r
+    <property name="options.splitter.main.proportions" value="0.3" />\r
+    <property name="WebServerToolWindowFactoryState" value="true" />\r
+    <property name="options.lastSelected" value="reference.settings.deploy.options" />\r
+    <property name="options.splitter.details.proportions" value="0.2" />\r
+    <property name="options.searchVisible" value="true" />\r
+  </component>\r
+  <component name="PublishConfig" serverName="in2code" serverId="3ca6b370-8a73-4525-bbbd-e6d3cdda1d7f" autoUpload="true" autoUploadExternalChanges="true">\r
+    <servers>\r
+      <server id="0094c18e-f800-42ec-93e2-efe3a9ae0f13">\r
+        <serverdata>\r
+          <mappings>\r
+            <mapping local="$PROJECT_DIR$" />\r
+          </mappings>\r
+        </serverdata>\r
+      </server>\r
+      <server id="11fde2e6-08c2-4ddf-9e6e-8b3729d937f7">\r
+        <serverdata>\r
+          <mappings>\r
+            <mapping local="$PROJECT_DIR$" />\r
+          </mappings>\r
+        </serverdata>\r
+      </server>\r
+      <server id="3ca6b370-8a73-4525-bbbd-e6d3cdda1d7f">\r
+        <serverdata>\r
+          <mappings>\r
+            <mapping deploy="/projekte/powermail_t347/typo3conf/ext/powermail_cond" local="$PROJECT_DIR$" web="/" />\r
+          </mappings>\r
+        </serverdata>\r
+      </server>\r
+      <server id="4e4aae77-c6d3-4bae-b71d-a7da8672f11a">\r
+        <serverdata>\r
+          <mappings>\r
+            <mapping local="$PROJECT_DIR$" />\r
+          </mappings>\r
+        </serverdata>\r
+      </server>\r
+      <server id="51a43eed-aae8-41d8-bccc-5373d4cad7de">\r
+        <serverdata>\r
+          <mappings>\r
+            <mapping local="$PROJECT_DIR$" />\r
+          </mappings>\r
+        </serverdata>\r
+      </server>\r
+      <server id="64d0b3ca-af69-48ea-93b6-735a61225184">\r
+        <serverdata>\r
+          <mappings>\r
+            <mapping local="$PROJECT_DIR$" />\r
+          </mappings>\r
+        </serverdata>\r
+      </server>\r
+      <server id="9aa7cf60-4064-493a-ae27-8dac6c967229">\r
+        <serverdata>\r
+          <mappings>\r
+            <mapping local="$PROJECT_DIR$" />\r
+          </mappings>\r
+        </serverdata>\r
+      </server>\r
+      <server id="a04ad4cc-99f6-4a4a-bbcc-dafec562d3b6">\r
+        <serverdata>\r
+          <mappings>\r
+            <mapping local="$PROJECT_DIR$" />\r
+          </mappings>\r
+        </serverdata>\r
+      </server>\r
+      <server id="b253c6c9-5bba-4daf-a0d6-117e20ef072e">\r
+        <serverdata>\r
+          <mappings>\r
+            <mapping local="$PROJECT_DIR$" />\r
+          </mappings>\r
+        </serverdata>\r
+      </server>\r
+      <server id="d4465f5d-e823-4eb4-9e95-eaf05d12f5b4">\r
+        <serverdata>\r
+          <mappings>\r
+            <mapping local="$PROJECT_DIR$" />\r
+          </mappings>\r
+        </serverdata>\r
+      </server>\r
+      <server id="fae71899-6969-4972-a4d4-323f242fa671">\r
+        <serverdata>\r
+          <mappings>\r
+            <mapping local="$PROJECT_DIR$" />\r
+          </mappings>\r
+        </serverdata>\r
+      </server>\r
+    </servers>\r
+  </component>\r
+  <component name="RunManager">\r
+    <list size="0" />\r
+  </component>\r
+  <component name="ShelveChangesManager" show_recycled="false" />\r
+  <component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false">\r
+    <option name="USER" value="" />\r
+    <option name="PASSWORD" value="" />\r
+    <option name="mySSHConnectionTimeout" value="30000" />\r
+    <option name="mySSHReadTimeout" value="30000" />\r
+    <option name="LAST_MERGED_REVISION" />\r
+    <option name="MERGE_DRY_RUN" value="false" />\r
+    <option name="MERGE_DIFF_USE_ANCESTRY" value="true" />\r
+    <option name="UPDATE_LOCK_ON_DEMAND" value="false" />\r
+    <option name="IGNORE_SPACES_IN_MERGE" value="false" />\r
+    <option name="DETECT_NESTED_COPIES" value="true" />\r
+    <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />\r
+    <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />\r
+    <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />\r
+    <option name="FORCE_UPDATE" value="false" />\r
+    <option name="IGNORE_EXTERNALS" value="false" />\r
+    <myIsUseDefaultProxy>false</myIsUseDefaultProxy>\r
+  </component>\r
+  <component name="TaskManager">\r
+    <task active="true" id="Default" summary="Default task">\r
+      <created>1350394416165</created>\r
+      <updated>1350394416165</updated>\r
+    </task>\r
+    <servers />\r
+  </component>\r
+  <component name="ToolWindowManager">\r
+    <frame x="1592" y="-262" width="1936" height="1096" extended-state="6" />\r
+    <editor active="true" />\r
+    <layout>\r
+      <window_info id="File Transfer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32917964" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Data Sources" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />\r
+      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />\r
+      <window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.20704375" sideWeight="0.67082036" order="0" side_tool="false" content_ui="combo" />\r
+      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />\r
+      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />\r
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />\r
+    </layout>\r
+  </component>\r
+  <component name="VcsContentAnnotationSettings">\r
+    <option name="myLimit" value="2678400000" />\r
+  </component>\r
+  <component name="VcsManagerConfiguration">\r
+    <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />\r
+    <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />\r
+    <option name="CHECK_NEW_TODO" value="true" />\r
+    <option name="myTodoPanelSettings">\r
+      <value>\r
+        <are-packages-shown value="false" />\r
+        <are-modules-shown value="false" />\r
+        <flatten-packages value="false" />\r
+        <is-autoscroll-to-source value="false" />\r
+      </value>\r
+    </option>\r
+    <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />\r
+    <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />\r
+    <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />\r
+    <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />\r
+    <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />\r
+    <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />\r
+    <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />\r
+    <option name="ENABLE_BACKGROUND_PROCESSES" value="false" />\r
+    <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />\r
+    <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />\r
+    <option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />\r
+    <option name="DEFAULT_PATCH_EXTENSION" value="patch" />\r
+    <option name="SHORT_DIFF_HORISONTALLY" value="true" />\r
+    <option name="SHORT_DIFF_EXTRA_LINES" value="2" />\r
+    <option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />\r
+    <option name="INCLUDE_TEXT_INTO_PATCH" value="false" />\r
+    <option name="INCLUDE_TEXT_INTO_SHELF" value="false" />\r
+    <option name="CREATE_PATCH_EXPAND_DETAILS_DEFAULT" value="true" />\r
+    <option name="SHOW_FILE_HISTORY_DETAILS" value="true" />\r
+    <option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />\r
+    <option name="FORCE_NON_EMPTY_COMMENT" value="false" />\r
+    <option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />\r
+    <option name="LAST_COMMIT_MESSAGE" />\r
+    <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />\r
+    <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />\r
+    <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />\r
+    <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />\r
+    <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />\r
+    <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />\r
+    <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />\r
+    <option name="ACTIVE_VCS_NAME" />\r
+    <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />\r
+    <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />\r
+    <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />\r
+    <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />\r
+  </component>\r
+  <component name="XDebuggerManager">\r
+    <breakpoint-manager />\r
+  </component>\r
+  <component name="editorHistoryManager">\r
+    <entry file="file://$PROJECT_DIR$/ext_tables.sql">\r
+      <provider selected="true" editor-type-id="text-editor">\r
+        <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">\r
+          <folding />\r
+        </state>\r
+      </provider>\r
+    </entry>\r
+    <entry file="file://$PROJECT_DIR$/tca.php">\r
+      <provider selected="true" editor-type-id="text-editor">\r
+        <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">\r
+          <folding />\r
+        </state>\r
+      </provider>\r
+    </entry>\r
+    <entry file="file://$PROJECT_DIR$/ext_localconf.php">\r
+      <provider selected="true" editor-type-id="text-editor">\r
+        <state line="13" column="0" selection-start="265" selection-end="265" vertical-scroll-proportion="-8.5">\r
+          <folding />\r
+        </state>\r
+      </provider>\r
+    </entry>\r
+    <entry file="file://$PROJECT_DIR$/ext_tables.php">\r
+      <provider selected="true" editor-type-id="text-editor">\r
+        <state line="41" column="88" selection-start="1523" selection-end="1523" vertical-scroll-proportion="0.5558061">\r
+          <folding />\r
+        </state>\r
+      </provider>\r
+    </entry>\r
+  </component>\r
+</project>\r
+\r
diff --git a/doc/manual.sxw b/doc/manual.sxw
new file mode 100644 (file)
index 0000000..1d9116d
Binary files /dev/null and b/doc/manual.sxw differ
diff --git a/ext_emconf.php b/ext_emconf.php
new file mode 100644 (file)
index 0000000..5fe4f6f
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+
+########################################################################
+# Extension Manager/Repository config file for ext "powermail_cond".
+#
+# Auto generated 16-10-2012 15:32
+#
+# Manual updates:
+# Only the data in the array - everything else is removed by next
+# writing. "version" and "dependencies" must not be touched!
+########################################################################
+
+$EM_CONF[$_EXTKEY] = array(
+       'title' => 'Powermail Conditions',
+       'description' => 'Add conditions via AJAX to powermail forms (fields and fieldsets). This extension uses jQuery.',
+       'category' => 'plugin',
+       'shy' => 0,
+       'version' => '1.0.2',
+       'dependencies' => '',
+       'conflicts' => '',
+       'priority' => '',
+       'loadOrder' => '',
+       'module' => '',
+       'state' => 'beta',
+       'uploadfolder' => 0,
+       'createDirs' => '',
+       'modify_tables' => '',
+       'clearcacheonload' => 0,
+       'lockType' => '',
+       'author' => 'Alex Kellner',
+       'author_email' => 'alexander.kellner@in2code.de',
+       'author_company' => 'in2code.',
+       'CGLcompliance' => '',
+       'CGLcompliance_note' => '',
+       'constraints' => array(
+               'depends' => array(
+                       'powermail' => '1.5.0-0.0.0',
+               ),
+               'conflicts' => array(
+               ),
+               'suggests' => array(
+               ),
+       ),
+       '_md5_values_when_last_written' => 'a:17:{s:12:"ext_icon.gif";s:4:"014a";s:17:"ext_localconf.php";s:4:"8fd8";s:14:"ext_tables.php";s:4:"7b13";s:14:"ext_tables.sql";s:4:"0755";s:36:"icon_tx_powermailcond_conditions.gif";s:4:"bd1e";s:31:"icon_tx_powermailcond_rules.gif";s:4:"a2f9";s:16:"locallang_db.xml";s:4:"3438";s:7:"tca.php";s:4:"9a53";s:14:"doc/manual.sxw";s:4:"9c63";s:26:"files/js/powermail_cond.js";s:4:"5c2c";s:26:"files/static/constants.txt";s:4:"bfff";s:22:"files/static/setup.txt";s:4:"75c5";s:48:"lib/class.tx_powermailcond_ajaxFieldList_eid.php";s:4:"3f0f";s:53:"lib/class.tx_powermailcond_ajaxWriteInSession_eid.php";s:4:"cd8f";s:34:"lib/class.tx_powermailcond_div.php";s:4:"0352";s:40:"lib/class.tx_powermailcond_fields_be.php";s:4:"38f8";s:43:"lib/class.tx_powermailcond_pidContainer.php";s:4:"edfc";}',
+);
+
+?>
\ No newline at end of file
diff --git a/ext_icon.gif b/ext_icon.gif
new file mode 100644 (file)
index 0000000..c2c6694
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..933d783
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+if (!defined ('TYPO3_MODE')) {
+       die ('Access denied.');
+}
+
+// Show Tables in Page View
+$TYPO3_CONF_VARS['EXTCONF']['cms']['db_layout']['addTables']['tx_powermailcond_conditions'][0] = array(
+       'fList' => 'title',
+       'icon' => TRUE,
+);
+
+
+##### EID Services #####
+
+// EID for storing values in the session (via AJAX)
+$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['powermailcond_saveToSession'] = 'EXT:powermail_cond/lib/class.tx_powermailcond_ajaxWriteInSession_eid.php';
+
+// EID for telling jQuery which values are allowed and which not (via AJAX)
+$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['powermailcond_getFieldStatus'] = 'EXT:powermail_cond/lib/class.tx_powermailcond_ajaxFieldList_eid.php';
+
+// Hook to add a pid container
+$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['powermail']['PM_FormWrapMarkerHook'][] = 'EXT:powermail_cond/lib/class.tx_powermailcond_pidContainer.php:tx_powermailcond_pidContainer';
+
+?>
\ No newline at end of file
diff --git a/ext_tables.php b/ext_tables.php
new file mode 100644 (file)
index 0000000..c2b37bc
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+if (!defined ('TYPO3_MODE')) {
+       die ('Access denied.');
+}
+if (TYPO3_MODE=='BE') {
+       include_once(t3lib_extMgm::extPath('powermail_cond') . 'lib/class.tx_powermailcond_fields_be.php');
+}
+
+t3lib_extMgm::addStaticFile($_EXTKEY, 'files/static/', 'Main TypoScript');
+t3lib_extMgm::allowTableOnStandardPages('tx_powermailcond_conditions');
+t3lib_extMgm::allowTableOnStandardPages('tx_powermailcond_rules');
+
+
+$TCA['tx_powermailcond_conditions'] = array (
+       'ctrl' => array (
+               'title'     => 'LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_conditions',
+               'label'     => 'title',
+               'tstamp'    => 'tstamp',
+               'crdate'    => 'crdate',
+               'cruser_id' => 'cruser_id',
+               'languageField'            => 'sys_language_uid',       
+               'transOrigPointerField'    => 'l18n_parent',    
+               'transOrigDiffSourceField' => 'l18n_diffsource',        
+               'sortby' => 'sorting',  
+               'delete' => 'deleted',  
+               'enablecolumns' => array (              
+                       'disabled' => 'hidden', 
+                       'starttime' => 'starttime',     
+                       'endtime' => 'endtime'
+               ),
+               'requestUpdate' => 'actions',
+               'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php',
+               'iconfile'          => t3lib_extMgm::extRelPath($_EXTKEY) . 'icon_tx_powermailcond_conditions.gif'
+       ),
+       'feInterface' => array (
+               'fe_admin_fieldList' => 'sys_language_uid,l18n_parent,l18n_diffsource,hidden,starttime,endtime,title,targetField,actions,rules,conjunction',
+       )
+);
+
+$TCA['tx_powermailcond_rules'] = array (
+       'ctrl' => array (
+               'title'     => 'LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules',
+               'label'     => 'title',
+               'tstamp'    => 'tstamp',
+               'crdate'    => 'crdate',
+               'cruser_id' => 'cruser_id',
+               'sortby' => 'sorting',  
+               'delete' => 'deleted',  
+               'enablecolumns' => array (              
+                       'disabled' => 'hidden'
+               ),
+               'requestUpdate' => 'ops',
+               'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php',
+               'iconfile'          => t3lib_extMgm::extRelPath($_EXTKEY) . 'icon_tx_powermailcond_rules.gif'
+       ),
+       'feInterface' => array (
+               'fe_admin_fieldList' => 'hidden,startField,ops,condstring'
+       )
+);
+
+?>
\ No newline at end of file
diff --git a/ext_tables.sql b/ext_tables.sql
new file mode 100644 (file)
index 0000000..dff3fec
--- /dev/null
@@ -0,0 +1,52 @@
+#\r
+# Table structure for table 'tx_powermailcond_conditions'\r
+#\r
+CREATE TABLE tx_powermailcond_conditions (\r
+       uid int(11) NOT NULL auto_increment,\r
+       pid int(11) DEFAULT '0' NOT NULL,\r
+       tstamp int(11) DEFAULT '0' NOT NULL,\r
+       crdate int(11) DEFAULT '0' NOT NULL,\r
+       cruser_id int(11) DEFAULT '0' NOT NULL,\r
+       sys_language_uid int(11) DEFAULT '0' NOT NULL,\r
+       l18n_parent int(11) DEFAULT '0' NOT NULL,\r
+       l18n_diffsource mediumblob NOT NULL,\r
+       sorting int(10) DEFAULT '0' NOT NULL,\r
+       deleted tinyint(4) DEFAULT '0' NOT NULL,\r
+       hidden tinyint(4) DEFAULT '0' NOT NULL,\r
+       starttime int(11) DEFAULT '0' NOT NULL,\r
+       endtime int(11) DEFAULT '0' NOT NULL,\r
+       title tinytext NOT NULL,\r
+       targetField tinytext NOT NULL,\r
+       actions tinytext NOT NULL,\r
+       filterSelectField tinytext NOT NULL,\r
+       conjunction tinytext NOT NULL,\r
+       rules int(11) DEFAULT '0' NOT NULL,\r
+       \r
+       PRIMARY KEY (uid),\r
+       KEY parent (pid)\r
+);\r
+\r
+\r
+\r
+#\r
+# Table structure for table 'tx_powermailcond_rules'\r
+#\r
+CREATE TABLE tx_powermailcond_rules (\r
+       uid int(11) NOT NULL auto_increment,\r
+       pid int(11) DEFAULT '0' NOT NULL,\r
+       tstamp int(11) DEFAULT '0' NOT NULL,\r
+       crdate int(11) DEFAULT '0' NOT NULL,\r
+       cruser_id int(11) DEFAULT '0' NOT NULL,\r
+       sorting int(10) DEFAULT '0' NOT NULL,\r
+       deleted tinyint(4) DEFAULT '0' NOT NULL,\r
+       hidden tinyint(4) DEFAULT '0' NOT NULL,\r
+       title tinytext NOT NULL,\r
+       startField int(11) DEFAULT '0' NOT NULL,\r
+       ops int(11) DEFAULT '0' NOT NULL,\r
+       condstring text NOT NULL,\r
+       conditions int(11) DEFAULT '0' NOT NULL,\r
+       equalField int(11) DEFAULT '0' NOT NULL,\r
+       \r
+       PRIMARY KEY (uid),\r
+       KEY parent (pid)\r
+);
\ No newline at end of file
diff --git a/files/js/powermail_cond.js b/files/js/powermail_cond.js
new file mode 100644 (file)
index 0000000..2d09b8f
--- /dev/null
@@ -0,0 +1,209 @@
+$(document).ready(function() {
+       var fieldsOnChange = '.powermail_text, .powermail_textarea, .powermail_select, .powermail_radio, .powermail_check'; // all fields with events
+       if ($('form.tx_powermail_pi1_form').length > 0) { // only if the powermail form is on the page (not for confirmation page)
+               checkConditions(0); // check if something should be changed
+       }
+       
+       // save values via ajax to session
+       $(fieldsOnChange).change(function() {
+               //var url = self.location.href;
+               var pid = $('#powermail_cond_pid_container').val();
+               var url = '/index.php';
+               var timestamp = Number(new Date()); // timestamp is needed for a internet explorer workarround (always change a parameter)
+               var value = $(this).val(); // current value
+               var uid = $(this).attr('id').substr(3); // current uid (without "uid")
+               if ($(this).attr('type') == 'radio') { // if field is a radiobutton
+                       var tmp_uid = uid.split('_'); // split on _
+                       uid = tmp_uid[0]; // we want only the uid (not the subuid)
+               }
+               var name = $(this).attr('name');
+               if (this.type == 'checkbox' && this.checked == false) { // no checkbox workarround
+                       value = '';
+               }
+               if (name.indexOf('tx_powermail_pi1') == '-1') { // if checkbox workarround from powermail
+                       var value = $('#' + name.substr(6)).val();
+                       var uid = $('#' + name.substr(6)).attr('id').substr(3);
+               }
+               var params = 'eID=' + 'powermailcond_saveToSession' + '&id=' + pid + '&tx_powermailcond_pi1[uid]=' + uid + '&tx_powermailcond_pi1[value]=' + value + '&ts=' + timestamp;
+               
+               $.ajax({
+                       type: 'GET', // type
+                       url: url, // send to this url
+                       data: params, // add params
+                       cache: false, // disable cache (for ie)
+                       success: function(data) { // return values
+                               if (data != '') { // if there is a response
+                                       //alert(data); // alert the response
+                                       $('form.tx_powermail_pi1_form').append('Error in powermail_cond.js in change function:' + data);
+                               }
+                               checkConditions(uid); // check if something should be changed
+                       }
+               });
+       });
+       
+});
+
+/**
+ * Main function to check conditions and do something (if necessary)
+ *
+ * @param      integer uid: Field uid (if available)
+ * @return     void
+ */
+function checkConditions(uid) {
+       //var url = self.location.href;
+       var pid = $('#powermail_cond_pid_container').val();
+       var url = '/index.php';
+       var params = '';
+       if (uid > 0) {
+               params += '&tx_powermailcond_pi1[uid]=' + uid;
+       }
+       $.ajax({
+               type: 'GET', // type
+               url: url, // send to this url
+               data: 'eID=' + 'powermailcond_getFieldStatus' + params + '&id=' + pid, // add params
+               cache: false, // disable cache (for ie)
+               beforeSend: function() {
+                       document.body.style.cursor = 'progress'; // change cursor to busy
+               },
+               complete: function() {
+                       document.body.style.cursor = 'auto'; // normal cursor
+               },
+               success: function(data) { // return values
+                       if (data != 'nochange') {
+                               $('.powermail_select option').show(); // show all options at the beginning
+                               $('.powermail_select option').removeAttr('disabled'); // enable all options at the beginning
+                               if (data != '') { // if there is a response
+                                       if (data.length < 500) { // stop if wrong result (maybe complete t3 page)
+                                               doAction(data); // hide all given fields
+                                       }
+                               } else { // if there is no response
+                                       $('.tx_powermail_pi1_fieldwrap_html').show(); // show all fields
+                                       $('.tx-powermail-pi1_fieldset').show(); // show all fieldsets at the beginning
+                               }
+                       }
+               },
+               error: function() {
+                       //alert("Error in powermail_cond.js:\n");
+                       $('form.tx_powermail_pi1_form').append('Error in powermail_cond.js in checkCondtions function by opening the url ' + url + '?' + data);
+               }
+       });
+}
+
+/**
+ * Do some actions (hide and/or filter)
+ *
+ * @param      string  list: commaseparated list with uids (1,2,3)
+ * @return     void
+ */
+function doAction(list) {
+       $('.tx_powermail_pi1_fieldwrap_html').show(); // show all fields at the beginning
+       $('.tx-powermail-pi1_fieldset').show(); // show all fieldsets at the beginning
+       
+       var uid = list.split(',');
+       if (uid.length < 1) { 
+               return false; // stop process   
+       }
+       for (i=0; i<uid.length; i++) { // one loop for every affected field
+               if (uid[i].indexOf('fieldset:') != '-1') { // fieldset part
+                       hideFieldset(uid[i]);
+               } else if (uid[i].indexOf('filter:') != '-1') { // filter part
+                       filterSelection(uid[i]);
+               } else { // fields part
+                       hideField(uid[i]);
+               }
+       }
+}
+
+/**
+ * Hide some fields and clear there value
+ *
+ * @param      string  string: mix of uid and values (fieldset:5:12;13;14)
+ * @return     void
+ */
+function hideFieldset(string) {
+       var params = string.split(':'); // filter / uid / values
+       var values = params[2].split(';'); // value1 / value2 / value3
+       $('fieldset.tx-powermail-pi1_fieldset_' + params[1]).hide(); // hide current fieldset
+       for (k=0; k<values.length; k++) { // one loop for every field inside the fieldset
+               clearValue('.powermail_uid' + values[k]); // clear value of current field
+       }
+}
+
+/**
+ * Hide some fields and clear there value
+ *
+ * @param      integer uid: uid of the element
+ * @return     void
+ */
+function hideField(uid) {
+       $('div.tx_powermail_pi1_fieldwrap_html_' + uid).hide(); // hide current field
+       if ($('.powermail_uid' + uid).val() != '') { // only if value is not yet empty
+               clearValue('.powermail_uid' + uid); // clear value of current field
+               clearSession(uid); // clear value of current field
+       }
+}
+
+/**
+ * Hide some fields and clear there value
+ *
+ * @param      string  string: mix of uid and values (filter:123:Value1;Value2;Value3)
+ * @return     void
+ */
+function filterSelection(string) {
+       var params = string.split(':'); // filter / uid / values
+       var values = params[2].split(';'); // value1 / value2 / value3
+       $('select.powermail_uid' + params[1] + ' option').hide(); // disable all options
+       $('select.powermail_uid' + params[1] + ' option').attr('disabled', 'disabled'); // disable all options
+       
+       for (j=0; j<values.length; j++) { // one loop for every option in select field
+               $('select.powermail_uid' + params[1] + ' option:contains(' + values[j] + ')').show(); // show this option
+               $('select.powermail_uid' + params[1] + ' option:contains(' + values[j] + ')').removeAttr('disabled'); // enable this option
+       }
+       
+       var valueSelected = $('select.powermail_uid' + params[1] + ' option:selected').val(); // give me the value of the selected option
+       if (params[2].indexOf(valueSelected) == '-1') { // if current selected value is one of the not allowed options
+               $('select.powermail_uid' + params[1]).get(0).selectedIndex = 0; // remove selection (because the selected option is not allowed)
+       }
+}
+
+/**
+ * Clear value of an inputfield, set selectedIndex to 0 for selection and so on
+ *
+ * @param      string  selection: selection for jQuery (e.g. input.powermail)
+ * @return     void
+ */
+function clearValue(selection) {
+       if ($(selection).attr('type') == 'radio' || $(selection).attr('type') == 'checkbox') {
+               $(selection).attr('checked', false);
+       } else {
+               $(selection).val('');
+       }
+}
+
+/**
+ * Clear session of a uid
+ *
+ * @param      integer uid: uid of the element
+ * @return     void
+ */
+function clearSession(uid) {
+       //var url = self.location.href;
+       var pid = $('#powermail_cond_pid_container').val();
+       var url = '/index.php';
+       var timestamp = Number(new Date()); // timestamp is needed for a internet explorer workarround (always change a parameter)
+       var params = 'eID=' + 'powermailcond_saveToSession' + '&id=' + pid + '&tx_powermailcond_pi1[uid]=' + uid + '&tx_powermailcond_pi1[value]=&ts=' + timestamp;
+       
+       $.ajax({
+               type: 'GET', // type
+               url: url, // send to this url
+               data: params, // add params
+               cache: false, // disable cache (for ie)
+               success: function(data) { // return values
+                       if (data != '') { // if there is a response
+                               //alert(data); // alert the response
+                               $('form.tx_powermail_pi1_form').append('Error in powermail_cond.js in clearSession function:' + data);
+                       }
+                       checkConditions(uid); // check if something should be changed
+               }
+       });
+};
\ No newline at end of file
diff --git a/files/static/constants.txt b/files/static/constants.txt
new file mode 100644 (file)
index 0000000..7840948
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Unbenanntes Dokument</title>
+</head>
+
+<body>
+</body>
+</html>
diff --git a/files/static/setup.txt b/files/static/setup.txt
new file mode 100644 (file)
index 0000000..716786c
--- /dev/null
@@ -0,0 +1,7 @@
+page.headerData.3131 = TEXT
+page.headerData.3131.value (
+       <meta http-equiv="expires" content="0" />
+       <meta http-equiv="cache-control" content="no-cache" />
+       <meta http-equiv="pragma" content="no-cache" />
+)
+page.includeJSFooter.powermail_cond = EXT:powermail_cond/files/js/powermail_cond.js
\ No newline at end of file
diff --git a/icon_tx_powermailcond_conditions.gif b/icon_tx_powermailcond_conditions.gif
new file mode 100644 (file)
index 0000000..0480fc3
Binary files /dev/null and b/icon_tx_powermailcond_conditions.gif differ
diff --git a/icon_tx_powermailcond_rules.gif b/icon_tx_powermailcond_rules.gif
new file mode 100644 (file)
index 0000000..18415b1
Binary files /dev/null and b/icon_tx_powermailcond_rules.gif differ
diff --git a/lib/class.tx_powermailcond_ajaxFieldList_eid.php b/lib/class.tx_powermailcond_ajaxFieldList_eid.php
new file mode 100644 (file)
index 0000000..ccddd0b
--- /dev/null
@@ -0,0 +1,330 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010 Alexander Kellner <alexander.kellner@in2code.de>, in2code.
+*  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(PATH_t3lib . 'class.t3lib_befunc.php');
+require_once(PATH_t3lib . 'stddb/tables.php');
+require_once(t3lib_extMgm::extPath('cms', 'ext_tables.php'));
+require_once(PATH_tslib . 'class.tslib_pibase.php');
+require_once(PATH_tslib . 'class.tslib_fe.php');
+require_once(PATH_t3lib . 'class.t3lib_page.php');
+require_once(t3lib_extMgm::extPath('powermail_cond') . 'lib/class.tx_powermailcond_div.php'); // load div class
+
+/**
+ * This class tells jQuery which field are allowed in which are not allowed
+ *
+ * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
+ * @package    TYPO3
+ * @subpackage tx_powermailcond_ajaxWriteInSession_eid
+ */
+class tx_powermailcond_ajaxFieldList_eid extends tslib_pibase {
+
+       public $extKey = 'powermail_cond'; // Extension key
+       public $prefixId = 'tx_powermailcond_pi1';
+       public $piVars;
+       private $content = '';
+       
+       /**
+        * Return list with fields which are not allowed (should be hidden)
+        *
+        * @return      string  $content:       commaseparated field list (1,2,3) 
+        *                                                              complex list could be:
+        *                                                              filter:12:option1;option2,12,13,fieldset:2:18;19 
+        *                                                              explanation - filter select.uid12, hide uid12, hide uid3, hide fieldset uid2 and clear uid18 and uid19
+        */
+    public function main() {
+               $this->cObj = $this->getCObj(); // enable TSFE globals
+               $conditions = $this->getConditionsFromThisPage(); // get conditions from database
+               $targetFields = $this->div->getStartFields($conditions); // get all startfields in an array
+               if ($this->piVars['uid'] > 0 && !in_array($this->piVars['uid'], $targetFields)) { // if current field uid given and this
+                       return 'nochange';
+               }
+               
+               foreach ((array) $conditions as $targetUid => $conf) { // one loop for every single target field
+                       $content .= $this->checkRules($conf) . ','; // add list to content object
+               }
+               
+               $content = t3lib_div::rm_endcomma($content); // remove last ,
+               $content = t3lib_div::uniqueList($content); // remove double values
+               
+               return $content;
+    }
+       
+       /**
+        * Preflight function checks the rules if there should be an action (show/hide) or not
+        *
+        * @param       array   $conf: Configuration of current field
+        * @return      boolean true:hide false:show(nothing)
+        */
+       public function checkRules($conf) {
+               $content = '';
+               $do = 0; // start with 0
+               if ($conf[0]['conjunction'] == 'AND') {
+                       $do = 1; // start with 1
+               }
+               
+               foreach ((array) $conf as $key => $subconf) { // one loop for every rule of current target field
+                       $ttcontentUid = $this->div->getTtcontentUid($conf[$key]['startField']);
+                       
+                       // special case: hide a field from the beginning
+                       if ($conf[$key]['actions'] == 1) { // show
+                               $content .= $this->getFieldsFromFieldset($conf[$key]['targetField'], $ttcontentUid) . ',';
+                       }
+                        
+                       // operations
+                       $act = 0;
+                       $startFieldSession = $GLOBALS['TSFE']->fe_user->sesData['powermail_' . $ttcontentUid]['uid' . $conf[$key]['startField']]; // get startfield value from session
+                       if (is_array($startFieldSession)) { // if second level
+                               $startFieldSession = implode(',', $startFieldSession); // get all values in a commaseparated list
+                       }
+                       switch ($conf[$key]['ops']) {
+                               case 0: // "not empty"
+                                       if ($startFieldSession != '') { // if start field value in session is not empty
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       } 
+                                       break;
+                                       
+                               case 1: // "empty"
+                                       if ($startFieldSession == '') { // if start field value in session is empty
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       } 
+                                       break;
+                                       
+                               case 2: // "contains"
+                                       if (stristr($startFieldSession, $conf[$key]['condstring'])) { // if start field value in session contains condstring
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       } 
+                                       break;
+                                       
+                               case 3: // "not contains"
+                                       if (!stristr($startFieldSession, $conf[$key]['condstring'])) { // if start field value in session contains not condstring
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       } 
+                                       break;
+                                       
+                               case 4: // "is"
+                                       if ($startFieldSession === $conf[$key]['condstring']) { // if start field value in session === condstring
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       } 
+                                       break;
+                                       
+                               case 5: // "is not"
+                                       if ($startFieldSession !== $conf[$key]['condstring']) { // if start field value in session is not condstring
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       } 
+                                       break;
+                                       
+                               case 6: // "is greater than"
+                                       if (intval($startFieldSession) > intval($conf[$key]['condstring'])) { // if start field value in session is greater than condstring
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       } 
+                                       break;
+                                       
+                               case 7: // "is less than"
+                                       if (intval($startFieldSession) < intval($conf[$key]['condstring'])) { // if start field value in session is greater than condstring
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       }
+                                       break;
+                                       
+                               case 8: // "contains value from field"
+                                       $comparisonFieldSession = $GLOBALS['TSFE']->fe_user->sesData['powermail_' . $ttcontentUid]['uid' . $conf[$key]['equalField']]; // get comparisonfield value from session
+                                       if (stristr($comparisonFieldSession, $startFieldSession)) {
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       }
+                                       break;
+                                       
+                               case 9: // "contains not value from field"
+                                       $comparisonFieldSession = $GLOBALS['TSFE']->fe_user->sesData['powermail_' . $ttcontentUid]['uid' . $conf[$key]['equalField']]; // get comparisonfield value from session
+                                       if (!stristr($comparisonFieldSession, $startFieldSession)) {
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       }
+                                       break;
+                       }
+                       
+                       $do = $this->setDo(($act ? 1 : 0), $do, $conf[$key]['conjunction']); // $do = 1;
+               }
+               
+               $content = $this->doAction($do, $content, $ttcontentUid, $tmp_conf); // add new field if needed
+               return t3lib_div::rm_endcomma($content); // return commaseparated list
+       }
+       
+       /**
+        * This function return current field uid if this field should be hidden (and removes value from session)
+        *
+        * @param       boolean $do: If something should be done or not
+        * @param       string  $content: List with all fields which should be hidden
+        * @param       integer $ttcontentUid: UID of this tt_content
+        * @param       array   $conf: Configuration of current field
+        * @return      string list
+        */
+       public function doAction($do, $content, $ttcontentUid, $conf) {
+               if (!$do) {
+                       return $content;
+               }
+               
+               switch ($conf['actions']) {
+                       case 0: // hide
+                               $this->div->saveInSession(array('uid' . $conf['targetField'] => ''), 'powermail_' . $ttcontentUid); // remove value from session of this field
+                               $content .= $this->getFieldsFromFieldset($conf['targetField'], $ttcontentUid, 1) . ','; // hide this field
+                               break;
+                               
+                       case 1: // show
+                               $content = t3lib_div::rmFromList($this->getFieldsFromFieldset($conf['targetField'], $ttcontentUid), $content); // remove from hidelist (show this field)
+                               break;
+                               
+                       case 2: // filter from selectbox
+                               $content .= 'filter:' . $conf['targetField'] . ':' . str_replace(',', ';', $conf['filterSelectField']);
+                               break;
+               }
+               
+               return $content;
+       }
+       
+       /**
+        * Set a value to 0 or 1 depending on previous value and on conjunction (AND/OR)
+        *
+        * @param       boolean $newStatus: New status
+        * @param       boolean $oldStatus: Old status
+        * @param       string  $conjunction: AND or OR
+        * @return      boolean
+        */
+       private function setDo($newStatus, $oldStatus = 0, $conjunction = 'OR') {
+               //t3lib_div::debug(array($newStatus, $oldStatus), $conjunction);
+               if ($conjunction == 'OR') {
+                       if ($newStatus || $oldStatus) {
+                               return 1;
+                       } else {
+                               return 0;
+                       }
+               } elseif ($conjunction == 'AND') {
+                       if ($newStatus && $oldStatus) {
+                               return 1;
+                       } else {
+                               return 0;
+                       }
+               }
+       }
+       
+       /**
+        * get condition as array from current page
+        *
+        * @return      array   $arr: Array with all conditions of the current page
+        */
+       private function getConditionsFromThisPage() {
+               $arr = array();
+               $pid = t3lib_div::_GET('id');
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery ( // Get all rules to current field
+                       'tx_powermailcond_conditions.targetField, tx_powermailcond_conditions.actions, tx_powermailcond_conditions.conjunction, tx_powermailcond_conditions.filterSelectField, tx_powermailcond_rules.startField, tx_powermailcond_rules.ops, tx_powermailcond_rules.condstring, tx_powermailcond_rules.equalField',
+                       'tx_powermailcond_conditions LEFT JOIN tx_powermailcond_rules ON tx_powermailcond_conditions.uid = tx_powermailcond_rules.conditions',
+                       $where_clause = (intval($pid) ? 'tx_powermailcond_conditions.pid = ' . intval($pid) : '1') . $this->cObj->enableFields('tx_powermailcond_conditions') . $this->cObj->enableFields('tx_powermailcond_rules'),
+                       $groupBy = 'tx_powermailcond_rules.uid',
+                       $orderBy = '',
+                       $limit = '1000'
+               );
+               if ($res) { // If there is a result
+                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { // One loop for every rule on current page
+                               $arr[$row['targetField']][] = $row;
+                       }
+                       
+                       return $arr;
+               }
+       }
+       
+       /**
+        * Get all fields in a commaseparated list from a fieldset uid
+        *
+        * @param       integer $uid: Fieldset UID
+        * @param       integer $ttcontentUid: UID of this tt_content
+        * @param       boolean $clearSession: Clear cache of each of this fields
+        * @return      string  $list: Commaseparated List with field uids
+        */
+       private function getFieldsFromFieldset($uid, $ttcontentUid, $clearSession = 0) {
+               if (is_numeric($uid)) { // if this uid don't contains fs (for fs123)
+                       return $uid;
+               }
+               
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery (
+                       'tx_powermail_fields.uid',
+                       'tx_powermail_fieldsets LEFT JOIN tx_powermail_fields ON tx_powermail_fieldsets.uid = tx_powermail_fields.fieldset',
+                       $where = 'tx_powermail_fieldsets.uid = ' . intval(str_replace('fieldset:', '', $uid)),
+                       $groupBy = '',
+                       $orderBy = '',
+                       $limit = '1000'
+               );
+               if ($res) { // If there is a result
+                       $uids = '';
+                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { // One loop for every field
+                               $uids .= $row['uid'] . ';';
+                               $this->div->saveInSession(array('uid' . $row['uid'] => ''), 'powermail_' . $ttcontentUid); // remove value from session of this field
+                       }
+               }
+               
+               if (!isset($uids)) {
+                       return $uid;
+               }
+               
+               return $uid . ':' . substr($uids, 0, -1); // return without last ;
+       }
+       
+       /**
+        * Initialize cObj and TSFE Globals
+        *
+        * @return      object  cObj
+        */
+       private function getCObj() {
+               $this->piVars = t3lib_div::_GET($this->prefixId);
+               $this->div = t3lib_div::makeInstance('tx_powermailcond_div'); // Create new instance for div class
+               $userObj = tslib_eidtools::initFeUser();                                            
+               $temp_TSFEclassName = t3lib_div::makeInstance('tslib_fe');
+               $GLOBALS['TSFE'] = new $temp_TSFEclassName($TYPO3_CONF_VARS, 0, 0, true);
+               $GLOBALS['TSFE']->connectToDB();
+               $GLOBALS['TSFE']->fe_user = $userObj;
+               $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
+               $GLOBALS['TSFE']->determineId();
+               $GLOBALS['TSFE']->getCompressedTCarray();
+               $GLOBALS['TSFE']->initTemplate();
+               $GLOBALS['TSFE']->getConfigArray();
+               $GLOBALS['TSFE']->includeTCA();
+               
+               return t3lib_div::makeInstance('tslib_cObj');
+    }
+       
+}
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_ajaxFieldList_eid.php'])    {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_ajaxFieldList_eid.php']);
+}
+
+$SOBE = t3lib_div::makeInstance('tx_powermailcond_ajaxFieldList_eid'); // make instance
+echo $SOBE->main(); // print content
+?>
\ No newline at end of file
diff --git a/lib/class.tx_powermailcond_ajaxWriteInSession_eid.php b/lib/class.tx_powermailcond_ajaxWriteInSession_eid.php
new file mode 100644 (file)
index 0000000..1f8449b
--- /dev/null
@@ -0,0 +1,135 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010 Alexander Kellner <alexander.kellner@in2code.de>, in2code.
+*  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(PATH_t3lib . 'class.t3lib_befunc.php');
+require_once(PATH_t3lib . 'stddb/tables.php');
+require_once(t3lib_extMgm::extPath('cms', 'ext_tables.php'));
+require_once(PATH_tslib . 'class.tslib_pibase.php');
+require_once(t3lib_extMgm::extPath('powermail_cond') . 'lib/class.tx_powermailcond_div.php'); // load div class
+
+/**
+ * This class is for storing values to the session on every fieldchange (via AJAX)
+ *
+ * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
+ * @package    TYPO3
+ * @subpackage tx_powermailcond_ajaxWriteInSession_eid
+ */
+class tx_powermailcond_ajaxWriteInSession_eid extends tslib_pibase {
+
+       public $extKey = 'powermail_cond'; // Extension key
+       public $prefixId = 'tx_powermailcond_pi1';
+       private $debug = false;
+       
+       /**
+        * Write values to session - main method called via AJAX
+        * Call this with index.php?id=97&eID=powermailcond_ajax&tx_powermailcond_pi1[uid]=5&tx_powermailcond_pi1[value]=test
+        *
+        * @return      void
+        */
+    public function main() {
+               // config
+               $this->getCObj(); // enable TSFE globals
+               $GLOBALS['TSFE']->sesData = tslib_eidtools::initFeUser();
+               $piVars = t3lib_div::_GP($this->prefixId); // GET param
+               $uids = t3lib_div::trimExplode('_', $piVars['uid']);
+               $uid = intval($uids[0]); // uid of current field
+               $value = htmlspecialchars($piVars['value']); // value from current field
+               $this->div = t3lib_div::makeInstance('tx_powermailcond_div'); // Create new instance for div class
+               $ttcontent_uid = $this->div->getTtcontentUid($uid); // get tt_content uid to current field
+               
+               // start
+               if ($uid == 0) {
+                       return false;
+               }
+               if (isset($uids[1])) { // second level
+                       $oldSession = array();
+                       $arr['uid' . $uid] = $GLOBALS['TSFE']->fe_user->sesData['powermail_' . $ttcontent_uid]['uid' . $uid];
+                       $arr['uid' . $uid][$uids[1]] = $value;
+                       $this->div->saveInSession($arr, 'powermail_' . $ttcontent_uid); // save values to session
+               } else { // first level
+                       $arr = array(
+                               'uid' . $uid => $value
+                       );
+                       $this->div->saveInSession($arr, 'powermail_' . $ttcontent_uid); // save values to session
+               }
+               
+               if ($this->debug) {
+                       t3lib_div::debug($arr, 'powermail_' . $ttcontent_uid);
+               }
+    }
+       
+       /**
+        * Get tt_content UID from field UID
+        *
+        * @param       integer $fuid: UID of tx_powermail_fields
+        * @return      integer $uid: tt_content UID
+        */
+       private function getTtcontentUid($fuid) {
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery ( // DB query
+                       'tt_content.uid',
+                       'tx_powermail_fieldsets LEFT JOIN tx_powermail_fields ON tx_powermail_fieldsets.uid = tx_powermail_fields.fieldset LEFT JOIN tt_content ON tx_powermail_fieldsets.tt_content = tt_content.uid',
+                       'tx_powermail_fields.uid = ' . intval($fuid),
+                       '',
+                       '',
+                       1
+               );
+               if (!$res) { // If there is a result
+                       return false;
+               }
+
+               $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+               return $row['uid'];
+       }
+       
+       /**
+        * Initialize cObj and TSFE Globals
+        *
+        * @return      object  cObj
+        */
+       private function getCObj() {
+               $this->div = t3lib_div::makeInstance('tx_powermailcond_div'); // Create new instance for div class
+               $userObj = tslib_eidtools::initFeUser();                                            
+               $temp_TSFEclassName = t3lib_div::makeInstance('tslib_fe');
+               $GLOBALS['TSFE'] = new $temp_TSFEclassName($TYPO3_CONF_VARS, 32, 0, true);
+               $GLOBALS['TSFE']->connectToDB();
+               $GLOBALS['TSFE']->fe_user = $userObj;
+               $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
+               $GLOBALS['TSFE']->determineId();
+               $GLOBALS['TSFE']->getCompressedTCarray();
+               $GLOBALS['TSFE']->initTemplate();
+               $GLOBALS['TSFE']->getConfigArray();
+               $GLOBALS['TSFE']->includeTCA();
+               
+               return t3lib_div::makeInstance('tslib_cObj');
+    }
+       
+}
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_ajaxWriteInSession_eid.php'])       {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_ajaxWriteInSession_eid.php']);
+}
+
+$SOBE = t3lib_div::makeInstance('tx_powermailcond_ajaxWriteInSession_eid'); // make instance
+echo $SOBE->main(); // print content
+?>
\ No newline at end of file
diff --git a/lib/class.tx_powermailcond_div.php b/lib/class.tx_powermailcond_div.php
new file mode 100644 (file)
index 0000000..945b94f
--- /dev/null
@@ -0,0 +1,114 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010 Alexander Kellner <alexander.kellner@in2code.de>, in2code.
+*  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!
+***************************************************************/
+
+/**
+ * This class is for misc stuff and could be called from all other methods of this extension
+ *
+ * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
+ * @package    TYPO3
+ * @subpackage tx_powermailcond_div
+ */
+class tx_powermailcond_div {
+
+       public $extKey = 'powermail_cond'; // Extension key
+       public $prefixId = 'tx_powermailcond_pi1';
+       
+       /**
+        * Write values to session
+        *
+        * @param       array   $array: Array for session store
+        * @param       string  $sesName: Session name
+        * @return      void
+        */
+       public function saveInSession($array, $sesName) {
+               // get current stored values from session
+               $oldArray = $GLOBALS['TSFE']->fe_user->getKey('ses', $sesName);
+               
+               // merge old with new values
+               $array = array_merge((array) $oldArray, (array) $array);
+               
+               // store new session
+               $GLOBALS['TSFE']->fe_user->setKey('ses', $sesName, $array); // Generate Session with piVars array
+               $GLOBALS['TSFE']->storeSessionData(); // Save session
+       }
+       
+       /**
+        * Return all values from the session (could be used for debugging, etc..)
+        *
+        * @param       string  $sesName: Session name
+        * @return      array   $array: with session values
+        */
+       public function getAllSessionValues($sesName) {
+               // get current stored values from session
+               $array = $GLOBALS['TSFE']->fe_user->getKey('ses', $sesName);
+               return $array;
+       }
+       
+       /**
+        * Get tt_content UID from field UID
+        *
+        * @param       integer $fuid: UID of tx_powermail_fields
+        * @return      integer $uid: tt_content UID
+        */
+       public function getTtcontentUid($fuid) {
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery ( // DB query
+                       'tt_content.uid',
+                       'tx_powermail_fieldsets LEFT JOIN tx_powermail_fields ON tx_powermail_fieldsets.uid = tx_powermail_fields.fieldset LEFT JOIN tt_content ON tx_powermail_fieldsets.tt_content = tt_content.uid',
+                       'tx_powermail_fields.uid = ' . intval($fuid),
+                       '',
+                       '',
+                       1
+               );
+               if (!$res) { // If there is a result
+                       return false;
+               }
+
+               $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+               return $row['uid'];
+       }
+       
+       /**
+        * Write values to session
+        *
+        * @param       array   $conf: Configuration Array
+        * @return      array   $array: With all Startfields
+        */
+       public function getStartFields($conf) {
+               $array = array();
+               foreach ((array) $conf as $confLevel1) {
+                       foreach ((array) $confLevel1 as $confLevel2) {
+                               if (!empty($confLevel2['startField'])) {
+                                       $array[] = $confLevel2['startField'];
+                               }
+                       }
+               }
+               return $array;
+       }
+       
+}
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_div.php'])  {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_div.php']);
+}
+?>
\ No newline at end of file
diff --git a/lib/class.tx_powermailcond_fields_be.php b/lib/class.tx_powermailcond_fields_be.php
new file mode 100644 (file)
index 0000000..e83d38e
--- /dev/null
@@ -0,0 +1,138 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010 Alex Kellner <alexander.kellner@in2code.de>, in2code.
+*  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 table/field tx_powermailcond_rules_fieldname.
+ *
+ * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
+ * @package    TYPO3
+ * @subpackage tx_powermailcond_fields_be
+ */
+class tx_powermailcond_fields_be {
+       
+       /**
+        * show all fields in the backend
+        *
+        * @param       array   $params: Params
+        * @param       object  $pObj: Parent Object
+        * @return      void
+        */
+       public function fieldname(&$params, $pObj)      {
+               $where = '1';
+               if (isset($params['config']['itemsProcFuncValue'])) { // additional where clause
+                       $where = 'formtype IN (' . $params['config']['itemsProcFuncValue'] . ')';
+               }
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       $select = 'uid, title',
+                       $from = 'tx_powermail_fields',
+                       $where .= ' AND pid = ' . intval($params['row']['pid']) . ' AND hidden = 0 AND deleted = 0',
+                       $groupBy = '',
+                       $orderBy = 'sorting',
+                       $limit = ''
+               );
+               if ($res) {
+                       $params['items'][] = array('powermail Fields', '--div--');
+                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                               $params['items'][] = array($pObj->sL($row['title']) . ' (' . $row['uid'] . ')', $row['uid']);
+                       }
+               }
+               
+               if (isset($params['config']['itemsProcFunc_addFieldsets'])) { // add fieldsets to selection
+                       $params['items'] = array_merge((array) $params['items'], $this->getFieldsets($params['row']['pid'])); // add some fieldsets
+               }
+       }
+       
+       /**
+        * give me all fieldsets in an array
+        *
+        * @param       integer $pid: Page ID
+        * @return      array   $arr: all fieldsets with its name and the fieldset uid
+        */
+       public function getFieldsets($pid) {
+               $arr = array();
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       $select = 'uid, title',
+                       $from = 'tx_powermail_fieldsets',
+                       $where .= 'pid = ' . intval($pid) . ' AND hidden = 0 AND deleted = 0',
+                       $groupBy = '',
+                       $orderBy = 'sorting',
+                       $limit = ''
+               );
+               if ($res) {
+                       $arr[] = array('powermail Fieldsets', '--div--');
+                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                               $arr[] = array($row['title'] . ' (' . $row['uid'] . ')', 'fieldset:' . $row['uid']);
+                       }
+               }
+               return $arr;
+       }
+       
+       /**
+        * List values of a powermail selectorbox
+        *
+        * @param       array   $params: Params
+        * @param       object  $pObj: Parent Object
+        * @return      void
+        */
+       public function valuesFromPowermailSelectbox(&$params, $pObj) {
+               // Get targetField UID
+               $gParams = t3lib_div::_GET('edit');
+               $gParams2 = $gParams['tx_powermailcond_conditions'];
+               foreach ((array) $gParams2 as $uid => $actions) {
+                       $thisConditionsUid = $uid;
+               }
+               $targetField = $pObj->cachedTSconfig['tx_powermailcond_conditions:' . $thisConditionsUid]['_THIS_ROW']['targetField'];
+               
+               // Read values from powermail 
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       $select = 'flexform',
+                       $from = 'tx_powermail_fields',
+                       $where = 'uid = ' . intval($targetField),
+                       $groupBy = '',
+                       $orderBy = '',
+                       $limit = '1'
+               );
+               if ($res) {
+                       $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+               }
+               
+               // Change xml to a readable format
+               $arr = (array) t3lib_div::xml2array($row['flexform']);
+               $optionlist = $arr['data']['sDEF']['lDEF']['options']['vDEF'];
+               $options = t3lib_div::trimExplode("\n", $optionlist, 1);
+               
+               // write params
+               foreach ((array) $options as $option) {
+                       $params['items'][] = array(htmlspecialchars($option), htmlspecialchars($option));
+               }
+       }
+}
+
+
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/class.tx_powermailcond_fields_be.php'])        {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/class.tx_powermailcond_fields_be.php']);
+}
+
+?>
\ No newline at end of file
diff --git a/lib/class.tx_powermailcond_pidContainer.php b/lib/class.tx_powermailcond_pidContainer.php
new file mode 100644 (file)
index 0000000..5bdd86b
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2011 Alexander Kellner <alexander.kellner@in2code.de>, in2code.
+*  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!
+***************************************************************/
+
+/**
+ * This class adds a pid container hidden field at the end of a powermail form
+ *
+ * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
+ * @package    TYPO3
+ * @subpackage tx_powermailcond_pidContainer
+ */
+class tx_powermailcond_pidContainer {
+
+       public $extKey = 'powermail_cond'; // Extension key
+       public $prefixId = 'tx_powermailcond_pi1';
+       
+       /**
+        * Return all values from the session (could be used for debugging, etc..)
+        *
+        * @param       array   Outer Marker Array
+        * @param       array   Subpart Array
+        * @param       array   TypoScript configuration
+        * @param       object  Parent object
+        * @return      void
+        */
+       public function PM_FormWrapMarkerHook($markerArray, &$subpartArray, $conf, $pObj) {
+               if (isset($subpartArray['###POWERMAIL_CONTENT###'])) {
+                       $subpartArray['###POWERMAIL_CONTENT###'] .= '<input type="hidden" id="powermail_cond_pid_container" name="powermail_cond_pid_container" value="' . intval($GLOBALS['TSFE']->id) . '" />';
+               }
+       }
+       
+}
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_div.php'])  {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_div.php']);
+}
+?>
\ No newline at end of file
diff --git a/locallang_db.xml b/locallang_db.xml
new file mode 100644 (file)
index 0000000..15be45c
--- /dev/null
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>\r
+<T3locallang>\r
+       <meta type="array">\r
+               <type>database</type>\r
+               <description>Language labels for database tables/fields belonging to extension 'powermail_cond'</description>\r
+       </meta>\r
+       <data type="array">\r
+               <languageKey index="default" type="array">\r
+                       <label index="tx_powermailcond_conditions">Conditions</label>\r
+                       <label index="tx_powermailcond_conditions.title">Title</label>\r
+                       <label index="tx_powermailcond_conditions.targetField">Which field is affected (target field)?</label>\r
+                       <label index="tx_powermailcond_conditions.targetField.I.0">Please choose...</label>\r
+                       <label index="tx_powermailcond_conditions.action">What should happen to the chosen field?</label>\r
+                       <label index="tx_powermailcond_conditions.action.I.main">Main actions</label>\r
+                       <label index="tx_powermailcond_conditions.action.I.additional">Additional Actions</label>\r
+                       <label index="tx_powermailcond_conditions.action.I.0">hide</label>\r
+                       <label index="tx_powermailcond_conditions.action.I.1">unhide</label>\r
+                       <label index="tx_powermailcond_conditions.action.I.2">filter Selectbox (for fields only)</label>\r
+                       <label index="tx_powermailcond_conditions.filterSelectField">Filter to these values</label>\r
+                       <label index="tx_powermailcond_conditions.rules">Rules</label>\r
+                       <label index="tx_powermailcond_conditions.conjunction">Conjunction of the rules</label>\r
+                       <label index="tx_powermailcond_conditions.conjunction.I.0">AND</label>\r
+                       <label index="tx_powermailcond_conditions.conjunction.I.1">OR</label>\r
+                       <label index="tx_powermailcond_rules">Rules</label>\r
+                       <label index="tx_powermailcond_rules.title">Title</label>\r
+                       <label index="tx_powermailcond_rules.startField">Which field starts the condition (start field)?</label>\r
+                       <label index="tx_powermailcond_rules.startField.I.0">Please choose...</label>\r
+                       <label index="tx_powermailcond_rules.operator">Operator</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.operators">Simple Operators</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.operatorsComparisonValue">Operators with comparison value</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.operatorsComparisonField">Operators with comparison field</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.0">is set</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.1">is not set</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.2">contains value</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.3">contains value not</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.4">is</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.5">is not</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.6">is greater than (numbers only)</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.7">is less than (numbers only)</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.8">contains value from field</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.9">contains not value from field</label>\r
+                       <label index="tx_powermailcond_rules.condstring">Value</label>\r
+                       <label index="tx_powermailcond_rules.equalField">Field for comparison</label>\r
+                       <label index="tx_powermailcond_rules.equalField.I.0">Please choose...</label>\r
+               </languageKey>\r
+               <languageKey index="de" type="array">\r
+                       <label index="tx_powermailcond_conditions">Bedingungen</label>\r
+                       <label index="tx_powermailcond_conditions.title">Bezeichnung</label>\r
+                       <label index="tx_powermailcond_conditions.targetField">Welches Feld ist betroffen (Zielfeld)?</label>\r
+                       <label index="tx_powermailcond_conditions.targetField.I.0">Bitte wählen...</label>\r
+                       <label index="tx_powermailcond_conditions.action">Was soll mit dem gewählten Feld passieren?</label>\r
+                       <label index="tx_powermailcond_conditions.action.I.main">Hauptaktionen</label>\r
+                       <label index="tx_powermailcond_conditions.action.I.additional">Zusätzliche Aktionen</label>\r
+                       <label index="tx_powermailcond_conditions.action.I.0">verberge</label>\r
+                       <label index="tx_powermailcond_conditions.action.I.1">zeige</label>\r
+                       <label index="tx_powermailcond_conditions.action.I.2">filter Auswahlbox (nur für Felder)</label>\r
+                       <label index="tx_powermailcond_conditions.filterSelectField">Auf diese Werte begrenzen</label>\r
+                       <label index="tx_powermailcond_conditions.rules">Regeln</label>\r
+                       <label index="tx_powermailcond_conditions.conjunction">Logische Verknüpfung der Regeln</label>\r
+                       <label index="tx_powermailcond_conditions.conjunction.I.0">UND</label>\r
+                       <label index="tx_powermailcond_conditions.conjunction.I.1">ODER</label>\r
+                       <label index="tx_powermailcond_rules">Regeln</label>\r
+                       <label index="tx_powermailcond_rules.title">Bezeichnung</label>\r
+                       <label index="tx_powermailcond_rules.startField">Welches Feld löst die Bedingung aus (Startfeld)?</label>\r
+                       <label index="tx_powermailcond_rules.startField.I.0">Bitte wählen...</label>\r
+                       <label index="tx_powermailcond_rules.operator">Operator</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.operators">Einfache Operatoren</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.operatorsComparisonValue">Operatoren mit Vergleichswert</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.operatorsComparisonField">Operatoren mit Vergleichsfeld</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.0">nicht leer</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.1">leer</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.2">beinhaltet Wert</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.3">beinhaltet Wert nicht</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.4">ist</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.5">ist nicht</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.6">ist größer als (nur Zahlen)</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.7">ist kleiner als (nur Zahlen)</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.8">beinhaltet Wert von Feld</label>\r
+                       <label index="tx_powermailcond_rules.operator.I.9">beinhaltet nicht Wert von Feld</label>\r
+                       <label index="tx_powermailcond_rules.condstring">Wert</label>\r
+                       <label index="tx_powermailcond_rules.equalField">Vergleichsfeld</label>\r
+                       <label index="tx_powermailcond_rules.equalField.I.0">Bitte wählen...</label>\r
+               </languageKey>\r
+       </data>\r
+</T3locallang>\r
diff --git a/tca.php b/tca.php
new file mode 100644 (file)
index 0000000..666a412
--- /dev/null
+++ b/tca.php
@@ -0,0 +1,272 @@
+<?php
+if (!defined ('TYPO3_MODE')) {
+       die ('Access denied.');
+}
+
+$TCA['tx_powermailcond_conditions'] = array (
+       'ctrl' => $TCA['tx_powermailcond_conditions']['ctrl'],
+       'interface' => array (
+               'showRecordFieldList' => 'sys_language_uid,l18n_parent,l18n_diffsource,hidden,starttime,endtime,title,targetField,actions,filterSelectField,rules,conjunction'
+       ),
+       'feInterface' => $TCA['tx_powermailcond_conditions']['feInterface'],
+       'columns' => array (
+               'sys_language_uid' => array (           
+                       'exclude' => 1,
+                       'label'  => 'LLL:EXT:lang/locallang_general.xml:LGL.language',
+                       'config' => array (
+                               'type'                => 'select',
+                               'foreign_table'       => 'sys_language',
+                               'foreign_table_where' => 'ORDER BY sys_language.title',
+                               'items' => array(
+                                       array('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1),
+                                       array('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0)
+                               )
+                       )
+               ),
+               'l18n_parent' => array (                
+                       'displayCond' => 'FIELD:sys_language_uid:>:0',
+                       'exclude'     => 1,
+                       'label'       => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent',
+                       'config'      => array (
+                               'type'  => 'select',
+                               'items' => array (
+                                       array('', 0),
+                               ),
+                               'foreign_table'       => 'tx_powermailcond_conditions',
+                               'foreign_table_where' => 'AND tx_powermailcond_conditions.pid=###CURRENT_PID### AND tx_powermailcond_conditions.sys_language_uid IN (-1,0)',
+                       )
+               ),
+               'l18n_diffsource' => array (            
+                       'config' => array (
+                               'type' => 'passthrough'
+                       )
+               ),
+               'hidden' => array (             
+                       'exclude' => 1,
+                       'label'   => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
+                       'config'  => array (
+                               'type'    => 'check',
+                               'default' => '0'
+                       )
+               ),
+               'starttime' => array (          
+                       'exclude' => 1,
+                       'label'   => 'LLL:EXT:lang/locallang_general.xml:LGL.starttime',
+                       'config'  => array (
+                               'type'     => 'input',
+                               'size'     => '8',
+                               'max'      => '20',
+                               //'eval'     => 'date',
+                               'default'  => '0',
+                               'checkbox' => '0'
+                       )
+               ),
+               'endtime' => array (            
+                       'exclude' => 1,
+                       'label'   => 'LLL:EXT:lang/locallang_general.xml:LGL.endtime',
+                       'config'  => array (
+                               'type'     => 'input',
+                               'size'     => '8',
+                               'max'      => '20',
+                               //'eval'     => 'date',
+                               'checkbox' => '0',
+                               'default'  => '0',
+                               'range'    => array (
+                                       'upper' => mktime(0, 0, 0, 12, 31, 2020),
+                                       'lower' => mktime(0, 0, 0, date('m')-1, date('d'), date('Y'))
+                               )
+                       )
+               ),
+               'title' => Array (              
+                       'exclude' => 1,         
+                       'label' => 'LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_conditions.title',         
+                       'config' => Array (
+                               'type' => 'input',      
+                               'size' => '30',
+                       )
+               ),
+               'targetField' => Array (                
+                       'exclude' => 1,         
+                       'label' => 'LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_conditions.targetField',           
+                       'config' => Array (
+                               'type' => 'select',
+                               'items' => Array (
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_conditions.targetField.I.0', '0'),
+                               ),
+                               'itemsProcFunc' => 'tx_powermailcond_fields_be->fieldname',     
+                               'itemsProcFunc_addFieldsets' => 1, // add fieldsets
+                               'size' => 1,    
+                               'maxitems' => 1,
+                               'eval' => 'required'
+                       )
+               ),
+        'actions' => Array (
+            'exclude' => 1,
+            'label' => 'LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_conditions.action',
+            'config' => Array (
+                'type' => 'select',
+                'items' => Array (
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_conditions.action.I.main', '--div--'), // title main
+                    Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_conditions.action.I.0', '0'), // hide
+                    Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_conditions.action.I.1', '1'), // unhide
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_conditions.action.I.additional', '--div--'), // title additional
+                    Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_conditions.action.I.2', '2'), // filter selectbox
+                       ),
+                'size' => 1,
+                'maxitems' => 1,
+            )
+        ),
+               'filterSelectField' => Array (          
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_conditions.filterSelectField',             
+                       'config' => Array (
+                               'type' => 'select',
+                               'items' => Array (
+                               ),
+                               'itemsProcFunc' => 'tx_powermailcond_fields_be->valuesFromPowermailSelectbox',  
+                               'size' => 4,
+                               'maxitems' => 1000
+                       ),
+                       'displayCond' => 'FIELD:actions:IN:2' // show only if ops value is greater than 1
+               ),
+               'rules' => Array (              
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_conditions.rules',         
+                       'config' => Array (
+                               'type' => 'inline',
+                               'foreign_table' => 'tx_powermailcond_rules',
+                               'foreign_table_where' => 'AND tx_powermailcond_rules.pid=###CURRENT_PID### ORDER BY tx_powermailcond_rules.uid',
+                               'foreign_field' => 'conditions',
+                               'maxitems' => 99,
+                               'appearance' => array(
+                                       'collapseAll' => 1,
+                                       'expandSingle' => 1,
+                                       'useSortable' => 1,
+                                       'newRecordLinkAddTitle' => 1,
+                                       'newRecordLinkPosition' => 'both',
+                               ),
+                       )
+               ),
+               'conjunction' => Array (                
+                       'exclude' => 1,         
+                       'label' => 'LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_conditions.conjunction',           
+                       'config' => Array (
+                               'type' => 'select',
+                               'items' => Array (
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_conditions.conjunction.I.1', 'OR'), // OR
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_conditions.conjunction.I.0', 'AND'), // AND
+                               ),
+                               'size' => 1,    
+                               'maxitems' => 1,
+                       )
+               ),
+       ),
+       'types' => array (
+               '0' => array('showitem' => '--palette--;;1, targetField, --palette--;;2, rules, conjunction, sys_language_uid, l18n_parent, l18n_diffsource')
+       ),
+       'palettes' => array (
+               '1' => array('showitem' => 'title, starttime, endtime, hidden'),
+               '2' => array('showitem' => 'actions, filterSelectField')
+       )
+);
+
+
+
+$TCA['tx_powermailcond_rules'] = array (
+       'ctrl' => $TCA['tx_powermailcond_rules']['ctrl'],
+       'interface' => array (
+               'showRecordFieldList' => 'hidden,startField,ops,condstring,equalField'
+       ),
+       'feInterface' => $TCA['tx_powermailcond_rules']['feInterface'],
+       'columns' => array (
+               'hidden' => array (             
+                       'exclude' => 1,
+                       'label'   => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
+                       'config'  => array (
+                               'type'    => 'check',
+                               'default' => '0'
+                       )
+               ),
+               'title' => Array (              
+                       'exclude' => 1,         
+                       'label' => 'LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.title',              
+                       'config' => Array (
+                               'type' => 'input',      
+                               'size' => '30',
+                       )
+               ),
+               'startField' => Array (         
+                       'exclude' => 1,         
+                       'label' => 'LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.startField',         
+                       'config' => Array (
+                               'type' => 'select',
+                               'items' => Array (
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.startField.I.0', '0'),
+                               ),
+                               'itemsProcFunc' => 'tx_powermailcond_fields_be->fieldname',
+                               'itemsProcFuncValue' => '"text","textarea","select","radio","check"', // allow only this types of fields in selector
+                               'size' => 1,    
+                               'maxitems' => 1,
+                               'eval' => 'required'
+                       )
+               ),
+               'ops' => Array (
+                       'exclude' => 1,         
+                       'label' => 'LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.operator',           
+                       'config' => Array (
+                               'type' => 'select',
+                               'items' => Array (
+                                       //Array('', ''), // empty
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.operator.I.operators', '--div--'), // title operators
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.operator.I.0', '0'), // is set
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.operator.I.1', '1'), // is not set
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.operator.I.operatorsComparisonValue', '--div--'), // title operatorsComparisonValue
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.operator.I.2', '2'), // contains
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.operator.I.3', '3'), // contains not
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.operator.I.4', '4'), // is
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.operator.I.5', '5'), // is not
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.operator.I.6', '6'), // is greater than
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.operator.I.7', '7'), // is less than
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.operator.I.operatorsComparisonField', '--div--'), // title operatorsComparisonField
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.operator.I.8', '8'), // contains value from field
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.operator.I.9', '9'), // contains not value from field
+                               ),
+                               'size' => 1,    
+                               'maxitems' => 1
+                       )
+               ),
+               'condstring' => Array (
+                       'exclude' => 1,         
+                       'label' => 'LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.condstring',         
+                       'config' => Array (
+                               'type' => 'text',
+                               'cols' => '30', 
+                               'rows' => '2',
+                       ),
+                       'displayCond' => 'FIELD:ops:IN:2,3,4,5,6,7' // show only if ops value is greater than 1
+               ),
+               'equalField' => Array (         
+                       'exclude' => 1,         
+                       'label' => 'LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.equalField',         
+                       'config' => Array (
+                               'type' => 'select',
+                               'items' => Array (
+                                       Array('LLL:EXT:powermail_cond/locallang_db.xml:tx_powermailcond_rules.equalField.I.0', '0'),
+                               ),
+                               'itemsProcFunc' => 'tx_powermailcond_fields_be->fieldname',     
+                               'itemsProcFuncValue' => '"text","textarea","select","radio"', // allow only this types of fields in selector
+                               'size' => 1,    
+                               'maxitems' => 1
+                       ),
+                       'displayCond' => 'FIELD:ops:IN:8,9' // show only if ops value is greater than 1
+               ),
+       ),
+       'types' => array (
+               '0' => array('showitem' => '--palette--;;1,startField,--palette--;;2')
+       ),
+       'palettes' => array (
+               '1' => array('showitem' => 'title, hidden'),
+               '2' => array('showitem' => 'ops,condstring,equalField')
+       )
+);
+?>
\ No newline at end of file