ZEXP((U App.ProductqUProductqtqNt.}q(UBannerFolder_add_permissionq(Upq(UApp.PermissionqU PermissionqttQUidq U BannerFolderq U__ac_local_roles__q }q Ulaloq ]qUOwnerqasU_objectsq(}q(U meta_typeqU DTML MethodqUidqUAdBanner_addFormqu}q(hhhU AdBanner_addqu}q(hUZope PermissionqhUAdBanner_add_permissionqu}q(hU Zope FactoryqhUAdBanner_factoryqu}q(hhhUBannerFolder_addFormqu}q (hhhUBannerFolder_addq!u}q"(hhhUBannerFolder_add_permissionq#u}q$(hhhUBannerFolder_factoryq%u}q&(U meta_typeq'UZ Classq(Uidq)UAdBannerq*u}q+(U meta_typeq,UZ Classq-Uidq.U BannerFolderq/utU BannerFolderq0(Uq1(UZClasses.ZClassq2UZClassq3ttQUBannerFolder_addFormq4(Urq5(UOFS.DTMLMethodq6U DTMLMethodq7ttQUversionq8U0.1q9UAdBannerq:(Uq;(h2UZClassq(hU Permissionq?ttQU AdBanner_addq@(UaqA(h6U DTMLMethodqBttQUAdBanner_addFormqC(U_qD(h6U DTMLMethodqEttQUAdBanner_factoryqF(U`qG(U App.FactoryqHUFactoryqIttQUtitleqJUBanner Advertising ProductqKUconfigurable_objects_qL]qMUBannerFolder_addqN(UsqO(h6U DTMLMethodqPttQUBannerFolder_factoryqQ(UtqR(hHUFactoryqSttQu.p((UApp.PermissionqU PermissionqtqNt.}q(UtitleqU#BannerFolder constructor permissionqUidqUBannerFolder_add_permissionqUnameq UAdd Advertising Banner Foldersq U__ac_local_roles__q }q Ulaloq ]qUOwnerqasu.e((UZClasses.ZClassqUZClassqtqNt.}q(U_permissionMapperqcAccessControl.PermissionMapping PM qNRq}q(U"_Create_class_instances_Permissionq U*_Add_Advertising_Banner_Folders_Permissionq U_Change_permissions_Permissionq U_Change_permissions_Permissionq U_View_Permissionq U_View_PermissionqU'_Access_contents_information_PermissionqU'_Access_contents_information_PermissionqU_Delete_objects_PermissionqU_Delete_objects_PermissionqU_Manage_properties_PermissionqU_Manage_properties_PermissionqubU_zclass_propertysheets_classqUqQUidqU BannerFolderqU_zbasesq]q(cZClasses.ZClass ZObject qcProducts.Renderable _ZClass_for_Renderable qcZClasses.ObjectManager ZObjectManager qeU__ac_local_roles__q}qUlaloq ]q!UOwnerq"asU_zclass_q#Uq$QUtitleq%UAdvertising Banner Folderq&Upropertysheetsq'(Uq(Uq)QtQu.rT((UOFS.DTMLMethodqU DTMLMethodqtqNt.}q(UtitleqU#BannerFolder constructor input formqUrawqT{ Add Advertising Banner Folder

Add Advertising Banner Folder

