Changeset 929 in products
- Timestamp:
- Aug 2, 2007 3:46:53 PM (17 years ago)
- Location:
- qPloneSkinDump/branches/multipleslots
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
qPloneSkinDump/branches/multipleslots/qPloneSkinDump.py
r894 r929 8 8 9 9 security = ModuleSecurityInfo( 'Products.qPloneSkinDump.qPloneSkinDump' ) 10 11 security.declarePublic('getProductsPath')12 def getProductsPath():13 return PRODUCTS_PATH14 10 15 11 security.declarePublic('getExportingData') … … 39 35 40 36 security.declarePublic('isValidProductName') 41 def isValidProductName(product_name , fs_dest_directory):37 def isValidProductName(product_name): 42 38 """ Check for product presence in installed products list""" 43 if not fs_dest_directory==PRODUCTS_PATH: 44 return (not product_name in os.listdir(fs_dest_directory)) \ 45 and isValidDirName(product_name) 46 47 return (not product_name in get_product_listdirs()) \ 48 and isValidDirName(product_name) 49 50 security.declarePublic('isValidDestinationDir') 51 def isValidDestinationDir(destination_dir): 52 """ Check for existance of destination directory.""" 53 return os.path.isdir(destination_dir) 39 return (product_name not in get_product_listdirs() \ 40 and isValidDirName(product_name)) 54 41 55 42 DIR_NAME_PATTERN = re.compile("^[a-zA-Z]+[a-zA-Z0-9_]*[a-zA-Z0-9]$") … … 62 49 security.declarePublic('createProduct') 63 50 def createProduct(context, \ 64 zmi_skin_name s=['custom',], \51 zmi_skin_name='custom', \ 65 52 zmi_base_skin_name='', \ 66 53 subdir=None,\ 67 fs_dest_directory=PRODUCTS_PATH, \68 54 fs_skin_directory='custom',\ 69 55 fs_product_name='QSkinTemplate',\ … … 78 64 exporting_objects=[], \ 79 65 dump_CSS=True, \ 80 dump_JS=True, \ 81 dump_portlets=0, \ 82 dump_policy='root', \ 83 dump_portlets_selection=[], \ 84 dump_custom_views=False): 66 dump_JS=True ): 85 67 """ Main Skin Product creating procedure.""" 86 makeNewProduct(context, fs_ dest_directory, fs_product_name, fs_skin_directory, \87 zmi_skin_name s, zmi_base_skin_name, subdir, \68 makeNewProduct(context, fs_product_name, fs_skin_directory, \ 69 zmi_skin_name, zmi_base_skin_name, subdir, \ 88 70 doesCustomizeSlots, left_slots, right_slots, slot_forming, main_column, \ 89 71 doesExportObjects, import_policy, \ 90 dump_CSS, dump_JS, dump_portlets, dump_policy, dump_portlets_selection, dump_custom_views) 91 dumpSkin(context, zmi_skin_names, fs_dest_directory, fs_product_name, erase_from_skin) 92 result = exportObjects(context, doesExportObjects, exporting_objects, fs_dest_directory, fs_product_name) 72 dump_CSS, dump_JS ) 73 dumpSkin(context, zmi_skin_name, subdir, fs_skin_directory.lower(), 74 fs_product_name, erase_from_skin) 75 result = exportObjects(context, doesExportObjects, exporting_objects, fs_product_name) 93 76 return result 94 77 -
qPloneSkinDump/branches/multipleslots/skins/qploneskindump/qploneskindump_config.cpt
r503 r929 9 9 <div metal:define-macro="main" 10 10 tal:define="errors options/state/getErrors | nothing;"> 11 12 <div metal:use-macro="here/global_statusmessage/macros/portal_message"> 13 Portal status message 11 <h1 class="QSDFirstHeading"> 12 <img tal:replace="structure here/product_icon.gif" /> 13 <span tal:replace="here/title_or_id">Title or id</span> 14 </h1> 15 16 <div metal:use-macro="here/document_actions/macros/document_actions"> 17 Document actions (print, sendto etc) 14 18 </div> 15 16 <h1 class="documentFirstHeading"17 i18n:translate="heading_addremove_products">Skin Dump</h1>18 19 19 20 <a href="" 20 21 class="link-parent" 21 tal:attributes="href string: $portal_url/plone_control_panel" 22 i18n:translate="label_up_to_plone_setup"> 23 Up to Site Setup 22 i18n:translate="label_up_to_product_page" 23 tal:define="parent_url python:here.navigationParent(here, template.getId())" 24 tal:condition="parent_url" 25 tal:attributes="href parent_url"> 26 Up to Product page 24 27 </a> 25 28 26 <p class="documentDescription" 27 i18n:translate="description_addremove_products"> 28 This is a form for dumping your zmi skin to filesystem based product. 29 </p> 30 31 <p class="discreet" i18n:translate="description_product_location"> 32 Navigate through all form tabs to set needed configuration for dump. 33 </p> 34 29 <h2 i18n:translate="heading_portalactions_lists"> 30 qPloneSkinDump input FORM 31 </h2> 35 32 <form name="edit_form" 36 33 action="href" 37 34 method="post" 38 class="enableFormTabbing"39 35 enctype="multipart/form-data" 40 36 tal:attributes="action string:$here_url/$template_id"> 41 42 <fieldset id="fieldset-product" 43 tal:define="error_fsSkinDir python:errors.get('FSSkinDirectory'); 44 error_fsProdName python:errors.get('FSProductName'); 45 error_fsDestinationDir python:errors.get('FSDestinationDirectory');"> 46 <legend id="fieldsetlegend-product"> 47 <label style="font-size: 110%" i18n:translate="label_product">Product</label> 37 <fieldset tal:define="error_zmiSN python:errors.get('ZMISkinName'); 38 error_zmiBSN python:errors.get('ZMIBaseSkinName')"> 39 <legend> 40 <label style="font-size: 110%" i18n:translate="legend_ZMI"> ZMI:</label> 48 41 </legend> 49 < p />50 <div class="FSProductName"51 tal:attributes="class python: test(error_fsProdName, 'FSProductName error', 'FSProductName');">52 <label class=" FSProductName_title"53 i18n:translate="label_FSProductName">Product name</label>42 <div class="ZMISkinName" 43 tal:attributes="class python: test(error_zmiSN, 'ZMISkinName error', 'ZMISkinName');"> 44 <!-- folder in ZMI .../portal_skins, from which will be copyed content --> 45 <label class="ZMISkinName_title" 46 i18n:translate="label_ZMISkinName">Source ZMI skin folder</label> 54 47 <span class="fieldRequired" 55 48 title="Required" 56 49 i18n:translate="label_required" 57 i18n:attributes="title title_required;">(Required)</span> 58 <div i18n:translate="help_FSProductName" 59 class="formHelp"> 60 Name for dumped product. This name should be unique in Destination directory. The name must begin with alphabetical character, following with an alphanumeric combination, also underscore accepts, but not on boundaries. 61 </div> 62 <div tal:condition="error_fsProdName" 63 tal:content="error_fsProdName" i18n:translate="">Validation Error</div> 64 65 <input class="FSProductName_input" 66 type="text" 67 name="FSProductName" 68 value="qPloneSkinTemplate" 69 size="50" 70 tal:attributes="value request/FSProductName|nothing" /> 71 </div> 72 <p /> 73 <div class="FSSkinDirectory" 74 tal:attributes="class python: test(error_fsSkinDir, 'FSSkinDirectory error', 'FSSkinDirectory');"> 75 <label class="FSSkinDirectory_title" 76 i18n:translate="label_FSSkinDirectory">Skin name</label> 77 <span class="fieldRequired" 78 title="Required" 79 i18n:translate="label_required" 80 i18n:attributes="title title_required;">(Required)</span> 81 <div i18n:translate="help_FSSkinDirectory" 82 class="formHelp"> 83 Skin name in dumped product. The name must begin with alphabetical character, following with an alphanumeric combination, also underscore accepts, but not on boundaries. 84 </div> 85 <div tal:condition="error_fsSkinDir" 86 tal:content="error_fsSkinDir" i18n:translate="">Validation Error</div> 87 88 <input class="FSSkinDirectory_input" 89 type="text" 90 name="FSSkinDirectory" 91 value="" 92 size="50" 93 tal:attributes="value request/FSSkinDirectory|nothing" /> 94 </div> 95 <p /> 96 <div class="FSDestinationDirectory" 97 tal:define="destinationDir python:modules['Products.qPloneSkinDump.qPloneSkinDump'].getProductsPath();" 98 tal:attributes="class python: test(error_fsDestinationDir, 'FSDestinationDirectory error', 'FSDestinationDirectory');"> 99 <label class="FSDestinationDirectory_title" 100 i18n:translate="label_FSDestinationDirectory">Destination directory</label> 101 <span class="fieldRequired" 102 title="Required" 103 i18n:translate="label_required" 104 i18n:attributes="title title_required;">(Required)</span> 105 <div i18n:translate="help_FSDestinationDirectory" 106 class="formHelp"> 107 Absolute path to directory, where SkinProduct will be created. 108 </div> 109 <div tal:condition="error_fsDestinationDir" 110 tal:content="error_fsDestinationDir" i18n:translate="">Validation Error</div> 111 112 <input class="FSDestinationDirectory_input" 113 type="text" 114 name="FSDestinationDirectory" 115 value="" 116 size="50" 117 tal:attributes="value request/FSDestinationDirectory|destinationDir" /> 118 </div> 119 </fieldset> 120 121 <fieldset id="fieldset-zmi" 122 tal:define="error_zmiSN python:errors.get('ZMISkinName'); 123 error_zmiBSN python:errors.get('ZMIBaseSkinName')"> 124 <legend id="fieldsetlegend-zmi"> 125 <label style="font-size: 110%" i18n:translate="legend_ZMI">Skin</label> 126 </legend> 127 <p /> 50 i18n:attributes="title title_required;"> 51 (Required) 52 </span> 53 <div i18n:translate="help_ZMISkinName" 54 class="formHelp"> 55 Select folder from portal_skins, which content should by copyed to FS product. 56 </div> 57 <div tal:condition="error_zmiSN" 58 tal:content="error_zmiSN" i18n:translate="">Validation Error</div> 59 60 <select class="ZMISkinName_input" id="ZMISkinName" 61 size="1" name="ZMISkinName" 62 tal:define="value request/ZMISkinName|string:custom; 63 p_skins_ids python:portal.portal_skins.objectIds(spec='Folder')" 64 tal:attributes="value value; 65 tabindex tabindex/next;"> 66 <option selected="" 67 value="#" 68 tal:repeat="ps_folder p_skins_ids" 69 tal:attributes="value nocall:ps_folder; 70 selected python:test(ps_folder==value, 'selected', None);" 71 tal:content="ps_folder"/> 72 73 </select> 74 </div> 75 <p/> 128 76 <div class="ZMIBaseSkinName" 129 77 tal:attributes="class python: test(error_zmiBSN, 'ZMIBaseSkinName error', 'ZMIBaseSkinName');"> 130 78 <!-- base for building layers list --> 131 79 <label class="ZMIBaseSkinName_title" 132 i18n:translate="label_ZMIBaseSkinName"> Skin selection</label>80 i18n:translate="label_ZMIBaseSkinName">ZMI base skin name</label> 133 81 <span class="fieldRequired" 134 82 title="Required" 135 83 i18n:translate="label_required" 136 i18n:attributes="title title_required;">(Required)</span> 84 i18n:attributes="title title_required;"> 85 (Required) 86 </span> 137 87 <div i18n:translate="help_ZMIBaseSkinName" 138 88 class="formHelp"> 139 Select skin selection from portal_skins, which layers list will be used for creating new skin.89 Select Skin name, which layers list will be used for creating new skin. 140 90 </div> 141 91 <div tal:condition="error_zmiBSN" … … 144 94 <select tal:define="value request/ZMIBaseSkinName|string:Plone Tableless; 145 95 skin_names portal/portal_skins/getSkinSelections" 146 tal:attributes="name string:ZMIBaseSkinName; 96 tal:attributes="value value; 97 name string:ZMIBaseSkinName; 147 98 id string:ZMIBaseSkinName; 148 99 size string:1; … … 154 105 selected python:test(skin_name==value, 'selected', None);" 155 106 tal:content="skin_name"/> 107 156 108 </select> 157 109 </div> 158 <p /> 159 <div class="ZMISkinName" 160 tal:attributes="class python: test(error_zmiSN, 'ZMISkinName error', 'ZMISkinName');"> 161 <!-- folder in ZMI .../portal_skins, from which will be copyed content --> 162 <label class="ZMISkinName_title" 163 i18n:translate="label_ZMISkinName">Skin folders</label> 110 <p/> 111 <div class="EraseFromSkin"> 112 <!-- erase content of folder in ZMI .../portal_skins after copying --> 113 <div i18n:translate="help_Erase" 114 class="formHelp"> 115 Select for erase content of skin's source folder. 116 </div> 117 118 <input class="EraseFromSkin_input" 119 type="checkbox" 120 name="EraseFromSkin" 121 value="0" 122 tal:attributes="checked python:test(request.has_key('EraseFromSkin'), 'checked', nothing)" 123 /> 124 <label class="EraseFromSkin_title" 125 i18n:translate="label_Erace">Erase </label> 126 </div> 127 <p/> 128 <!--Next is checkbox to select generating main_template.pt 129 <div class="GenerateTemplate" 130 tal:define="isAvailable python:modules['Products.qPloneSkinDump.generatingTemplate'].available(here)"> 131 <div i18n:translate="help_Generate" 132 class="formHelp"> 133 Select next for generating "main_template.pt" from qMultipleSlots plone site properties. 134 <p tal:condition="not:isAvailable"> 135 <b>Not available! qMultipleSlots product isn't installed.</b> 136 </p> 137 </div> 138 139 <input class="GenerateTemplate_input" 140 type="checkbox" 141 name="GenerateTemplate" 142 value="0" 143 tal:attributes="checked python:request.get('GenerateTemplate', isAvailable and 'checked'); 144 disabled python:test(isAvailable, nothing, 'disabled')"/> 145 146 <label class="GenerateTemplate_title" 147 i18n:translate="label_Generate">Generate</label> 148 </div> 149 --> 150 151 <a href="" 152 tal:attributes="href string:${portal_url}/qploneskindump_generate" 153 tal:condition="python:modules['Products.qPloneSkinDump.generatingTemplate'].available(here)"> 154 Want to generate main template? 155 </a> 156 </fieldset> 157 158 <fieldset tal:define="error_fsSkinDir python:errors.get('FSSkinDirectory'); 159 error_fsProdName python:errors.get('FSProductName')"> 160 <legend> 161 <label style="font-size: 110%" i18n:translate="label_FS"> File system:</label> 162 </legend> 163 <div class="FSSkinDirectory" 164 tal:attributes="class python: test(error_fsSkinDir, 'FSSkinDirectory error', 'FSSkinDirectory');"> 165 <label class="FSSkinDirectory_title" 166 i18n:translate="label_FSSkinDirectory">Skin's name for new product</label> 164 167 <span class="fieldRequired" 165 168 title="Required" 166 169 i18n:translate="label_required" 167 i18n:attributes="title title_required;">(Required)</span> 168 <div i18n:translate="help_ZMISkinName" 169 class="formHelp"> 170 Select folders from portal_skins, which should be dumped to FS product's skins folder. 171 </div> 172 <div tal:condition="error_zmiSN" 173 tal:content="error_zmiSN" i18n:translate="">Validation Error</div> 174 175 <select class="ZMISkinName_input" id="ZMISkinName" 176 size="5" name="ZMISkinName" multiple="1" 177 tal:define="value request/ZMISkinName|string:custom; 178 p_skins_ids python:portal.portal_skins.objectIds(spec='Folder')" 179 tal:attributes="tabindex tabindex/next;"> 180 <option selected="" 181 value="#" 182 tal:repeat="ps_folder p_skins_ids" 183 tal:attributes="value nocall:ps_folder; 184 selected python:test(ps_folder==value, 'selected', None);" 185 tal:content="ps_folder"/> 186 </select> 187 </div> 188 <p /> 189 <div class="EraseFromSkin"> 190 <!-- erase content of folder in ZMI .../portal_skins after copying --> 191 <input class="EraseFromSkin_input" 192 type="checkbox" 193 name="EraseFromSkin" 194 id="EraseFromSkin" 195 value="0" 196 tal:attributes="checked python:test(request.has_key('EraseFromSkin'), 'checked', nothing)" 197 /> 198 <label class="EraseFromSkin_title" for="EraseFromSkin" 199 i18n:translate="label_Erase">Erase folders from portal_skins after dump</label> 170 i18n:attributes="title title_required;"> 171 (Required) 172 </span> 173 <div i18n:translate="help_FSSkinDirectory" 174 class="formHelp"> 175 Input skin's name for new prodct. <br/> 176 This name in lower case will be used as skin's folder name and as layer name too.<br/> 177 The name must begin with alphabetical character, following with an alphanumeric combination, also underscore accepts, but not on boundaries.<br/> 178 </div> 179 <div tal:condition="error_fsSkinDir" 180 tal:content="error_fsSkinDir" i18n:translate="">Validation Error</div> 181 182 <input class="FSSkinDirectory_input" 183 type="text" 184 name="FSSkinDirectory" 185 value="" 186 size="50" 187 tal:attributes="value request/FSSkinDirectory|nothing" /> 188 </div> 189 <p/> 190 <div class="FSProductName" 191 tal:attributes="class python: test(error_fsProdName, 'FSProductName error', 'FSProductName');"> 192 <label class="FSProductName_title" 193 i18n:translate="label_FSProductName">Product name</label> 194 <span class="fieldRequired" 195 title="Required" 196 i18n:translate="label_required" 197 i18n:attributes="title title_required;"> 198 (Required) 199 </span> 200 <div i18n:translate="help_FSProductName" 201 class="formHelp"> 202 Input name of new product. <br/> 203 This name can't be identical with other, presenting in your Products directory of Plone's instance. <br/> 204 The name must begin with alphabetical character, following with an alphanumeric combination, also underscore accepts, but not on boundaries. 205 </div> 206 <div tal:condition="error_fsProdName" 207 tal:content="error_fsProdName" i18n:translate="">Validation Error</div> 208 209 <input class="FSProductName_input" 210 type="text" 211 name="FSProductName" 212 value="qPloneSkinTemplate" 213 size="50" 214 tal:attributes="value request/FSProductName|nothing" /> 200 215 </div> 201 216 </fieldset> 202 217 203 <fieldset id="fieldset-portlets"> 204 <legend id="fieldsetlegend-portlets" class="DoesCustomizeSlots"> 205 <label style="font-size: 110%" i18n:translate="label_portlets">Portlets</label> 218 <fieldset> 219 <legend class="DoesCustomizeSlots"> 220 <input class="noborder" 221 type="checkbox" 222 name="DoesCustomizeSlots" 223 id="DoesCustomizeSlots" 224 value="DOCustomizeSlots" 225 tal:attributes="checked python:test(request.has_key('DoesCustomizeSlots'),'checked', nothing)"/> 226 <label for="DoesCustomizeSlots" 227 style="font-size: 110%" 228 i18n:translate="label_Slots">Customize portal slots in new product</label> 206 229 </legend> 207 <p /> 208 <div class="customize-portlets"> 209 <input class="noborder" 210 type="checkbox" 211 name="dump_portlets" 212 id="DoesCustomizeSlots" 213 value="0" 214 tal:attributes="checked request/dump_portlets|nothing" /> 215 <label for="DoesCustomizeSlots" 216 i18n:translate="label_dump_portlets">Dump Portlets</label> 217 </div> 230 <div class="formHelp" 231 i18n:translate="help_DoesCustomizeSlots"> 232 Customization portal slots in New Skin Product. 233 </div> 234 218 235 <p/> 219 236 <div class="SlotsCustomizing"> 220 237 <label class="SlotsCustomizing_title" 221 i18n:translate="label_ dump_policy">Dump Policy</label>238 i18n:translate="label_SlotsCustomizing">Portal slots</label> 222 239 223 240 <div i18n:translate="help_SlotsCustomizing" 224 241 class="formHelp"> 225 226 </div> 227 242 BE VERY ACCURACY! 243 Leave in the left and right slot lists only those portlets, which relate <br/> 244 to your skin product and either bring with new product or is standard for Plone. 245 </div> 246 <div class="LeftSlotsCustomizing_title"> 247 <label class="LeftSlotsCustomizing_title" 248 i18n:translate="label_LeftsSlotCustomizing">Left portal slots customizing</label> 249 <textarea class="LeftSlotsCustomizing_lines" 250 rows="6" 251 cols="35" 252 name="left_slots:lines" 253 value="" 254 tal:define="value python:'\n'.join(request.get('left_slots', portal.left_slots))" 255 tal:attributes="value value" 256 tal:content="value" ></textarea> 257 </div> 258 <p/> 259 <div class="RightSlotsCustomizing_title"> 260 <label class="RightSlotsCustomizing_title" 261 i18n:translate="label_RightSlotsCustomizing">Right portal slots customizing</label> 262 <textarea class="RightSlotsCustomizing_lines" 263 rows="6" 264 cols="35" 265 name="right_slots:lines" 266 value="" 267 tal:define="value python:'\n'.join(request.get('right_slots', portal.right_slots))" 268 tal:attributes="value value" 269 tal:content="value"></textarea> 270 </div> 271 272 </div> 273 <p/> 274 <div class="ColumnSlotsForming" 275 tal:define="formers python:modules['Products.qPloneSkinDump.qPloneSkinDump'].getSlotsFormingList(); 276 value request/slot_forming|formers/default"> 277 <label i18n:translate="label_ColumnSlotsForming">Slot's list forming</label> 278 <div i18n:translate="help_ColumnSlotsForming" 279 class="formHelp"> 280 Choose procedure of forming slots lists.<br/> 281 Blend with skin - to SKIN PRODUCT's slots list added unknown slots from SITE.<br/> 282 Blend with site - to SITE's slots list added unknown slots from SKIN PRODUCT.<br/> 283 Replace - in left and right site's columns placed ONLY SKIN PRODUCT's slots. 284 </div> 285 <tal:loop tal:omit-tag="" 286 tal:repeat="former formers/data"> 287 <div> 288 <input type="radio" 289 name="slot_forming" 290 value="#" 291 tal:attributes="value python:former[0]; 292 checked python:test(former[0]==value,'checked', nothing)" /> 293 <label class="ColumnSlotsForming_title" 294 i18n:translate="" 295 tal:content="python:former[1]"></label> 296 </div> 297 </tal:loop> 298 </div> 299 <p/> 300 <div class="FavourColumn" 301 tal:define="favour_columns python:modules['Products.qPloneSkinDump.qPloneSkinDump'].getMainColumnList(); 302 value request/main_column|favour_columns/default"> 303 <label i18n:translate="label_FavourColumn">Main column</label> 304 <div i18n:translate="help_FavourColumn" 305 class="formHelp"> 306 Choose favour column for slots forming procedure. IMPORTANT only for 'Blend with...' formers.<br/> 307 Left/Right - if find same slots in left and right columns - than slots move accordingly to left/right column.<br/> 308 Both - if find same slots in left and right columns - than slots positionings as in Master's slots lists 309 (from SKIN PRODUCT's slots for 'Blend with skin' procedure and SITE's slots for 'Blend with site'). 310 </div> 311 <tal:loop tal:omit-tag="" 312 tal:repeat="favour favour_columns/data"> 313 <div> 314 <input type="radio" 315 name="main_column" 316 value="#" 317 tal:attributes="value python:favour[0]; 318 checked python:test(favour[0]==value,'checked', nothing)" /> 319 <label class="FavourColumn_title" 320 i18n:translate="" 321 tal:content="python:favour[1]"></label> 322 </div> 323 </tal:loop> 324 </div> 325 326 </fieldset> 327 328 <fieldset tal:define="exp_data python:modules['Products.qPloneSkinDump.qPloneSkinDump'].getExportingData(here);"> 329 <legend class="DoesExportObjects"> 228 330 <input class="noborder" 229 type="radio"230 name="dump_policy"231 value="root"232 id="root_dump_policy"233 onclick="javascript:document.getElementById('selection_widget').style.display='none';"234 tal:attributes="checked python:request.get('dump_policy', 'root') == 'root';" />235 <label for="root_dump_policy"236 i18n:translate="label_root_dump_policy">237 Dump portlets only for portal root238 </label>239 <br />240 241 <input class="noborder"242 type="radio"243 name="dump_policy"244 value="all"245 id="all_dump_policy"246 onclick="javascript:document.getElementById('selection_widget').style.display='none';"247 tal:attributes="checked python:request.get('dump_policy', 'root') == 'all';" />248 <label for="all_dump_policy"249 i18n:translate="label_all_dump_policy">250 Dump portlets for the whole site content251 </label>252 <br />253 254 <input class="noborder"255 type="radio"256 name="dump_policy"257 value="selection"258 id="selection_dump_policy"259 onclick="javascript:document.getElementById('selection_widget').style.display='';"260 tal:attributes="checked python:request.get('dump_policy', 'root') == 'selection';" />261 <label for="selection_dump_policy"262 i18n:translate="label_selection_dump_policy">263 Dump portlets only for selected content objects264 </label>265 <div id="selection_widget" style="display:none;"266 tal:define="friendly_types here/@@plone_portal_state/friendly_types;267 options python:here.portal_catalog(portal_types=friendly_types)">268 <select name="dump_objects" multiple="1" size="7">269 <option value="root_path"270 tal:content="string:[portal root]"271 tal:attributes="value string:" />272 <tal:options repeat="option options">273 <option value="object_path"274 tal:define="ppath python:'/'.join(option.getPath().split('/')[2:])"275 tal:content="ppath"276 tal:attributes="value ppath" />277 </tal:options>278 </select>279 </div>280 </div>281 </fieldset>282 283 <fieldset id="fieldset-zexp"284 tal:define="exp_data python:modules['Products.qPloneSkinDump.qPloneSkinDump'].getExportingData(here);">285 <legend id="fieldsetlegend-zexp" class="DoesExportObjects">286 <label style="font-size: 110%" i18n:translate="label_portlets">Objects Export</label>287 </legend>288 <p />289 <div class="objects-export">290 <input class="noborder"291 331 type="checkbox" 292 332 name="DoesExportObjects" 293 id="DoesExportObjects" 333 id="DoesExportObjects" 294 334 value="DoesExportObjects" 295 335 tal:attributes="checked python:test(request.has_key('DoesExportObjects'), 'checked', nothing)" /> 296 336 <label for="DoesExportObjects" 297 337 style="font-size: 110%" 298 i18n:translate="label_DoesExportObjects">Dump Objects</label> 299 <div class="formHelp" 300 i18n:translate="help_DoesExportObjects"> 301 Selected below objects will be exported to New Skin Product. Then on installation generated Skin Product 302 they will be imported to portal root, based on choosed policy. 303 </div> 304 </div> 338 i18n:translate="label_DoesExportObjects">Exporting objects from portal root</label> 339 </legend> 340 <div class="formHelp" 341 i18n:translate="help_DoesExportObjects"> 342 Selected below objects will be exported to New Skin Product. Then on installation generated Skin Product 343 they will be imported to portal root, based on choosed policy. 344 </div> 345 305 346 <p/> 306 347 <div class="ImportPolicy" … … 357 398 </fieldset> 358 399 359 <fieldset id="fieldset-resources" 360 tal:define="isFirst python:not request.get('dump_registries', None); 361 checked_css python:test(isFirst, 'checked', test(request.has_key('DumpCSSRegistry'), 'checked', None)); 362 checked_js python:test(isFirst, 'checked', test(request.has_key('DumpJSRegistry'), 'checked', None));"> 363 <legend id="fieldsetlegend-resources" class="DoesExportResources"> 400 <fieldset tal:define="isFirst python:not request.get('dump_registries', None); 401 checked_css python:test(isFirst, 'checked', test(request.has_key('DumpCSSRegistry'), 'checked', nothing)); 402 checked_js python:test(isFirst, 'checked', test(request.has_key('DumpJSRegistry'), 'checked', nothing));"> 403 <legend class="DoesExportResources"> 364 404 <label for="DoesExportResources" 365 405 style="font-size: 110%" 366 i18n:translate="label_DoesExportResources"> Resources</label>406 i18n:translate="label_DoesExportResources">Exporting portal resources</label> 367 407 </legend> 368 <p />369 408 <div class="formHelp" 370 409 i18n:translate="help_DoesExportResources"> … … 381 420 type="checkbox" 382 421 name="DumpCSSRegistry" 383 id="DumpCSSRegistry"384 422 value="0" 385 423 tal:attributes="checked checked_css" 386 424 /> 387 <label class="DumpCSSRegistry_title" for="DumpCSSRegistry"425 <label class="DumpCSSRegistry_title" 388 426 i18n:translate="label_DumpCSSRegistry">Dump portal_css registry.</label> 389 427 </div> … … 394 432 type="checkbox" 395 433 name="DumpJSRegistry" 396 id="DumpJSRegistry"397 434 value="0" 398 435 tal:attributes="checked checked_js" 399 436 /> 400 <label class="DumpJSRegistry_title" for="DumpJSRegistry"437 <label class="DumpJSRegistry_title" 401 438 i18n:translate="label_DumpJSRegistry">Dump portal_javascripts registry.</label> 402 439 </div> 403 440 <p/> 404 </fieldset>405 406 <!-- dump views -->407 <fieldset id="fieldset-views"408 tal:define="error_zmiSN python:errors.get('ZMISkinName');409 error_zmiBSN python:errors.get('ZMIBaseSkinName')">410 <legend id="fieldsetlegend-views">411 <label style="font-size: 110%" i18n:translate="legend_viewlets">Views</label>412 </legend>413 <p />414 <div class="dump-viewlets-field">415 <div i18n:translate="help_dumpviewlets"416 class="formHelp">417 Check this field for dumping all customized objects in portal_view_customization tool.418 </div>419 420 <input class="dumpviewlets-input"421 type="checkbox"422 name="dump_viewlets"423 id="dump_viewlets"424 value="1"425 tal:attributes="checked python:test(request.has_key('dump_viewlets'), 'checked', nothing)"426 />427 <label class="dumpviewlets-title" for="dump_viewlets"428 i18n:translate="label_dumpviewlets">Dump views, viewlets and portlets</label>429 </div>430 441 </fieldset> 431 442 -
qPloneSkinDump/branches/multipleslots/skins/qploneskindump/qploneskindump_config_script.cpy
r503 r929 12 12 #from Products.CMFCore.utils import getToolByName 13 13 from Products.qPloneSkinDump.qPloneSkinDump import createProduct 14 from Products.CMFPlone import PloneMessageFactory as _15 14 16 15 REQUEST = context.REQUEST 17 16 # ZMI data 18 zmi_skin_name s= REQUEST.get('ZMISkinName')17 zmi_skin_name = REQUEST.get('ZMISkinName') 19 18 zmi_base_skin_name = REQUEST.get('ZMIBaseSkinName') 20 19 21 20 # File system data 22 fs_dest_directory = REQUEST.get("FSDestinationDirectory")23 21 fs_skin_directory = REQUEST.get('FSSkinDirectory') 24 22 fs_product_name = REQUEST.get('FSProductName') … … 39 37 right_slots = [i for i in right_slots if i] 40 38 41 # Exporting portlets42 dump_portlets = REQUEST.get('dump_portlets', 0)43 dump_policy = REQUEST.get('dump_policy', 'root')44 dump_portlets_selection = REQUEST.get('dump_objects', [])45 46 39 # Exporting objects 47 40 import_policy = exporting_objects = None … … 57 50 dump_JS = REQUEST.get('DumpJSRegistry') 58 51 59 dump_custom_views = REQUEST.get('dump_viewlets', None)60 61 52 # create Product 62 result = createProduct(context, zmi_skin_name s=zmi_skin_names,\53 result = createProduct(context, zmi_skin_name=zmi_skin_name,\ 63 54 zmi_base_skin_name=zmi_base_skin_name,\ 64 fs_dest_directory=fs_dest_directory, \65 55 fs_skin_directory=fs_skin_directory,\ 66 56 fs_product_name=fs_product_name,\ … … 75 65 exporting_objects=exporting_objects, \ 76 66 dump_CSS=dump_CSS, \ 77 dump_JS=dump_JS, \ 78 dump_portlets=dump_portlets, \ 79 dump_policy=dump_policy, \ 80 dump_portlets_selection=dump_portlets_selection, \ 81 dump_custom_views=dump_custom_views ) 67 dump_JS=dump_JS ) 82 68 83 portal_status_message = u'"%s" Product successfully created.' % fs_product_name69 portal_status_message='"%s" Product successfully created.' % fs_product_name 84 70 if result: 85 portal_status_message = portal_status_message + u"Failed exporting objects: %s." % str(result)71 portal_status_message = portal_status_message + "Failed exporting objects: %s." % str(fail) 86 72 87 context.plone_utils.addPortalMessage(_(portal_status_message)) 88 return state 73 return state.set(portal_status_message=portal_status_message)
Note: See TracChangeset
for help on using the changeset viewer.