Changeset 11380 for extensions
- Timestamp:
- Jun 15, 2011, 4:19:31 PM (13 years ago)
- Location:
- extensions/SmartAlbums
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/SmartAlbums/admin.php
r11376 r11380 12 12 $conf['SmartAlbums'] = array( 13 13 'update_on_upload' => $_POST['update_on_upload'], 14 'update_on_login' => $_POST['update_on_login'],15 14 ); 16 15 … … 22 21 'SMART_PATH' => SMART_PATH, 23 22 'update_on_upload' => $conf['SmartAlbums']['update_on_upload'], 24 'update_on_login' => $conf['SmartAlbums']['update_on_login'],25 23 )); 26 24 -
extensions/SmartAlbums/include/functions.inc.php
r11376 r11380 42 42 /* 43 43 * Make associations for all SmartAlbums 44 * Called with invalidate_user_cache and/or on admin login 45 * @param string login (not mandatory) 46 */ 47 function smart_make_all_associations($login = false) 44 * Called with invalidate_user_cache 45 */ 46 function smart_make_all_associations() 48 47 { 49 48 global $conf; … … 51 50 if (!is_array($conf['SmartAlbums'])) $conf['SmartAlbums'] = unserialize($conf['SmartAlbums']); 52 51 53 if ( !$login AND !defined('SMART_NOT_UPDATE') AND $conf['SmartAlbums']['update_on_upload'] != 'false' ) 54 continue; 55 else if ( is_string($login) AND is_admin() AND $conf['SmartAlbums']['update_on_login'] != 'false' ) 56 continue; 57 else 58 return; 52 if ( defined('SMART_NOT_UPDATE') OR $conf['SmartAlbums']['update_on_upload'] == 'false' ) return; 59 53 60 54 /* get categories with smart filters */ … … 69 63 $smart_cats = array_from_query($query, 'id'); 70 64 array_map('smart_make_associations', $smart_cats); 71 72 if (is_string($login))73 {74 define('SMART_NOT_UPDATE', 1);75 invalidate_user_cache();76 }77 65 } 78 66 … … 178 166 else if ($filter['type'] == 'date') 179 167 { 180 if ($filter['cond'] == 'the') $where[] = 'date_available BETWEEN "'.$filter['value'].' 00:00:00" AND "'.$filter['value'].' 23:59:59"'; 181 else if ($filter['cond'] == 'before') $where[] = 'date_available < "'.$filter['value'].' 00:00:00"'; 182 else if ($filter['cond'] == 'after') $where[] = 'date_available > "'.$filter['value'].' 23:59:59"'; 168 switch ($filter['cond']) 169 { 170 case 'the': 171 $where[] = 'date_available BETWEEN "'.$filter['value'].' 00:00:00" AND "'.$filter['value'].' 23:59:59"'; 172 break; 173 case 'before': 174 $where[] = 'date_available < "'.$filter['value'].' 00:00:00"'; 175 break; 176 case 'after': 177 $where[] = 'date_available > "'.$filter['value'].' 23:59:59"'; 178 break; 179 case 'the_crea': 180 $where[] = 'date_creation BETWEEN "'.$filter['value'].' 00:00:00" AND "'.$filter['value'].' 23:59:59"'; 181 break; 182 case 'before_crea': 183 $where[] = 'date_creation < "'.$filter['value'].' 00:00:00"'; 184 break; 185 case 'after_crea': 186 $where[] = 'date_creation > "'.$filter['value'].' 23:59:59"'; 187 break; 188 } 183 189 } 184 190 // limit -
extensions/SmartAlbums/include/init_cat_modify.php
r11376 r11380 79 79 ), 80 80 'date' => array( 81 'the' => l10n('Added the'), 82 'before' => l10n('Added before the'), 83 'after' => l10n('Added after the'), 81 'the' => l10n('Added on'), 82 'before' => l10n('Added before'), 83 'after' => l10n('Added after'), 84 'the_crea' => l10n('Created on'), 85 'before_crea' => l10n('Created before'), 86 'after_crea' => l10n('Created after'), 84 87 ), 85 88 'limit' => array('limit' => 'limit'), // second filter not used -
extensions/SmartAlbums/language/en_UK/plugin.lang.php
r11376 r11380 11 11 $lang['None of these tags'] = 'None of these tags'; 12 12 $lang['Only these tags'] = 'Only these tags'; 13 $lang['Added the'] = 'Added the'; 14 $lang['Added before the'] = 'Added before the'; 15 $lang['Added after the'] = 'Added after the'; 13 $lang['Added on'] = 'Added on'; 14 $lang['Added before'] = 'Added before'; 15 $lang['Added after'] = 'Added after'; 16 $lang['Created on'] = 'Created on'; 17 $lang['Created before'] = 'Created before'; 18 $lang['Created after'] = 'Created after'; 16 19 $lang['%d photo'] = '%d photo'; 17 20 $lang['%d photos'] = '%d photos'; … … 24 27 $lang['Regenerate photos list of all SmartAlbums'] = 'Regenerate photos list of all SmartAlbums'; 25 28 $lang['Update albums on file upload'] = 'Update albums on file upload'; 26 $lang['Update albums when an admin logins'] = 'Update albums when an admin logins';27 29 28 30 ?> -
extensions/SmartAlbums/language/fr_FR/plugin.lang.php
r11376 r11380 11 11 $lang['None of these tags'] = 'Aucun des tags'; 12 12 $lang['Only these tags'] = 'Seulement les tags'; 13 $lang['Added the'] = 'Ajouté le'; 14 $lang['Added before the'] = 'Ajouté avant le'; 15 $lang['Added after the'] = 'Ajouté après le'; 13 $lang['Added on'] = 'Ajouté le'; 14 $lang['Added before'] = 'Ajouté avant le'; 15 $lang['Added after'] = 'Ajouté après le'; 16 $lang['Created on'] = 'Créé le'; 17 $lang['Created before'] = 'Créé avant le'; 18 $lang['Created after'] = 'Créé après le'; 16 19 $lang['%d photo'] = '%d photo'; 17 20 $lang['%d photos'] = '%d photos'; … … 24 27 $lang['Regenerate photos list of all SmartAlbums'] = 'Régénérer les photos de tous les SmartAlbums'; 25 28 $lang['Update albums on file upload'] = 'Mettre à jour les albums après la mise en ligne d\'un fichier'; 26 $lang['Update albums when an admin logins'] = 'Mettre à jour les albums quand un admin se connecte';27 29 28 30 ?> -
extensions/SmartAlbums/main.inc.php
r11376 r11380 17 17 18 18 add_event_handler('invalidate_user_cache', 'smart_make_all_associations'); 19 add_event_handler('login_success', 'smart_make_all_associations');20 19 include_once(SMART_PATH.'include/functions.inc.php'); 21 20 -
extensions/SmartAlbums/maintain.inc.php
r11376 r11380 26 26 \''.serialize(array( 27 27 'update_on_upload' => false, 28 'update_on_login' => false,29 28 ) 30 29 ).'\', … … 47 46 \''.serialize(array( 48 47 'update_on_upload' => false, 49 'update_on_login' => false,50 48 ) 51 49 ).'\', -
extensions/SmartAlbums/template/admin.tpl
r11376 r11380 12 12 <label><input type="radio" name="update_on_upload" value="false" {if $update_on_upload == 'false'}checked="checked"{/if}/> {'No'|@translate}</label> 13 13 </li> 14 <li>15 <span class="property">{'Update albums when an admin logins'|@translate}</span>16 <label><input type="radio" name="update_on_login" value="true" {if $update_on_login == 'true'}checked="checked"{/if}/> {'Yes'|@translate}</label>17 <label><input type="radio" name="update_on_login" value="false" {if $update_on_login == 'false'}checked="checked"{/if}/> {'No'|@translate}</label>18 </li>19 14 </ul> 20 15 </fieldset>
Note: See TracChangeset
for help on using the changeset viewer.