Id
qU__ac_local_roles__q }q Ulaloq ]q UOwnerq asUglobalsq}qU__name__qUBannerFolder_addFormqU_varsq}qu.@((UZClasses.ZClassqUZClassqtqNt.}q(U_permissionMapperqcAccessControl.PermissionMapping PM qNRq}q(U"_Create_class_instances_Permissionq U*_Add_Advertising_Banner_Folders_Permissionq U_Change_permissions_Permissionq U_Change_permissions_Permissionq U_View_Permissionq U_View_PermissionqU'_Access_contents_information_PermissionqU'_Access_contents_information_PermissionqU_Delete_objects_PermissionqU_Delete_objects_PermissionqU_Manage_properties_PermissionqU_Manage_properties_PermissionqubU_zclass_propertysheets_classqUqQUidqUAdBannerqU_zbasesq]q(cZClasses.ZClass ZObject qcProducts.Renderable _ZClass_for_Renderable qcProducts.OFSP _ZClass_for_Image qeU__ac_local_roles__q}qUlaloq ]q!UOwnerq"asU_zclass_q#Uq$QUtitleq%UUpropertysheetsq&(Uq'Uq(QtQu.^((UApp.PermissionqU PermissionqtqNt.}q(UtitleqUAdBanner constructor permissionqUidqUAdBanner_add_permissionqUnameq UAdd Advertising Bannersq U__ac_local_roles__q }q Ulaloq ]qUOwnerqasu.a((UOFS.DTMLMethodqU DTMLMethodqtqNt.}q(UtitleqUAdBanner constructorqUrawqT Add AdBanner We add the new object by calling the class in a with tag. Not only does this get the thing added, it adds the new thing's attributes to the DTML name space, so we can call methods to initialize the object. You can ad code that modifies the new instance here. For example, if you have a property sheet that you want to update from form values, you can call it here: Now we need to return something. We do this via a redirect so that the URL is correct. Unfortunately, the way we do this depends on whether we live in a product or in a class. If we live in a product, we need to use DestinationURL to decide where to go. If we live in a class, DestinationURL won't be available, so we use URL2. qU__ac_local_roles__q }q Ulaloq ]q UOwnerq asUglobalsq}qU__name__qU AdBanner_addqU_varsq}qu._((UOFS.DTMLMethodqU DTMLMethodqtqNt.}q(UtitleqUAdBanner constructor input formqUrawqT* Add Advertising Banner

Add Advertising Banner

Id
URL
Allowed views
Image
Alt string

qU__ac_local_roles__q }q Ulaloq ]q UOwnerq asUglobalsq}qU__name__qUAdBanner_addFormqU_varsq}qu.`((U App.FactoryqUFactoryqtqNt.}q(UtitleqUAdBanner factoryqUidqUAdBanner_factoryqUinitialq UAdBanner_addFormq U object_typeq UAdvertising Bannerq U__ac_local_roles__q }qUlaloq]qUOwnerqasU permissionqUAdd Advertising Bannersqu.s((UOFS.DTMLMethodqU DTMLMethodqtqNt.}q(UtitleqUBannerFolder constructorqUrawqT Add BannerFolder We add the new object by calling the class in a with tag. Not only does this get the thing added, it adds the new thing's attributes to the DTML name space, so we can call methods to initialize the object. You can ad code that modifies the new instance here. For example, if you have a property sheet that you want to update from form values, you can call it here: Now we need to return something. We do this via a redirect so that the URL is correct. Unfortunately, the way we do this depends on whether we live in a product or in a class. If we live in a product, we need to use DestinationURL to decide where to go. If we live in a class, DestinationURL won't be available, so we use URL2. qU__ac_local_roles__q }q Ulaloq ]q UOwnerq asUglobalsq}qU__name__qUBannerFolder_addqU_varsq}qu.t((U App.FactoryqUFactoryqtqNt.}q(UtitleqUBannerFolder factoryqUidqUBannerFolder_factoryqUinitialq UBannerFolder_addFormq U object_typeq UAdvertising Banner Folderq U__ac_local_roles__q }qUlaloq]qUOwnerqasU permissionqUAdd Advertising Banner Foldersqu. (cExtensionClass ExtensionClass q(U BannerFolder_PropertySheetsClassq(cZClasses.ZClass PersistentClass qcZClasses.Property ZInstanceSheets qtq}q(UiconqUU _p_changedqKU__doc__q UBannerFolder Property Sheetsq U_p_oidq Uq U __module__q Nutqt.N.(cExtensionClass ExtensionClass q(U BannerFolderq(cZClasses.ZClass PersistentClass qcProducts.Renderable.Renderable Renderable qcZClasses.ObjectManager ObjectManager qcOFS.SimpleItem SimpleItem qtq}q(Uiconq U;Control_Panel/Products/BannerFolder/BannerFolder/ziconImageq U _p_changedq KU__doc__q U BannerFolderq U meta_typesq(}q(U permissionqUAdd Advertising BannersqUnameqUAdvertising BannerqUproductqU BannerFolderqUactionqU/manage_addProduct/BannerFolder/AdBanner_factoryqu}q(U permissionqU Add Documents, Images, and FilesqUnameqU DTML MethodqUproductqUOFSPqUactionqU manage_addProduct/OFSP/methodAddq utq!U_p_oidq"Uq#U meta_typeq$UAdvertising Banner Folderq%Upropertysheetsq&(Uq'Uq(QtQU ziconImageq)(Uq*(U OFS.Imageq+UImageq,ttQUisPrincipiaFolderishq-UYU__ac_permissions__q.)Urenderq/cZClasses.Method MW q0NRq1}q2U$_ZClassMethodPermissionMapperMethod_q3(Uq4(U"Products.PythonMethod.PythonMethodq5U PythonMethodq6ttQsbU _p_serialq7U/ /DLq8U __module__q9U*JPKBNN0kBp2JEJtHobe2wg==q:U render_oldq;h0NRq<}q=U$_ZClassMethodPermissionMapperMethod_q>(Uq?(UOFS.DTMLMethodq@U DTMLMethodqAttQsbutqBt.N.(cExtensionClass ExtensionClass q(U!BannerFolder_ZPropertySheetsClassq(cZClasses.ZClass PersistentClass qcOFS.PropertySheets PropertySheets qcZClasses.ObjectManager ZObjectManagerPropertySheets qcZClasses.ZClass ZClassSheets qcApp.PersistentExtra Persistent qtq}q (Uiconq UU _p_changedq KU__doc__q U!BannerFolder_ZPropertySheetsClassq U_p_oidqUqU __module__qNutqt.N.(UqQNt.}q(Ucommonq(Uq(UZClasses.PropertyqUZInstanceSheetsSheetqttQUmethodsq(Uq(UZClasses.Methodq UZClassMethodsSheetq ttQu.(cExtensionClass ExtensionClass q(UAdBanner_PropertySheetsClassq(cZClasses.ZClass PersistentClass qcZClasses.Property ZInstanceSheets qtq}q(UiconqUU _p_changedqKU__doc__q UAdBanner Property Sheetsq Uad_infoq (Uq (UZClasses.Propertyq UZInstanceSheetqttQU__propset_attrs__q(Uad_infoqtqU_p_oidqUqU __module__qNU _p_serialqU/w qutqt.N./(cExtensionClass ExtensionClass q(UAdBannerq(cZClasses.ZClass PersistentClass qcProducts.Renderable.Renderable Renderable qcOFS.Image Image qcOFS.SimpleItem SimpleItem qtq}q(Uiconq U7Control_Panel/Products/BannerFolder/AdBanner/ziconImageq U _p_changedq KU__doc__q UAdBannerq U__ac_permissions__q)U_p_oidqUqU alt_stringqU&Please click here to support this siteqU meta_typeqUAdvertising BannerqUhit_URLqUhttp://www.zope.org/qUpropertysheetsq(UqUqQtQUmanage_optionsq(}q(UlabelqUAdvertising InfoqUactionqUpropertysheets/ad_info/managequ}q (hUUploadq!hUmanage_uploadFormq"u}q#(hU Propertiesq$hUmanage_propertiesFormq%u}q&(hUViewq'hUview_image_or_fileq(u}q)(hUSecurityq*hU manage_accessq+utq,U ziconImageq-(Uq.(U OFS.Imageq/UImageq0ttQUhitsq1KUremaining_viewsq2KUviewsq3KUrenderq4cZClasses.Method MW q5NRq6}q7U$_ZClassMethodPermissionMapperMethod_q8(Uq9(UOFS.DTMLMethodq:U DTMLMethodq;ttQsbU _p_serialqU*/z19MlDlV7e7P0QHV0lJ5A==q?utq@t.N.K(cExtensionClass ExtensionClass q(UAdBanner_ZPropertySheetsClassq(cZClasses.ZClass PersistentClass qcOFS.PropertySheets PropertySheets qhcZClasses.ZClass ZClassSheets qcApp.PersistentExtra Persistent qtq}q(Uiconq UU _p_changedq KU__doc__q UAdBanner_ZPropertySheetsClassq U_p_oidq UqU __module__qNutqt.N.(UqQNt.}q(Ucommonq(Uq(UZClasses.PropertyqUZInstanceSheetsSheetqttQUmethodsq(Uq(UZClasses.Methodq UZClassMethodsSheetq ttQu.(UqQNt.}q.((U OFS.ImageqUImageqtqNt.}q(UsizeqKUdataqUGIF89aPPP@@@@@!Made with GIMP!,X#dI `oޢ<|vS1  ARhRQ bB?p{Mpt"!;qU__name__qU ziconImageq Utitleq UU content_typeq U image/gifq U preconditionq UUwidthqU16qUheightqU16qu.((U"Products.PythonMethod.PythonMethodqU PythonMethodqtqNt.}q(U func_codeq(cProducts.PythonMethod.PythonMethod AnObject qoq}q(U co_argcountq KU co_varnamesq (U namespaceq Ukeysq Ubannerq U bannerobjqU bannerstrqUposqU$guardqtqubU_paramsqUnamespace, **keysqUidqUrenderqU__ac_local_roles__q}qUlaloq]qUOwnerqasU_tq(UrenderqN(KKKK Tot}t}x| oti|d}|ddjo||d} |idjo  t}n> |idjo* |iii h|idd<n|o*|iii h|i dd<nn||d}qWt |}t i|d d }|d jo#|| |dd ||Sn!|SdSq(NU_objectsqU meta_typeq UAdvertising Bannerq!Uidq"KKUremaining_viewsq#Uviewsq$Uimg src=q%K KU/t(UNoneq&h Uwhrandomq'Uchoiceq(h hh#Upropertysheetsq)Uad_infoq*Umanage_changePropertiesq+h$Ustrq,hUstringq-Ufindq.hht(h h h hhhhtUq/hKU$   * .#q0tN}q1tq2U_bodyq3Tbanner = None while not banner: bannerobj = whrandom.choice (keys['_objects']) if bannerobj['meta_type'] == 'Advertising Banner': banner = keys[bannerobj['id']] if banner.remaining_views == 0: banner = None elif banner.remaining_views > 0: banner.propertysheets.ad_info.manage_changeProperties ({ 'remaining_views': banner.remaining_views - 1 }) if banner: banner.propertysheets.ad_info.manage_changeProperties ({ 'views': banner.views + 1, }) else: banner = keys[bannerobj['id']] #banner = banner + `keys` #banner = str (keys['debian_banner']) #banner = whrandom.choice (objectValues()) bannerstr = str (banner) pos = string.find (bannerstr, 'img src=') + 9 if pos > 8: return bannerstr[:pos] + keys['id'] + '/' + bannerstr[pos:] else: return bannerstrq4Uwarningsq5]q6Uerrorsq7]q8Utitleq9UU _proxy_rolesq:(UManagerq;UOwnerqNu.((UOFS.DTMLMethodqU DTMLMethodqtqNt.}q(U__ac_local_roles__q}qUlaloq]qUOwnerq asU__name__q U render_oldq Utitleq UU _proxy_rolesq (UManagerqUOwnerqtqUglobalsq}qUrawqU 8"> qU_varsq}qu.9((UZClasses.PropertyqUZInstanceSheetsSheetqtqNt.}q.((UZClasses.MethodqUZClassMethodsSheetqtqNt.}q(U_mdq}qUidqUmethodsqU_objectsq (}q (U meta_typeq U DTML Methodq Uidq U render_old qu}q(U meta_typeqU Python MethodqUidqUrender qutu.|((UZClasses.PropertyqUZInstanceSheetqtqNt.}q(U_mdq}qU_baseq(Uq(hU ZCommonSheetq ttQUidq Uad_infoq u.(UqQNt.}q.((U OFS.ImageqUImageqtqNt.}q(UsizeqKUdataqUGIF89aPPP@@@@@!Made with GIMP!,X#dI `oޢ<|vS1  ARhRQ bB?p{Mpt"!;qU__name__qU ziconImageq Utitleq UU content_typeq U image/gifq U preconditionq UUwidthqU16qUheightqU16qu.((UOFS.DTMLMethodqU DTMLMethodqtqNt.}q(U__ac_local_roles__q}qUlaloq]qUOwnerq asU__name__q Urenderq Utitleq UU _proxy_rolesq (UManagerqUOwnerqtqUglobalsq}qUrawqUJ qU_varsq}qu.((UZClasses.PropertyqUZInstanceSheetsSheetqtqNt.}q(Uad_infoq(Uq(hU ZCommonSheetqttQU_objectsq(}q (U meta_typeq UCommon Instance Property Sheetq Uidq Uad_infoq utu.((UZClasses.MethodqUZClassMethodsSheetqtqNt.}q(U_mdq}qUidqUmethodsqU_objectsq (}q (U meta_typeq U DTML Methodq hUrender q utu."((UZClasses.PropertyqU ZCommonSheetqtqNt.}q(UtitleqUU_mdq}qUidqUad_infoq U _propertiesq (}q (Umetaq }q hUremaining_viewsqUtypeqUintqu}q(h }qhUviewsqhUintqu}q(h }qhUhitsqhUintqu}q(h }qhUhit_URLqhUstringqu}q(h }qhU alt_stringqhUstringq utu.