🌍
English
This shows you the differences between two versions of the page.
dev:changes_in_2.6 [2013/10/10 11:18] mistic100 Unified Batch Manager URL |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Technical changes in Piwigo 2.6 ====== | ||
- | ===== Jquery UI 1.9 ===== | ||
- | Jquery ui effects filename have changed. For example change | ||
- | <file>footer|combine_script require='jquery.effects.blind'</file> | ||
- | to | ||
- | <file>footer|combine_script require='jquery.ui.effect-blind'</file> | ||
- | We had backward naming compatibility for 2.5 but not for 2.6. | ||
- | |||
- | ===== jGrowl CSS file ===== | ||
- | the file //admin/themes/default/uplodify.jgrowl.css// was moved to //themes/default/js/plugins/jquery.jgrowl.css// | ||
- | |||
- | use this line to include the file in your template : | ||
- | <code>{combine_css path="themes/default/js/plugins/jquery.jgrowl.css"}</code> | ||
- | no changes for the javascript file | ||
- | |||
- | |||
- | ===== Add action buttons ===== | ||
- | Following http://piwigo.org/doc/doku.php?id=dev:changes_in_2.5#add_action_buttons\\ | ||
- | |||
- | Themes have to handle two new template vars : //$PLUGIN_INDEX_BUTTONS// and //$PLUGIN_PICTURE_BUTTONS//\\ | ||
- | Plugins creators SHOULD NOT add <li> or <div> or <span> around their buttons, it's now handled by the theme. | ||
- | |||
- | Default implementation is | ||
- | <code>{if !empty($PLUGIN_INDEX_BUTTONS)}{foreach from=$PLUGIN_INDEX_BUTTONS item=button}<li>{$button}</li>{/foreach}{/if}</code> | ||
- | in index.tpl and | ||
- | <code>{if isset($PLUGIN_PICTURE_BUTTONS)}{foreach from=$PLUGIN_PICTURE_BUTTONS item=button}{$button}{/foreach}{/if}</code> | ||
- | in picture.tpl | ||
- | |||
- | ===== TokenInput CSS + config ===== | ||
- | TokenInput CSS was moved from //admin/themes/default/style.css// to //themes/default/js/plugins/jquery.tokeninput.css//. Needs to be explicitly imported with <code>{combine_css path="themes/default/js/plugins/jquery.tokeninput.css"}</code> | ||
- | **allowCreation** parameter was renamed into **allowFreeTagging** | ||
- | |||
- | ===== SwitchBox ===== | ||
- | SwitchBox are used for derivatives choices, sort options, LanguageSwitch, ThemeSwitch, etc.\\ | ||
- | Now the JS code is factorized in a function available in //themes/default/js/switchbox.js//\\ | ||
- | Usage : | ||
- | <code>{combine_script id='core.switchbox' load='async' require='jquery' path='themes/default/js/switchbox.js'} | ||
- | {footer_script require='core.switchbox'}(SwitchBox=window.SwitchBox||[]).push("#sortOrderLink", "#sortOrderBox");{/footer_script}</code> | ||
- | |||
- | The CSS is still provided by themes. | ||
- | |||
- | ===== Smarty 3 ===== | ||
- | |||
- | In template/menubar_categories.tpl, replace: | ||
- | <code>{'</ul></li>'|@str_repeat:$ref_level-$cat.LEVEL}</code> | ||
- | by | ||
- | <code>{'</ul></li>'|@str_repeat:($ref_level-$cat.LEVEL)}</code> | ||
- | |||
- | Added a function **translate_dec**, replace: | ||
- | <code>{$pwg->l10n_dec('singular string', 'plural string', $value)}</code> | ||
- | by | ||
- | <code>{$value|@translate_dec:'singular string':'plural string'}</code> | ||
- | |||
- | ===== Generic template for custom pages ===== | ||
- | Many plugins add a new public page to Piwigo. Lacking of a documented way to do it, everybody was using his own method, causing display issues with some themes. | ||
- | |||
- | In Piwigo 2.6 we introduced a simple way to do it. | ||
- | |||
- | === For plugins developpers === | ||
- | First define in **loc_end_section_init** trigger : | ||
- | <code>$page['body_id'] = 'whatever_you_want'; | ||
- | $page['is_external'] = true;</code> | ||
- | |||
- | Then when you want to display the content of your page : | ||
- | <code> | ||
- | $template->set_filename('your_page', realpath(path to your template)); | ||
- | $template->assign_var_from_handle('CONTENT', 'your_page');</code> | ||
- | |||
- | Check Skeleton plugin for complete example http://piwigo.org/svn/extensions/skeleton/trunk/include/public_events.inc.php | ||
- | |||
- | === For themes developpers === | ||
- | There a little modification of **index.tpl** : you need to add | ||
- | <code>{if !empty($CONTENT)}{$CONTENT}{/if}</code> | ||
- | in the main block of the page. | ||
- | |||
- | ===== Unified Batch Manager URL ===== | ||
- | **admin.php?page=batch_manager** could be accessed with four URL parameters :\\ | ||
- | &cat=caddie\\ | ||
- | &cat=recent\\ | ||
- | &cat=###\\ | ||
- | &tag=### | ||
- | |||
- | This has been replaced by a single parameter **filter** :\\ | ||
- | &filter=prefilter-caddie\\ | ||
- | &filter=prefilter-last_import\\ | ||
- | &filter=album-##\\ | ||
- | &filter=tag-## | ||
- | |||
- | Now any prefilter (build-in or added by a plugin) can be accessed via this URL parameter. Build-in prefilters are : | ||
- | caddie, favorites, last_import, no_album, no_tag, duplicates, all_photos, no_virtual_album. |