Changeset 11392
- Timestamp:
- Jun 16, 2011, 12:54:59 PM (13 years ago)
- Location:
- extensions/SmartAlbums
- Files:
-
- 7 added
- 9 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
extensions/SmartAlbums/admin.php
r11381 r11392 2 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 3 4 global $conf, $template; 4 global $conf, $template, $page; 5 5 6 load_language('plugin.lang', SMART_PATH); 6 7 if (!is_array($conf['SmartAlbums'])) $conf['SmartAlbums'] = unserialize($conf['SmartAlbums']); 7 8 8 9 // Enregistrement de la configuration 10 if (isset($_POST['submit'])) 11 { 12 $conf['SmartAlbums'] = array( 13 'update_on_upload' => isset($_POST['update_on_upload']), 14 ); 15 16 conf_update_param('SmartAlbums', serialize($conf['SmartAlbums'])); 17 array_push($page['infos'], l10n('Information data registered in database')); 18 } 9 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 10 $page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'albums'; 11 12 $tabsheet = new tabsheet(); 13 $tabsheet->add('albums', l10n('All SmartAlbums'), SMART_ADMIN.'-albums'); 14 $tabsheet->add('config', l10n('Configuration'), SMART_ADMIN.'-config'); 15 $tabsheet->select($page['tab']); 16 $tabsheet->assign(); 19 17 20 18 $template->assign(array( 21 19 'SMART_PATH' => SMART_PATH, 22 'update_on_upload' => $conf['SmartAlbums']['update_on_upload'],23 20 )); 24 25 $template->set_filename('SmartAlbums_conf', dirname(__FILE__).'/template/admin.tpl'); 26 $template->assign_var_from_handle('ADMIN_CONTENT', 'SmartAlbums_conf'); 21 22 include(SMART_PATH.'admin/'.$page['tab'].'.inc.php'); 23 $template->set_filename('SmartAlbums_content', dirname(__FILE__).'/admin/template/'.$page['tab'].'.tpl'); 24 $template->assign_var_from_handle('ADMIN_CONTENT', 'SmartAlbums_content'); 27 25 28 26 ?> -
extensions/SmartAlbums/include/init_cat_list.php
r11376 r11392 31 31 ;'; 32 32 33 $result = pwg_query($query); 34 $smart_cats = array(); 35 while ($cat = pwg_db_fetch_assoc($result)) 36 { 37 $smart_cats[$cat['id']] = trigger_event('render_category_name', $cat['name']); 38 } 39 33 $smart_cats = hash_from_query($query, 'id'); 40 34 $smart_count = count($smart_cats); 41 35 … … 45 39 if ($_GET['smart_generate'] == 'all') 46 40 { 47 foreach ($smart_cats as $cat => $name)41 foreach ($smart_cats as $category) 48 42 { 49 $associated_images = smart_make_associations($cat );43 $associated_images = smart_make_associations($category['id']); 50 44 array_push( 51 45 $page['infos'], 52 46 l10n_args(get_l10n_args( 53 47 '%d photos associated to album «%s»', 54 array(count($associated_images), $name) 48 array( 49 count($associated_images), 50 trigger_event( 51 'render_category_name', 52 $category['name'], 53 'admin_cat_list' 54 ) 55 ) 55 56 )) 56 57 ); … … 65 66 l10n_args(get_l10n_args( 66 67 '%d photos associated to album «%s»', 67 array(count($associated_images), $smart_cats[$_GET['smart_generate']]) 68 array( 69 count($associated_images), 70 trigger_event( 71 'render_category_name', 72 $smart_cats[$_GET['smart_generate']]['name'], 73 'admin_cat_list' 74 ) 75 ) 68 76 )) 69 77 ); … … 98 106 $replacement[0] = ' 99 107 {if isset($SMART_URL[$category.ID])} 100 <li><a href="{$SMART_URL[$category.ID]}" title="{\'Regenerate photos list of this SmartAlbum\'|@translate}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/synchronize.png" class="button" alt="{\' regenerate photos list\'|@translate}"></a></li>108 <li><a href="{$SMART_URL[$category.ID]}" title="{\'Regenerate photos list of this SmartAlbum\'|@translate}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/synchronize.png" class="button" alt="{\'Regenerate photos list of this SmartAlbum\'|@translate}"></a></li> 101 109 {/if}' 102 110 .$search[0]; -
extensions/SmartAlbums/include/init_cat_modify.php
r11380 r11392 87 87 ), 88 88 'limit' => array('limit' => 'limit'), // second filter not used 89 // TODO : new filter by album 89 90 ) 90 91 ); … … 130 131 } 131 132 133 if (isset($_GET['new_smart'])) 134 { 135 $template->assign('new_smart', true); 136 } 137 132 138 $template->assign(array( 133 139 'SMART_PATH' => SMART_PATH, … … 141 147 function smart_cat_modify_prefilter($content, &$smarty) 142 148 { 143 $search = '<form action="{$F_ACTION}" method="POST" id=" links">';149 $search = '<form action="{$F_ACTION}" method="POST" id="catModify">'; 144 150 $replacement = file_get_contents(SMART_PATH.'template/cat_modify.tpl')."\n".$search; 145 151 return str_replace($search, $replacement, $content); -
extensions/SmartAlbums/language/en_UK/plugin.lang.php
r11380 r11392 22 22 $lang['date filter'] = 'date filter'; 23 23 $lang['limit filter'] = 'limit filter'; 24 $lang['Add filters here'] = 'Add filters here'; 24 25 $lang['This album is a SmartAlbum'] = 'This album is a SmartAlbum'; 25 26 $lang['Count'] = 'Count'; … … 27 28 $lang['Regenerate photos list of all SmartAlbums'] = 'Regenerate photos list of all SmartAlbums'; 28 29 $lang['Update albums on file upload'] = 'Update albums on file upload'; 30 $lang['All SmartAlbums'] = 'All SmartAlbums'; 31 $lang['Add a SmartAlbum'] = 'Add a SmartAlbum'; 32 $lang['SmartAlbum deleted'] = 'SmartAlbum deleted'; 33 $lang['SmartAlbum added'] = 'SmartAlbum added'; 34 $lang['Only SmartAlbums are displayed on this page'] = 'Only SmartAlbums are displayed on this page'; 35 $lang['To order albums please go the main albums management page'] = 'To order albums please go the main albums management page'; 36 $lang['Don\'t show this message again'] = 'Don\'t show this message again'; 29 37 30 38 ?> -
extensions/SmartAlbums/language/fr_FR/plugin.lang.php
r11380 r11392 2 2 3 3 $lang['%d photos associated to album «%s»'] = '%d photos associées à l\'album «%s»'; 4 $lang['No filter selected'] = 'Aucun filt ersélectionné';4 $lang['No filter selected'] = 'Aucun filtre sélectionné'; 5 5 $lang['No tag selected'] = 'Aucun tag sélectionné'; 6 6 $lang['Date string is malformed'] = 'La date n\'est pas correcte'; … … 22 22 $lang['date filter'] = 'filtrer par date'; 23 23 $lang['limit filter'] = 'nombre max. d\'éléments'; 24 $lang['Add filters here'] = 'Ajoutez des filtres ici'; 24 25 $lang['This album is a SmartAlbum'] = 'Cet album est un SmartAlbum'; 25 26 $lang['Count'] = 'Compter'; … … 27 28 $lang['Regenerate photos list of all SmartAlbums'] = 'Régénérer les photos de tous les SmartAlbums'; 28 29 $lang['Update albums on file upload'] = 'Mettre à jour les albums après la mise en ligne d\'un fichier'; 30 $lang['All SmartAlbums'] = 'Tous les SmartAlbums'; 31 $lang['Add a SmartAlbum'] = 'Ajouter un SmartAlbum'; 32 $lang['SmartAlbum deleted'] = 'SmartAlbum ajouté'; 33 $lang['SmartAlbum added'] = 'SmartAlbum supprimé'; 34 $lang['Only SmartAlbums are displayed on this page'] = 'Seuls les SmartAlbums sont affichés sur cette page'; 35 $lang['To order albums please go the main albums management page'] = 'Pour ordonner les albums veuillez vous rendre sur la page principale de gestion des albums'; 36 $lang['Don\'t show this message again'] = 'Ne plus afficher ce message'; 29 37 30 38 ?> -
extensions/SmartAlbums/main.inc.php
r11380 r11392 15 15 define('SMART_PATH', PHPWG_PLUGINS_PATH.SMART_DIR.'/'); 16 16 define('CATEGORY_FILTERS_TABLE', $prefixeTable.'category_filters'); 17 define('SMART_ADMIN', get_root_url().'admin.php?page=plugin-' . SMART_DIR); 17 18 18 19 add_event_handler('invalidate_user_cache', 'smart_make_all_associations'); … … 39 40 array_push($menu, array( 40 41 'NAME' => 'SmartAlbums', 41 'URL' => get_root_url().'admin.php?page=plugin-' . SMART_DIR)); 42 'URL' => SMART_ADMIN, 43 ) 44 ); 42 45 return $menu; 43 46 } -
extensions/SmartAlbums/maintain.inc.php
r11381 r11392 26 26 \''.serialize(array( 27 27 'update_on_upload' => true, 28 'show_list_messages' => true, 28 29 ) 29 30 ).'\', … … 36 37 function plugin_activate() 37 38 { 38 $sa_config = pwg_query('SELECT * FROM `' . CONFIG_TABLE . '` WHERE param = \'SmartAlbums\';'); 39 40 if (!pwg_db_num_rows($sa_config)) 39 if (!isset($conf['SmartAlbums'])) 41 40 { 42 41 pwg_query(' … … 46 45 \''.serialize(array( 47 46 'update_on_upload' => true, 47 'show_list_messages' => true, 48 48 ) 49 49 ).'\', -
extensions/SmartAlbums/template/cat_modify.tpl
r11334 r11392 42 42 return false; 43 43 }); 44 45 44 46 45 47 function add_filter(type) { … … 100 102 } 101 103 104 function doBlink(obj,start,finish) { 105 jQuery(obj).fadeOut(400).fadeIn(400); 106 if(start!=finish) { 107 doBlink(obj,start+1,finish); 108 } else { 109 jQuery(obj).fadeOut(400); 110 } 111 } 112 113 doBlink('.new_smart', 0, 3); 102 114 init_jquery_handlers(); 103 115 }); … … 111 123 <legend>{'SmartAlbums'|@translate}</legend> 112 124 113 <label><input type="checkbox" name="is_smart" {if isset($filters) }checked="checked"{/if}/> {'This album is a SmartAlbum'|@translate}</label>125 <label><input type="checkbox" name="is_smart" {if isset($filters) OR isset($new_smart)}checked="checked"{/if}/> {'This album is a SmartAlbum'|@translate}</label> 114 126 115 <div id="SmartAlbum_options" style="margin-top:1em;{if !isset($filters) }display:none;{/if}">127 <div id="SmartAlbum_options" style="margin-top:1em;{if !isset($filters) AND !isset($new_smart)}display:none;{/if}"> 116 128 <ul id="filterList"> 117 129 {counter start=0 assign=i} … … 151 163 </select> 152 164 <a id="removeFilters">{'Remove all filters'|@translate}</a> 165 {if isset($new_smart)}<span class="new_smart">{'Add filters here'|@translate}</span>{/if} 153 166 </p> 154 167 </div> … … 156 169 <p class="actionButtons" id="applyFilterBlock"> 157 170 <input class="submit" type="submit" value="{'Submit'|@translate}" name="submitFilters"/> 158 <input class="submit" type="submit" value="{'Count'|@translate}" name="countImages" {if !isset($filters) }style="display:none;"{/if}/>171 <input class="submit" type="submit" value="{'Count'|@translate}" name="countImages" {if !isset($filters) AND !isset($new_smart)}style="display:none;"{/if}/> 159 172 <span class="count_images_display">{$IMAGE_COUNT}</span> 160 173 </p> -
extensions/SmartAlbums/template/style.css
r10980 r11392 12 12 margin-bottom:0px !important; 13 13 } 14 15 .new_smart { 16 color:#00AA00; 17 background-color:#C2F5C2; 18 font-weight:bold; 19 padding:3px 10px; 20 border-radius:4px; 21 box-shadow:0 0 2px #0a0; 22 }
Note: See TracChangeset
for help on using the changeset viewer.