ZEXP⺠(cOFS.Folder Folder q)tq.}q(U add_fs_imageqUâ»qQUzip_fileqUâÐqQUedit_okqUâ¿q QU moderateurq Uclaudiux@zwookedu.netq U contributeursq (Uzwook@matisson.comq tqUunzip_file_formqUâ½qQU access_redacqUutilisable par un rédacteurqU config_okqUâ¼qQUskinqU1UimagesqUâÀqQUnew_okqUâÁqQUzwo_config_htmlqUâÂqQUidqUalbum_photo_jqueryqUmove_imgqUâÃqQU certifwebq Unonq!Uview_imgq"UâÅq#QUadd_fs_thumbnailq$UâÆq%QUtitleq&UAlbum-photo-jqueryq'U rotate90fsq(UâÇq)QUnoteq*MÊU del_img_fsq+UâÙq,QUversionq-U2.11q.U add_image_okq/UâÈq0QU_objectsq1(}q2(U meta_typeq3UScript (Python)q4Uidq5Unew_okq6u}q7(U meta_typeq8UScript (Python)q9Uidq:U add_imageq;u}q<(U meta_typeq=UScript (Python)q>Uidq?h/u}q@(U meta_typeqAUScript (Python)qBUidqCUdel_imgqDu}qE(U meta_typeqFUScript (Python)qGUidqHh"u}qI(U meta_typeqJUScript (Python)qKUidqLU edit_htmlqMu}qN(hJhKhLhu}qO(U meta_typeqPUImageqQUidqRU icone.pngqSu}qT(U meta_typeqUUScript (Python)qVUidqWU thumbscriptqXu}qY(hUUExternal MethodqZhWU thumbnailq[u}q\(U meta_typeq]UScript (Python)q^Uidq_U zwo_new_htmlq`u}qa(h]h^h_U zwo_view_htmlqbu}qc(h]h^h_hu}qd(U meta_typeqeUScript (Python)qfUidqgU move_htmlqhu}qi(hehfhghu}qj(U meta_typeqkUScript (Python)qlUidqmhu}qn(U meta_typeqoUExternal MethodqpUidqqUtestPILqru}qs(hoUScript (Python)qthqU testPILscriptquu}qv(U meta_typeqwUExternal MethodqxUidqyUrotate90qzu}q{(hwUScript (Python)q|hyUrotate90scriptq}u}q~(U meta_typeqUFolderq€UidqU Extensionsq‚u}qƒ(U meta_typeq„UExternal Methodq…Uidq†U unzip_fileq‡u}qˆ(h„UScript (Python)q‰h†Uunzip_file_scriptqŠu}q‹(U meta_typeqŒUScript (Python)qUidqŽUadd_filequ}q(U meta_typeq‘UScript (Python)q’Uidq“hu}q”(U meta_typeq•UExternal Methodq–Uidq—hu}q˜(h•UScript (Python)q™h—Uzip_file_scriptqšu}q›(U meta_typeqœUScript (Python)qUidqžUtestqŸu}q (U meta_typeq¡UFolderq¢Uidq£U javascriptq¤u}q¥(U meta_typeq¦UFolderq§Uidq¨Ucssq©u}qª(U meta_typeq«UExternal Methodq¬Uidq­U add_fs_imageq®u}q¯(U meta_typeq°UExternal Methodq±Uidq²Uadd_fs_thumbnailq³u}q´(U meta_typeqµUExternal Methodq¶Uidq·U rotate90fsq¸u}q¹(U meta_typeqºUExternal Methodq»Uidq¼U del_img_fsq½u}q¾(U meta_typeq¿UFolderqÀUidqÁUimagesqÂu}qÃ(U meta_typeqÄUScript (Python)qÅUidqÆUdownload_imageqÇu}qÈ(U meta_typeqÉUExternal MethodqÊUidqËUget_fileqÌu}qÍ(U meta_typeqÎUExternal MethodqÏUidqÐUget_fdqÑu}qÒ(U meta_typeqÓUExternal MethodqÔUidqÕUzodb2fsqÖutq×hzUâÉqØQhšUâÊqÙQU thumbnailqÚUâËqÛQUcssqÜUâÌqÝQUzone_principaleqÞU1Uzodb2fsqßUâàqàQU descriptionqá(UÀAffiche un album photo, sous forme de pages de vignettes. Chaque image est affichée en taille réelle lorsqu'on clique sur sa vignette, et peut être accompagnée d'un titre et d'une description.qâU2La taille maximale des vignettes est paramétrable.qãU”Si la librairie graphique PIL est installée, ainsi que les extensions thumbnail.py, rotate90.py et testPIL.py (ce qui est le cas sur un ZEServer) :qäUE- les vignettes des images téléchargées sont automatiquement créées ;qåUA- il est possible de faire subir aux images des rotations de 90°.qæUL- il est aussi possible d'importer ou d'exporter des images en dossier zipé.qçtqèhDUâÏqéQU thumbscriptqêUâÎqëQU javascriptqìUâÑqíQh;UâÒqîQhUâÓqïQhuUâÔqðQUtestqñUâÕqòQU ExtensionsqóUâÖqôQUtestPILqõUâ×qöQU certifdevq÷UnonqøhŠUâÄqùQhÇUâØqúQh}UâÝqûQUdevqüU100%qýUget_fileqþUâÚqÿQhhUâÛrQh‡UâÜrQU_ownerr(]rU acl_usersraUrage2000rtrhMUâÍrQU _propertiesr(}r (Utyper Ustringr Uidr Utitler UmoderUwu}r(UtyperUstringrUidrU experimentalru}r(UtyperUintrUidrUnoteru}r(jUstringrjUversionru}r(jjjUdevru}r(jjjU certifdevru}r (jjjU certifwebr!u}r"(jjjU moderateurr#u}r$(Utyper%Ulinesr&Uidr'U descriptionr(u}r)(Utyper*Ulinesr+Uidr,h u}r-(Utyper.Ustringr/Uidr0hu}r1(j.j/j0hÞu}r2(Utyper3Ustringr4Uidr5U access_redacr6utr7hSUâÞr8QU zwo_view_htmlr9Uâßr:QU__ac_local_roles__r;}r<U zwo_new_htmlr=Uâ¾r>QU experimentalr?UUget_fdr@UâárAQu.â»Ñ(cProducts.ExternalMethod.ExternalMethod ExternalMethod q)tq.}q(U_moduleqUfilemanagementqU _functionqU write_fileqU__ac_local_roles__q}q Urage2000q ]q UOwnerq asUidq U add_fs_imageqUtitleqUu.âÐÙ(cProducts.ExternalMethod.ExternalMethod ExternalMethod q)tq.}q(U_moduleqUZwooksManager.unzipqU _functionqUexport_in_zipfileqU__ac_local_roles__q}q Uclaudiuxq ]q UOwnerq asUidq Uzip_fileqUtitleqUu.â¿;R(cProducts.PythonScripts.PythonScript PythonScript q)tq.}q(U Python_magicqUmò qU _proxy_rolesq(UManagerqtqUwarningsq )U Script_magicq KU_bodyq TU# RECUPERATION DES PARAMETRES mem=context.zwo_lib.mem_mod_data() lieu=mem['rep_obj'][instid] #lieu=mem['parent'] # url_lieu=mem['parent_url'] obj=lieu[imgid] thumbnail=obj.thumbnail module_src = context.zwo_modules[lieu.element] if mem['droit_edit_dossier']<>1 and not context.zwo_lib.droit_redac(mem,lieu): return 'Vous n\'avez pas les droits pour cette action !' sizes = ('octets', 'Ko', 'Mo', 'Go', 'To') def human_size(size): size = float(size) unity = 0 while size >= 1024 and unity < len(sizes)-1: size = size/1024 unity += 1 return "%0.2f %s" % (size, sizes[unity]) def img_time(x): """ Retourne le time (fake s'il existe, réel sinon) de l'image""" if x.hasProperty('faketime'): return DateTime(x.faketime) else: return DateTime(x.bobobase_modification_time()) # end of def img_time(x) # upload nouvelle image faketime=DateTime() wasfs = False path = mem['rep_url'].replace(mem['zwo_url'],'') path = path.split('/') if obj.element == 'fs_image': wasfs = True file_path = obj.file_path content_type = obj.content_type if data is not None: data_stream = data.read() else: data_stream = '' if len(data_stream)<=0: if isfs != wasfs: obj = context.zodb2fs(obj, lieu, path) if not obj.hasProperty('faketime'): obj.manage_addProperty('faketime',faketime,'date') rec_tn = 1 content_type = obj.content_type file_path = obj.file_path else: obj.manage_changeProperties(title=context.REQUEST.titre) obj.manage_changeProperties(description=context.REQUEST.description) obj.manage_changeProperties(affiche_titre=affiche_titre_change) obj.manage_changeProperties(affiche_description=affiche_description_change) if not obj.hasProperty('faketime'): obj.manage_addProperty('faketime',faketime,'date') if len(data_stream) > 0: if isfs != wasfs: rec_tn = 1 dossier=lieu faketime=img_time(obj) if wasfs: module_src.del_img_fs(obj.file_path) dossier.manage_delObjects([imgid]) if isfs: file_path, size = module_src.add_fs_image(data, subpath=path) width, height = size content_type = data.headers['Content-Type'] dossier.manage_addDTMLDocument(imgid, context.REQUEST.titre) dossier[imgid].manage_addProperty('alt', context.REQUEST.titre, 'string') dossier[imgid].manage_addProperty('content_type', content_type, 'string') dossier[imgid].manage_addProperty('height', height, 'string') dossier[imgid].manage_addProperty('width', width, 'string') type = 'fs_image' else: dossier.manage_delObjects([imgid]) dossier.manage_addImage(imgid,data,context.REQUEST.titre) type = 'image' file_path = '' obj = dossier[imgid] obj.manage_addProperty('type_zwook','element','string') obj.manage_addProperty('element', type,'string') obj.manage_addProperty('description',context.REQUEST.description,'lines') obj.manage_addProperty('affiche_description',affiche_description_change,'string') obj.manage_addProperty('affiche_titre',affiche_titre_change,'string') obj.manage_addProperty('thumbnail',thumbnail,'int') obj.manage_addProperty('faketime',faketime,'date') obj.manage_addProperty('file_path',file_path,'string') # upload nouveau thumbnail if lieu.hasProperty('biggest_width'): biggest_width=int(lieu.biggest_width) else: biggest_width=105 if biggest_width<1: biggest_width=105 dossierthumb=lieu['thumbnails'] if rec_tn==1: # on (re-)calcule le thumbnail: if imgid in dossierthumb.objectIds(): if wasfs: module_src.del_img_fs(dossierthumb[imgid].file_path) dossierthumb.manage_delObjects([imgid]) if isfs: thumb_path, size = module_src.add_fs_thumbnail(file_path, size=biggest_width) width, height = size if imgid in dossierthumb.objectIds(): dossierthumb.manage_delObjects([imgid]) dossierthumb.manage_addDTMLDocument(imgid, context.REQUEST.titre) thumbobj = dossierthumb[imgid] thumbobj.manage_addProperty('file_path', thumb_path, 'string') thumbobj.manage_addProperty('alt', context.REQUEST.titre, 'string') thumbobj.manage_addProperty('content_type', content_type, 'string') thumbobj.manage_addProperty('height', height, 'string') thumbobj.manage_addProperty('width', width, 'string') obj.manage_changeProperties(thumbnail=1) else: context.thumbscript(obj,imgid,biggest_width) elif not (not thumb or len(thumb.read())<=0): if imgid in dossierthumb.objectIds(): if wasfs: module_src.del_img_fs(dossierthumb[imgid].file_path) dossierthumb.manage_delObjects([imgid]) if isfs: obj.manage_changeProperties(thumbnail=1) thumb_path = path + ['thumbnail'] thumb_path, size = context.add_fs_image(thumb, subpath=thumb_path) width, height = size dossierthumb.manage_addDTMLDocument(imgid, context.REQUEST.titre) thumbobj = dossierthumb[imgid] thumbobj.manage_addProperty('file_path', thumb_path, 'string') thumbobj.manage_addProperty('alt', context.REQUEST.titre, 'string') thumbobj.manage_addProperty('content_type', thumb.headers['Content-Type'], 'string') thumbobj.manage_addProperty('height', height, 'string') thumbobj.manage_addProperty('width', width, 'string') else: dossierthumb.manage_addImage(imgid,thumb,obj.title) obj.manage_changeProperties(thumbnail=1) if 'hdfile' in obj.propertyIds(): have_hd_file = obj.hdfile else: have_hd_file = 0 hdfile_stream = hdfile.read() if del_hd_file == 1 or len(hdfile_stream) > 0: if 'hdfile' in obj.propertyIds() and obj.hdfile == 1: hd_obj = lieu['hd'][imgid] module_src.del_img_fs(hd_obj.file_path) lieu['hd'].manage_delObjects([imgid]) if len(hdfile_stream) > 0: have_hd_file = 1 hd_path = path + ['hd'] hd_path, size = context.add_fs_image(hdfile, subpath=hd_path) width, height = size if 'hd' not in lieu.objectIds(): lieu.manage_addFolder('hd', 'HD files') lieu['hd'].manage_addDTMLDocument(imgid, context.REQUEST.titre) hdobj = lieu['hd'][imgid] hdobj.manage_addProperty('file_path', hd_path, 'string') size = human_size(len(hdfile_stream)) hdobj.manage_addProperty('size', size, 'string') hdobj.manage_addProperty('content_type', data.headers['Content-Type'], 'string') hdobj.manage_addProperty('height', height, 'string') hdobj.manage_addProperty('width', width, 'string') if 'hdfile' in obj.propertyIds(): obj.manage_changeProperties(hdfile=have_hd_file) else: obj.manage_addProperty('hdfile', have_hd_file, 'int') try: num_page_album=int(context.REQUEST.form['num_page_album']) except: num_page_album=1 if num_page_album!=1: param_redirect='?num_page_album='+str(num_page_album) else: param_redirect='' # REDIRECTION PAGE ADMIN GENERALE PAGE OU SKIN. context.REQUEST.RESPONSE.redirect('../../'+param_redirect) q U _filepathq U=Script (Python):/zwookedu_0.7/zwo_modules/album_photo/edit_okqU_codeqTSc@sdddedd„ZdS(Nt0ic 34sF tttdƒdƒƒ} tt| dƒ|ƒ}t||ƒ}t|dƒ}tttdƒt|dƒƒ}t| dƒdjo tttdƒd ƒ| |ƒ od Snd d d ddf‰‡d†}d„}t ƒ}t}tt| dƒdƒt| dƒdƒ}t|dƒdƒ}t|dƒdjo(t}t|dƒ}t|dƒ}n|tj ot|dƒƒ}nd}t|ƒdjo8||jowttdƒ|||ƒ}t|dƒdƒ ot|d ƒd|d!ƒnd}t|dƒ}t|dƒ}n±t|d"ƒd#tttd$ƒd%ƒƒt|d"ƒd&tttd$ƒd&ƒƒt|d"ƒd'|ƒt|d"ƒd(|ƒt|dƒdƒ ot|d ƒd|d!ƒnnt|ƒdjoÆ||jo d}n|} ||ƒ}|o6t|d)ƒt|dƒƒt| d*ƒ|gƒn|ot|d+ƒ|d,|ƒtƒ\}}"|"tƒ\}#}$tt|d-ƒd.ƒ}t| d/ƒ|tttd$ƒd%ƒƒtt| |ƒd ƒd0tttd$ƒd%ƒd1ƒtt| |ƒd ƒd|d1ƒtt| |ƒd ƒd2|$d1ƒtt| |ƒd ƒd3|#d1ƒd}%nNt| d*ƒ|gƒt| d4ƒ||tttd$ƒd%ƒƒd5}%d}t| |ƒ}t|d ƒd6dd1ƒt|d ƒd|%d1ƒt|d ƒd&tttd$ƒd&ƒd7ƒt|d ƒd(|d1ƒt|d ƒd'|d1ƒt|d ƒd|d8ƒt|d ƒd|d!ƒt|d ƒd|d1ƒnt|dƒd9ƒot#t|d9ƒƒ}'nd:}'|'djo d:}'nt|d;ƒ}(|djoÕ|t|(d<ƒƒjoJ|o)t|d)ƒtt|(|ƒdƒƒnt|(d*ƒ|gƒn|oNt|d=ƒ|d>|'ƒtƒ\})}"|"tƒ\}#}$|t|(d<ƒƒjot|(d*ƒ|gƒnt|(d/ƒ|tttd$ƒd%ƒƒt|(|ƒ}*t|*d ƒd|)d1ƒt|*d ƒd0tttd$ƒd%ƒd1ƒt|*d ƒd|d1ƒt|*d ƒd2|$d1ƒt|*d ƒd3|#d1ƒt|d"ƒddƒnttd?ƒ|||'ƒn | ptt|dƒƒƒdj oà|t|(d<ƒƒjoJ|o)t|d)ƒtt|(|ƒdƒƒnt|(d*ƒ|gƒn|o:t|d"ƒddƒ|dg})ttd+ƒ|d,|)ƒtƒ\})}"|"tƒ\}#}$t|(d/ƒ|tttd$ƒd%ƒƒt|(|ƒ}*t|*d ƒd|)d1ƒt|*d ƒd0tttd$ƒd%ƒd1ƒt|*d ƒdtt|d-ƒd.ƒd1ƒt|*d ƒd2|$d1ƒt|*d ƒd3|#d1ƒn9t|(d4ƒ||t|d#ƒƒt|d"ƒddƒnd@t|dAƒƒjot|d@ƒ}+nd}+t|dƒƒ},| djpt|,ƒdjoŠd@t|dAƒƒjot|d@ƒdjoWtt|dBƒ|ƒ}-t|d)ƒt|-dƒƒtt|dBƒd*ƒ|gƒnnt|,ƒdjood}+|dBg}.ttd+ƒ|d,|.ƒtƒ\}.}"|"tƒ\}#}$dBt|d<ƒƒjot|dCƒdBdDƒntt|dBƒd/ƒ|tttd$ƒd%ƒƒtt|dBƒ|ƒ}/t|/d ƒd|.d1ƒ|t|,ƒƒ}"t|/d ƒd>|"d1ƒt|/d ƒdtt|d-ƒd.ƒd1ƒt|/d ƒd2|$d1ƒt|/d ƒd3|#d1ƒnd@t|dAƒƒjot|d"ƒd@|+ƒnt|d ƒd@|+d8ƒy+t#ttttd$ƒdEƒdFƒƒ}0Wn d}0nX|0djodGt1|0ƒ}2nd}2ttttd$ƒdHƒdIƒdJ|2ƒdKS(Ls; Retourne le time (fake s'il existe, réel sinon) de l'imagetzwo_libt mem_mod_datatrep_objt thumbnailt zwo_modulestelementtdroit_edit_dossierit droit_redacs.Vous n'avez pas les droits pour cette action !toctetstKotMotGotTocsut|ƒ}d}xE|djo|tˆƒdjo |d}td|dƒ}qWd|tˆ|ƒfSdS(Niiis+=s%0.2f %s(tfloattsizetunitytlentsizest _inplacevar_t _getitem_(RRRRRRR(R(sScript (Python)s human_sizes $ cCsGt|dƒdƒott|dƒƒSntt|dƒƒƒSdS(s; Retourne le time (fake s'il existe, réel sinon) de l'imaget hasPropertytfaketimetbobobase_modification_timeN(t _getattr_txtDateTime(RRR((sScript (Python)simg_timestrep_urltreplacetzwo_urlttsplitt/tfs_imaget file_patht content_typetreaditzodb2fsRRtmanage_addPropertytdatetmanage_changePropertiesttitletREQUESTttitret descriptiont affiche_titretaffiche_descriptiont del_img_fstmanage_delObjectst add_fs_imagetsubpaththeaderss Content-Typetmanage_addDTMLDocumenttalttstringtheighttwidthtmanage_addImagetimaget type_zwooktlinestintt biggest_widthiit thumbnailst objectIdstadd_fs_thumbnailRt thumbscriptthdfilet propertyIdsthdtmanage_addFoldersHD filestformtnum_page_albums?num_page_album=tRESPONSEtredirects../../N(3RtcontexttmemRtinstidtlieutimgidtobjRt module_srcRt human_sizetimg_timeRRtFalsetwasfstpathtTrueR"R#tdatatNonet data_streamRtisfstrec_tntaffiche_titre_changetaffiche_description_changetdossiert _getiter_RR8R7ttypeR=R>t dossierthumbt thumb_pathtthumbobjtthumbt have_hd_fileRCt hdfile_streamt del_hd_filethd_objthd_paththdobjRHtstrtparam_redirect(3RMROReRXRCR]R^R\R[RhRRKRLRRNRPRRQRRRRSRRRTRURVRWR"R#RYRZRR_R`RR8R7RaR=R>RbRcRdRfRgRiRjRkRHRlRm((RsScript (Python)sedit_oks&!9  *  ((!   ((4""" ++   )(+() ((+" /' (1.  (RTtedit_ok(RTRn((sScript (Python)sRqU func_defaultsq(U0U0KI00 KtqUerrorsq)U _bind_namesq(cShared.DC.Scripts.Bindings NameAssignments qoq}qU_asgnsq}q(U name_contextqUcontextqU name_subpathqUtraverse_subpathqU name_m_selfqUscriptqUname_containerq U containerq!usbU_dav_writelocksq"Uâåq#QU__ac_local_roles__q$}q%Uxavq&]q'UOwnerq(asUidq)Uedit_okq*U_paramsq+Uinstid, imgid, thumb, data, hdfile, affiche_titre_change='0', affiche_description_change='0', rec_tn=0, isfs=False, del_hd_file=0q,U func_codeq-(cShared.DC.Scripts.Signature FuncCode q.oq/}q0(U co_argcountq1K U co_varnamesq2(Uinstidq3Uimgidq4Uthumbq5Udataq6Uhdfileq7Uaffiche_titre_changeq8Uaffiche_description_changeq9Urec_tnq:Uisfsq;U del_hd_fileqUmemq?U _getitem_q@UlieuqAUobjqBU thumbnailqCU module_srcqDUsizesqEU human_sizeqFUimg_timeqGUDateTimeqHUfaketimeqIUFalseqJUwasfsqKUpathqLUTrueqMU file_pathqNU content_typeqOUNoneqPU data_streamqQUlenqRUdossierqSU _getiter_qTUsizeqUUwidthqVUheightqWUtypeqXUintqYU biggest_widthqZU dossierthumbq[U thumb_pathq\Uthumbobjq]U have_hd_fileq^U hdfile_streamq_Uhd_objq`Uhd_pathqaUhdobjqbUnum_page_albumqcUstrqdUparam_redirectqetqfubu.â½ :(cProducts.PythonScripts.PythonScript PythonScript q)tq.}q(U Python_magicqUmò qUerrorsq)Uwarningsq)U Script_magicqKU_bodyq Thmem=context.zwo_lib.mem_data() print context.zwo_lib.standard_html_header(mem) print """ Votre fichier ZIP ne doit contenir que des images ou des photos.
Fichier ZIP :
""" %(instid) print context.zwo_lib.standard_html_footer(mem) return printed q U _filepathq UOScript (Python):/zwook_active_kz1_0_rc1/zwo_modules/album_photo/unzip_file_formq U_codeq TÐc@s d„ZdS(Nc Cstƒ}tttdƒdƒƒ}|tttdƒdƒ|ƒIJ|d|IJ|tttdƒdƒ|ƒIJ|ƒSdS(Ntzwo_libtmem_datatstandard_html_headersÁ Votre fichier ZIP ne doit contenir que des images ou des photos.
Fichier ZIP :
tstandard_html_footer(t_print_t_printt _getattr_tcontexttmemtinstid(R RRRRR((sScript (Python)tunzip_file_forms $" "(R (R ((sScript (Python)stqU func_defaultsqNU _bind_namesq(cShared.DC.Scripts.Bindings NameAssignments qoq}qU_asgnsq}q(Uname_containerqU containerqU name_contextqUcontextqU name_subpathqUtraverse_subpathqU name_m_selfqUscriptqusbU func_codeq(cShared.DC.Scripts.Signature FuncCode qoq }q!(U co_argcountq"KU co_varnamesq#(Uinstidq$U_print_q%U_printq&U _getattr_q'Ucontextq(Umemq)tq*ubU__ac_local_roles__q+}q,Uclaudiuxq-]q.UOwnerq/asUidq0Uunzip_file_formq1U_paramsq2Uinstidq3U_dav_writelocksq4Uâãq5Qu.â¼:(cProducts.PythonScripts.PythonScript PythonScript q)tq.}q(U Python_magicqUmò qU _proxy_rolesq(UManagerqtqUwarningsq )U Script_magicq KU_bodyq T’# RECUPERATION DES PARAMETRES mem=context.zwo_lib.mem_mod_data() if type_rep=="skin": try: skin=context.zwo_info.skins[nom_rep] except: return 'nooo' obj=skin[instid] else: dossier=mem['rep_obj'] obj=dossier[instid] if mem['droit_edit_dossier']<>1 and not context.zwo_lib.droit_redac(mem,obj): return 'Vous n\'avez pas les droits pour cette action !' # EXEMPLE MODIFICATION #obj.manage_changeProperties(exemple=exemple) if obj.hasProperty('num_of_lines'): obj.manage_changeProperties(num_of_lines=num_of_lines) else: obj.manage_addProperty('num_of_lines',num_of_lines,'int') if obj.hasProperty('img_per_line'): obj.manage_changeProperties(img_per_line=img_per_line) else: obj.manage_addProperty('img_per_line',img_per_line,'int') if obj.hasProperty('biggest_width'): obj.manage_changeProperties(biggest_width=biggest_width) else: obj.manage_addProperty('biggest_width',biggest_width,'int') if obj.hasProperty('show_title'): obj.manage_changeProperties(show_title=show_title) else: obj.manage_addProperty('show_title',show_title,'string') if obj.hasProperty('show_desc'): obj.manage_changeProperties(show_desc=show_desc) else: obj.manage_addProperty('show_desc',show_desc,'string') img_width_max,img_height_max=dim_max.split('x') if obj.hasProperty('img_width_max'): obj.manage_changeProperties(img_width_max=img_width_max) else: obj.manage_addProperty('img_width_max',img_width_max,'int') if obj.hasProperty('img_height_max'): obj.manage_changeProperties(img_height_max=img_height_max) else: obj.manage_addProperty('img_height_max',img_height_max,'int') if obj.hasProperty('filesystem'): obj.manage_changeProperties(filesystem=isfs) else: obj.manage_addProperty('filesystem', isfs, 'boolean') # Rédacteurs: if mem['droit_redac']==1: if obj.hasProperty('redac_time'): obj.manage_changeProperties(redac_time=DateTime()) else: obj.manage_addProperty('redac_time',DateTime(),'date') elif mem['droit_edit_dossier']==1: context.zwo_lib.check_content_submited_by_redac(obj.getId(), obj.absolute_url(), 'chown', redacteur, imprimatur) # REDIRECTION PAGE ADMIN GENERALE PAGE OU SKIN. context.REQUEST.RESPONSE.redirect('../../') q U _filepathq U?Script (Python):/zwookedu_0.7/zwo_modules/album_photo/config_okqU_codeqT c@sddddded„ZdS(Ntt0t640x480c DCs#tttdƒdƒƒ}|djoFy%ttttdƒdƒ|ƒ}Wn dSnXt||ƒ}nt|dƒ}t||ƒ}t|dƒd jo tttdƒd ƒ||ƒ od Snt|d ƒd ƒot|dƒd |ƒnt|dƒd |dƒt|d ƒdƒot|dƒd|ƒnt|dƒd|dƒt|d ƒdƒot|dƒd|ƒnt|dƒd|dƒt|d ƒdƒot|dƒd| ƒnt|dƒd| dƒt|d ƒdƒot|dƒd| ƒnt|dƒd| dƒt|dƒdƒtƒ\}}t|d ƒdƒot|dƒd|ƒnt|dƒd|dƒt|d ƒdƒot|dƒd|ƒnt|dƒd|dƒt|d ƒdƒot|dƒd| ƒnt|dƒd| dƒt|d ƒd joSt|d ƒdƒot|dƒdtƒƒnt|dƒdtƒdƒn[t|dƒd joDtttdƒdƒt|dƒƒt|d ƒƒd!||ƒnttttd"ƒd#ƒd$ƒd%ƒdS(&Ntzwo_libt mem_mod_datatskintzwo_infotskinstnoootrep_objtdroit_edit_dossierit droit_redacs.Vous n'avez pas les droits pour cette action !t hasPropertyt num_of_linestmanage_changePropertiestmanage_addPropertytintt img_per_linet biggest_widtht show_titletstringt show_desctsplittxt img_width_maxtimg_height_maxt filesystemtbooleant redac_timetdatetcheck_content_submited_by_redactgetIdt absolute_urltchowntREQUESTtRESPONSEtredirects../../(t _getattr_tcontexttmemttype_rept _getitem_tnom_repRtinstidtobjtdossierR RRRRtdim_maxt _getiter_RRtisfstDateTimet redacteurt imprimatur(R+R*R(R RRR2R3R.RRR0R%R&R'R)RR,R-R/RRR1((sScript (Python)s config_oksT (9" D(tFalset config_ok(R4R5((sScript (Python)sRqU func_defaultsq(UU0U640x480qU0U0I00 tqUerrorsq)U _bind_namesq(cShared.DC.Scripts.Bindings NameAssignments qoq}qU_asgnsq}q(U name_contextqUcontextqU name_subpathqUtraverse_subpathqU name_m_selfqUscriptq Uname_containerq!U containerq"usbU_dav_writelocksq#Uââq$QU__ac_local_roles__q%}q&Uxavq']q(UOwnerq)asUidq*U config_okq+U_paramsq,Užinstid, nom_rep, type_rep, num_of_lines, img_per_line, biggest_width,redacteur='',imprimatur='0', dim_max='640x480', show_title='0', show_desc='0', isfs=Falseq-U func_codeq.(cShared.DC.Scripts.Signature FuncCode q/oq0}q1(U co_argcountq2K U co_varnamesq3(Uinstidq4Unom_repq5Utype_repq6U num_of_linesq7U img_per_lineq8U biggest_widthq9U redacteurq:U imprimaturq;Udim_maxqUisfsq?U _getattr_q@UcontextqAUmemqBU _getitem_qCUskinqDUobjqEUdossierqFU _getiter_qGU img_width_maxqHUimg_height_maxqIUDateTimeqJtqKubu.âÀ«(cOFS.Folder Folder q)tq.}q(U arriere.pngqUâæqQU rotate_cw.pngqUâçqQU remove.pngqUâèq QU avant.pngq Uâéq QU alb_next.gifq Uâêq QU album.pngqUâëqQU previous.pngqUâìqQUidqUimagesqUnext.pngqUâíqQU file_zip.pngqUâîqQUtitleqUU cle_admin.pngqUâïqQU download.gifqUâðqQU_objectsq(}q(U meta_typeqUImageq Uidq!U ajouter.gifq"u}q#(hh h!hu}q$(hh h!hu}q%(hh h!h u}q&(hh h!hu}q'(hh h!Ucle_admin_no.pngq(u}q)(hh h!U eraser.pngq*u}q+(hh h!hu}q,(hh h!U fileopen.pngq-u}q.(hh h!Uici.pngq/u}q0(hh h!Uinfo.pngq1u}q2(hh h!U info_no.pngq3u}q4(hh h!U matrix.pngq5u}q6(hh h!Umove.pngq7u}q8(hh h!hu}q9(hh h!U package.pngq:u}q;(hh h!hu}q<(hh h!hu}q=(hh h!hu}q>(hh h!hu}q?(U meta_typeq@UImageqAUidqBh u}qC(U meta_typeqDUImageqEUidqFU alb_prev.gifqGu}qH(hDhEhFU close.gifqIu}qJ(U meta_typeqKUImageqLUidqMUajaxLoader.gifqNutqOhGUâñqPQh3UâòqQQh1UâóqRQh:UâôqSQh(UâõqTQhIUâüqUQh7Uâ÷qVQh/UâøqWQh"UâùqXQh5UâúqYQhNUâûqZQh-Uâöq[QU__ac_local_roles__q\}q]Urage2000q^]q_UOwnerq`ash*UâýqaQu.âÁ³(cProducts.PythonScripts.PythonScript PythonScript q)tq.}q(U Python_magicqUmò qU _proxy_rolesq(UManagerqtqUwarningsq )U Script_magicq KU_bodyq Tí # RECUPERATION DES PARAMETRES mem=context.zwo_lib.mem_mod_data() if mem['droit_edit_dossier']<>1 and mem['droit_redac']!=1: return "Vous n'avez pas les droits pour cette action !" lieu=mem['parent'] url_lieu=mem['parent_bo_url'] idobj=context.zwo_lib.mix_id_zope(titre) img_width_max,img_height_max=dim_max.split('x') # REDIRECTION SI IDENTIFIANT MAL CHOISI if idobj in lieu.objectIds(): url='../ajout_element?type='+container.getId() print '' print '

Cet identifiant '+idobj+' est déja pris
' print 'Veuillez en choisir un autre
' print 'Redirection automatique dans 2 secondes.

' print 'Si la Redirection automatique ne fonctionne pas, cliquez ici : Redirection Manuelle' print '' return printed # CREATION INSTANCE MODULE (dossier, image, DTML Document ou Fichier selon Besoin. Folder conseillé en cas de doute) lieu.manage_addFolder(idobj,titre) lieu[idobj].manage_addFolder('thumbnails','thumbnails') lieu[idobj].manage_addFolder('hd','hd files') #lieu.manage_addImage(idobj,data,titre) #lieu.manage_addFile(idobj, file=data, title=titre) #lieu.manage_addDTMLDocument(idobj, titre) obj=lieu[idobj] # AJOUT DES PROPRIETES OBLIGATOIRE DU MODULES obj.manage_addProperty('type_zwook','element','string') obj.manage_addProperty('element',container.getId(),'string') # Ajouté pour rédacteur : if mem['droit_redac']==1: obj.manage_addProperty('redacteur',mem['user_id'],'string') obj.manage_addProperty('imprimatur',"0",'string') obj.manage_addProperty('redac_time',DateTime(),'date') # AJOUT D'AUTRES PROPRIETE en fonction du module obj.manage_addProperty('num_of_lines',int(num_of_lines),'int') obj.manage_addProperty('img_per_line',int(img_per_line),'int') obj.manage_addProperty('num_img',0,'int') obj.manage_addProperty('biggest_width',int(biggest_width),'int') obj.manage_addProperty('img_width_max', int(img_width_max),'int') obj.manage_addProperty('img_height_max', int(img_height_max),'int') obj.manage_addProperty('show_title', show_title, 'string') obj.manage_addProperty('show_desc', show_desc, 'string') obj.manage_addProperty('filesystem', isfs, 'boolean') # AJOUT DE SOUS ELEMENTS en fonction du module # (si dossier choisi comme type uniquement) #obj.manage_addFolder('truc','bidulle') #obj.truc.manage_addProperty('nom_propriete','valeur default',type) context.REQUEST.RESPONSE.redirect('../../place?obj='+idobj) return q U _filepathq U