[Erp5-report] r27643 - in /erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style: SkinTemplat...
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Jun 18 09:54:55 CEST 2009
Author: kazuhiko
Date: Thu Jun 18 09:54:52 2009
New Revision: 27643
URL: http://svn.erp5.org?rev=27643&view=rev
Log:
2009-06-18 Kazuhiko
* add a simple file browser for fckeditor, that allows to upload only in the current document.
Added:
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/editor_.xml
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser/
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser.xml
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser/browser.html.xml
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser/connectors/
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser/connectors.xml
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser/connectors/connectorERP5.xml
- copied unchanged from r27616, erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/connectorERP5.xml
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/template_local_role_list
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/template_portal_type_role_list
Removed:
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/connectorERP5.xml
Modified:
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fckeditor_wysiwyg_support.xml
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/change_log
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision
Removed: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/connectorERP5.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/connectorERP5.xml?rev=27642&view=auto
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/connectorERP5.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/connectorERP5.xml (removed)
@@ -1,831 +1,0 @@
-<?xml version="1.0"?>
-<ZopeData>
- <record id="1" aka="AAAAAAAAAAE=">
- <pickle>
- <tuple>
- <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
- <tuple/>
- </tuple>
- </pickle>
- <pickle>
- <dictionary>
- <item>
- <key> <string>Script_magic</string> </key>
- <value> <int>3</int> </value>
- </item>
- <item>
- <key> <string>_Access_contents_information_Permission</string> </key>
- <value>
- <list>
- <string>Manager</string>
- </list>
- </value>
- </item>
- <item>
- <key> <string>_Change_bindings_Permission</string> </key>
- <value>
- <list>
- <string>Manager</string>
- </list>
- </value>
- </item>
- <item>
- <key> <string>_Change_cache_settings_Permission</string> </key>
- <value>
- <list>
- <string>Manager</string>
- </list>
- </value>
- </item>
- <item>
- <key> <string>_Change_permissions_Permission</string> </key>
- <value>
- <list>
- <string>Manager</string>
- </list>
- </value>
- </item>
- <item>
- <key> <string>_Copy_or_Move_Permission</string> </key>
- <value>
- <list>
- <string>Manager</string>
- </list>
- </value>
- </item>
- <item>
- <key> <string>_Delete_objects_Permission</string> </key>
- <value>
- <list>
- <string>Manager</string>
- </list>
- </value>
- </item>
- <item>
- <key> <string>_Manage_WebDAV_Locks_Permission</string> </key>
- <value>
- <list>
- <string>Manager</string>
- </list>
- </value>
- </item>
- <item>
- <key> <string>_Manage_properties_Permission</string> </key>
- <value>
- <list>
- <string>Manager</string>
- </list>
- </value>
- </item>
- <item>
- <key> <string>_Take_ownership_Permission</string> </key>
- <value>
- <list>
- <string>Manager</string>
- </list>
- </value>
- </item>
- <item>
- <key> <string>_Undo_changes_Permission</string> </key>
- <value>
- <list>
- <string>Manager</string>
- </list>
- </value>
- </item>
- <item>
- <key> <string>_View_Permission</string> </key>
- <value>
- <list>
- <string>Manager</string>
- </list>
- </value>
- </item>
- <item>
- <key> <string>_View_management_screens_Permission</string> </key>
- <value>
- <list>
- <string>Manager</string>
- </list>
- </value>
- </item>
- <item>
- <key> <string>_WebDAV_Lock_items_Permission</string> </key>
- <value>
- <list>
- <string>Manager</string>
- </list>
- </value>
- </item>
- <item>
- <key> <string>_WebDAV_Unlock_items_Permission</string> </key>
- <value>
- <list>
- <string>Manager</string>
- </list>
- </value>
- </item>
- <item>
- <key> <string>_WebDAV_access_Permission</string> </key>
- <value>
- <list>
- <string>Manager</string>
- </list>
- </value>
- </item>
- <item>
- <key> <string>_bind_names</string> </key>
- <value>
- <object>
- <klass>
- <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
- </klass>
- <tuple/>
- <state>
- <dictionary>
- <item>
- <key> <string>_asgns</string> </key>
- <value>
- <dictionary>
- <item>
- <key> <string>name_container</string> </key>
- <value> <string>container</string> </value>
- </item>
- <item>
- <key> <string>name_context</string> </key>
- <value> <string>context</string> </value>
- </item>
- <item>
- <key> <string>name_m_self</string> </key>
- <value> <string>script</string> </value>
- </item>
- <item>
- <key> <string>name_subpath</string> </key>
- <value> <string>traverse_subpath</string> </value>
- </item>
- </dictionary>
- </value>
- </item>
- </dictionary>
- </state>
- </object>
- </value>
- </item>
- <item>
- <key> <string>_body</string> </key>
- <value> <string encoding="cdata"><![CDATA[
-
-from Products.PythonScripts.standard import html_quote\n
-from Products.CMFCore.utils import getToolByName\n
-from Products.FCKeditor.utils import fckCreateValidZopeId\n
-\n
-\n
-\n
-#############\n
-# This connector is based on CPS connector from the FCKeditor/zope integration product\n
-#############\n
-\n
-# 1. Config\n
-\n
-# Path to user files relative to the document root.\n
-ConfigUserFilesPath=""\n
-# SECURITY TIP: Uncomment the following line to set a fixed path\n
-# ConfigUserFilesPath = "/UserFiles/"\n
-# SECURITY TIP: Uncomment the 3 following code lines to force the Plone Member Home Folder as fixed path\n
-# You can do it as well with wysiwyg_support templates customization\n
-# it\'s just more secure\n
-# portal=context.portal_url.getPortalObject()\n
-# portal_url=portal.absolute_url()\n
-# ConfigUserFilesPath = portal.portal_membership.getHomeUrl().replace(portal_url, \'\') + \'/\'\n
-\n
-# special review_states\n
-# (unpublished states for contents which need to be hidden to local_roles\n
-# not in rolesSeeUnpublishedContent even with View permission )\n
-unpublishedStates = [] #[\'visible\',\'pending\',\'rejected\', \'waitreview\']\n
-\n
-# special local_roles who can see unpublished contents according to permissions\n
-# by default set to None\n
-rolesSeeUnpublishedContent = None\n
-# you can force the value here\n
-# rolesSeeUnpublishedContent = [\'Manager\',\'Reviewer\',\'Owner\', \'Contributor\']\n
-\n
-# if rolesSeeUnpublishedContent is None we try to take it from portal_properties > navtree_properties\n
-if not rolesSeeUnpublishedContent:\n
- try:\n
- props=getToolByName(context,\'portal_properties\')\n
- if hasattr(props,\'navtree_properties\'):\n
- props=props.navtree_properties\n
- rolesSeeUnpublishedContent=getattr(props,\'rolesSeeUnpublishedContent\', [\'Manager\',\'Reviewer\',\'Owner\'])\n
- except:\n
- rolesSeeUnpublishedContent = [\'Manager\',\'Reviewer\',\'Owner\']\n
-\n
-# Allowed and denied extensions dictionaries\n
-\n
-ConfigAllowedExtensions = { "File" : None\n
- , "Image": ( "jpg", "gif", "jpeg", "png")\n
- , "Flash": ( "swf", "fla")\n
- , "Media": ( "swf", "fla"\n
- , "jpg", "gif", "jpeg", "png"\n
- , "avi"\n
- , "mpg", "mpeg", "mp1", "mp2", "mp3", "mp4"\n
- , "wma", "wmv"\n
- , "wav", "mid", "midi"\n
- , "rmi", "rm", "ram", "rmvb"\n
- , "mov", "qt"\n
- )\n
- }\n
-ConfigDeniedExtensions = { "Image": None\n
- , "Flash": None\n
- , "Media": None\n
- , "File" : ( "py", "cpy"\n
- , "pt", "cpt", "dtml"\n
- , "php"\n
- , "asp", "aspx", "ascx"\n
- , "jsp"\n
- , "cfm", "cfc"\n
- , "pl"\n
- , "bat", "exe", "com", "dll"\n
- , "vbs"\n
- , "js"\n
- , "reg"\n
- )\n
- }\n
-\n
-# link by uid is against ERP5 rules\n
-linkbyuid = 0\n
-\n
-ERP5_FOLDER_TYPE = [\'Folder\', \'ERP5 Folder\', \'ERP5 Document\', \' ERP5 Web Page\']\n
-\n
-# ERP5 is full UTF-8, no need to get charset dynamiccaly\n
-charsetSite = "utf-8"\n
-\n
-\n
-# 2. utils\n
-\n
-def RemoveFromStart(sourceString,charToRemove ):\n
- return sourceString.lstrip(charToRemove)\n
-\n
-def utf8Encode(chaine) :\n
-\n
- errors="strict"\n
- if charsetSite.lower() in ("utf-8", "utf8"):\n
- return chaine\n
- else:\n
- return unicode(chaine, charsetSite, errors).encode("utf-8", errors)\n
-\n
-def utf8Decode(chaine) :\n
- # because browser upload form is in utf-8 we need it\n
- errors="strict"\n
- if charsetSite.lower() in ("utf-8", "utf8"):\n
- return chaine\n
- else:\n
- try:\n
- chaine = unicode(chaine, "utf-8", "strict").encode(charsetSite, "strict")\n
- except:\n
- chaine = chaine.encode(charsetSite, "strict")\n
- return chaine\n
-\n
-def ConvertToXmlAttribute( value ):\n
- return utf8Encode(value).replace("\\"", """).replace("&", "&")\n
-\n
-\n
-\n
-\n
-# 3. io\n
-\n
-\n
-\n
-def GetUrlFromPath( folderPath ) :\n
-\n
- return \'%s%s\' %(portal_path,folderPath.rstrip("/"))\n
-\n
-\n
-def RemoveExtension( fileName ):\n
-\n
- sprout=fileName.split(".")\n
- return \'.\'.join(sprout[:len(sprout)-1])\n
-\n
-def IsAllowedExt( extension, resourceType ) :\n
-\n
- sAllowed = ConfigAllowedExtensions[resourceType]\n
- sDenied = ConfigDeniedExtensions[resourceType]\n
-\n
- if (sAllowed is None or extension in sAllowed) and (sDenied is None or extension not in sDenied) :\n
- return 1\n
- else :\n
- return 0\n
-\n
-def FindExtension (fileName):\n
-\n
- sprout=fileName.split(RemoveExtension(fileName))\n
- return \'\'.join(sprout).lstrip(\'.\')\n
-\n
-\n
-\n
-\n
-\n
-# 4. basexml\n
-\n
-def CreateXmlHeader( command, resourceType, currentFolder ):\n
- header = [\'<?xml version="1.0" encoding="utf-8" ?>\']\n
- header.append(\'\\r<Connector command="%s" resourceType=" %s ">\'% (command,resourceType))\n
- header.append(\'\\r <CurrentFolder path="%s" url="%s/" />\'% (ConvertToXmlAttribute(currentFolder),ConvertToXmlAttribute(GetUrlFromPath(currentFolder))))\n
- return \'\'.join(header)\n
-\n
-\n
-def CreateXmlFooter():\n
- return \'\\r</Connector>\'\n
-\n
-\n
-\n
-def xmlString(results, resourceType, foldersOnly):\n
-\n
- # traitement xml\n
- xmlFiles=[\'\\r <Files>\']\n
- xmlFolders=[\'\\r <Folders>\']\n
-\n
- for result in results :\n
-\n
- titre = result.title_or_id()\n
- # create a safe title string\n
- titre = titre.replace("\'", "-")\n
- titre = titre.replace(\'"\', "-")\n
-\n
- if linkbyuid and hasattr(result, \'uid\'):\n
- tagLinkbyuid="yes"\n
- uid = result.getUid()\n
- else :\n
- tagLinkbyuid="no"\n
- uid=""\n
-\n
- if result.meta_type in ERP5_FOLDER_TYPE :\n
-\n
- try:\n
- xmlFolders.append(\'\\r <Folder name="%s" title="%s" linkbyuid="%s" uid="%s" type="%s" metatype="%s" />\'%(ConvertToXmlAttribute(result.id),ConvertToXmlAttribute(titre), tagLinkbyuid, uid, resourceType, ConvertToXmlAttribute(result.meta_type)))\n
-\n
- except Exception , e:\n
- pass\n
-\n
- else :\n
- tagPhoto= "no"\n
- size=\'unknown size\'\n
- unit=\'\'\n
- try:\n
- size = result.get_size()\n
- if size >= (1024*1024):\n
- size = size / (1024*1024)\n
- unit = " MB"\n
- elif size >= 1024:\n
- size = size / 1024\n
- unit = " KB"\n
- else:\n
- unit = " Bytes"\n
- except Exception,e:\n
- pass\n
- try:\n
- xmlFiles.append(\'\\r <File name="%s" size="%s%s" title="%s" photo="%s" linkbyuid="%s" uid="%s" type="%s" isPA3img="no" isattach="no" attachid="" />\'%(ConvertToXmlAttribute(result.getId()),size,unit,ConvertToXmlAttribute(titre), tagPhoto, tagLinkbyuid, uid, resourceType))\n
-\n
- except Exception,e:\n
- pass\n
-\n
- xmlFiles.append(\'\\r </Files>\')\n
- xmlFolders.append(\'\\r </Folders>\')\n
-\n
- if foldersOnly:\n
- stringXml=\'\'.join(xmlFolders)\n
- else:\n
- stringXml=\'\'.join(xmlFolders)+\'\'.join(xmlFiles)\n
- return stringXml\n
-\n
-\n
-def CreateXmlErrorNode (errorNumber,errorDescription):\n
-\n
- return \'\\r <Error number="\' + errorNumber + \'" originalNumber="\' + errorNumber + \'" originalDescription="\' + ConvertToXmlAttribute( errorDescription ) + \'" />\'\n
-\n
-\n
-# 5. commands\n
-\n
-def GetFoldersAndFiles( resourceType, currentFolder ):\n
- results=[]\n
- user=context.REQUEST[\'AUTHENTICATED_USER\']\n
- types=context.portal_types\n
-\n
- if resourceType=="Image" :\n
- accepted_types=[ctype.id for ctype in types.objectValues() if ctype.id in (\'Image\', )]\n
-\n
-\n
-\n
- elif resourceType=="Flash":\n
- accepted_types=[ctype.id for ctype in types.objectValues() if ctype.id in (\'Flash Animation\', )]\n
-\n
- #elif resourceType not in (\'Image\', \'Flash\') :\n
- # accepted_types=[ctype.id for ctype in types.objectValues()]\n
-\n
- else :\n
- accepted_types = [ctype.id for ctype in types.objectValues()]\n
- if currentFolder != "/" :\n
- try:\n
- obj = context.restrictedTraverse(currentFolder.lstrip(\'/\'))\n
- except Exception,e:\n
-\n
- obj = context.portal_url.getPortalObject()\n
- else :\n
-\n
- obj = context.portal_url.getPortalObject()\n
-\n
-\n
- for object in obj.objectValues():\n
- mtool = context.portal_membership\n
- checkPerm = mtool.checkPermission\n
-\n
- if not checkPerm(\'View\', object):\n
- pass\n
-\n
-\n
- if object.portal_type in accepted_types or (object.meta_type in ERP5_FOLDER_TYPE) :\n
-\n
- results.append(object)\n
-\n
- results = [ s for s in results if user.has_permission(\'View\', s) ]\n
-\n
- return xmlString(results,resourceType,0)\n
-\n
-\n
-def GetFolders( resourceType, currentFolder ):\n
- results=[]\n
- user=context.REQUEST[\'AUTHENTICATED_USER\']\n
- types=context.portal_types\n
-\n
- if currentFolder != "/" :\n
-\n
- #try:\n
-\n
- obj = context.restrictedTraverse(currentFolder.lstrip(\'/\'))\n
- #except Exception,e:\n
-\n
- # obj = context.portal_url.getPortalObject()\n
-\n
- else :\n
- #obj = context.portal_url.getPortalObject()\n
- return xmlString([],resourceType,1)\n
-\n
-\n
- mtool = context.portal_membership\n
- checkPerm = mtool.checkPermission\n
-\n
- for object in obj.objectValues():\n
-\n
-\n
- # filter out objects that cannot be viewed\n
- if not user.has_permission(\'View\', object):\n
-\n
- continue\n
-\n
-\n
- try:\n
- if object.meta_type in ERP5_FOLDER_TYPE:\n
-\n
- #review_state=container.portal_workflow.getInfoFor(object, \'review_state\', \'\')\n
- start_pub=getattr(object,\'effective_date\',None)\n
- end_pub=getattr(object,\'expiration_date\',None)\n
- if not ((start_pub and start_pub > DateTime()) or (end_pub and DateTime() > end_pub)):\n
- results.append(object)\n
- elif user.has_role(rolesSeeUnpublishedContent,object) :\n
- results.append(object)\n
- except Exception,e:\n
- pass\n
- results = [ s for s in results if user.has_permission(\'View\', s) ]\n
-\n
- return xmlString(results,resourceType,1)\n
-\n
-\n
-def CreateFolder(currentFolder, folderName ):\n
-\n
- user=context.REQUEST[\'AUTHENTICATED_USER\']\n
- if currentFolder != "/" :\n
- obj = context.restrictedTraverse(currentFolder.lstrip(\'/\'))\n
- else :\n
- obj = context.portal_url.getPortalObject()\n
- sErrorNumber=""\n
-\n
- # error cases\n
- if not user.has_permission(\'Add portal content\', obj) and not user.has_permission(\'Modify portal content\', obj):\n
- sErrorNumber = "103"\n
- sErrorDescription = "folder creation forbidden"\n
-\n
- if not folderName:\n
- sErrorNumber = "102"\n
- sErrorDescription = "invalid folder name"\n
-\n
- if not sErrorNumber :\n
- try :\n
- folderTitle=utf8Decode(folderName)\n
- folderName = fckCreateValidZopeId(utf8Encode(folderName))\n
- new_id = obj.invokeFactory(id=folderName, type_name=\'Folder\', title=folderTitle)\n
- sErrorNumber = "0"\n
- sErrorDescription = "success"\n
- except :\n
- sErrorNumber = "103"\n
- sErrorDescription = "folder creation forbidden"\n
-\n
- return CreateXmlErrorNode(sErrorNumber,sErrorDescription)\n
-\n
-\n
-\n
-\n
-# 6. upload\n
-\n
-def UploadFile(resourceType, currentFolder, data, title) :\n
-\n
- user=context.REQUEST[\'AUTHENTICATED_USER\']\n
- if currentFolder != "/" :\n
- obj = context.restrictedTraverse(currentFolder.lstrip(\'/\'))\n
- else :\n
- obj = context.portal_url.getPortalObject()\n
- error=""\n
- idObj=""\n
-\n
- # define Portal Type to add\n
- if resourceType == \'Image\' :\n
- typeToAdd=\'Image\'\n
- else:\n
- typeToAdd = \'File\'\n
-\n
-\n
-\n
- if not user.has_permission(\'Add portal content\', obj) and not user.has_permission(\'Modify portal content\', obj):\n
- error = "103"\n
-\n
- if not data:\n
- #pas de fichier\n
- error= "202"\n
-\n
- titre_data=\'\'\n
- filename=utf8Decode(getattr(data,\'filename\', \'\'))\n
- titre_data=filename[max(string.rfind(filename, \'/\'),\n
- string.rfind(filename, \'\\\\\'),\n
- string.rfind(filename, \':\'),\n
- )+1:]\n
-\n
- idObj=fckCreateValidZopeId(utf8Encode(titre_data))\n
-\n
-\n
-\n
- if title :\n
- titre_data=title\n
-\n
- if not IsAllowedExt( FindExtension(idObj), resourceType ):\n
- error= "202"\n
-\n
- if not error :\n
- error="0"\n
- indice=0\n
- exemple_titre=idObj\n
- while exemple_titre in obj.objectIds():\n
- indice=indice+1\n
- exemple_titre=str(indice) + idObj\n
- if indice!=0:\n
- error= "201"\n
- idObj = exemple_titre\n
-\n
- try:\n
- # this method need to be changed for browser refresh\n
- # because it send 302 redirection : we need no http response\n
- new_image = obj.newContent(portal_type=typeToAdd, id=idObj, title=titre_data, file=data)\n
- new_image.reindexObject()\n
-\n
- except Exception , e :\n
- error = "103"\n
-\n
- d= \'\'\'\n
- <script type="text/javascript">\n
- window.parent.frames[\'frmUpload\'].OnUploadCompleted(%s,"%s") ;\n
- </script>\n
- \'\'\'% (error, idObj)\n
-\n
-\n
- return d\n
-\n
-\n
-#7. connector\n
-\n
-\n
-request = context.REQUEST\n
-RESPONSE = request.RESPONSE\n
-dicoRequest = request.form\n
-message_error=""\n
-\n
-portal_url=context.portal_url.getPortalObject().absolute_url()\n
-server_url = request.SERVER_URL\n
-portal_path = portal_url.replace(server_url,\'\')\n
-\n
-if ConfigUserFilesPath != "" :\n
- sUserFilesPath = ConfigUserFilesPath\n
-elif dicoRequest.has_key(\'ServerPath\'):\n
- sUserFilesPath = dicoRequest [\'ServerPath\']\n
-else :\n
- sUserFilesPath = "/"\n
-\n
-\n
-if dicoRequest.has_key(\'CurrentFolder\'):\n
- sCurrentFolder = dicoRequest [\'CurrentFolder\']\n
- if sUserFilesPath!=\'/\' and sUserFilesPath.rstrip(\'/\') not in sCurrentFolder:\n
- sCurrentFolder = sUserFilesPath\n
-else :\n
- message_error="No CurrentFolder in request"\n
-\n
-\n
-\n
-if dicoRequest.has_key(\'Command\'):\n
- sCommand = dicoRequest [\'Command\']\n
-else :\n
- message_error="No Command in request"\n
-\n
-if dicoRequest.has_key(\'Type\'):\n
- sResourceType = dicoRequest [\'Type\']\n
-else :\n
- message_error="No Type in request"\n
-\n
-\n
-if dicoRequest.has_key(\'NewFolderName\'):\n
- sFolderName = dicoRequest [\'NewFolderName\']\n
-\n
-\n
-# interception File Upload\n
-if sCommand==\'FileUpload\' and dicoRequest.has_key(\'NewFile\'):\n
- sData = dicoRequest [\'NewFile\']\n
- sTitle = utf8Decode(dicoRequest [\'Title\'])\n
- chaineHtmlUpload = UploadFile(sResourceType, sCurrentFolder, sData, sTitle)\n
- RESPONSE.setHeader(\'Content-type\', \'text/html; charset=%s\' % charsetSite)\n
- return chaineHtmlUpload\n
-\n
-\n
-else :\n
-\n
- # Creation response XML\n
- if not message_error :\n
-\n
- RESPONSE.setHeader(\'Cache-control\', \'pre-check=0,post-check=0,must-revalidate,s-maxage=0,max-age=0,no-cache\')\n
- RESPONSE.setHeader(\'Content-type\', \'text/xml; charset=utf-8\')\n
-\n
- xmlHeader = CreateXmlHeader (sCommand, sResourceType, sCurrentFolder)\n
-\n
- xmlBody = \'\'\n
- if sCommand=="GetFolders":\n
- xmlBody = GetFolders (sResourceType, sCurrentFolder)\n
- elif sCommand=="GetFoldersAndFiles":\n
- xmlBody = GetFoldersAndFiles (sResourceType, sCurrentFolder)\n
- elif sCommand=="CreateFolder":\n
- xmlBody = CreateFolder (sCurrentFolder,sFolderName)\n
-\n
- xmlFooter = CreateXmlFooter()\n
- return xmlHeader + xmlBody + xmlFooter\n
-\n
- # creation response error request\n
- else :\n
-\n
- sErrorNumber="218"\n
- sErrorDescription="Browser Request exception : " + message_error\n
- xmlHeader = CreateXmlHeader (sCommand, sResourceType, sCurrentFolder)\n
- xmlFooter = CreateXmlFooter()\n
- return xmlHeader + CreateXmlErrorNode(sErrorNumber,sErrorDescription) + xmlFooter\n
-
-
-]]></string> </value>
- </item>
- <item>
- <key> <string>_code</string> </key>
- <value>
- <none/>
- </value>
- </item>
- <item>
- <key> <string>_params</string> </key>
- <value> <string>Command=\'\',Type=\'\',CurrentFolder=\'\',NewFolderName=\'\'</string> </value>
- </item>
- <item>
- <key> <string>_proxy_roles</string> </key>
- <value>
- <tuple>
- <string>Manager</string>
- </tuple>
- </value>
- </item>
- <item>
- <key> <string>errors</string> </key>
- <value>
- <tuple/>
- </value>
- </item>
- <item>
- <key> <string>func_code</string> </key>
- <value>
- <object>
- <klass>
- <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
- </klass>
- <tuple/>
- <state>
- <dictionary>
- <item>
- <key> <string>co_argcount</string> </key>
- <value> <int>4</int> </value>
- </item>
- <item>
- <key> <string>co_varnames</string> </key>
- <value>
- <tuple>
- <string>Command</string>
- <string>Type</string>
- <string>CurrentFolder</string>
- <string>NewFolderName</string>
- <string>Products.PythonScripts.standard</string>
- <string>html_quote</string>
- <string>Products.CMFCore.utils</string>
- <string>getToolByName</string>
- <string>Products.FCKeditor.utils</string>
- <string>fckCreateValidZopeId</string>
- <string>ConfigUserFilesPath</string>
- <string>unpublishedStates</string>
- <string>None</string>
- <string>rolesSeeUnpublishedContent</string>
- <string>context</string>
- <string>props</string>
- <string>hasattr</string>
- <string>_getattr_</string>
- <string>getattr</string>
- <string>ConfigAllowedExtensions</string>
- <string>ConfigDeniedExtensions</string>
- <string>linkbyuid</string>
- <string>ERP5_FOLDER_TYPE</string>
- <string>charsetSite</string>
- <string>RemoveFromStart</string>
- <string>utf8Encode</string>
- <string>utf8Decode</string>
- <string>ConvertToXmlAttribute</string>
- <string>portal_path</string>
- <string>GetUrlFromPath</string>
- <string>RemoveExtension</string>
- <string>IsAllowedExt</string>
- <string>FindExtension</string>
- <string>CreateXmlHeader</string>
- <string>CreateXmlFooter</string>
- <string>xmlString</string>
- <string>CreateXmlErrorNode</string>
- <string>GetFoldersAndFiles</string>
- <string>GetFolders</string>
- <string>CreateFolder</string>
- <string>UploadFile</string>
- <string>request</string>
- <string>RESPONSE</string>
- <string>dicoRequest</string>
- <string>message_error</string>
- <string>portal_url</string>
- <string>server_url</string>
- <string>sUserFilesPath</string>
- <string>_getitem_</string>
- <string>sCurrentFolder</string>
- <string>sCommand</string>
- <string>sResourceType</string>
- <string>sFolderName</string>
- <string>sData</string>
- <string>sTitle</string>
- <string>chaineHtmlUpload</string>
- <string>xmlHeader</string>
- <string>xmlBody</string>
- <string>xmlFooter</string>
- <string>sErrorNumber</string>
- <string>sErrorDescription</string>
- </tuple>
- </value>
- </item>
- </dictionary>
- </state>
- </object>
- </value>
- </item>
- <item>
- <key> <string>func_defaults</string> </key>
- <value>
- <tuple>
- <string></string>
- <string></string>
- <string></string>
- <string></string>
- </tuple>
- </value>
- </item>
- <item>
- <key> <string>id</string> </key>
- <value> <string>connectorERP5</string> </value>
- </item>
- <item>
- <key> <string>warnings</string> </key>
- <value>
- <tuple/>
- </value>
- </item>
- </dictionary>
- </pickle>
- </record>
-</ZopeData>
Added: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/editor_.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/editor_.xml?rev=27643&view=auto
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/editor_.xml (added)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/editor_.xml [utf8] Thu Jun 18 09:54:52 2009
@@ -1,0 +1,29 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="Folder" module="OFS.Folder"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>_objects</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>editor_</string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Added: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser.xml?rev=27643&view=auto
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser.xml (added)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser.xml [utf8] Thu Jun 18 09:54:52 2009
@@ -1,0 +1,29 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="Folder" module="OFS.Folder"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>_objects</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>fck_browser</string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Added: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser/browser.html.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser/browser.html.xml?rev=27643&view=auto
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser/browser.html.xml (added)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser/browser.html.xml [utf8] Thu Jun 18 09:54:52 2009
@@ -1,0 +1,168 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="DTMLMethod" module="OFS.DTMLMethod"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>__name__</string> </key>
+ <value> <string>browser.html</string> </value>
+ </item>
+ <item>
+ <key> <string>_vars</string> </key>
+ <value>
+ <dictionary/>
+ </value>
+ </item>
+ <item>
+ <key> <string>globals</string> </key>
+ <value>
+ <dictionary/>
+ </value>
+ </item>
+ <item>
+ <key> <string>raw</string> </key>
+ <value> <string encoding="cdata"><![CDATA[
+
+<!--\n
+ * FCKeditor - The text editor for internet\n
+ * Copyright (C) 2003-2004 Frederico Caldeira Knabben\n
+ * \n
+ * Licensed under the terms of the GNU Lesser General Public License:\n
+ * \t\thttp://www.opensource.org/licenses/lgpl-license.php\n
+ * \n
+ * For further information visit:\n
+ * \t\thttp://www.fckeditor.net/\n
+ * \n
+ * File Name: browser.html\n
+ * \tThis page compose the File Browser dialog frameset.\n
+ * \n
+ * Version: 2.0 FC\n
+ * Modified: 2005-05-16 \n
+ * \n
+ * File Authors:\n
+ * \t\tFrederico Caldeira Knabben (fredck at fckeditor.net)\n
+ * Browser and Connector adapted for Zope objects by jean-mat at macadames.com\n
+ * New attributes for xml nodes (title, description, image size for Zphotoslide albums ...)\n
+ * \n
+-->\n
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\n
+<html>\n
+\t<head>\n
+\t\t<title>FCKeditor - Resources Browser</title>\n
+\t\t<link href="editor/filemanager/browser/zope/Browser.css" type="text/css" rel="stylesheet">\n
+\t\t<script type="text/javascript" src="editor/filemanager/browser/zope/js/fckxml.js"></script>\n
+\t\t<script language="javascript">\n
+\n
+function GetUrlParam( paramName )\n
+{\n
+\tvar oRegex = new RegExp( \'[\\?&]\' + paramName + \'=([^&]+)\', \'i\' ) ;\n
+\tvar oMatch = oRegex.exec( window.top.location.search ) ;\n
+\t\n
+\tif ( oMatch && oMatch.length > 1 )\n
+\t\treturn oMatch[1] ;\n
+\telse\n
+\t\treturn \'\' ;\n
+}\n
+\n
+var oConnector = new Object() ;\n
+\n
+var sCurrentPath = escape(GetUrlParam( \'CurrentPath\' )) ;\n
+\n
+if (sCurrentPath ==\'\') sCurrentPath = \'/\' ;\n
+\n
+var sConnUrl = GetUrlParam( \'Connector\' ) ;\n
+\n
+// Gecko has some problems when using relative URLs (not starting with slash).\n
+if ( sConnUrl.substr(0,1) != \'/\' && sConnUrl.indexOf( \'://\' ) < 0 )\n
+\tsConnUrl = window.location.href.replace( /browser.html.*$/, \'\' ) + sConnUrl ;\n
+\n
+oConnector.ConnectorUrl\t\t= sConnUrl + \'?\' ;\n
+\n
+var sServerPath = GetUrlParam( \'ServerPath\' ) ;\n
+if ( sServerPath.length > 0 )\n
+\toConnector.ConnectorUrl += \'ServerPath=\' + escape( sServerPath ) + \'&\' ;\n
+\n
+oConnector.ResourceType\t\t= GetUrlParam( \'Type\' ) ;\n
+oConnector.ShowAllTypes\t\t= ( oConnector.ResourceType.length == 0 ) ;\n
+\n
+if ( oConnector.ShowAllTypes )\n
+\toConnector.ResourceType = \'File\' ;\n
+\n
+oConnector.SendCommand = function( command, params, callBackFunction )\n
+{\n
+\tvar sUrl = this.ConnectorUrl + \'Command=\' + command ;\n
+\tsUrl += \'&Type=\' + this.ResourceType ;\n
+\tsUrl += \'&CurrentFolder=\' + escape( this.CurrentFolder ) ;\n
+\t\n
+\tif ( params ) sUrl += \'&\' + params ;\n
+\n
+\tvar oXML = new FCKXml() ;\n
+\t\n
+\tif ( callBackFunction )\n
+\t\toXML.LoadUrl( sUrl, callBackFunction ) ;\t// Asynchronous load.\n
+\telse\n
+\t\treturn oXML.LoadUrl( sUrl ) ;\n
+}\n
+\n
+var oIcons = new Object() ;\n
+\n
+oIcons.AvailableIconsArray = [ \n
+\t\'ai\',\'avi\',\'bmp\',\'cs\',\'dll\',\'doc\',\'exe\',\'fla\',\'gif\',\'gz\',\'htm\',\'html\',\'jpg\',\'js\',\n
+\t\'mdb\',\'mp3\',\'pdf\',\'png\',\'ppt\',\'rdp\',\'swf\',\'swt\',\'tar\',\'tgz\',\'txt\',\'vsd\',\'xls\',\'xml\',\'zip\' ] ;\n
+\t\n
+oIcons.AvailableIcons = new Object() ;\n
+\n
+for ( var i = 0 ; i < oIcons.AvailableIconsArray.length ; i++ )\n
+\toIcons.AvailableIcons[ oIcons.AvailableIconsArray[i] ] = true ;\n
+\n
+oIcons.GetIcon = function( fileName )\n
+{\n
+\tvar sExtension = fileName.substr( fileName.lastIndexOf(\'.\') + 1 ).toLowerCase() ;\n
+\n
+\tif ( this.AvailableIcons[ sExtension ] == true )\n
+\t\treturn sExtension ;\n
+\telse\n
+\t\treturn \'default.icon\' ;\n
+}\n
+\n
+\n
+\n
+\t\t</script>\n
+\t</head>\n
+\n
+\t<frameset cols="0,*" class="Frame" framespacing="3" bordercolor="#f1f1e3" frameborder="no">\n
+\t\t<frameset rows="0,*" framespacing="0">\n
+\t\t\t<frame src="editor/filemanager/browser/zope/frmresourcetype.html" scrolling="no" frameborder="no" />\n
+\t\t\t<frame name="frmFolders" src="editor/filemanager/browser/zope/frmfolders.html?ServerPath=<dtml-var "REQUEST.form[\'ServerPath\']">&CurrentPath=<dtml-var "REQUEST.form[\'CurrentPath\']">" scrolling="auto" frameborder="yes" />\n
+\n
+\t\t</frameset>\n
+\t\t<frameset rows="0,*,50" framespacing="0">\n
+\t\t\t<frame name="frmActualFolder" src="editor/filemanager/browser/zope/frmactualfolder.html" scrolling="no" frameborder="no" />\n
+\t\t\t<frame name="frmResourcesList" src="editor/filemanager/browser/zope/frmresourceslist.html" scrolling="auto" frameborder="yes" />\n
+\t\t\t<frameset cols="0,*,0" framespacing="0" frameborder="no">\n
+\t\t\t\t<frame name="frmCreateFolder" src="editor/filemanager/browser/zope/frmcreatefolder.html" scrolling="no" frameborder="no" />\n
+\t\t\t\t<frame name="frmUpload" src="editor/filemanager/browser/zope/frmupload.html" scrolling="no" frameborder="no" />\n
+\t\t\t\t<frame name="frmUploadWorker" src="" scrolling="no" frameborder="no" />\n
+\t\t\t</frameset>\n
+\t\t</frameset>\n
+\t</frameset>\n
+\n
+\n
+</html>
+
+]]></string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Added: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser/connectors.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser/connectors.xml?rev=27643&view=auto
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser/connectors.xml (added)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fck_browser/connectors.xml [utf8] Thu Jun 18 09:54:52 2009
@@ -1,0 +1,23 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="Folder" module="OFS.Folder"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>connectors</string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fckeditor_wysiwyg_support.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fckeditor_wysiwyg_support.xml?rev=27643&r1=27642&r2=27643&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fckeditor_wysiwyg_support.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_fckeditor/fckeditor_wysiwyg_support.xml [utf8] Thu Jun 18 09:54:52 2009
@@ -80,7 +80,7 @@
oFCKeditor.Height = ${editor_height};\n
\n
// browsing for links\n
-oFCKeditor.Config[\'LinkBrowserURL\'] = \'${portal_path}editor/filemanager/browser/zope/browser.html?Connector=connectors/connectorERP5&ServerPath=/&CurrentPath=\' + pathUser ;\n
+oFCKeditor.Config[\'LinkBrowserURL\'] = \'${portal_path}fck_browser/browser.html?Connector=connectors/connectorERP5&ServerPath=/&CurrentPath=\' + pathUser ;\n
\n
// rapid upload activation for links\n
//oFCKeditor.Config[\'LinkUpload\'] = true ;\n
@@ -88,14 +88,14 @@
//oFCKeditor.Config[\'LinkUploadURL\'] = \'${portal_url}/\' + pathUser ;\n
\n
// browsing for images\n
-oFCKeditor.Config[\'ImageBrowserURL\'] = \'${portal_path}editor/filemanager/browser/zope/browser.html?Type=Image&Connector=connectors/connectorERP5&ServerPath=/&CurrentPath=\' + pathUser ;\n
+oFCKeditor.Config[\'ImageBrowserURL\'] = \'${portal_path}fck_browser/browser.html?Type=Image&Connector=connectors/connectorERP5&ServerPath=/&CurrentPath=\' + pathUser ;\n
\n
// rapid upload activation for images\n
//oFCKeditor.Config[\'ImageUpload\'] = true ;\n
//oFCKeditor.Config[\'ImageUploadURL\'] = \'${portal_path}editor/filemanager/upload/zope/uploadPlone?CurrentPath=\' + pathUser ;\n
\n
// browsing for flash\n
-//oFCKeditor.Config[\'FlashBrowserURL\'] = \'${portal_path}editor/filemanager/browser/zope/browser.html?Type=Flash&Connector=connectors/connectorPlone&ServerPath=/&CurrentPath=\' + pathUser ;\n
+//oFCKeditor.Config[\'FlashBrowserURL\'] = \'${portal_path}fck_browser/browser.html?Type=Flash&Connector=connectors/connectorPlone&ServerPath=/&CurrentPath=\' + pathUser ;\n
\n
// rapid upload activation for flash\n
//oFCKeditor.Config[\'FlashUpload\'] = true ;\n
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/change_log?rev=27643&r1=27642&r2=27643&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/change_log [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/change_log [utf8] Thu Jun 18 09:54:52 2009
@@ -1,3 +1,6 @@
+2009-06-18 Kazuhiko
+* add a simple file browser for fckeditor, that allows to upload only in the current document.
+
2009-04-30 Tatuya
* append a condition to ListBox_asStandardHTML to set a CSS class name in a table row using 'Row CSS Method'.
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision?rev=27643&r1=27642&r2=27643&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision [utf8] Thu Jun 18 09:54:52 2009
@@ -1,1 +1,1 @@
-767
+768
Added: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/template_local_role_list
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/template_local_role_list?rev=27643&view=auto
==============================================================================
(empty)
Added: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/template_portal_type_role_list
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/template_portal_type_role_list?rev=27643&view=auto
==============================================================================
(empty)
More information about the Erp5-report
mailing list