ZEXP-/(cOFS.Folder Folder q)tq.}q(Uunzip_file_formqU-1qQUzip_fileqU-^qQU config_okqU-7q QU moderateurq Uclaudiux@zwookedu.netq U contributeursq (Uzwook@matisson.comq tqU add_fs_imageqU-6qQU access_redacqUutilisable par un rdacteurqUedit_okqU-HqQUskinqU1UimagesqU2qQUnew_okqU-8qQUzwo_config_htmlqU-QqQUidqUalbum_photo_jqueryqUmove_imgqU-:qQU certifwebq Unonq!Uview_imgq"U-(U meta_typeq?UScript (Python)q@UidqAUdel_imgqBu}qC(U meta_typeqDUScript (Python)qEUidqFh"u}qG(U meta_typeqHUScript (Python)qIUidqJU edit_htmlqKu}qL(hHhIhJhu}qM(U meta_typeqNUImageqOUidqPU icone.pngqQu}qR(U meta_typeqSUScript (Python)qTUidqUU thumbscriptqVu}qW(hSUExternal MethodqXhUU thumbnailqYu}qZ(U meta_typeq[UScript (Python)q\Uidq]U zwo_new_htmlq^u}q_(h[h\h]U zwo_view_htmlq`u}qa(h[h\h]hu}qb(U meta_typeqcUScript (Python)qdUidqeU move_htmlqfu}qg(hchdhehu}qh(U meta_typeqiUScript (Python)qjUidqkhu}ql(U meta_typeqmUExternal MethodqnUidqoUtestPILqpu}qq(hmUScript (Python)qrhoU testPILscriptqsu}qt(U meta_typequUExternal MethodqvUidqwUrotate90qxu}qy(huUScript (Python)qzhwUrotate90scriptq{u}q|(U meta_typeq}UFolderq~UidqU Extensionsqu}q(U meta_typeqUExternal MethodqUidqU unzip_filequ}q(hUScript (Python)qhUunzip_file_scriptqu}q(U meta_typeqUScript (Python)qUidqUadd_filequ}q(U meta_typeqUScript (Python)qUidqhu}q(U meta_typeqUExternal MethodqUidqhu}q(hUScript (Python)qhUzip_file_scriptqu}q(U meta_typeqUScript (Python)qUidqUtestqu}q(U meta_typeqUFolderqUidqU javascriptqu}q(U meta_typeqUFolderqUidqUcssqu}q(U meta_typeqUExternal MethodqUidqU add_fs_imagequ}q(U meta_typeqUExternal MethodqUidqUadd_fs_thumbnailqu}q(U meta_typeqUExternal MethodqUidqU rotate90fsqu}q(U meta_typeqUExternal MethodqUidqU del_img_fsqu}q(U meta_typeqUFolderqUidqUimagesqu}q(U meta_typeqUScript (Python)qUidqUdownload_imagequ}q(U meta_typeqUExternal MethodqUidqUget_filequ}q(U meta_typeqUExternal MethodqUidqUget_fdqu}q(U meta_typeqUExternal MethodqUidqUzodb2fsqutqhxU-CqQhU-DqQU thumbnailqU-EqQUcssqU-aqQUzone_principaleqU1Uzodb2fsqUzqQU descriptionq(UAffiche un album photo, sous forme de pages de vignettes. Chaque image est affiche en taille relle lorsqu'on clique sur sa vignette, et peut tre accompagne d'un titre et d'une description.qU2La taille maximale des vignettes est paramtrable.qUSi la librairie graphique PIL est installe, ainsi que les extensions thumbnail.py, rotate90.py et testPIL.py (ce qui est le cas sur un ZEServer) :qUE- les vignettes des images tlcharges sont automatiquement cres ;qUA- il est possible de faire subir aux images des rotations de 90.qUL- il est aussi possible d'importer ou d'exporter des images en dossier zip.qtqhBU-IqQU thumbscriptqU-JqQU javascriptqU-KqQh9U-MqQhU-NqQhsU-OqQUtestqU-PqQU ExtensionsqU-SqQUtestPILqU-=qQh{U-WqQU certifdevqUnonqhU-ZqQhU:qQU del_img_fsqU-@qQUdevqU100%qUget_fileqUU zwo_new_htmlr?U-;r@QU experimentalrAUUget_fdrBU8rCQu.-1 :(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 Tc@s dZdS(Nc Cst}tttdd}|tttdd|IJ|d|IJ|tttdd|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-eq5Qu.-^(cProducts.ExternalMethod.ExternalMethod ExternalMethod q)tq.}q(U_moduleqUZwooksManager.unzipqU _functionqUexport_in_zipfileqU__ac_local_roles__q}q Uclaudiuxq ]q UOwnerq asUidq Uzip_fileqUtitleqUu.-7:(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') # Rdacteurs: 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@sdddddedZdS(Ntt0t640x480c DCs#tttdd}|djoFy%ttttdd|}Wn dSnXt||}nt|d}t||}t|dd jo tttdd || od Snt|d d ot|dd |nt|dd |dt|d dot|dd|nt|dd|dt|d dot|dd|nt|dd|dt|d dot|dd| nt|dd| dt|d dot|dd| nt|dd| dt|ddt\}}t|d dot|dd|nt|dd|dt|d dot|dd|nt|dd|dt|d dot|dd| nt|dd| dt|d d joSt|d dot|ddtnt|ddtdn[t|dd joDtttddt|dt|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-fq$QU__ac_local_roles__q%}q&Uxavq']q(UOwnerq)asUidq*U config_okq+U_paramsq,Uinstid, 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.-6(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.-H;(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() 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, rel 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_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 Uidq Uedit_okqU_codeqT4c@sdddeddZdS(Nt0ic 34s0 tttdd} tt| d|}t||}t|d}tttdt|d}t| ddjo tttdd | | od Snd d d ddfd}d}t }t}tt| ddt| dd}t|dd}t|ddjo(t}t|d}t|d}n|tj ot|d}nd}t|djo8||jowttd|||}t|dd ot|d d|d!nd}t|d}t|d}nt|d"d#tttd$d%t|d"d&tttd$d&t|d"d'|t|d"d(|t|dd ot|d d|d!nnt|djo||jo d}n|} ||}|o6t|d)t|dt| d*|gn|ot|d+|d,|t\}}"|"t\}#}$tt|d-d.}t| d/|tttd$d%tt| |d d0tttd$d%d1tt| |d d|d1tt| |d d2|$d1tt| |d d3|#d1d}%n8t| d4||tttd$d%d5}%d}t| |}t|d d6dd1t|d d|%d1t|d d&tttd$d&d7t|d d(|d1t|d d'|d1t|d d|d8t|d d|d!t|d d|d1nt|dd9ot#t|d9}'nd:}'|'djo d:}'nt|d;}(|djo|t|(d<joJ|o)t|d)tt|(|dnt|(d*|gn|oNt|d=|d>|'t\})}"|"t\}#}$|t|(d<jot|(d*|gnt|(d/|tttd$d%t|(|}*t|*d d|)d1t|*d d0tttd$d%d1t|*d d|d1t|*d d2|$d1t|*d d3|#d1t|d"ddnttd?|||'n | ptt|ddj o|t|(d<joJ|o)t|d)tt|(|dnt|(d*|gn|o:t|d"dd|dg})ttd+|d,|)t\})}"|"t\}#}$t|(d/|tttd$d%t|(|}*t|*d d|)d1t|*d d0tttd$d%d1t|*d dtt|d-d.d1t|*d d2|$d1t|*d d3|#d1n9t|(d4||t|d#t|d"ddnd@t|dAjot|d@}+nd}+t|d},| djpt|,djod@t|dAjot|d@djoWtt|dB|}-t|d)t|-dtt|dBd*|gnnt|,djood}+|dBg}.ttd+|d,|.t\}.}"|"t\}#}$dBt|d<jot|dCdBdDntt|dBd/|tttd$d%tt|dB|}/t|/d d|.d1|t|,}"t|/d d>|"d1t|/d dtt|d-d.d1t|/d d2|$d1t|/d d3|#d1nd@t|dAjot|d"d@|+nt|d d@|+d8y+t#ttttd$dEdF}0Wn d}0nX|0djodGt1|0}2nd}2ttttd$dHdIdJ|2dKS(Ls; Retourne le time (fake s'il existe, rel 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|tdjo |d}td|d}qWd|t|fSdS(Niiis+=s%0.2f %s(tfloattsizetunitytlentsizest _inplacevar_t _getitem_(RRRRRRR(R(sScript (Python)s human_sizes $ cCsGt|ddott|dSntt|dSdS(s; Retourne le time (fake s'il existe, rel 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)tedit_oks$!9  *  ((!   ((4""" ++   )(+() ((+" /' (1.  (RTRn(RTRn((sScript (Python)sRqU func_defaultsq(U0U0KI00 KtqUerrorsq)U _bind_namesq(cShared.DC.Scripts.Bindings NameAssignments qoq}qU_asgnsq}q(Uname_containerqU containerqU name_contextqUcontextqU name_subpathqUtraverse_subpathqU name_m_selfq Uscriptq!usbU func_codeq"(cShared.DC.Scripts.Signature FuncCode q#oq$}q%(U co_argcountq&K U co_varnamesq'(Uinstidq(Uimgidq)Uthumbq*Udataq+Uhdfileq,Uaffiche_titre_changeq-Uaffiche_description_changeq.Urec_tnq/Uisfsq0U del_hd_fileq1U _getattr_q2Ucontextq3Umemq4U _getitem_q5Ulieuq6Uobjq7U thumbnailq8U module_srcq9Usizesq:U human_sizeq;Uimg_timeqUFalseq?Uwasfsq@UpathqAUTrueqBU file_pathqCU content_typeqDUNoneqEU data_streamqFUlenqGUdossierqHU _getiter_qIUsizeqJUwidthqKUheightqLUtypeqMUintqNU biggest_widthqOU dossierthumbqPU thumb_pathqQUthumbobjqRU have_hd_fileqSU hdfile_streamqTUhd_objqUUhd_pathqVUhdobjqWUnum_page_albumqXUstrqYUparam_redirectqZtq[ubU__ac_local_roles__q\}q]Uxavq^]q_UOwnerq`asU _filepathqaU=Script (Python):/zwookedu_0.7/zwo_modules/album_photo/edit_okqbU_paramsqcUinstid, imgid, thumb, data, hdfile, affiche_titre_change='0', affiche_description_change='0', rec_tn=0, isfs=False, del_hd_file=0qdU_dav_writelocksqeU-nqfQu.2(cOFS.Folder Folder q)tq.}q(U arriere.pngqU-0qQU rotate_cw.pngqU-2qQU remove.pngqU-3q QU avant.pngq U-4q QU album.pngq U-5q QU cle_admin.pngqU-FqQUidqUimagesqUnext.pngqU-[qQU file_zip.pngqU->qQUtitleqUU previous.pngqU-9qQU download.gifqU3qQU_objectsq(}q(U meta_typeqUImageqUidqU ajouter.gifq u}q!(hhhh u}q"(hhhhu}q#(hhhh u}q$(hhhhu}q%(hhhUcle_admin_no.pngq&u}q'(hhhU eraser.pngq(u}q)(hhhhu}q*(hhhU fileopen.pngq+u}q,(hhhUici.pngq-u}q.(hhhUinfo.pngq/u}q0(hhhU info_no.pngq1u}q2(hhhU matrix.pngq3u}q4(hhhUmove.pngq5u}q6(hhhhu}q7(hhhU package.pngq8u}q9(hhhhu}q:(hhhhu}q;(hhhhu}q<(hhhhutq=h1U-Tq>Qh/U-Gq?Qh8U-Lq@Qh&U-RqAQh5U-XqBQh-U-YqCQh U-VqDQh3U-]qEQh+U-bqFQU__ac_local_roles__qG}qHUrage2000qI]qJUOwnerqKash(U-dqLQu.-8P(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 dja 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.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 rdacteur : 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 Uidq Unew_okqU_codeqT c@s"ddddddedZdS(Niiit640x480t0cCsgt} tttdd} t| ddjot| ddjodSnt| d}t| d}tttdd |}t|d d t \}}|t|d joud ttd}| d|dIJ| d|dIJ| dIJ| dIJ| d|dIJ| dIJ| Snt|d||tt||dddt||}t|ddddt|ddttddt| ddjo[t|ddt| ddt|dd d!dt|dd"td#nt|dd$t|d%t|dd&t|d%t|dd'd(d%t|dd)t|d%t|dd*t|d%t|dd+t|d%t|dd,|dt|dd-|dt|dd.|d/ttttd0d1d2d3|dSdS(4Ntzwo_libt mem_mod_datatdroit_edit_dossierit droit_redacs.Vous n'avez pas les droits pour cette action !tparentt parent_bo_urlt mix_id_zopetsplittxt objectIdss../ajout_element?type=tgetIds7s.

Cet identifiant s est dja pris
s"Veuillez en choisir un autre
s6Redirection automatique dans 2 secondes.

sGSi la Redirection automatique ne fonctionne pas, cliquez ici : Redirection Manuellestmanage_addFoldert thumbnailstmanage_addPropertyt type_zwooktelementtstringt redacteurtuser_idt imprimaturRt redac_timetdatet num_of_linestintt img_per_linetnum_imgit biggest_widtht img_width_maxtimg_height_maxt show_titlet show_desct filesystemtbooleantREQUESTtRESPONSEtredirects../../place?obj=(t_print_t_printt _getattr_tcontexttmemt _getitem_tlieuturl_lieuttitretidobjtdim_maxt _getiter_RRt containerturltobjtDateTimeRRRRRR tisfs(R.RRRR0RR R6R&R'R(R)R*R+R,R-R/R1RRR2R3R4R5R((sScript (Python)snew_oksH ,"    %" )(tFalsetnew_ok(R7R8((sScript (Python)stqU func_defaultsq(KKKiU640x480qU0U0I00 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 func_codeq#(cShared.DC.Scripts.Signature FuncCode q$oq%}q&(U co_argcountq'KU co_varnamesq((Utitreq)U num_of_linesq*U img_per_lineq+U biggest_widthq,Udim_maxq-U show_titleq.U show_descq/Uisfsq0U_print_q1U_printq2U _getattr_q3Ucontextq4Umemq5U _getitem_q6Ulieuq7Uurl_lieuq8Uidobjq9U _getiter_q:U img_width_maxq;Uimg_height_maxqUobjq?UDateTimeq@UintqAtqBubU__ac_local_roles__qC}qDUgregqE]qFUOwnerqGasU _filepathqHU