Commit 21a3e374 authored by Ivan Tyagov's avatar Ivan Tyagov

Use only content_type_registry to get portal_type by extension. Define more extensions.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14204 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d2bfa36b
......@@ -143,6 +143,7 @@
<value>
<list>
<string>sxd</string>
<string>odg</string>
</list>
</value>
</item>
......@@ -202,10 +203,12 @@
<list>
<string>gif</string>
<string>jpg</string>
<string>jpeg</string>
<string>png</string>
<string>bmp</string>
<string>GIF</string>
<string>JPG</string>
<string>JPEG</string>
<string>PNG</string>
<string>BMP</string>
</list>
......@@ -293,6 +296,7 @@
<string>xls</string>
<string>ods</string>
<string>sdc</string>
<string>sxc</string>
</list>
</value>
</item>
......
......@@ -68,25 +68,8 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>typetoext = {\n
\'Text\':(\'doc\', \'sxw\', \'odt\', \'txt\', \'rtf\'),\n
\'Spreadsheet\':(\'xls\', \'sxc\', \'ods\'),\n
\'Presentation\':(\'ppt\', \'odp\'),\n
\'Drawing\':(\'odg\',),\n
\'Image\':(\'jpg\', \'jpeg\', \'gif\', \'bmp\', \'png\'),\n
\'PDF\':(\'pdf\',),\n
}\n
\n
multitypes = {\n
# \'Text\':(\'Text\', \'Memo\')\n
}\n
context.log(ext)\n
\n
for ptype, ext_list in typetoext.items():\n
if ext in ext_list:\n
return multitypes.get(ptype, (ptype,))\n
\n
return ()\n
<value> <string>pt = context.content_type_registry.findTypeName(\'a.%s\' %ext, None, None)\n
return pt\n
</string> </value>
</item>
<item>
......@@ -130,13 +113,10 @@ return ()\n
<value>
<tuple>
<string>ext</string>
<string>typetoext</string>
<string>multitypes</string>
<string>_getattr_</string>
<string>context</string>
<string>_getiter_</string>
<string>ptype</string>
<string>ext_list</string>
<string>None</string>
<string>pt</string>
</tuple>
</value>
</item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment