Changeset 2382
- Timestamp:
- 06/21/10 18:13:15 (13 years ago)
- Location:
- plugins/postExpired
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/postExpired/_admin.php
r2330 r2382 13 13 if (!defined('DC_CONTEXT_ADMIN')){return;} 14 14 15 if (!$core->auth->check('usage,contentadmin',$core->blog->id)) { return; } 16 15 17 # Admin behaviors 16 18 $core->addBehavior('adminPostHeaders',array('postExpiredAdmin','header')); … … 30 32 # Getting categories 31 33 $categories_combo = array( 32 __(' not changed') => '',33 __(' uncategorized') => '.'34 __('Not changed') => '', 35 __('Uncategorized') => '.' 34 36 ); 35 37 try { … … 50 52 { 51 53 return array( 52 __(' not changed') => '',53 __(' pending') => '.-2',54 __(' unpublished') => '.0'54 __('Not changed') => '', 55 __('Pending') => '.-2', 56 __('Unpublished') => '.0' 55 57 ); 56 58 } … … 59 61 { 60 62 return array( 61 __(' not changed') => '',62 __(' selected') => '.1',63 __(' not selected') => '.0'63 __('Not changed') => '', 64 __('Selected') => '.1', 65 __('Not selected') => '.0' 64 66 ); 65 67 } … … 75 77 global $core; 76 78 $expired_date = $expired_status = $expired_cat = $expired_selected = ''; 79 $can_edit = true; 77 80 78 81 if ($post) 79 82 { 83 $can_edit = $post->isEditable(); 80 84 $rs_date = $core->meta->getMetadata(array('meta_type'=>'postexpired','limit'=>1,'post_id'=>$post->post_id)); 81 85 if (!$rs_date->isEmpty()) … … 96 100 echo 97 101 '<h3 id="postexpired-form-title">'.__('Expired date').'</h3>'. 98 '<div id="postexpired-form-content">'. 99 '<p><label>'.__('Date:'). 100 form::field('post_expired_date',16,16,$expired_date,'',3). 101 '</label></p>'. 102 '<p><label>'.__('Change status on expire:'). 103 form::combo('post_expired_status',self::statusCombo(),$expired_status,'',3). 104 '</label></p>'. 105 '<p><label>'.__('Change category on expire:'). 106 form::combo('post_expired_cat',self::categoriesCombo(),$expired_cat,'',3). 107 '</label></p>'. 108 '<p><label>'.__('Change selection on expire:'). 109 form::combo('post_expired_selected',self::selectedCombo(),$expired_selected,'',3). 110 '</label></p>'; 102 '<div id="postexpired-form-content">'; 103 104 if (!$can_edit && $post) 105 { 106 $status = (string) array_search($expired_status,self::statusCombo()); 107 $category = (string) array_search($expired_cat,self::categoriesCombo()); 108 $selected = (string) array_search($expired_selected,self::selectedCombo()); 109 110 echo 111 '<p>'.__('Date:').' '.$expired_date.'</p>'. 112 '<p>'.__('Status:').' '.$status.'</p>'. 113 '<p>'.__('Category:').' '.$category.'</p>'. 114 '<p>'.__('Selected:').' '.$selected.'</p>'; 115 } 116 else 117 { 118 echo 119 '<p><label>'.__('Date:'). 120 form::field('post_expired_date',16,16,$expired_date,'',3). 121 '</label></p>'. 122 '<p><label>'.__('Change status on expire:'). 123 form::combo('post_expired_status',self::statusCombo(),$expired_status,'',3). 124 '</label></p>'. 125 '<p><label>'.__('Change category on expire:'). 126 form::combo('post_expired_cat',self::categoriesCombo(),$expired_cat,'',3). 127 '</label></p>'. 128 '<p><label>'.__('Change selection on expire:'). 129 form::combo('post_expired_selected',self::selectedCombo(),$expired_selected,'',3). 130 '</label></p>'; 131 } 111 132 112 133 # --BEHAVIOR-- adminPostExpiredFormSidebar … … 116 137 } 117 138 118 public static function set( &$cur,&$post_id)139 public static function set($cur,$post_id) 119 140 { 120 141 global $core; … … 169 190 } 170 191 171 public static function combo(&$args) 172 { 173 if ($GLOBALS['core']->auth->check('usage,contentadmin',$GLOBALS['core']->blog->id)) 174 { 175 $args[0][__('Expired entries')][__('add expired date')] = 'postexpired_add'; 176 } 177 if ($GLOBALS['core']->auth->check('delete,contentadmin',$GLOBALS['core']->blog->id)) 178 { 179 $args[0][__('Expired entries')][__('remove expired date')] = 'postexpired_remove'; 180 } 181 } 182 183 public static function action(&$core,$posts,$action,$redir) 192 public static function combo($args) 193 { 194 global $core; 195 if ($core->auth->check('usage,contentadmin',$core->blog->id)) 196 { 197 $args[0][__('Expired entries')][__('Add expired date')] = 'postexpired_add'; 198 } 199 if ($core->auth->check('delete,contentadmin',$core->blog->id)) 200 { 201 $args[0][__('Expired entries')][__('Remove expired date')] = 'postexpired_remove'; 202 } 203 } 204 205 public static function action($core,$posts,$action,$redir) 184 206 { 185 207 if ($action == 'action_postexpired_add') … … 252 274 while ($rs->fetch()) 253 275 { 254 self::del($rs->post_id); 276 if ($post->isEditable()) 277 { 278 self::del($rs->post_id); 279 } 255 280 } 256 281 -
plugins/postExpired/_define.php
r2330 r2382 17 17 /* Description*/ "Change entries options at a given date", 18 18 /* Author */ "JC Denis", 19 /* Version */ '0.3 ',20 /* Permissions */ ' contentadmin'19 /* Version */ '0.3.1', 20 /* Permissions */ 'usage,contentadmin' 21 21 ); 22 /* date */ #201006 0822 /* date */ #20100621 23 23 ?> -
plugins/postExpired/_public.php
r2330 r2382 16 16 __('This entry has no expirion date'); 17 17 18 if (in_array($core->url->type,array('default','feed'))){ 19 $core->addBehavior('publicBeforeDocument',array('publicBehaviorPostExpired','u npublishExpiredEntries'));18 if (in_array($core->url->type,array('default','feed'))){ //launch update only on home page and feed 19 $core->addBehavior('publicBeforeDocument',array('publicBehaviorPostExpired','updateExpiredEntries')); 20 20 } 21 21 $core->addBehavior('coreBlogGetPosts',array('publicBehaviorPostExpired','coreBlogGetPosts')); … … 27 27 class publicBehaviorPostExpired 28 28 { 29 public static function u npublishExpiredEntries($core)29 public static function updateExpiredEntries($core) 30 30 { 31 31 # Get expired dates and post_id … … 139 139 } 140 140 141 public static function coreBlogGetPosts( &$rs)141 public static function coreBlogGetPosts($rs) 142 142 { 143 143 $rs->extend('rsExtPostExpiredPublic'); … … 147 147 class rsExtPostExpiredPublic extends rsExtPost 148 148 { 149 public static function postExpiredDate( &$rs,$absolute_urls=false)150 { 151 if (!$rs->postexpired[$rs->post_id]) 149 public static function postExpiredDate($rs,$absolute_urls=false) 150 { 151 if (!$rs->postexpired[$rs->post_id]) //memory 152 152 { 153 153 $params = array( -
plugins/postExpired/locales/fr/main.lang.php
r2187 r2382 1 1 <?php 2 // Language: français 3 // Module: postExpired - 0.2 4 // Date: 2010-04-14 02:18:31 5 // Translated with dcTranslater - 1.3 6 7 #_admin.php:33 8 #_admin.php:51 9 #_admin.php:60 10 $GLOBALS['__l10n']['not changed'] = 'inchangé'; 2 // Language: Français 3 // Module: postExpired - 0.3.1 4 // Date: 2010-06-21 16:01:48 5 // Translated with dcTranslater - 1.4 11 6 12 7 #_admin.php:34 13 $GLOBALS['__l10n']['uncategorized'] = 'non catégorisé'; 8 #_admin.php:54 9 #_admin.php:63 10 $GLOBALS['__l10n']['Not changed'] = 'Inchangé'; 14 11 15 #_admin.php:97 12 #_admin.php:55 13 $GLOBALS['__l10n']['Pending'] = 'En attente'; 14 15 #_admin.php:56 16 $GLOBALS['__l10n']['Unpublished'] = 'Non publié'; 17 18 #_admin.php:65 19 $GLOBALS['__l10n']['Not selected'] = 'Non sélectionné'; 20 21 #_admin.php:101 16 22 $GLOBALS['__l10n']['Expired date'] = 'Date de péremption'; 17 23 18 #_admin.php:1 0219 #_admin.php: 27024 #_admin.php:122 25 #_admin.php:302 20 26 $GLOBALS['__l10n']['Change status on expire:'] = 'Changer de status à cette date :'; 21 27 22 #_admin.php:1 0523 #_admin.php: 27328 #_admin.php:125 29 #_admin.php:305 24 30 $GLOBALS['__l10n']['Change category on expire:'] = 'Changer da catégorie à cette date :'; 25 31 26 #_admin.php:1 0827 #_admin.php: 27628 $GLOBALS['__l10n']['Change selection on expire:'] = 'Changer la s elecion à cette date :';32 #_admin.php:128 33 #_admin.php:308 34 $GLOBALS['__l10n']['Change selection on expire:'] = 'Changer la sélection à cette date :'; 29 35 30 #_admin.php:1 7331 #_admin.php: 17636 #_admin.php:197 37 #_admin.php:201 32 38 $GLOBALS['__l10n']['Expired entries'] = 'Billets périmés'; 33 39 34 #_admin.php:1 7335 $GLOBALS['__l10n'][' add expired date'] = 'ajouter des datesde péremption';40 #_admin.php:197 41 $GLOBALS['__l10n']['Add expired date'] = 'Ajouter une date de péremption'; 36 42 37 #_admin.php: 17638 $GLOBALS['__l10n'][' remove expired date'] = 'retirer des datesde péremption';43 #_admin.php:201 44 $GLOBALS['__l10n']['Remove expired date'] = 'Retirer une date de péremption'; 39 45 40 #_admin.php:2 6446 #_admin.php:296 41 47 $GLOBALS['__l10n']['Add expired date to entries'] = 'Ajouter une date de péremption aux billets'; 42 48 43 #_admin.php:2 6544 $GLOBALS['__l10n']['It will be added only if there is no expired date on entry.'] = 'Ajout eruniquement si il n\'y a pas de date de péremption sur le billet.';49 #_admin.php:297 50 $GLOBALS['__l10n']['It will be added only if there is no expired date on entry.'] = 'Ajouté uniquement si il n\'y a pas de date de péremption sur le billet.'; 45 51 46 #_admin.php:3 0752 #_admin.php:341 47 53 $GLOBALS['__l10n']['Remove selected expired date from entries'] = 'Retirer les dates de péremption sélectionnées des billets'; 48 54 49 #_admin.php:3 1055 #_admin.php:345 50 56 $GLOBALS['__l10n']['No expired date for selected entries'] = 'Pas de date de peremption sur les billets sélectionnés'; 51 57 52 #_admin.php:3 1858 #_admin.php:353 53 59 $GLOBALS['__l10n']['Following expired date have been found in selected entries:'] = 'Les dates de péremption suivante ont été trouvé sur les billets sélectionnés :'; 54 60 55 #_public.php:1 661 #_public.php:15 56 62 $GLOBALS['__l10n']['Expired on'] = 'Expire le'; 57 63 58 #_public.php:1 759 $GLOBALS['__l10n']['This entry has no expirion date'] = 'Ce billet n\'a pas de date d \'expiration';64 #_public.php:16 65 $GLOBALS['__l10n']['This entry has no expirion date'] = 'Ce billet n\'a pas de date de péremption'; 60 66 61 67 ?> -
plugins/postExpired/locales/fr/main.po
r2187 r2382 1 # Language: français2 # Module: postExpired - 0. 23 # Date: 2010-0 4-14 02:18:314 # Translated with translater 1. 31 # Language: Français 2 # Module: postExpired - 0.3.1 3 # Date: 2010-06-21 16:01:48 4 # Translated with translater 1.4 5 5 6 6 msgid "" 7 7 msgstr "" 8 8 "Content-Type: text/plain; charset=UTF-8\n" 9 "Project-Id-Version: postExpired 0. 2\n"9 "Project-Id-Version: postExpired 0.3.1\n" 10 10 "POT-Creation-Date: \n" 11 "PO-Revision-Date: 2010-0 4-14T02:18:31+00:00\n"11 "PO-Revision-Date: 2010-06-21T16:01:48+00:00\n" 12 12 "Last-Translator: JC Denis\n" 13 13 "Language-Team: \n" … … 15 15 "Content-Transfer-Encoding: 8bit\n" 16 16 17 #: _admin.php:3 318 #: _admin.php:5 119 #: _admin.php:6 020 msgid " not changed"21 msgstr " inchangé"17 #: _admin.php:34 18 #: _admin.php:54 19 #: _admin.php:63 20 msgid "Not changed" 21 msgstr "Inchangé" 22 22 23 #: _admin.php: 3424 msgid " uncategorized"25 msgstr " non catégorisé"23 #: _admin.php:55 24 msgid "Pending" 25 msgstr "En attente" 26 26 27 #: _admin.php:97 27 #: _admin.php:56 28 msgid "Unpublished" 29 msgstr "Non publié" 30 31 #: _admin.php:65 32 msgid "Not selected" 33 msgstr "Non sélectionné" 34 35 #: _admin.php:101 28 36 msgid "Expired date" 29 37 msgstr "Date de péremption" 30 38 31 #: _admin.php:1 0232 #: _admin.php: 27039 #: _admin.php:122 40 #: _admin.php:302 33 41 msgid "Change status on expire:" 34 42 msgstr "Changer de status à cette date :" 35 43 36 #: _admin.php:1 0537 #: _admin.php: 27344 #: _admin.php:125 45 #: _admin.php:305 38 46 msgid "Change category on expire:" 39 47 msgstr "Changer da catégorie à cette date :" 40 48 41 #: _admin.php:1 0842 #: _admin.php: 27649 #: _admin.php:128 50 #: _admin.php:308 43 51 msgid "Change selection on expire:" 44 msgstr "Changer la s elecion à cette date :"52 msgstr "Changer la sélection à cette date :" 45 53 46 #: _admin.php:1 7347 #: _admin.php: 17654 #: _admin.php:197 55 #: _admin.php:201 48 56 msgid "Expired entries" 49 57 msgstr "Billets périmés" 50 58 51 #: _admin.php:1 7352 msgid " add expired date"53 msgstr " ajouter des datesde péremption"59 #: _admin.php:197 60 msgid "Add expired date" 61 msgstr "Ajouter une date de péremption" 54 62 55 #: _admin.php: 17656 msgid " remove expired date"57 msgstr " retirer des datesde péremption"63 #: _admin.php:201 64 msgid "Remove expired date" 65 msgstr "Retirer une date de péremption" 58 66 59 #: _admin.php:2 6467 #: _admin.php:296 60 68 msgid "Add expired date to entries" 61 69 msgstr "Ajouter une date de péremption aux billets" 62 70 63 #: _admin.php:2 6571 #: _admin.php:297 64 72 msgid "It will be added only if there is no expired date on entry." 65 msgstr "Ajout eruniquement si il n'y a pas de date de péremption sur le billet."73 msgstr "Ajouté uniquement si il n'y a pas de date de péremption sur le billet." 66 74 67 #: _admin.php:3 0775 #: _admin.php:341 68 76 msgid "Remove selected expired date from entries" 69 77 msgstr "Retirer les dates de péremption sélectionnées des billets" 70 78 71 #: _admin.php:3 1079 #: _admin.php:345 72 80 msgid "No expired date for selected entries" 73 81 msgstr "Pas de date de peremption sur les billets sélectionnés" 74 82 75 #: _admin.php:3 1883 #: _admin.php:353 76 84 msgid "Following expired date have been found in selected entries:" 77 85 msgstr "Les dates de péremption suivante ont été trouvé sur les billets sélectionnés :" 78 86 79 #: _public.php:1 687 #: _public.php:15 80 88 msgid "Expired on" 81 89 msgstr "Expire le" 82 90 83 #: _public.php:1 791 #: _public.php:16 84 92 msgid "This entry has no expirion date" 85 msgstr "Ce billet n'a pas de date d 'expiration"93 msgstr "Ce billet n'a pas de date de péremption" 86 94 -
plugins/postExpired/release.txt
r2330 r2382 1 1 todo 2 2 * Add option to add/remove tag 3 4 0.3.1 20100621 5 * Fixed user rights 6 * Fixed (again) PHP 5.3 compatibility 7 * Fixed typo 3 8 4 9 0.3 20100608
Note: See TracChangeset
for help on using the changeset viewer.