'."\n". "//\n". '' ; buffer::str('

'.__('Pagination').'

'); // Traitement des modifications de la configuration if (isset($_POST['submit'])) { $my_config = array(); // Activation de la pagination $my_config['dc_pagination_active'] = !(empty($_POST['active'])); // Modes à intercepter $intercepted_modes = array(); foreach (array('home','cat','year','month','day','search') as $key) { if (!empty($_POST[$key])) { $intercepted_modes[$key] = true; } } $my_config['dc_pagination_modes'] = implode(';',array_keys($intercepted_modes)); // Options avancées (0.1.4+) // Nombre de billets par page $pg_pagesize = (integer)$_POST['posts_per_page']; if ($pg_pagesize <= 0) { $pg_pagesize = dc_nb_post_per_page; } $my_config['dc_pagination_pagesize'] = $pg_pagesize; // Nombre de pages par groupe $pg_groupsize = (integer)$_POST['pages_per_group']; if ($pg_groupsize <= 0) { $pg_groupsize = 5; } $my_config['dc_pagination_groupsize'] = $pg_groupsize; // Activation du mode étendu $my_config['dc_pagination_external'] = isset($_POST['external']); // Ecriture de la nouvelle configuration if (installer::savePluginConfig($my_name,$my_config)) { $res = __('New configuration saved.'); } else { $res = __('Unable to save configuration'); } } // Vérification de l'installation et récupération de la configuration else { if (($err = installer::checkPluginShareDir($my_name))) { buffer::str( '

'. sprintf(__('Unavailable %s/ directory in share/. You may create it manually.'),$my_name). '

'. '
' ); } $my_config = installer::loadPluginConfig($my_name); if (!$my_config) { $my_config = array('dc_pagination_active' => 0, 'dc_pagination_modes' => ''); } $intercepted_modes = array(); if ($my_config['dc_pagination_modes'] != '') { foreach (explode(';',$my_config['dc_pagination_modes']) as $key) { $intercepted_modes[$key] = true; } } } // Affichage d'un message d'erreur ou d'état si défini. if (!empty($res)) { buffer::str('

'.$res.'

'); } // Affichage du formulaire de modification des paramètres de configuration buffer::str( '

'.__('Configuration').'

'. '
'. '
'. ''.__('Plugin activation').''. '

'. ''. form::checkbox('active', 1, !empty($my_config['dc_pagination_active'])?'checked':'','','active'). '

'. '
'. '
'. ''.__('Mode(s) to intercept').''. '

'. ''. form::checkbox('home', 1, !empty($intercepted_modes['home'])?'checked':'','','home'). '

'. '

'. ''. form::checkbox('cat', 1, !empty($intercepted_modes['cat'])?'checked':'','','cat'). '

'. '

'. ''. form::checkbox('month', 1, !empty($intercepted_modes['month'])?'checked':'','','month'). '

'. '

'. ''. form::checkbox('day', 1, !empty($intercepted_modes['day'])?'checked':'','','day'). '

'. // Interception du mode recherche (0.2RC1+) '

'. ''. form::checkbox('search', 1, !empty($intercepted_modes['search'])?'checked':'','','search'). '

'. '
' ); // Options avancées (0.1.4+) buffer::str( '

'. ' '. __('Advanced configuration').'

'. '
'. '
'. ''.__('Pagination display options').''. '

'. ''. form::field('posts_per_page',5,5,!empty($my_config['dc_pagination_pagesize'])?$my_config['dc_pagination_pagesize']:dc_nb_post_per_page). '

'. '

'. ' '. form::field('pages_per_group',5,5,!empty($my_config['dc_pagination_groupsize'])?$my_config['dc_pagination_groupsize']:5). '

'. '
'. // Permettre les options complètes externes (0.2RC1+) '
'. ''.__('Full external options').''. '

'. ''. form::checkbox('external', 1, !empty($my_config['dc_pagination_external'])?'checked':'','','external'). '

'. '
'. '
' ); buffer::str( '

'. dcNonce::form(). '

'. '
' ); // Notes rapides pour une utilisation basique /* buffer::str( '

'.__('Usage').'

'. '

'.__('Recommended method').'

'. '

'.__('First, in the template.php of your theme, add the following line at the very top of the file').' :

'. '
'.
	'<?php if (!empty($is_paginated)) dcPagination::restoreMode(); ?>'.
	'
'. '

'.__('Then, in the list.php file of your theme, add the following line before and/or after the while loop').' :

'. '
'.
	'<?php if (!empty($is_paginated)) dcPagination::showNavigation(); ?>'.
	'
'. '

'.__('Backward compatible method').'

'. '

'.__('In the list.php file of your theme, add the following line before and/or after the while loop').' :

'. '
'.
	'<?php if ($mode == \'pagination\') dcPagination::showNavigation(); ?>'.
	'
'. '

'.__('Advanced usage').'

'. '

'.__('For a more advanced usage or more options, please check help.').' '.helpLink('guide&plugin='.$my_name,'') ); */ ?>