Changeset 10852
- Timestamp:
- May 11, 2011, 7:17:49 PM (13 years ago)
- Location:
- extensions/Back2Front
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Back2Front/Back2Front.php
r10828 r10852 1 1 <?php 2 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 4 include_once(B2F_PATH.'functions.inc.php'); 3 5 4 6 /* … … 7 9 function Back2Front_picture_content($content, $image) 8 10 { 9 global $template, $ conf;11 global $template, $user, $conf; 10 12 11 13 /* search for a verso picture */ … … 14 16 i.id, 15 17 i.path, 16 i.has_high 18 i.has_high, 19 i.width, 20 i.height 17 21 FROM ".IMAGES_TABLE." as i 18 22 INNER JOIN ".B2F_TABLE." as v … … 26 30 { 27 31 $verso = pwg_db_fetch_assoc($result); 32 $conf['back2front'] = explode(',',$conf['back2front']); 33 34 // calculation of width and height 35 include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php'); 36 37 if (!empty($verso['width'])) 38 { 39 list( 40 $verso['scaled_width'], 41 $verso['scaled_height'] 42 ) = get_picture_size( 43 $verso['width'], 44 $verso['height'], 45 @$user['maxwidth'], 46 @$user['maxheight'] 47 ); 48 } 28 49 29 50 /* websize picture */ 30 $template->assign('VERSO_URL', $verso['path']); 51 $template->assign(array( 52 'VERSO_URL' => $verso['path'], 53 'VERSO_WIDTH' => $verso['scaled_width'], 54 'VERSO_HEIGHT' => $verso['scaled_height'], 55 'b2f_switch_mode' => $conf['back2front'][1], 56 'b2f_transition' => $conf['back2front'][2], 57 )); 31 58 32 59 /* admin link */ … … 48 75 $template->assign('B2F_PATH', B2F_PATH); 49 76 50 return $ content . $template->parse('B2F_picture_content', true);77 return $template->parse('B2F_picture_content', true).$content; 51 78 } 52 79 else … … 60 87 * Add field on picture modify page 61 88 */ 62 function Back2Front_picture_modify( )89 function Back2Front_picture_modify($menu) 63 90 { 64 91 global $page, $template, $conf; 92 93 if ($page['page'] != 'picture_modify') return $menu; 65 94 $conf['back2front'] = explode(',',$conf['back2front']); 66 67 if ($page['page'] != 'picture_modify')68 {69 return;70 }71 95 72 96 /* SAVE VALUES */ 73 97 if (isset($_POST['b2f_submit'])) 74 98 { 99 /* catch all verso and recto ids and original categories */ 100 $query = "SELECT image_id, verso_id, categories 101 FROM ".B2F_TABLE.";"; 102 $rectos = array_from_query($query, 'image_id'); 103 $versos = array_from_query($query, 'verso_id'); 104 $cats = array_from_query($query, 'categories'); 105 106 if (count($rectos) != 0) 107 { 108 $all_recto_verso = array_combine($rectos, $versos); 109 $verso_cats = array_combine($versos, $cats); 110 } 111 else 112 { 113 $all_recto_verso = array(0=>0); 114 $verso_cats = array(0=>NULL); 115 } 116 unset($rectos, $versos, $cats); 117 75 118 /* picture is verso */ 76 119 if (isset($_POST['b2f_is_verso'])) 77 { 78 /* catch all verso and recto ids */ 79 $query = "SELECT image_id, verso_id 80 FROM ".B2F_TABLE.";"; 81 $rectos = array_from_query($query, 'image_id'); 82 $versos = array_from_query($query, 'verso_id'); 83 if (count($rectos) != 0) 84 { 85 $all_recto_verso = array_combine($rectos, $versos); 86 } 87 else 88 { 89 $all_recto_verso = array(0=>0); 90 } 91 unset($rectos, $versos); 92 120 { 93 121 /* verso don't exists */ 94 122 if (!picture_exists($_POST['b2f_front_id'])) 95 123 { 96 $template->append('errors', l10n('Unknown id for frontside picture : ').$_POST['b2f_front_id']);124 array_push($page['errors'], l10n_args(get_l10n_args('Unknown id %d for frontside picture', $_POST['b2f_front_id']))); 97 125 } 98 126 /* verso same as recto */ 99 127 else if ($_POST['b2f_front_id'] == $_GET['image_id']) 100 128 { 101 $template->append('errors', l10n('Backside and frontside can\'t be the same picture'));129 array_push($page['errors'], l10n('Backside and frontside can\'t be the same picture')); 102 130 } 103 131 /* recto has already a verso */ 104 else if (in_array($_POST['b2f_front_id'], array_keys($all_recto_verso)) )132 else if (in_array($_POST['b2f_front_id'], array_keys($all_recto_verso)) AND $all_recto_verso[$_POST['b2f_front_id']] != $_GET['image_id']) 105 133 { 106 134 $recto_current_verso['id'] = $all_recto_verso[$_POST['b2f_front_id']]; 107 135 $recto_current_verso['link'] = get_root_url().'admin.php?page=picture_modify&image_id='.$recto_current_verso['id']; 108 $template->append('errors', l10n('This picture has already a backside : ').'<a href="'.$recto_current_verso['link'].'">'.$recto_current_verso['id'].'</a>'); 136 array_push($page['errors'], 137 l10n_args(get_l10n_args('The picture n°%d has already a backside : %s', 138 array($_POST['b2f_front_id'], '<a href="'.$recto_current_verso['link'].'">'.$recto_current_verso['id'].'</a>') 139 )) 140 ); 109 141 } 110 142 /* recto is already a verso */ … … 113 145 $recto_is_verso['id'] = $_POST['b2f_front_id']; 114 146 $recto_is_verso['link'] = get_root_url().'admin.php?page=picture_modify&image_id='.$recto_is_verso['id']; 115 $template->append('errors', l10n('This picture is already a backside : ').'<a href="'.$recto_is_verso['link'].'">'.$recto_is_verso['id'].'</a>');147 array_push($page['errors'], l10n_args(get_l10n_args('The picture n°%s is already a backside', '<a href="'.$recto_is_verso['link'].'">'.$recto_is_verso['id'].'</a>'))); 116 148 } 117 149 /* everything is fine */ 118 150 else 119 151 { 120 // get current categories 121 $query = "SELECT category_id FROM ".IMAGE_CATEGORY_TABLE." WHERE image_id = ".$_GET['image_id'].";"; 122 $verso_categories = array_from_query($query, 'category_id'); 123 124 // insert or update verso associations 125 pwg_query("INSERT INTO ".B2F_TABLE." 126 VALUES(".$_POST['b2f_front_id'].", ".$_GET['image_id'].", '".implode(',',$verso_categories)."') 127 ON DUPLICATE KEY UPDATE image_id = ".$_POST['b2f_front_id'].";"); 128 129 // move the verso ? 130 if (isset($_POST['b2f_move_verso'])) 152 // move the verso - if first save 153 if (isset($_POST['b2f_move_verso']) AND (!array_key_exists($_GET['image_id'], $verso_cats) OR $verso_cats[$_GET['image_id']] == NULL)) 131 154 { 155 // get current categories 156 $query = "SELECT category_id FROM ".IMAGE_CATEGORY_TABLE." WHERE image_id = ".$_GET['image_id'].";"; 157 $verso_categories = array_from_query($query, 'category_id'); 158 132 159 pwg_query("DELETE FROM ".IMAGE_CATEGORY_TABLE." 133 160 WHERE image_id = ".$_GET['image_id'].";"); 134 135 161 pwg_query("INSERT INTO ".IMAGE_CATEGORY_TABLE." 136 162 VALUES(".$_GET['image_id'].", ".$conf['back2front'][0].", NULL);"); … … 138 164 // random representant for each categories 139 165 set_random_representant($verso_categories); 166 167 $verso_categories = isset($verso_cats[$_GET['image_id']]) ? $verso_cats[$_GET['image_id']] : implode(',',$verso_categories); 168 $template->assign('B2F_MOVE_VERSO', 'checked="checked"'); 140 169 } 170 // restore the verso - if precedently moved 171 else if (!isset($_POST['b2f_move_verso']) AND array_key_exists($_GET['image_id'], $verso_cats) AND $verso_cats[$_GET['image_id']] != NULL) 172 { 173 $item['verso_id'] = $_GET['image_id']; 174 $item['categories'] = $verso_cats[$_GET['image_id']]; 175 back2front_restaure_categories($item); 176 177 $verso_categories = 'NULL'; 178 $template->assign('B2F_MOVE_VERSO', ''); 179 } 180 // leave the verso 181 else 182 { 183 $verso_categories = isset($verso_cats[$_GET['image_id']]) ? $verso_cats[$_GET['image_id']] : 'NULL'; 184 $template->assign('B2F_MOVE_VERSO', isset($verso_cats[$_GET['image_id']]) ? 'checked="checked"' : ''); 185 } 186 187 // insert or update verso associations 188 pwg_query("INSERT INTO ".B2F_TABLE." 189 VALUES(".$_POST['b2f_front_id'].", ".$_GET['image_id'].", '".$verso_categories."') 190 ON DUPLICATE KEY UPDATE image_id = ".$_POST['b2f_front_id'].", categories = ".$verso_categories.";"); 141 191 142 192 $template->assign(array( … … 145 195 )); 146 196 147 $template->append('infos', l10n('This picture is now the backside of the picture n° ').$_POST['b2f_front_id']); 197 $verso['id'] = $_POST['b2f_front_id']; 198 $verso['link'] = get_root_url().'admin.php?page=picture_modify&image_id='.$verso['id']; 199 array_push($page['infos'], l10n_args(get_l10n_args('This picture is now the backside of the picture n°%s', '<a href="'.$verso['link'].'">'.$verso['id'].'</a>'))); 148 200 } 149 201 } … … 160 212 if (pwg_db_num_rows($result)) 161 213 { 162 // original categories214 $item['verso_id'] = $_GET['image_id']; 163 215 list($item['categories']) = pwg_db_fetch_row($result); 164 // catch current categories 165 $versos_infos = pwg_query("SELECT category_id FROM ".IMAGE_CATEGORY_TABLE." WHERE image_id = ".$_GET['image_id'].";"); 166 while (list($verso_cat) = pwg_db_fetch_row($versos_infos)) 167 { 168 $current_verso_cats[] = $verso_cat; 169 } 170 171 /* if verso € 'versos' cat only */ 172 if (count($current_verso_cats) == 1 AND $current_verso_cats[0] == $conf['back2front'][0]) 173 { 174 foreach (explode(',',$item['categories']) as $cat) 175 { 176 $datas[] = array( 177 'image_id' => $_GET['image_id'], 178 'category_id' => $cat, 179 ); 180 } 181 if (isset($datas)) 182 { 183 mass_inserts( 184 IMAGE_CATEGORY_TABLE, 185 array('image_id', 'category_id'), 186 $datas 187 ); 188 } 189 } 190 191 pwg_query("DELETE FROM ".IMAGE_CATEGORY_TABLE." 192 WHERE image_id = ".$_GET['image_id']." AND category_id = ".$conf['back2front'][0].";"); 216 back2front_restaure_categories($item); 193 217 194 218 pwg_query("DELETE FROM ".B2F_TABLE." 195 219 WHERE verso_id = ".$_GET['image_id'].";"); 196 220 197 $template->append('infos', l10n('This picture is no longer a backside'));221 array_push($page['infos'], l10n('This picture is no longer a backside')); 198 222 } 199 223 } … … 203 227 if ($template->get_template_vars('B2F_IS_VERSO') == null) 204 228 { 229 $template->assign('B2F_MOVE_VERSO', 'checked="checked"'); 230 205 231 /* is the picture a verso ? */ 206 232 $query = " 207 SELECT image_id 233 SELECT image_id, categories 208 234 FROM ".B2F_TABLE." 209 235 WHERE verso_id = ".$_GET['image_id']." … … 213 239 if (pwg_db_num_rows($result)) 214 240 { 215 list($recto_id ) = pwg_db_fetch_row($result);241 list($recto_id, $cats) = pwg_db_fetch_row($result); 216 242 $template->assign(array( 217 243 'B2F_IS_VERSO' => 'checked="checked"', 218 244 'B2F_FRONT_ID' => $recto_id, 245 'B2F_MOVE_VERSO' => $cats != NULL ? 'checked="checked"' : '', 219 246 )); 220 247 } … … 228 255 229 256 if (pwg_db_num_rows($result)) 230 { 231 include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php'); 232 257 { 233 258 $item = pwg_db_fetch_assoc($result); 234 $query = "SELECT id, name, file 235 FROM ".IMAGES_TABLE." 236 WHERE id = ".$item['verso_id'].";"; 237 $item = pwg_db_fetch_assoc(pwg_query($query)); 238 259 239 260 $template->assign(array( 240 'B2F_VERSO_ID' => $item['id'], 241 'B2F_VERSO_URL' => get_root_url().'admin.php?page=picture_modify&image_id='.$item['id'], 242 'B2F_VERSO_NAME' => get_image_name($item['name'], $item['file']), 261 'B2F_VERSO_ID' => $item['verso_id'], 262 'B2F_VERSO_URL' => get_root_url().'admin.php?page=picture_modify&image_id='.$item['verso_id'], 243 263 )); 244 264 } … … 246 266 } 247 267 248 $template->set_filename('B2F_picture_modify', dirname(__FILE__).'/template/picture_modify.tpl'); 249 $template->concat('ADMIN_CONTENT', $template->parse('B2F_picture_modify', true)); 268 $template->set_prefilter('picture_modify', 'Back2front_picture_modify_prefilter'); 269 270 return $menu; 250 271 } 251 272 252 function picture_exists($id) 273 274 function Back2front_picture_modify_prefilter($content, &$smarty) 253 275 { 254 if (!preg_match('#([0-9]{1,})#', $id) OR $id == '0') return false; 255 256 $query = "SELECT id FROM ".IMAGES_TABLE." WHERE id = ".$id.";"; 257 $result = pwg_query($query); 258 259 if (pwg_db_num_rows($result)) return true; 260 else return false; 276 $search = '<form id="associations" method="post" action="{$F_ACTION}#associations">'; 277 $replacement = file_get_contents(B2F_PATH.'template/picture_modify.tpl')."\n".$search; 278 return str_replace($search, $replacement, $content); 261 279 } 262 280 -
extensions/Back2Front/language/en_UK/plugin.lang.php
r10823 r10852 4 4 $lang['See front'] = 'See front'; 5 5 $lang['Modify backside information'] = 'Modify backside information'; 6 7 $lang['Switch mode'] = 'Switch mode'; 8 $lang['Click'] = 'Click'; 9 $lang['Mouseover'] = 'Mouseover'; 10 $lang['Fade'] = 'Fade'; 6 11 7 12 $lang['This picture is a backside...'] = 'This picture is a backside...'; … … 12 17 13 18 $lang['Backside and frontside can\'t be the same picture'] = 'Backside and frontside can\'t be the same picture'; 14 $lang['Th is picture has already a backside : '] = 'This picture has already a backside :';15 $lang['Th is picture id already a backside : '] = 'This picture is already a backside :';16 $lang['This picture is now the backside of the picture n° '] = 'This picture is now the backside of the picture n°';17 $lang['Unknown id for frontside picture : '] = 'Unknown id for frontside picture :';19 $lang['The picture n°%d has already a backside : %s'] = 'The picture n°%d has already a backside : %s'; 20 $lang['The picture n°%s is already a backside'] = 'The picture n°%s is already a backside'; 21 $lang['This picture is now the backside of the picture n°%s'] = 'This picture is now the backside of the picture n°%s'; 22 $lang['Unknown id %d for frontside picture'] = 'Unknown id %d for frontside picture'; 18 23 $lang['This picture is no longer a backside'] = 'This picture is no longer a backside'; 19 24 -
extensions/Back2Front/language/fr_FR/plugin.lang.php
r10823 r10852 4 4 $lang['See front'] = 'Voir le recto'; 5 5 $lang['Modify backside information'] = 'Modifier les informations du verso'; 6 7 $lang['Switch mode'] = 'Interchanger les images au'; 8 $lang['Click'] = 'Clic'; 9 $lang['Mouseover'] = 'Survol'; 10 $lang['Fade'] = 'Fondu'; 6 11 7 12 $lang['This picture is a backside...'] = 'Cette image est le verso...'; … … 12 17 13 18 $lang['Backside and frontside can\'t be the same picture'] = 'Verso et recto ne peuvent être la même image'; 14 $lang['Th is picture has already a backside : '] = 'Cette image a déjà un verso :';15 $lang['Th is picture is already a backside : '] = 'Cette image est déjà un verso :';16 $lang['This picture is now the backside of the picture n° '] = 'Cette image est maintenant le verso de l\'image n°';17 $lang['Unknown id for frontside picture : '] = 'Id inconnu pour le recto :';19 $lang['The picture n°%d has already a backside : %s'] = 'L\'image n°%d a déjà un verso'; 20 $lang['The picture n°%s is already a backside'] = 'L\'image n°%s est déjà un verso'; 21 $lang['This picture is now the backside of the picture n°%s'] = 'Cette image est maintenant le verso de l\'image n°%s'; 22 $lang['Unknown id %d for frontside picture'] = 'Identifiant %d inconnu'; 18 23 $lang['This picture is no longer a backside'] = 'Cette image n\'est plus un verso'; 19 24 -
extensions/Back2Front/main.inc.php
r10821 r10852 19 19 include_once(B2F_PATH . 'Back2Front.php'); 20 20 21 add_event_handler('render_element_content', 'Back2Front_picture_content', 99, 2); 22 add_event_handler('loc_end_admin', 'Back2Front_picture_modify'); 21 if (script_basename() == 'picture') 22 { 23 add_event_handler('render_element_content', 'Back2Front_picture_content', 99, 2); 24 } 25 26 if (script_basename() == 'admin') 27 { 28 add_event_handler('get_admin_plugin_menu_links', 'Back2Front_picture_modify'); 29 // add_event_handler('loc_begin_admin_page', 'Back2Front_picture_modify'); /* for Piwigo 2.2.2 */ 30 31 add_event_handler('get_admin_plugin_menu_links', 'Back2Front_admin_menu'); 32 function Back2Front_admin_menu($menu) 33 { 34 array_push($menu, array( 35 'NAME' => 'Back2Front', 36 'URL' => get_root_url().'admin.php?page=plugin-' . B2F_DIR)); 37 return $menu; 38 } 39 } 23 40 24 41 ?> -
extensions/Back2Front/maintain.inc.php
r10821 r10852 1 1 <?php 2 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 4 include_once(PHPWG_PLUGINS_PATH.'back2front/functions.inc.php'); 3 5 4 6 function plugin_install() { … … 34 36 /* config parameter */ 35 37 pwg_query("INSERT INTO `" . CONFIG_TABLE . "` 36 VALUES ('back2front', '".$versos_cat['id']." ', 'Configuration for Back2Front plugin');");38 VALUES ('back2front', '".$versos_cat['id'].",click,none', 'Configuration for Back2Front plugin');"); 37 39 } 38 40 … … 53 55 while ($item = pwg_db_fetch_assoc($images_versos)) 54 56 { 55 /* catch current verso categories */ 56 $versos_infos = pwg_query("SELECT category_id FROM ".IMAGE_CATEGORY_TABLE." WHERE image_id = ".$item['verso_id'].";"); 57 while (list($verso_cat) = pwg_db_fetch_row($versos_infos)) 58 { 59 $item['current_verso_cats'][] = $verso_cat; 60 } 61 62 /* if verso 'versos' cat only */ 63 if (count($item['current_verso_cats']) == 1 AND $item['current_verso_cats'][0] == $conf['back2front'][0]) 64 { 65 foreach (explode(',',$item['categories']) as $cat) 66 { 67 $datas[] = array( 68 'image_id' => $item['verso_id'], 69 'category_id' => $cat, 70 ); 71 } 72 } 73 74 pwg_query("DELETE FROM ".IMAGE_CATEGORY_TABLE." 75 WHERE image_id = ".$item['verso_id']." AND category_id = ".$conf['back2front'][0].";"); 76 } 77 78 if (isset($datas)) 79 { 80 mass_inserts( 81 IMAGE_CATEGORY_TABLE, 82 array('image_id', 'category_id'), 83 $datas 84 ); 57 back2front_restaure_categories($item); 85 58 } 86 59 87 60 pwg_query("DROP TABLE `" . $prefixeTable . "image_verso`;"); 88 61 pwg_query("DELETE FROM `" . CONFIG_TABLE . "` WHERE param = 'back2front';"); 89 62 pwg_query("DELETE FROM `" . CATEGORIES_TABLE ."`WHERE id = ".$conf['back2front'][0].";"); -
extensions/Back2Front/template/picture_content.tpl
r10821 r10852 3 3 {footer_script require="jquery"} 4 4 jQuery(document).ready(function () {ldelim} 5 6 {if $b2f_switch_mode == 'click'} 5 7 jQuery('.reverse').click(function() {ldelim} 6 8 if (jQuery(this).attr('rel') == 'front') {ldelim} 7 /* picture attributes */ 8 jQuery('#theImage img:first-child').attr({ldelim} 9 {else} 10 jQuery('.reverse').hover(function() {ldelim} 11 {/if} 12 13 /* picture switch */ 14 {if $b2f_transition == 'fade'} 15 jQuery('img[alt="{$ALT_IMG}"]').animate({ldelim} 16 opacity:0 17 }, 400, function() {ldelim} 18 jQuery(this).animate({ldelim} 19 width:'{$VERSO_WIDTH}px', 20 height:'{$VERSO_HEIGHT}px' 21 }, 200, function() {ldelim} 22 jQuery(this).attr('src', '{$VERSO_URL}'); 23 jQuery(this).animate({ldelim} 24 opacity:1 25 }, 400); 26 }); 27 }); 28 {else} 29 jQuery('img[alt="{$ALT_IMG}"]').attr({ldelim} 9 30 src: '{$VERSO_URL}', 10 style: 'width: ;height:;',31 style: 'width:{$VERSO_WIDTH}px;height:{$VERSO_HEIGHT}px;', 11 32 }); 12 13 /* hd link atributes */ 33 {/if} 34 35 {if $b2f_switch_mode == 'click'} 36 /* hd link */ 14 37 {if isset($VERSO_HD)} 15 jQuery(' #theImage a:first-child').attr({ldelim}38 jQuery('img[alt="{$ALT_IMG}"]').parent().attr({ldelim} 16 39 href: "javascript:phpWGOpenWindow('{$VERSO_HD}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')" 17 40 }); 18 41 {/if} 19 42 20 43 /* B2F link content */ 21 44 jQuery(this).html('<img src="{$B2F_PATH}template/rotate_2.png"/> {'See front'|@translate}'); 22 45 jQuery(this).attr('rel', 'back'); 46 {/if} 23 47 48 {if $b2f_switch_mode == 'click'} 24 49 } else if (jQuery(this).attr('rel') == 'back') {ldelim} 25 jQuery('#theImage img:first-child').attr({ldelim} 50 {else} 51 }, function() {ldelim} 52 {/if} 53 54 {if $b2f_transition == 'fade'} 55 jQuery('img[alt="{$ALT_IMG}"]').animate({ldelim} 56 opacity:0 57 }, 400, function() {ldelim} 58 jQuery(this).animate({ldelim} 59 width:'{$WIDTH_IMG}px', 60 height:'{$HEIGHT_IMG}px' 61 }, 200, function() {ldelim} 62 jQuery(this).attr('src', '{$SRC_IMG}'); 63 jQuery(this).animate({ldelim} 64 opacity:1 65 }, 400); 66 }); 67 }); 68 {else} 69 jQuery('img[alt="{$ALT_IMG}"]').attr({ldelim} 26 70 src: '{$SRC_IMG}', 27 71 style: 'width:{$WIDTH_IMG}px;height:{$HEIGHT_IMG}px;', 28 72 }); 73 {/if} 29 74 30 {if isset($VERSO_HD)} 31 jQuery('#theImage a:first-child').attr({ldelim} 32 href: "javascript:phpWGOpenWindow('{$high.U_HIGH}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')')" 75 {if $b2f_switch_mode == 'click'} 76 {if isset($high.U_HIGH)} 77 jQuery('img[alt="{$ALT_IMG}"]').parent().attr({ldelim} 78 href: "javascript:phpWGOpenWindow('{$high.U_HIGH}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')" 33 79 }); 34 80 {/if} … … 36 82 jQuery(this).html('<img src="{$B2F_PATH}template/rotate_1.png"/> {'See back'|@translate}'); 37 83 jQuery(this).attr('rel', 'front'); 84 {/if} 85 86 {if $b2f_switch_mode == 'click'} 38 87 } 39 88 }); 89 {else} 90 }); 91 {/if} 92 40 93 }); 41 94 {/footer_script} 42 95 43 <a class="reverse" rel="front" href="#"> 44 <img src="{$B2F_PATH}template/rotate_1.png"/> 45 {'See back'|@translate} 96 <img src="{$VERSO_URL}" style="display:none;"> {* <!-- force preload the verso --> *} 97 98 <a class="reverse" rel="front" name="verso-link" {if $b2f_switch_mode == 'hover'}href="javascript:phpWGOpenWindow('{$VERSO_HD}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"{/if}> 99 <img src="{$B2F_PATH}template/rotate_1.png"/> {'See back'|@translate} 46 100 </a> 101 <br/> -
extensions/Back2Front/template/picture_modify.tpl
r10821 r10852 2 2 $(document).ready(function () {ldelim} 3 3 $('input[name="b2f_is_verso"]').change(function () {ldelim} 4 if (this.checked) {ldelim} 5 $('.frontside_id').css('visibility', ''); 6 } else {ldelim} 7 $('.frontside_id').css('visibility', 'hidden'); 8 } 4 $('.frontside_param').toggle(); 9 5 }); 10 6 }); … … 21 17 <tr> 22 18 <td><b>{'This picture has a backside :'|@translate}</b></td> 23 <td><a href="{$B2F_VERSO_URL}">{$B2F_VERSO_ID} - {$B2F_VERSO_NAME}</a></td>19 <td><a href="{$B2F_VERSO_URL}">{$B2F_VERSO_ID}</a></td> 24 20 </tr> 25 21 </table> 26 22 {else} 27 <table >23 <table style="min-width:400px;"> 28 24 <tr> 29 25 <td><b>{'This picture is a backside...'|@translate}</b></td> 30 <td ><input type="checkbox" name="b2f_is_verso" {$B2F_IS_VERSO}></td>26 <td style="width:70px"><input type="checkbox" name="b2f_is_verso" {$B2F_IS_VERSO}></td> 31 27 </tr> 32 33 <tr class="frontside_ id" {if !isset($B2F_IS_VERSO)}style="visibility:hidden;"{/if}>28 29 <tr class="frontside_param" {if !isset($B2F_IS_VERSO)}style="display:none;"{/if}> 34 30 <td><b>{'...of the picture n°'|@translate}</b></td> 35 31 <td><input type="text" size="4" name="b2f_front_id" value="{$B2F_FRONT_ID}"></td> 36 32 </tr> 37 33 38 <tr class="frontside_ id" {if !isset($B2F_IS_VERSO)}style="visibility:hidden;"{/if}>34 <tr class="frontside_param" {if !isset($B2F_IS_VERSO)}style="display:none;"{/if}> 39 35 <td><b>{'Move backside to private album'|@translate}</b></td> 40 <td><input type="checkbox" name="b2f_move_verso" checked="checked"></td>36 <td><input type="checkbox" name="b2f_move_verso" {$B2F_MOVE_VERSO}></td> 41 37 </tr> 42 38 </table> -
extensions/Back2Front/template/style.css
r10819 r10852 6 6 font-size:15px; 7 7 font-style:italic; 8 height:1em; 8 9 } 9 10 a.reverse img { 11 margin:0 !important; 10 12 vertical-align:top; 11 13 border:none !important;
Note: See TracChangeset
for help on using the changeset viewer.