From 92ea98a2568a0e59779b924a8b699bea7936fa14 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Beno=C3=AEt=20Pin?= Date: Tue, 16 Aug 2011 13:22:13 +0200 Subject: [PATCH] =?utf8?q?Ajout=20du=20code=20du=20finder=20ajax=20depuis?= =?utf8?q?=20le=20d=C3=A9p=C3=B4t=20de=20FCK.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- skins/ckeditor/config.js | 2 +- .../mac_finder/_graphics/folderish_icons.psd | Bin 0 -> 20495 bytes .../browser/mac_finder/browser.css | 68 ++++ .../browser/mac_finder/browser.html.dtml | 351 ++++++++++++++++++ .../mac_finder/connectors/plinn/connector.py | 73 ++++ .../mac_finder/images/folderish-selected.gif | Bin 0 -> 107 bytes .../browser/mac_finder/images/folderish.gif | Bin 0 -> 163 bytes .../mac_finder/images/folderishNode.gif | Bin 0 -> 160 bytes 8 files changed, 493 insertions(+), 1 deletion(-) create mode 100644 skins/ckeditor/filemanager/browser/mac_finder/_graphics/folderish_icons.psd create mode 100644 skins/ckeditor/filemanager/browser/mac_finder/browser.css create mode 100644 skins/ckeditor/filemanager/browser/mac_finder/browser.html.dtml create mode 100644 skins/ckeditor/filemanager/browser/mac_finder/connectors/plinn/connector.py create mode 100644 skins/ckeditor/filemanager/browser/mac_finder/images/folderish-selected.gif create mode 100644 skins/ckeditor/filemanager/browser/mac_finder/images/folderish.gif create mode 100644 skins/ckeditor/filemanager/browser/mac_finder/images/folderishNode.gif diff --git a/skins/ckeditor/config.js b/skins/ckeditor/config.js index 9467812..bb14ec7 100644 --- a/skins/ckeditor/config.js +++ b/skins/ckeditor/config.js @@ -22,5 +22,5 @@ CKEDITOR.editorConfig = function( config ) ]; config.height = '500px'; - config.filebrowserBrowseUrl = CKEDITOR.basePath; + config.filebrowserBrowseUrl = CKEDITOR.basePath + 'filemanager/browser/mac_finder/browser.html?Connector=connectors/plinn/connector'; }; \ No newline at end of file diff --git a/skins/ckeditor/filemanager/browser/mac_finder/_graphics/folderish_icons.psd b/skins/ckeditor/filemanager/browser/mac_finder/_graphics/folderish_icons.psd new file mode 100644 index 0000000000000000000000000000000000000000..69fe1b3c05bd5ce58f40e53a4f948495de122641 GIT binary patch literal 20495 zcmeGkTW}j!^{(WHEIWQAP8(jGtx4km)zfw?Ya9n#b`mpItlCPOmVwS{cO`GV+EsT~ zu^m2mmtlquEpIwyXn__Oet7f2OfjVeJ~}`jG%X#VEu}mLLQ6vlAsunf-Cb!VOG?zb zp3-VHyL<1s=iYnHxo6Kk_v~IprV@*UA?D$RTRWVc#6vI*$2-;|Q?v1w%V?&TUL6-& zwi^K#pBX=}n&bFo(O^?zMpE_<{^N%~8e}D5|KL?4@nAd`6PKjJCp2;K#E~R_VwoQk z1`kYl$5*4P*<4mMICeEFD|&Qw{~#x*DKQFZ1P2CLiefD9A3PRMu!gG2%aXwk`GdZ2 zS@Ew7`Bg0w2#t-61%lx~ zIP3!qpT4FT+^SE}-weG`GNfb0YKrcs6#02I8<36#LjGU?I`Xo#t7%c^H7RFEs={K| zTuRLw`v>!RNr*;9hQxhiT+o-|#Svd9ByhelA;SB{(&4dGXl!_Rbd($PvR0Sks#K!2 ztWzwpyJgvN%tm9XtZIuOadBceJT^SGZ!|nMG9IWbgVs&_gtRKk$EKyMsOUiJL?~n- zR~D4lxVlth)LFp+2SEgobB82e2I=G+16d{Pu>_x`O2FV#k0L zVbQ~qZm8PY#CTvMY-`9jq;w4}!x9J4n2pYBk_e9mYWD;v%mx@L3k4oq5Or0~Q^e75 zz{Yigi?~-;$8~~>xFyu1ieyZLEgCAoTO+zvuEv-{fkSYRi^epOGsI~)C&IztK3{Oi z7amTA_C<$6(czJ|1w+wba6C|fiA*CXt_o6mt-SJRG8B#uhoU2+&dLtVVr8(I0%vd+ zRNaYdH$X{OwItZtiAl7?Y{FJ)HnzydIbKrm0dSCSVQ<+e#N*YUJ$oFoS!xZaG~@B; zw94nf>>0Du6Xw(+s61Hb(i3Rf=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i=)aBw*l~ z?bHfV&yjgOX~kkVQ_LHR>Fb!i77q9=ObEOf_`ncOjS15rh(x^wtos!>e+B1Z zI5AJ}rY)(yf0f|I+-Ptp8Xjfsy|qx!eH-|;*hZlMPpqrhe&=oOVw!p!fYZjfEgHcG zEb+lyQsRTzCbQ!;C>4XHIdq$y?j1);n=sVTa>aOva(A#VNcferKG`fWiJ^1Nu%(Z}Q8t0a-~ z7<~Axsd5=neI>@MVjv6o>yjaYB?`3I$!C|oB&CfRXh|xrN|BWwK{A#^ZBov_3e#AE z9sP8L*)v@ZM%3xFP8XYIjfAN2@VT|MY(>#{(~@j`vTiRu4;CR%?mh%wBB0^-xS9S_@8w`z8^c<(b-hs6WQPh!;weH(hrFIs=4NhV8tca;a z9FlT5B88psrN1bcy_OAn$2C}hZ^{7+r|}MciBl9&HbVv0RJu*f=9V~JIw9h!*%n@J z5qc$j%cN>lAF;RAw5+O{L-zf&d-^{y8Tf0Xt3KV-7WAtEE6apW9J7 z#FvHTJKRgQr^Sjmq58F3vFD=rXw5HSMdHco!z*xyfogd>oR^#S2aDi953Up4Ah?^c zu5oJH#wpe~wxhuAj{@0?*nh(d9FV~p=RZ9$PQE@bvKY?7w&c7bK@xpd54gr0#Kf+L zSQxt3AzH5J7#C}ixiyXE*Cc$TQORgzl9y9x9$S!UEQe3)R;_ZHUsjfFr8N7~b7^O} z%*)um2Tpom8|hUIUHRU1)`YDib>+uKDa}(U%~L7OV=J2>r7-kLxvnjxFfFewCAwnX z5-Gvjo*uBqa{it#IDa6eR?x9_i1y&Mm3eaYOr%g?9=z^s`%hcYUpz|_g~F|;tOPzluk7Y5jZDBSXb$(LlKaYS?0+aLNs|Bo literal 0 HcmV?d00001 diff --git a/skins/ckeditor/filemanager/browser/mac_finder/browser.css b/skins/ckeditor/filemanager/browser/mac_finder/browser.css new file mode 100644 index 0000000..cf93b14 --- /dev/null +++ b/skins/ckeditor/filemanager/browser/mac_finder/browser.css @@ -0,0 +1,68 @@ +body { + margin:0; + padding:0; +/* overflow-x : scroll;*/ +} +#finder { + position : relative; + border : none; + vertical-align : top; + font-family : Arial, Helvetica, Geneva, Swiss, SunSans-Regular, sans-serif; + font-size : small; +} + + +#finder td { +/* width : 200px;*/ + padding : 0; +} + +#finder ul { +/* float : left;*/ + list-style : none; + margin : 0; + padding : 0; + overflow-y : scroll; +} +#finder li { + padding-left : 5px; + margin : 2px 0; + cursor : default; +/* vertical-align : middle*/ +} + +#finder li.contentish { + /* nothing special */ +} + +#finder li.contentish-selected { + background-color : #3875d7; + color : white; +} + + +#finder li.folderish { + background : url(images/folderish.gif) center right no-repeat; +} + +#finder li.folderish-selected { + background : url(images/folderish-selected.gif) center right no-repeat #3875d7 ; + color : white; +} + + +#finder img { + margin-right : 3px; + vertical-align : middle; +} + +.finder_preview { + font-size : 95%; +} +.finder_preview th { + color : #7f7f7f; + text-align : right; +} +.finder_preview .thumbnail { + text-align:center; +} \ No newline at end of file diff --git a/skins/ckeditor/filemanager/browser/mac_finder/browser.html.dtml b/skins/ckeditor/filemanager/browser/mac_finder/browser.html.dtml new file mode 100644 index 0000000..be15cd2 --- /dev/null +++ b/skins/ckeditor/filemanager/browser/mac_finder/browser.html.dtml @@ -0,0 +1,351 @@ + + + + + Site browser + + + + + + + + + + + +
    +
  • Folder
  • +
  • Content
  • +
+
+ + \ No newline at end of file diff --git a/skins/ckeditor/filemanager/browser/mac_finder/connectors/plinn/connector.py b/skins/ckeditor/filemanager/browser/mac_finder/connectors/plinn/connector.py new file mode 100644 index 0000000..61d0eae --- /dev/null +++ b/skins/ckeditor/filemanager/browser/mac_finder/connectors/plinn/connector.py @@ -0,0 +1,73 @@ +##parameters=command, path, Type=None +from Products.CMFCore.utils import getToolByName +from Products.CMFCore.permissions import View +mtool = getToolByName(context, 'portal_membership') +checkView = lambda o : mtool.checkPermission(View, o) +utool = getToolByName(context, 'portal_url') +portal = utool.getPortalObject() + +def replaceXMLEntities(text) : + for c, ent in (('<', '<'), ('>', '>'), ('&', '&')) : + text = text.replace(c, ent) + return text + +ob = portal +path = path.replace('\\', '/') +path = path.strip('/') + +if path : + for name in path.split('/') : + ob = getattr(ob, name) + +if command == 'ls' : + objects = [] + if ob.isPrincipiaFolderish : + if Type == 'Image' : filter = {'portal_type' : ['Plinn Folder', 'Portfolio', 'Photo']} + else : filter = {} + objects = ob.listNearestFolderContents(contentFilter = filter) + objects = sequence.sort( objects, (('title_or_id', 'nocase', 'asc'),) ) + + # xml printing + print '' + for o in objects : + path = o.getPhysicalPath() + encodedPath = '' + partObject = portal + for name in path[1:] : + partObject = getattr(partObject, name) + sep = checkView(partObject) and '/' or '\\' + encodedPath += sep+name + + row = '%(title)s' % { + 'path' : encodedPath, + 'folderish' : o.isPrincipiaFolderish, + 'icon' : o.getIcon(), + 'title' : replaceXMLEntities(o.title_or_id()), + 'link' : o.absolute_url() + } + print row + print '' + +elif command == 'info': + #linkFunction = (Type == 'Image') and (lambda o : o.absolute_url() + '/index_html') or (lambda o : o.absolute_url()) + linkFunction = lambda o : o.absolute_url() + ti = ob.getTypeInfo() + method_id = ti.queryMethodID('info') + meth = method_id and getattr(ob, method_id) or (lambda:'Not implemented') + lines = [] + pr = lines.append + pr('') + # print info summary in a CDATA section + pr('') + # print the url link in a tag + pr('') + pr(linkFunction(ob)) + pr('') + pr('') + print ''.join(lines) + + +context.REQUEST.RESPONSE.setHeader('content-type', 'text/xml; charset=utf-8') +return printed \ No newline at end of file diff --git a/skins/ckeditor/filemanager/browser/mac_finder/images/folderish-selected.gif b/skins/ckeditor/filemanager/browser/mac_finder/images/folderish-selected.gif new file mode 100644 index 0000000000000000000000000000000000000000..ebad9f6348aaa0babd9151b054cd46fa4598a559 GIT binary patch literal 107 zcmZ?wbhEHbC&Zl@7`U!c=6-Mk6*rgnKNh3xpU{{&!0bG!i4+x?{{`~ zu3o+R=+UG5_U-HG>1k_gJ8{(^FJ8Pj zfByV0U%p(rbZNqb3HR^cU%h(u|Ns9Phz5#3Sr{1@1Q~QdIzV