Changeset 26665
- Timestamp:
- Jan 12, 2014, 7:13:40 PM (10 years ago)
- Location:
- extensions/typetags
- Files:
-
- 8 added
- 1 deleted
- 26 edited
- 2 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
extensions/typetags/admin.php
r21361 r26665 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 4 load_language('plugin.lang', typetags_PATH); 5 6 function get_color_text($color) 7 { 8 if (strlen($color) == 7) 9 { 10 $rgb[] = hexdec(substr($color, 1, 2))/255; 11 $rgb[] = hexdec(substr($color, 3, 2))/255; 12 $rgb[] = hexdec(substr($color, 5, 2))/255; 13 } 14 else if (strlen($color) == 4) 15 { 16 $rgb[] = hexdec(substr($color, 1, 1))/15; 17 $rgb[] = hexdec(substr($color, 2, 1))/15; 18 $rgb[] = hexdec(substr($color, 3, 1))/15; 19 } 20 $l = (min($rgb) + max($rgb)) / 2; 21 return $l > 0.45 ? '#000' : '#fff'; 22 } 2 defined('TYPETAGS_PATH') or die('Hacking attempt!'); 3 4 load_language('plugin.lang', TYPETAGS_PATH); 5 6 include_once(TYPETAGS_PATH . 'include/functions.inc.php'); 7 23 8 24 9 // +-----------------------------------------------------------------------+ 25 10 // | edit typetags | 26 11 // +-----------------------------------------------------------------------+ 27 28 if ( isset($_POST['edittypetag']) and (empty($_POST['typetag_name']) or empty($_POST['typetag_color'])) ) 29 { 30 $edited_typetag = array( 31 'id' => $_POST['edited_typetag'], 32 'name' => $_POST['typetag_name'], 33 'color' => $_POST['typetag_color'], 34 ); 35 36 array_push($page['errors'], l10n('typetag_error')); 37 } 38 else if (isset($_POST['edittypetag'])) 39 { 40 // we must not rename typetag with an already existing name 41 $query = ' 12 if (isset($_POST['edittypetag'])) 13 { 14 if (empty($_POST['typetag_name']) or empty($_POST['typetag_color'])) 15 { 16 $page['errors'][] = l10n('You must fill all fields (name and color)'); 17 } 18 else 19 { 20 // we must not rename typetag with an already existing name 21 $query = ' 42 22 SELECT id 43 FROM ' .typetags_TABLE.'23 FROM ' . TYPETAGS_TABLE . ' 44 24 WHERE 45 name = "'.$_POST['typetag_name'].'" 46 AND id != '.$_POST['edited_typetag'].' 47 ;'; 48 49 if ( pwg_db_num_rows(pwg_query($query)) ) 25 name = "' . pwg_db_real_escape_string($_POST['typetag_name']) . '" 26 AND id != ' . $_POST['edited_typetag'] . ' 27 ;'; 28 29 if (pwg_db_num_rows(pwg_query($query))) 30 { 31 $page['errors'][] = l10n('This name is already used'); 32 } 33 else if ( ($color = check_color($_POST['typetag_color'])) === false ) 34 { 35 $page['errors'][] = l10n('Invalid color'); 36 } 37 else 38 { 39 $query = ' 40 UPDATE '.TYPETAGS_TABLE.' 41 SET 42 name = "' . pwg_db_real_escape_string($_POST['typetag_name']) . '", 43 color = "' . $color . '" 44 WHERE id = ' . $_POST['edited_typetag'] . ' 45 ;'; 46 pwg_query($query); 47 48 $page['infos'][] = l10n('Color saved'); 49 } 50 } 51 52 if (count($page['errors'])) 50 53 { 51 54 $edited_typetag = array( … … 53 56 'name' => $_POST['typetag_name'], 54 57 'color' => $_POST['typetag_color'], 55 ); 56 57 array_push($page['errors'], l10n('typetag_already_exists')); 58 ); 59 } 60 } 61 62 // +-----------------------------------------------------------------------+ 63 // | delete typetags | 64 // +-----------------------------------------------------------------------+ 65 if (isset($_GET['deletetypetag'])) 66 { 67 $query = ' 68 UPDATE ' . TAGS_TABLE . ' 69 SET id_typetags = NULL 70 WHERE id_typetags = ' . intval($_GET['deletetypetag']) . ' 71 ;'; 72 pwg_query($query); 73 74 $query = ' 75 DELETE FROM ' . TYPETAGS_TABLE . ' 76 WHERE id = ' . intval($_GET['deletetypetag']) . ' 77 ;'; 78 pwg_query($query); 79 80 if (pwg_db_changes()) 81 { 82 $page['infos'][] = l10n('Color deleted'); 83 } 84 } 85 86 // +-----------------------------------------------------------------------+ 87 // | add a typetag | 88 // +-----------------------------------------------------------------------+ 89 if (isset($_POST['addtypetag'])) 90 { 91 if (empty($_POST['typetag_name']) or empty($_POST['typetag_color'])) 92 { 93 $page['errors'][] = l10n('You must fill all fields (name and color)'); 58 94 } 59 95 else 60 96 { 97 $typetag_name = $_POST['typetag_name']; 98 $typetag_color = $_POST['typetag_color']; 99 100 // does the tag already exists? 61 101 $query = ' 62 UPDATE '.typetags_TABLE.'63 SET64 name = "'.$_POST['typetag_name'].'",65 color = "'.$_POST['typetag_color'].'"66 WHERE id = '.$_POST['edited_typetag'].'67 ;';68 pwg_query($query);69 70 array_push($page['infos'], l10n('typetag_saved'));71 }72 }73 74 // +-----------------------------------------------------------------------+75 // | delete typetags |76 // +-----------------------------------------------------------------------+77 78 if (isset($_GET['deletetypetag']))79 {80 $query = '81 102 SELECT id 82 FROM '.typetags_TABLE.' 83 WHERE id = '.$_GET['deletetypetag'].' 84 ;'; 85 86 if ( pwg_db_num_rows(pwg_query($query)) ) 87 { 88 $query = ' 89 UPDATE '.TAGS_TABLE.' 90 SET id_typetags = NULL 91 WHERE id_typetags = '.$_GET['deletetypetag'].' 92 ;'; 93 pwg_query($query); 94 95 $query = ' 96 DELETE FROM '.typetags_TABLE.' 97 WHERE id = '.$_GET['deletetypetag'].' 98 ;'; 99 pwg_query($query); 100 101 array_push($page['infos'], l10n('typetag_suppr')); 102 } 103 else 104 { 105 array_push($page['errors'], l10n('typetag_unknown')); 106 } 107 } 108 109 // +-----------------------------------------------------------------------+ 110 // | add a typetag | 111 // +-----------------------------------------------------------------------+ 112 113 if ( isset($_POST['addtypetag']) and (empty($_POST['typetag_name']) or empty($_POST['typetag_color'])) ) 114 { 115 $template->assign('typetag', array( 116 'NAME' => $_POST['typetag_name'], 117 'COLOR' => $_POST['typetag_color'], 118 )); 119 120 array_push($page['errors'], l10n('typetag_error')); 121 } 122 else if (isset($_POST['addtypetag'])) 123 { 124 $typetag_name = $_POST['typetag_name']; 125 $typetag_color = $_POST['typetag_color']; 126 127 // does the tag already exists? 128 $query = ' 129 SELECT id 130 FROM '.typetags_TABLE.' 131 WHERE name = "'.$_POST['typetag_name'].'" 103 FROM ' . TYPETAGS_TABLE . ' 104 WHERE name = "' . pwg_db_real_escape_string($_POST['typetag_name']) . '" 132 105 '; 133 106 134 if ( pwg_db_num_rows(pwg_query($query)) ) 135 { 136 $template->assign('typetag', array( 137 'NAME' => $_POST['typetag_name'], 138 'COLOR' => $_POST['typetag_color'], 139 )); 140 141 array_push($page['errors'], l10n('typetag_already_exists')); 142 } 143 else 144 { 145 $query = ' 146 INSERT INTO '.typetags_TABLE.'( 107 if (pwg_db_num_rows(pwg_query($query))) 108 { 109 $page['errors'][] = l10n('This name is already used'); 110 } 111 else if ( ($color = check_color($_POST['typetag_color'])) === false ) 112 { 113 $page['errors'][] = l10n('Invalid color'); 114 } 115 else 116 { 117 $query = ' 118 INSERT INTO ' . TYPETAGS_TABLE . '( 147 119 name, 148 120 color 149 121 ) 150 122 VALUES( 151 "' .$_POST['typetag_name'].'",152 "' .$_POST['typetag_color'].'"123 "' . pwg_db_real_escape_string($_POST['typetag_name']) . '", 124 "' . $color . '" 153 125 ) 154 126 ;'; 155 pwg_query($query); 156 157 array_push($page['infos'], l10n('typetag_saved')); 158 } 159 } 160 161 // +-----------------------------------------------------------------------+ 162 // | Associate Tag to Typetage | 163 // +-----------------------------------------------------------------------+ 164 165 if (isset($_POST['delete_all_assoc'])) 166 { 167 pwg_query('UPDATE '.TAGS_TABLE.' SET id_typetags = NULL;'); 168 array_push($page['infos'], l10n('All associations have been removed')); 169 } 170 else if (isset($_POST['associations'])) 171 { 172 // beautify the parameters array 173 $string = preg_replace('#[;]$#', null, $_POST['associations']); 174 $associations = array(); 175 $a = explode(';', $string); 176 177 foreach ($a as $s) 178 { 179 $v = explode(':', $s); 180 $associations[ltrim($v[0],'t-')] = ltrim($v[1],'tt-'); 181 } 182 183 // save associations 184 $updates = array(); 185 foreach ($associations as $tag => $typetag) 186 { 187 array_push($updates, array( 188 'id' => $tag, 189 'id_typetags' => $typetag, 127 pwg_query($query); 128 129 $page['infos'][] = l10n('Color added'); 130 } 131 } 132 133 if (count($page['errors'])) 134 { 135 $template->assign('typetag', array( 136 'NAME' => $_POST['typetag_name'], 137 'COLOR' => $_POST['typetag_color'], 190 138 )); 191 139 } 192 193 mass_updates(194 TAGS_TABLE,195 array('primary' => array('id'), 'update' => array('id_typetags')),196 $updates197 );198 199 array_push($page['infos'], l10n('typetags_associated'));200 140 } 201 141 … … 208 148 'show_all' => $_POST['show_all'] == 'true', 209 149 ); 210 150 211 151 conf_update_param('TypeTags', serialize($conf['TypeTags'])); 152 $page['infos'][] = l10n('Information data registered in database'); 212 153 } 213 154 … … 217 158 // | template init | 218 159 // +-----------------------------------------------------------------------+ 219 220 $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin/typetags_admin.tpl')); 221 222 // get all tags 223 $query = ' 224 SELECT 225 id as tagid, 226 name as tagname, 227 id_typetags as typetagid 228 FROM '.TAGS_TABLE.' 229 ORDER BY name ASC 230 ;'; 231 $all_tags = pwg_query($query); 232 233 while ($row = pwg_db_fetch_assoc($all_tags)) 234 { 235 if (!$row['typetagid']) $row['typetagid'] = 'NULL'; 236 $row['tagname'] = strip_tags(trigger_event('render_tag_name', $row['tagname'])); 237 $template->append('typetags_association', $row); 238 } 160 $template->assign('TYPETAGS_PATH', TYPETAGS_PATH); 161 $template->assign('F_ACTION', TYPETAGS_ADMIN); 239 162 240 163 // get all typetags 241 $query = 'SELECT * FROM ' .typetags_TABLE.' ORDER BY name;';242 $ all_typetags= pwg_query($query);243 244 while ($row = pwg_db_fetch_assoc($ all_typetags))164 $query = 'SELECT * FROM ' . TYPETAGS_TABLE . ' ORDER BY name;'; 165 $result = pwg_query($query); 166 167 while ($row = pwg_db_fetch_assoc($result)) 245 168 { 246 169 $row['color_text'] = get_color_text($row['color']); 247 $row['u_edit'] = typetags_ADMIN . '&edittypetag=' . $row['id'];248 $row['u_delete'] = typetags_ADMIN . '&deletetypetag=' . $row['id'];249 250 $template->append('typetags _selection', $row);170 $row['u_edit'] = TYPETAGS_ADMIN . '&edittypetag=' . $row['id']; 171 $row['u_delete'] = TYPETAGS_ADMIN . '&deletetypetag=' . $row['id']; 172 173 $template->append('typetags', $row); 251 174 } 252 175 … … 254 177 if (isset($_GET['edittypetag'])) 255 178 { 256 $edited_typetag['id'] = $_GET['edittypetag'];257 } 258 259 if (isset($edited_typetag['id']) )179 $edited_typetag['id'] = intval($_GET['edittypetag']); 180 } 181 182 if (isset($edited_typetag['id']) and $edited_typetag['id']>0) 260 183 { 261 184 $template->assign('edited_typetag', $edited_typetag['id']); 262 185 263 186 $query = ' 264 SELECT 265 id, 266 name, 267 color 268 FROM '.typetags_TABLE.' 269 WHERE id = '.$edited_typetag['id'].' 187 SELECT * 188 FROM ' . TYPETAGS_TABLE . ' 189 WHERE id = ' . $edited_typetag['id'] . ' 270 190 ;'; 271 191 $row = pwg_db_fetch_assoc(pwg_query($query)); … … 278 198 'NAME' => isset($edited_typetag['name']) ? $edited_typetag['name'] : $row['name'], 279 199 'COLOR'=> isset($edited_typetag['color']) ? $edited_typetag['color'] : $row['color'], 280 ));281 200 )); 201 282 202 $template->assign('IN_EDIT', true); 283 203 } … … 286 206 // | sending html code | 287 207 // +-----------------------------------------------------------------------+ 288 289 $template->assign('typetags_ADMIN', typetags_ADMIN); 290 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 291 292 ?> 208 $template->set_filename('typetags', realpath(TYPETAGS_PATH . 'template/admin.tpl')); 209 $template->assign_var_from_handle('ADMIN_CONTENT', 'typetags'); -
extensions/typetags/include/events_public.inc.php
r24342 r26665 1 1 <?php 2 defined('TYPETAGS_PATH') or die('Hacking attempt!'); 2 3 3 4 /** 4 5 * triggered by 'render_tag_name' 5 6 */ 6 function typetags_render($tag )7 function typetags_render($tag_name, $tag=array()) 7 8 { 8 global $pwg_loaded_plugins, $page ;9 10 if ( defined('IN_ADMIN') and in_array($page['page'], array('photo', 'batch_manager')))9 global $pwg_loaded_plugins, $page, $typetags_cache; 10 11 if (defined('IN_ADMIN') and in_array($page['page'], array('photo', 'batch_manager', 'tags'))) 11 12 { 12 return $tag ;13 return $tag_name; 13 14 } 14 15 $query = ' 15 16 if (isset($typetags_cache['tags'][$tag_name])) 17 { 18 return $typetags_cache['tags'][$tag_name]; 19 } 20 21 if (!isset($typetags_cache['colors'])) 22 { 23 $query = ' 24 SELECT id, color 25 FROM ' . TYPETAGS_TABLE . ' 26 ;'; 27 $typetags_cache['colors'] = query2array($query, 'id', 'color'); 28 } 29 30 if (!empty($tag['id_typetags'])) 31 { 32 $color = $typetags_cache['colors'][ $tag['id_typetags'] ]; 33 } 34 else 35 { 36 if (isset($tag['id'])) 37 { 38 $where = 't.id = ' . $tag['id']; 39 } 40 else 41 { 42 $where = 't.name = "' . pwg_db_real_escape_string($tag_name) . '"'; 43 } 44 45 $query = ' 16 46 SELECT color 17 FROM '.typetags_TABLE.' AS tt 18 INNER JOIN '.TAGS_TABLE.' AS t 19 ON t.id_typetags = tt.id 20 WHERE t.name = "'.pwg_db_real_escape_string($tag).'" 21 ;';; 22 list($color) = pwg_db_fetch_row(pwg_query($query)); 23 24 if ($color === null) 47 FROM ' . TYPETAGS_TABLE . ' AS tt 48 INNER JOIN ' . TAGS_TABLE . ' AS t 49 ON t.id_typetags = tt.id 50 WHERE ' . $where . ' 51 ;'; 52 list($color) = pwg_db_fetch_row(pwg_query($query)); 53 } 54 55 if ($color === null) 25 56 { 26 return $tag;57 $ret = $tag_name; 27 58 } 28 59 elseif (isset($pwg_loaded_plugins['ExtendedDescription'])) 29 60 { 30 return "[lang=all]<span style='color:".$color.";'>[/lang]".$tag."[lang=all]</span>[/lang]";61 $ret = '[lang=all]<span style="color:' . $color . ';">[/lang]' . $tag_name . '[lang=all]</span>[/lang]'; 31 62 } 32 63 else 33 64 { 34 return "<span style='color:".$color.";'>".$tag."</span>";65 $ret = '<span style="color:' . $color . ';">' . $tag_name . '</span>'; 35 66 } 67 68 $typetags_cache['tags'][$tag_name] = $ret; 69 return $ret; 36 70 } 37 71 … … 42 76 { 43 77 global $template; 44 78 45 79 $tags = $template->get_template_vars('related_tags'); 46 80 if (empty($tags)) return; 47 81 48 82 $query = ' 49 83 SELECT 50 84 t.id , 51 85 tt.color 52 FROM '. typetags_TABLE.' AS tt86 FROM '.TYPETAGS_TABLE.' AS tt 53 87 INNER JOIN '.TAGS_TABLE.' AS t 54 88 ON t.id_typetags = tt.id … … 65 99 } 66 100 } 67 101 68 102 $template->clear_assign('related_tags'); 69 103 $template->assign('related_tags', $tags); … … 75 109 function typetags_tags() 76 110 { 77 global $template; 111 global $template, $page, $tags; 112 113 if (empty($tags)) 114 { 115 return; 116 } 78 117 79 118 $query = ' 80 119 SELECT 81 t.id 120 t.id, 82 121 tt.color 83 FROM ' .typetags_TABLE.' AS tt84 INNER JOIN ' .TAGS_TABLE.' AS t85 122 FROM ' . TYPETAGS_TABLE . ' AS tt 123 INNER JOIN ' . TAGS_TABLE . ' AS t 124 ON t.id_typetags = tt.id 86 125 WHERE t.id_typetags IS NOT NULL 87 126 ;'; 88 $tagsColor = simple_hash_from_query($query, 'id', 'color'); 89 if (empty($tagsColor)) return; 127 $tagsColor = query2array($query, 'id', 'color'); 90 128 91 $display = $template->get_template_vars('display_mode'); 92 if ($display == 'letters') 129 if (empty($tagsColor)) 130 { 131 return; 132 } 133 134 // LETTERS 135 if ($page['display_mode'] == 'letters') 93 136 { 94 137 $letters = $template->get_template_vars('letters'); 95 if (empty($letters)) return;96 138 97 foreach ($letters as $k1 =>$letter)139 foreach ($letters as &$letter) 98 140 { 99 foreach ($letter['tags'] as $k2 =>$tag)141 foreach ($letter['tags'] as &$tag) 100 142 { 101 143 if (isset($tagsColor[ $tag['id'] ])) 102 144 { 103 $ letters[$k1]['tags'][$k2]['URL'].= '" style="color:'.$tagsColor[ $tag['id'] ].';';145 $tag['URL'].= '" style="color:' . $tagsColor[ $tag['id'] ] . ';'; 104 146 } 105 147 } 148 unset($tag); 106 149 } 107 108 $template->clear_assign('letters'); 150 unset($letter); 151 109 152 $template->assign('letters', $letters); 110 153 } 111 elseif ($display == 'cloud') 154 // CLOUD 155 else if ($page['display_mode'] == 'cloud') 112 156 { 113 157 $tags = $template->get_template_vars('tags'); 114 if (empty($tags)) return;115 158 116 foreach ($tags as $key =>$tag)159 foreach ($tags as &$tag) 117 160 { 118 161 if (isset($tagsColor[ $tag['id'] ])) 119 162 { 120 $tag s[$key]['URL'].= '" style="color:'.$tagsColor[ $tag['id'] ].';';163 $tag['URL'].= '" style="color:' . $tagsColor[ $tag['id'] ] . ';'; 121 164 } 122 165 } 123 124 $template->clear_assign('tags'); 166 unset($tag); 167 125 168 $template->assign('tags', $tags); 126 169 } 127 elseif ($display == 'cumulus') 170 // CUMULUS 171 else if ($page['display_mode'] == 'cumulus') 128 172 { 129 173 $tags = $template->get_template_vars('tags'); 130 if (empty($tags)) return;131 174 132 foreach ($tags as $key =>$tag)175 foreach ($tags as &$tag) 133 176 { 134 177 if (isset($tagsColor[ $tag['id'] ])) 135 178 { 136 179 $tagsColor[ $tag['id'] ] = str_replace('#', '0x', $tagsColor[ $tag['id'] ]); 137 $tag s[$key]['URL'].= '\' color=\''.$tagsColor[ $tag['id'] ].'\' hicolor=\''.$tagsColor[ $tag['id'] ];180 $tag['URL'].= '\' color=\'' . $tagsColor[ $tag['id'] ] . '\' hicolor=\'' . $tagsColor[ $tag['id'] ]; 138 181 } 139 182 } 140 141 $template->clear_assign('tags'); 183 unset($tag); 184 142 185 $template->assign('tags', $tags); 143 186 } 144 187 } 145 146 ?> -
extensions/typetags/language/ca_ES/plugin.lang.php
r15355 r26665 37 37 $lang['Only on tags page'] = 'Només a la pàgina etiquetes'; 38 38 $lang['typetag_already_exists'] = 'Aquest TypeTag ja existeix'; 39 $lang[' typetag_error'] = 'Cal omplir tots els camps (nom i color)';39 $lang['You must fill all fields (name and color)'] = 'Cal omplir tots els camps (nom i color)'; 40 40 $lang['typetag_saved'] = 'TypeTag desat'; 41 41 $lang['typetag_suppr'] = 'TypeTag eliminat'; -
extensions/typetags/language/cs_CZ/plugin.lang.php
r15356 r26665 26 26 $lang['New color'] = 'Nová barva'; 27 27 $lang['New name'] = 'Nový název'; 28 $lang[' typetag_error'] = 'Musíte vyplnit všechna pole (název a barva)';28 $lang['You must fill all fields (name and color)'] = 'Musíte vyplnit všechna pole (název a barva)'; 29 29 $lang['Color TypeTag'] = 'Barva TypeTagu'; 30 30 $lang['Create a Typetag'] = 'Vytvořit TypeTag'; -
extensions/typetags/language/da_DK/plugin.lang.php
r18318 r26665 38 38 $lang['Only on tags page'] = 'Kun på tagside'; 39 39 $lang['typetag_already_exists'] = 'Dette TypeTag findes allerede'; 40 $lang[' typetag_error'] = 'Du skal udfylde alle felter (navn og farve)';40 $lang['You must fill all fields (name and color)'] = 'Du skal udfylde alle felter (navn og farve)'; 41 41 $lang['typetag_saved'] = 'TypeTag gemt'; 42 42 $lang['typetag_suppr'] = 'TypeTag slettet'; -
extensions/typetags/language/de_DE/plugin.lang.php
r15313 r26665 21 21 $lang['typetag_suppr'] = 'TypeTag gelöscht'; 22 22 $lang['typetag_unknown'] = 'Unknown TypeTag'; 23 $lang[' typetag_error'] = 'Alle Felder müssen ausgefüllt werden (Name und Farbe)';23 $lang['You must fill all fields (name and color)'] = 'Alle Felder müssen ausgefüllt werden (Name und Farbe)'; 24 24 $lang['All associations have been removed'] = 'All associations have been removed'; 25 25 $lang['typetags_associated'] = 'TypeTags wurde assoziiert'; -
extensions/typetags/language/el_GR/plugin.lang.php
r15317 r26665 37 37 $lang['Only on tags page'] = 'Μόνο στη σελίδα ετικετών'; 38 38 $lang['typetag_already_exists'] = 'Αυτό το TypeTag υπάρχει ήδη '; 39 $lang[' typetag_error'] = 'Θα πρέπει να συμπληρώσετε όλα τα πεδία (όνομα και το χρώμα)';39 $lang['You must fill all fields (name and color)'] = 'Θα πρέπει να συμπληρώσετε όλα τα πεδία (όνομα και το χρώμα)'; 40 40 $lang['typetag_saved'] = 'TypeTag αποθηκεύτηκε '; 41 41 $lang['typetag_suppr'] = 'TypeTag διεγράφη'; -
extensions/typetags/language/en_UK/plugin.lang.php
r15149 r26665 1 1 <?php 2 2 3 /* section */ 4 $lang['Create a Typetag'] = 'Create a TypeTag'; 5 $lang['Edit typetag'] = 'Edit TypeTag'; 6 $lang['Edit and associate TypeTags'] = 'Edit and associate TypeTags'; 7 8 /* fields */ 9 $lang['Edited TypeTag'] = 'TypeTag edited'; 10 $lang['New color'] = 'New color'; 11 $lang['New TypeTag'] = 'TypeTag name'; 12 $lang['New name'] = 'New name'; 13 $lang['Color TypeTag'] = 'TypeTag color'; 14 $lang['Not associated'] = 'Not associated'; 3 $lang['Add a new color'] = 'Add a new color'; 4 $lang['Apply the same color to all tags'] = 'Apply the same color to all tags'; 5 $lang['Color'] = 'Color'; 6 $lang['Color added'] = 'Color added'; 7 $lang['Color deleted'] = 'Color deleted'; 8 $lang['Color saved'] = 'Color saved'; 9 $lang['Edit color'] = 'Edit color'; 10 $lang['Go to <a href="%s">Photos/Tags</a> to manage associations.'] = 'Go to <a href="%s">Photos/Tags</a> to manage associations.'; 11 $lang['Invalid color'] = 'Invalid color'; 12 $lang['Manage colors'] = 'Manage colors'; 13 $lang['This name is already used'] = 'This name is already used'; 14 $lang['Set a different color for each tag'] = 'Set a different color for each tag'; 15 $lang['Set tags color'] = 'Set tags color'; 15 16 $lang['Display colored tags'] = 'Display colored tags'; 16 17 $lang['Only on tags page'] = 'Only on tags page'; 17 18 $lang['Everywhere'] = 'Everywhere'; 18 19 /* buttons */ 20 $lang['Modify'] = 'Modify'; 21 $lang['Delete all associations'] = 'Delete all associations'; 22 23 /* messages */ 24 $lang['typetag_already_exists'] = 'This TypeTag already exists'; 25 $lang['typetag_saved'] = 'TypeTag saved'; 26 $lang['typetag_suppr'] = 'TypeTag deleted'; 27 $lang['typetag_unknown'] = 'Unknown TypeTag'; 28 $lang['typetag_error'] = 'You must fill all fields (name and color)'; 29 $lang['All associations have been removed'] = 'All associations have been removed'; 30 $lang['typetags_associated'] = 'TypeTags associated'; 19 $lang['New color'] = 'New color'; 20 $lang['You must fill all fields (name and color)'] = 'You must fill all fields (name and color)'; 31 21 32 22 ?> -
extensions/typetags/language/es_ES/plugin.lang.php
r15303 r26665 21 21 $lang['typetag_suppr'] = 'TypeTag suprimido'; 22 22 $lang['typetag_unknown'] = 'Unknown TypeTag'; 23 $lang[' typetag_error'] = 'Usted debe informar todos los campos (nombre y color)';23 $lang['You must fill all fields (name and color)'] = 'Usted debe informar todos los campos (nombre y color)'; 24 24 $lang['All associations have been removed'] = 'All associations have been removed'; 25 25 $lang['typetags_associated'] = 'TypeTags asociado'; -
extensions/typetags/language/fr_FR/plugin.lang.php
r15149 r26665 1 1 <?php 2 2 3 /* section */ 4 $lang['Create a Typetag'] = 'Créer un TypeTag'; 5 $lang['Edit typetag'] = 'Editer le TypeTag'; 6 $lang['Edit and associate TypeTags'] = 'Editer et associer les TypeTags'; 7 8 /* fields */ 9 $lang['Edited TypeTag'] = 'TypeTag édité'; 3 $lang['Add a new color'] = 'Ajouter une nouvelle couleur'; 4 $lang['Apply the same color to all tags'] = 'Appliquer la même couleur à tous les tags'; 5 $lang['Color'] = 'Couleur'; 6 $lang['Color added'] = 'Couleur ajoutée'; 7 $lang['Color deleted'] = 'Couleur supprimée'; 8 $lang['Color saved'] = 'Couleur sauvegardée'; 9 $lang['Edit color'] = 'Editer une couleur'; 10 $lang['Go to <a href="%s">Photos/Tags</a> to manage associations.'] = 'Allez sur <a href="%s">Photos/Tags</a> pour gérer les associations.'; 11 $lang['Invalid color'] = 'Couleur invalide'; 12 $lang['Manage colors'] = 'Gérer les couleurs'; 13 $lang['This name is already used'] = 'The nom est déjà utilisé'; 14 $lang['Set a different color for each tag'] = 'Appliquer une couleur différente à chaque tag'; 15 $lang['Set tags color'] = 'Changer la couleur des tags'; 16 $lang['Display colored tags'] = 'Afficher les tags colorés'; 17 $lang['Only on tags page'] = 'Uniquement sur la liste des tags'; 18 $lang['Everywhere'] = 'Partout'; 10 19 $lang['New color'] = 'Nouvelle couleur'; 11 $lang['New TypeTag'] = 'Nom du TypeTag'; 12 $lang['New name'] = 'Nouveau nom'; 13 $lang['Color TypeTag'] = 'Couleur du TypeTag'; 14 $lang['Not associated'] = 'Non associés'; 15 $lang['Display colored tags'] = 'Afficher les tags colorés'; 16 $lang['Only on tags page'] = 'Seulement sur la page des tags'; 17 $lang['Everywhere'] = 'Partout'; 18 19 /* buttons */ 20 $lang['Modify'] = 'Modifier'; 21 $lang['Delete all associations'] = 'Supprimer toutes les associations'; 22 23 /* messages */ 24 $lang['typetag_already_exists'] = 'Ce TypeTag existe déjà'; 25 $lang['typetag_saved'] = 'TypeTag enregistré'; 26 $lang['typetag_suppr'] = 'TypeTag supprimé'; 27 $lang['typetag_unknown'] = 'TypeTag inconnu'; 28 $lang['typetag_error'] = 'Vous devez renseigner tous les champs (nom et couleur)'; 29 $lang['All associations have been removed'] = 'Tous les associations ont été supprimées'; 30 $lang['typetags_associated'] = 'TypeTags associés'; 20 $lang['You must fill all fields (name and color)'] = 'Vous devez remplir tous les champs (nom et couleur)'; 31 21 32 22 ?> -
extensions/typetags/language/gl_ES/plugin.lang.php
r21031 r26665 32 32 $lang['typetag_unknown'] = 'EtiquetaTipo descoñecida'; 33 33 $lang['typetags_associated'] = 'EtiquetasTipo asociadas'; 34 $lang[' typetag_error'] = 'Debes encher tódolos campos (nome e cor)';34 $lang['You must fill all fields (name and color)'] = 'Debes encher tódolos campos (nome e cor)'; 35 35 $lang['Delete all associations'] = 'Eliminar todas as asociacións'; 36 36 $lang['Display colored tags'] = 'Amosar as etiquetas coloreadas'; -
extensions/typetags/language/hu_HU/plugin.lang.php
r15751 r26665 37 37 $lang['Only on tags page'] = 'Csak a címkék oldalon'; 38 38 $lang['typetag_already_exists'] = 'Ilyes címke típus már létezik'; 39 $lang[' typetag_error'] = 'Ki kel tölteni a mezőket (név és szín)';39 $lang['You must fill all fields (name and color)'] = 'Ki kel tölteni a mezőket (név és szín)'; 40 40 $lang['typetag_saved'] = 'Címke típus mentve'; 41 41 $lang['typetag_suppr'] = 'Címke típus törölve'; -
extensions/typetags/language/it_IT/plugin.lang.php
r15397 r26665 21 21 $lang['typetag_suppr'] = 'TypeTag cancellato'; 22 22 $lang['typetag_unknown'] = 'TypeTag sconosciuto'; 23 $lang[' typetag_error'] = 'Dovete inserire tutti campi (nome e colore)';23 $lang['You must fill all fields (name and color)'] = 'Dovete inserire tutti campi (nome e colore)'; 24 24 $lang['All associations have been removed'] = 'Tutte le associazioni sono state rimosse'; 25 25 $lang['typetags_associated'] = 'TypeTag associato'; -
extensions/typetags/language/lv_LV/plugin.lang.php
r15616 r26665 21 21 $lang['typetag_suppr'] = 'TypeTag dzēsti'; 22 22 $lang['typetag_unknown'] = 'Unknown TypeTag'; 23 $lang[' typetag_error'] = 'Jums jāinformē visus laukus (nosaukums un krāsa)';23 $lang['You must fill all fields (name and color)'] = 'Jums jāinformē visus laukus (nosaukums un krāsa)'; 24 24 $lang['All associations have been removed'] = 'All associations have been removed'; 25 25 $lang['typetags_associated'] = 'TypeTags sasaistīts'; -
extensions/typetags/language/nb_NO/plugin.lang.php
r15417 r26665 21 21 $lang['typetag_suppr'] = 'TypeTag slettet'; 22 22 $lang['typetag_unknown'] = 'Unknown TypeTag'; 23 $lang[' typetag_error'] = 'Du må inkludere alle felter (navn og farge)';23 $lang['You must fill all fields (name and color)'] = 'Du må inkludere alle felter (navn og farge)'; 24 24 $lang['All associations have been removed'] = 'All associations have been removed'; 25 25 $lang['typetags_associated'] = 'TypeTags assossiert'; -
extensions/typetags/language/nl_NL/plugin.lang.php
r15157 r26665 32 32 $lang['New name'] = 'Nieuwe naam'; 33 33 $lang['typetag_already_exists'] = 'Deze TypeTag bestaat al'; 34 $lang[' typetag_error'] = 'Je moet alle velden invullen (naam en kleur)';34 $lang['You must fill all fields (name and color)'] = 'Je moet alle velden invullen (naam en kleur)'; 35 35 $lang['typetag_saved'] = 'TypeTag opgeslagen'; 36 36 $lang['typetag_suppr'] = 'TypeTag verwijderd'; -
extensions/typetags/language/pl_PL/plugin.lang.php
r15321 r26665 33 33 $lang['typetags_associated'] = 'Powiązano TypeTag'; 34 34 $lang['typetag_already_exists'] = 'Ten TypeTag już istnieje'; 35 $lang[' typetag_error'] = 'Należy uzupełnić wszystkie pola (nazwę i kolor)';35 $lang['You must fill all fields (name and color)'] = 'Należy uzupełnić wszystkie pola (nazwę i kolor)'; 36 36 $lang['typetag_saved'] = 'Zapisano TypeTag'; 37 37 $lang['typetag_suppr'] = 'Skasowano TypeTag'; -
extensions/typetags/language/pt_BR/plugin.lang.php
r21492 r26665 38 38 $lang['Only on tags page'] = 'Somente na página etiquetas'; 39 39 $lang['typetag_already_exists'] = 'Este TipoEtiqueta já existe'; 40 $lang[' typetag_error'] = 'Você deve preencher todos os campos (nome e cor)';40 $lang['You must fill all fields (name and color)'] = 'Você deve preencher todos os campos (nome e cor)'; 41 41 $lang['typetag_saved'] = 'TipoEtiqueta salvo'; 42 42 $lang['typetag_suppr'] = 'TipoEtiqueta eliminado'; -
extensions/typetags/language/pt_PT/plugin.lang.php
r15550 r26665 37 37 $lang['Only on tags page'] = 'Apenas na página de etiquetas'; 38 38 $lang['typetag_already_exists'] = 'Já existe o tipo de etiqueta'; 39 $lang[' typetag_error'] = 'Deve preencher todos os campos ( nome e cor)';39 $lang['You must fill all fields (name and color)'] = 'Deve preencher todos os campos ( nome e cor)'; 40 40 $lang['typetag_saved'] = 'Tipo de etiqueta salvo'; 41 41 $lang['typetag_suppr'] = 'Apagado o tipo de etiqueta'; -
extensions/typetags/language/ru_RU/plugin.lang.php
r15185 r26665 32 32 $lang['New name'] = 'Новое название'; 33 33 $lang['typetag_already_exists'] = 'Этот тип тегов уже есть'; 34 $lang[' typetag_error'] = 'Нужно заполнить все поля (название и цвет)';34 $lang['You must fill all fields (name and color)'] = 'Нужно заполнить все поля (название и цвет)'; 35 35 $lang['typetag_saved'] = 'Тип тегов сохранен'; 36 36 $lang['typetag_suppr'] = 'Тип тегов удален'; -
extensions/typetags/language/sk_SK/plugin.lang.php
r15304 r26665 19 19 $lang['typetag_already_exists'] = 'Tento typ kľúčového slova už existuje'; 20 20 $lang['typetag_unknown'] = 'Unknown TypeTag'; 21 $lang[' typetag_error'] = 'Môžete meniť všetky údaje (názov a farbu)';21 $lang['You must fill all fields (name and color)'] = 'Môžete meniť všetky údaje (názov a farbu)'; 22 22 $lang['All associations have been removed'] = 'All associations have been removed'; 23 23 $lang['typetags_associated'] = 'Kľúčové slovo spojené'; -
extensions/typetags/language/tr_TR/plugin.lang.php
r17195 r26665 37 37 $lang['Only on tags page'] = 'Sadece bir etiket sayfası'; 38 38 $lang['typetag_already_exists'] = 'Bu TypeTag zaten var'; 39 $lang[' typetag_error'] = 'Tüm alanları doldurmalısınız (isim ve renk)';39 $lang['You must fill all fields (name and color)'] = 'Tüm alanları doldurmalısınız (isim ve renk)'; 40 40 $lang['typetag_saved'] = 'TypeTag kaydedildi'; 41 41 $lang['typetag_suppr'] = 'TypeTag silindi'; -
extensions/typetags/language/uk_UA/plugin.lang.php
r15243 r26665 33 33 $lang['typetags_associated'] = 'TypeTags, пов\'язані'; 34 34 $lang['typetag_already_exists'] = 'Це TypeTag вже існує'; 35 $lang[' typetag_error'] = 'Ви повинні заповнити всі поля (ім\'я та колір)';35 $lang['You must fill all fields (name and color)'] = 'Ви повинні заповнити всі поля (ім\'я та колір)'; 36 36 $lang['typetag_saved'] = 'TypeTag збережено'; 37 37 $lang['typetag_suppr'] = 'TypeTag видалено'; -
extensions/typetags/language/zh_CN/plugin.lang.php
r20726 r26665 23 23 $lang['Edit and associate TypeTags'] = '编辑和关联TypeTag(标签组)'; 24 24 $lang['Not associated'] = '尚未关联到标签组的标签'; 25 $lang[' typetag_error'] = '请完整填写信息(名称与颜色)';25 $lang['You must fill all fields (name and color)'] = '请完整填写信息(名称与颜色)'; 26 26 $lang['typetags_associated'] = 'TypeTag(标签组)已关联'; 27 27 $lang['All associations have been removed'] = '所有关联已删除'; -
extensions/typetags/language/zh_TW/plugin.lang.php
r24481 r26665 28 28 $lang['Only on tags page'] = '僅在標籤頁'; 29 29 $lang['typetag_already_exists'] = '此TypeTag(標籤組)已存在'; 30 $lang[' typetag_error'] = '請完整填寫信息(名稱與顏色)';30 $lang['You must fill all fields (name and color)'] = '請完整填寫信息(名稱與顏色)'; 31 31 $lang['typetag_saved'] = 'TypeTag(標籤組)已保存'; 32 32 $lang['typetag_suppr'] = 'TypeTag(標籤組)已刪除'; -
extensions/typetags/main.inc.php
r21361 r26665 1 1 <?php 2 2 /* 3 Plugin Name: TypeT@gs3 Plugin Name: Coloured Tags (TypeT@gs) 4 4 Version: auto 5 5 Description: Allow to manage color of tags, as you want... 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=1667 Author: Sakkhho & P@t &Mistic6 Plugin URI: auto 7 Author: Mistic 8 8 */ 9 9 10 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');10 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 11 11 12 12 global $prefixeTable, $conf; 13 13 14 define('typetags_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); 15 define('typetags_TABLE' , $prefixeTable . 'typetags'); 16 define('typetags_ADMIN', get_root_url().'admin.php?page=plugin-' . basename(dirname(__FILE__))); 14 define('TYPETAGS_ID', basename(dirname(__FILE__))); 15 define('TYPETAGS_PATH' , PHPWG_PLUGINS_PATH . TYPETAGS_ID . '/'); 16 define('TYPETAGS_TABLE' , $prefixeTable . 'typetags'); 17 define('TYPETAGS_ADMIN', get_root_url().'admin.php?page=plugin-' . TYPETAGS_ID); 18 define('TYPETAGS_VERSION', 'auto'); 17 19 18 20 19 include_once(typetags_PATH . 'typetags.php');20 21 $conf['TypeTags'] = unserialize($conf['TypeTags']); 22 23 24 include_once(TYPETAGS_PATH . 'include/events_public.inc.php'); 21 25 22 26 // tags on picture page … … 27 31 28 32 // tags everywhere 29 if ( $conf['TypeTags']['show_all'] and script_basename() != 'tags')33 if ($conf['TypeTags']['show_all'] and script_basename() != 'tags') 30 34 { 31 add_event_handler('render_tag_name', 'typetags_render', 0); 32 } 33 // tags on tags page 34 else if (script_basename() == 'tags') 35 { 36 add_event_handler('loc_begin_page_header', 'typetags_tags'); 35 add_event_handler('render_tag_name', 'typetags_render', 0, 2); 37 36 } 38 37 38 // tags on tags page 39 add_event_handler('loc_end_tags', 'typetags_tags'); 39 40 40 add_event_handler('get_admin_plugin_menu_links', 'typetags_admin_menu');41 41 42 function typetags_admin_menu($menu)42 if (defined('IN_ADMIN')) 43 43 { 44 a rray_push($menu, array(45 'NAME' => 'TypeT@gs', 46 'URL' => typetags_ADMIN,47 )); 48 return $menu;44 add_event_handler('get_admin_plugin_menu_links', 'typetags_admin_menu'); 45 46 add_event_handler('loc_begin_admin_page', 'typetags_admin'); 47 48 include_once(TYPETAGS_PATH . 'include/events_admin.inc.php'); 49 49 } 50 51 ?> -
extensions/typetags/maintain.inc.php
r21361 r26665 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 3 3 4 function plugin_install() 4 class typetags_maintain extends PluginMaintain 5 5 { 6 global $prefixeTable;6 private $installed = false; 7 7 8 $query = 'SHOW FULL COLUMNS FROM ' . TAGS_TABLE . ';'; 9 $result = array_from_query($query, 'Field'); 10 if (!in_array('id_typetags', $result)) 8 private $default_conf = array( 9 'show_all'=>true, 10 ); 11 12 function install($plugin_version, &$errors=array()) 11 13 { 12 pwg_query('ALTER TABLE '.TAGS_TABLE.' ADD COLUMN `id_typetags` SMALLINT(5);'); 13 } 14 global $conf, $prefixeTable; 14 15 15 $result = pwg_query('SHOW TABLES LIKE "' . $prefixeTable .'typetags"'); 16 if (!pwg_db_num_rows($result)) 17 { 16 if (empty($conf['TypeTags'])) 17 { 18 $conf['TypeTags'] = serialize($this->default_conf); 19 conf_update_param('TypeTags', $conf['TypeTags']); 20 } 21 22 $result = pwg_query('SHOW COLUMNS FROM `' . TAGS_TABLE . '` LIKE "id_typetags";'); 23 if (!pwg_db_num_rows($result)) 24 { 25 pwg_query('ALTER TABLE `' . TAGS_TABLE . '` ADD `id_typetags` SMALLINT(5) DEFAULT NULL;'); 26 } 27 18 28 $query = ' 19 CREATE TABLE `'. $prefixeTable .'typetags` (29 CREATE TABLE IF NOT EXISTS `' . $prefixeTable . 'typetags` ( 20 30 `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, 21 31 `name` varchar(255) NOT NULL, … … 25 35 ;'; 26 36 pwg_query($query); 37 38 $this->installed = true; 27 39 } 28 29 conf_update_param('TypeTags', serialize(array('show_all'=>true)));30 }31 40 32 function plugin_activate() 33 { 34 global $conf; 35 36 if (!isset($conf['TypeTags'])) 41 function activate($plugin_version, &$errors=array()) 37 42 { 38 conf_update_param('TypeTags', serialize(array('show_all'=>true))); 43 if (!$this->installed) 44 { 45 $this->install($plugin_version, $errors); 46 } 47 } 48 49 function deactivate() 50 { 51 } 52 53 function uninstall() 54 { 55 global $prefixeTable; 56 57 conf_delete_param('TypeTags'); 58 59 pwg_query('ALTER TABLE `' . TAGS_TABLE . '` DROP `id_typetags`'); 60 pwg_query('DROP TABLE `' . $prefixeTable . 'typetags`;'); 39 61 } 40 62 } 41 42 function plugin_uninstall()43 {44 global $prefixeTable;45 46 pwg_query('ALTER TABLE '.TAGS_TABLE.' DROP COLUMN `id_typetags`');47 pwg_query('DROP TABLE '. $prefixeTable .'typetags;');48 pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param = "TypeTags" LIMIT 1;');49 }50 51 ?> -
extensions/typetags/template/admin.tpl
r26663 r26665 1 {combine_script id="jquery.ui.draggable"} 2 {combine_script id="jquery.ui.droppable"} 3 {combine_script id="farbtastic" require="jquery" path=$ROOT_URL|@cat:"plugins/typetags/admin/farbtastic/farbtastic.js"} 4 {combine_css path=$ROOT_URL|@cat:"plugins/typetags/admin/farbtastic/farbtastic.css"} 5 {combine_css path=$ROOT_URL|@cat:"plugins/typetags/admin/typetags_style.css"} 1 {combine_script id="farbtastic" require="jquery" path=$TYPETAGS_PATH|cat:"template/farbtastic/farbtastic.js"} 2 {combine_css path=$TYPETAGS_PATH|cat:"template/farbtastic/farbtastic.css"} 3 {combine_css path=$TYPETAGS_PATH|cat:"template/style.css"} 6 4 7 {footer_script}{literal} 8 // set all containers the same size 9 function equilibrate() { 10 var h=0; 11 jQuery("#associations ul") 12 .css('height', 'auto') 13 .each(function() { 14 h = Math.max(h, jQuery(this).height()); 15 }) 16 .promise().done(function() { 17 jQuery("#associations ul").css({'height': h+'px'}); 18 }); 19 20 //jQuery("#tt-NULL").css('height', 'auto'); 21 } 22 23 // generate tag:typetag couples before submit the form 24 function save_datas(form) { 25 var out = ''; 26 27 jQuery(".tt-container").each(function() { 28 var section = jQuery(this).attr('id'); 29 jQuery("> li", this).each(function() { 30 out += jQuery(this).attr('id') + ':' + section + ';'; 31 }); 32 }); 33 34 jQuery('#assoc-input').val(out); 35 submit(form); 36 } 37 38 // colorpicker 5 {footer_script} 6 // init colorpicker 39 7 jQuery('#colorpicker').farbtastic('#hexval'); 40 41 // move each tag in it's typetag container 42 jQuery('ul#tt-NULL li').each(function() { 43 var $target = jQuery('ul#' + jQuery(this).attr('data')); 44 jQuery(this).appendTo($target).css('float', 'left'); 45 if ($($target).attr('id') == 'tt-NULL') jQuery(this).css({'display':'inline-block','float':'none'}); 46 }); 47 equilibrate(); 48 49 // init drag 50 jQuery("li").draggable({ 51 revert: "invalid", 52 helper: "clone", 53 cursor: "move" 54 }); 55 56 // init drop 57 jQuery('.tt-container').droppable({ 58 accept: "li", 59 hoverClass: "active", 60 drop: function(event, ui) { 61 var $gallery = this; 62 ui.draggable.fadeOut(function() { 63 jQuery(this).appendTo($gallery).css('float', 'left').css('display','').fadeIn(); 64 if ($($gallery).attr('id') == 'tt-NULL') jQuery(this).css({'display':'inline-block','float':'none'}); 65 equilibrate(); 66 }); 67 } 68 }); 69 {/literal}{/footer_script} 8 {/footer_script} 70 9 71 10 <div class="titrePage"> 72 <h2> TypeT@gs</h2>11 <h2>Coloured Tags</h2> 73 12 </div> 74 75 <form action="{$ typetags_ADMIN}" method="post" name="form">13 14 <form action="{$F_ACTION}" method="post" name="form"> 76 15 <fieldset> 77 16 {if isset($IN_EDIT)} 78 <legend>{'Edit typetag'|@translate}</legend>17 <legend>{'Edit color'|translate}</legend> 79 18 <div class="edit-container"> 80 19 <div id="colorpicker"></div> 81 <p><b>{'Edit ed TypeTag'|@translate} : <input type="text" readonly="readonly" size="18" style="background-color:{$typetag.OLD_COLOR};color:{$typetag.COLOR_TEXT};" value="{$typetag.OLD_NAME}"></b></p>20 <p><b>{'Edit color'|translate} : <input type="text" readonly="readonly" size="18" style="background-color:{$typetag.OLD_COLOR};color:{$typetag.COLOR_TEXT};" value="{$typetag.OLD_NAME}"></b></p> 82 21 <p> </p> 83 <p>{'New name'| @translate} : <input type="text" size="18" name="typetag_name" value="{$typetag.NAME}"></p>84 <p>{'New color'| @translate} : <input type="text" id="hexval" name="typetag_color" size="7" maxlength="7" value="{$typetag.COLOR}"></p>22 <p>{'New name'|translate} : <input type="text" size="18" name="typetag_name" value="{$typetag.NAME}"></p> 23 <p>{'New color'|translate} : <input type="text" id="hexval" name="typetag_color" size="7" maxlength="7" value="{$typetag.COLOR}"></p> 85 24 <p> </p> 86 25 <p> 87 26 <input type="hidden" name="edited_typetag" value="{$edited_typetag}"> 88 <input class="submit" type="submit" name="edittypetag" value="{' Modify'|@translate}">89 <input class="submit" type="submit" name="cancel" value="{'Reset'| @translate}">27 <input class="submit" type="submit" name="edittypetag" value="{'Save'|translate}"> 28 <input class="submit" type="submit" name="cancel" value="{'Reset'|translate}"> 90 29 </p> 91 30 </div> 92 31 {else} 93 <legend>{' Create a Typetag'|@translate}</legend>32 <legend>{'Add a new color'|translate}</legend> 94 33 <div class="edit-container"> 95 34 <div id="colorpicker"></div> 96 <p>{'New TypeTag'|@translate} : <input type="text" size="18" name="typetag_name" value="{if isset($typetag.NAME)}{$typetag.NAME}{/if}"></p> 97 <p>{'Color TypeTag'|@translate} : <input type="text" id="hexval" name="typetag_color" size="7" maxlength="7" value="{if isset($typetag.COLOR)}{$typetag.COLOR}{else}#444444{/if}"></p> 35 <p> </p> 36 <p>{'Name'|translate} : <input type="text" size="18" name="typetag_name" value="{if isset($typetag.NAME)}{$typetag.NAME}{/if}"></p> 37 <p>{'Color'|translate} : <input type="text" id="hexval" name="typetag_color" size="7" maxlength="7" value="{if isset($typetag.COLOR)}{$typetag.COLOR}{else}#444444{/if}"></p> 98 38 <p> </p> 99 39 <p> 100 <input class="submit" type="submit" name="addtypetag" value="{' Create a Typetag'|@translate}">40 <input class="submit" type="submit" name="addtypetag" value="{'Add'|translate}"> 101 41 </p> 102 42 </div> … … 105 45 </form> 106 46 107 {if !empty($typetags_selection) and !isset($IN_EDIT)} 108 <form action="{$typetags_ADMIN}" method="post" name="form" onsubmit="save_datas(this);"> 47 {if !empty($typetags)} 48 <fieldset> 49 <legend>{'Manage colors'|translate}</legend> 50 51 <ul class="tagSelection typetagSelection"> 52 {foreach from=$typetags item=typetag} 53 <li style="background-color:{$typetag.color};color:{$typetag.color_text};"> 54 <span class="buttons"> 55 <a href="{$typetag.u_edit}" title="{'edit'|translate}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/edit_s.png" class="button" alt="{'edit'|translate}"></a> 56 <a href="{$typetag.u_delete}" title="{'delete'|translate}" onclick="return confirm('{'Are you sure?'|translate}');"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" class="button" alt="{'delete'|translate}"></a> 57 </span> 58 {$typetag.name} 59 </li> 60 {/foreach} 61 </ul> 62 63 <p style="text-align:left;">{'Go to <a href="%s">Photos/Tags</a> to manage associations.'|translate:($ROOT_URL|cat:'admin.php?page=tags')}</p> 64 </fieldset> 65 {/if} 66 67 68 <form action="{$F_ACTION}" method="post" name="form"> 109 69 <fieldset> 110 <legend>{'Edit and associate TypeTags'|@translate}</legend> 111 112 <ul id="tt-NULL" class="tt-container NULL"> 113 <h5>{'Not associated'|@translate}</h5> 114 {foreach from=$typetags_association item=tag} 115 <li id="t-{$tag.tagid}" data="tt-{$tag.typetagid}"> 116 {$tag.tagname} 117 </li> 118 {/foreach} 119 </ul> 120 121 <div id="associations"> 122 {foreach from=$typetags_selection item=typetag} 123 <ul id="tt-{$typetag.id}" class="tt-container" style="box-shadow:inset 0 0 5px {$typetag.color};"> 124 <span class="buttons"> 125 <a href="{$typetag.u_edit}" title="{'edit'|@translate}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/edit_s.png" class="button" alt="{'edit'|@translate}"></a> 126 <a href="{$typetag.u_delete}" title="{'delete'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" class="button" alt="{'delete'|@translate}"></a> 127 </span> 128 <h5 style="background-color:{$typetag.color};color:{$typetag.color_text};">{$typetag.name}</h5> 129 </ul> 130 {/foreach} 131 </div> 132 133 <div style="clear:both;"></div> 134 <p style="margin-top:20px;"> 135 <input type="hidden" name="associations" id="assoc-input"> 136 <input class="submit" type="submit" name="associate" value="{'Validate'|@translate}"> 137 <input class="submit" type="submit" name="delete_all_assoc" value="{'Delete all associations'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');"> 138 </p> 70 <legend>{'Configuration'|translate}</legend> 71 72 <b>{'Display colored tags'|translate}</b> 73 <label><input type="radio" name="show_all" value="false" {if not $SHOW_ALL}checked="checked"{/if}> {'Only on tags page'|translate}</label> 74 <label><input type="radio" name="show_all" value="true" {if $SHOW_ALL}checked="checked"{/if}> {'Everywhere'|translate}</label> 75 76 <p><input class="submit" type="submit" name="save_config" value="{'Submit'|translate}"></p> 139 77 </fieldset> 140 78 </form> 141 {/if}142 143 {if !isset($IN_EDIT)}144 <form action="{$typetags_ADMIN}" method="post" name="form">145 <fieldset>146 <legend>{'Configuration'|@translate}</legend>147 <b>{'Display colored tags'|@translate}</b>148 <label><input type="radio" name="show_all" value="false" {if not $SHOW_ALL}checked="checked"{/if}> {'Only on tags page'|@translate}</label>149 <label><input type="radio" name="show_all" value="true" {if $SHOW_ALL}checked="checked"{/if}> {'Everywhere'|@translate}</label>150 <p><input class="submit" type="submit" name="save_config" value="{'Submit'|@translate}"></p>151 </fieldset>152 </form>153 {/if}
Note: See TracChangeset
for help on using the changeset viewer.