Changeset 12361 for extensions
- Timestamp:
- Oct 6, 2011, 1:45:36 PM (13 years ago)
- Location:
- extensions/Back2Front
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Back2Front/Back2Front.php
r11599 r12361 8 8 */ 9 9 function Back2Front_picture_content($content, $image) 10 10 { 11 11 global $template, $user, $conf; 12 12 … … 33 33 34 34 /* websize picture */ 35 $template->assign('VERSO_URL', $verso['path']); 35 $template->assign(array( 36 'B2F_PATH' => B2F_PATH, 37 'VERSO_URL' => $verso['path'], 38 )); 36 39 37 40 /* admin link */ … … 79 82 80 83 /* template & output */ 81 $template->set_filename s(array('B2F_picture_content' => dirname(__FILE__).'/template/picture_content.tpl'));84 $template->set_filename('B2F_picture_content', dirname(__FILE__).'/template/picture_content.tpl'); 82 85 $template->assign(array( 83 'B2F_PATH' => B2F_PATH,84 86 'b2f_switch_mode' => $conf['back2front'][1], 85 87 'b2f_transition' => $conf['back2front'][2], … … 92 94 { 93 95 case 'toolbar': 94 $template-> set_prefilter('picture', 'Back2Front_toolbar_prefilter');96 $template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('B2F_picture_content', true)); 95 97 break; 96 98 case 'top': … … 104 106 105 107 return $content; 106 }107 108 function Back2Front_toolbar_prefilter($content, &$smarty)109 {110 $search = '{/if}{/strip}{*caddie management END*}';111 $replacement = $search."\n".file_get_contents(B2F_PATH.'template/picture_content.tpl');112 return str_replace($search, $replacement, $content);113 108 } 114 109 … … 322 317 } 323 318 319 320 /* 321 * Add mark on thumbnails list 322 */ 323 function Back2Front_thumbnails($tpl_thumbnails_var, $pictures) 324 { 325 global $conf; 326 327 $conf['back2front'] = explode(',',$conf['back2front']); 328 if (!$conf['back2front'][5]) return $tpl_thumbnails_var; 329 330 $ids = array(); 331 foreach ($pictures as $row) 332 { 333 array_push($ids, $row['id']); 334 } 335 336 /* has the pictures a verso ? */ 337 $query = "SELECT image_id, verso_id 338 FROM ".B2F_TABLE." 339 WHERE image_id IN(".implode(',', $ids).");"; 340 $result = hash_from_query($query, 'image_id'); 341 342 $ids = array_keys($result); 343 344 foreach($tpl_thumbnails_var as &$tpl_var) 345 { 346 if (in_array($tpl_var['ID'], $ids)) 347 { 348 $tpl_var['NAME'].= ' <img class="has_verso" src="'.B2F_PATH.'template/rotate_1.png" title="'.l10n('This picture has a backside :').'"/>'; 349 } 350 } 351 352 return $tpl_thumbnails_var; 353 } 354 324 355 ?> -
extensions/Back2Front/admin.php
r11219 r12361 11 11 if (isset($_POST['submit'])) 12 12 { 13 13 $conf['back2front'] = array( 14 14 $conf['back2front'][0], 15 15 $_POST['switch_mode'], … … 17 17 $_POST['position'], 18 18 serialize(stripslashes_deep(str_replace(array("'",'"',','), null, $_POST['link_name']))), 19 isset($_POST['show_thumbnail']), 19 20 ); 20 21 21 22 conf_update_param('back2front', implode (',', $conf['back2front'])); 22 23 array_push($page['infos'], l10n('Information data registered in database')); 23 24 } 24 25 … … 33 34 foreach (get_languages() as $language_code => $language_name) 34 35 { 35 36 $template->append('link_name', array( 36 37 'LANGUAGE_NAME' => $language_name, 37 38 'LANGUAGE_CODE' => $language_code, … … 43 44 $template->assign(array( 44 45 'B2F_PATH' => B2F_PATH, 45 46 46 'SWITCH_MODE' => $conf['back2front'][1], 47 'TRANSITION' => $conf['back2front'][2], 47 48 'POSITION' => $conf['back2front'][3], 49 'SHOW_THUMBNAIL' => $conf['back2front'][5], 48 50 )); 49 51 50 52 $template->set_filename('back2front_conf', dirname(__FILE__).'/template/admin.tpl'); 51 53 $template->assign_var_from_handle('ADMIN_CONTENT', 'back2front_conf'); -
extensions/Back2Front/language/en_UK/plugin.lang.php
r11238 r12361 15 15 $lang['Toolbar'] = 'Toolbar'; 16 16 $lang['Link name'] = 'Button name'; 17 $lang['Display a mark on thumbnails list'] = 'Display a mark on thumbnails list'; 17 18 18 19 $lang['Seperate the two labels with the | symbol. Leave blank to use default translation.'] = 'Seperate the two labels with the | symbol. Leave blank to use default translation.'; … … 22 23 $lang['Backside management'] = 'Backside management'; 23 24 $lang['Move backside to private album'] = 'Move backside to private album'; 24 $lang['This picture has a backside : 25 $lang['This picture has a backside :'] = 'This picture has a backside : '; 25 26 26 27 $lang['Backside and frontside can\'t be the same picture'] = 'Backside and frontside can\'t be the same picture'; -
extensions/Back2Front/language/fr_FR/plugin.lang.php
r11238 r12361 15 15 $lang['Toolbar'] = 'Barre d\'outils'; 16 16 $lang['Link name'] = 'Nom du bouton'; 17 $lang['Display a mark on thumbnails list'] = 'Marquer les versos sur la liste des miniatures'; 17 18 18 19 $lang['Seperate the two labels with the | symbol. Leave blank to use default translation.'] = 'Séparez les deux textes par le symbole |. Laissez vide pour utiliser la traduction par défaut.'; … … 22 23 $lang['Backside management'] = 'Gestion des recto-verso'; 23 24 $lang['Move backside to private album'] = 'Déplacer le verso vers un album privé'; 24 $lang['This picture has a backside : 25 $lang['This picture has a backside :'] = 'Cette image a un verso : '; 25 26 26 27 $lang['Backside and frontside can\'t be the same picture'] = 'Verso et recto ne peuvent être la même image'; -
extensions/Back2Front/language/it_IT/plugin.lang.php
r11519 r12361 22 22 $lang['Backside management'] = 'Gestione delle fronte-retro'; 23 23 $lang['Move backside to private album'] = 'Spostare il retro verso un\'album privato'; 24 $lang['This picture has a backside : '] = 'Questa foto a un retro :';24 $lang['This picture has a backside :'] = 'Questa foto a un retro :'; 25 25 26 26 $lang['Backside and frontside can\'t be the same picture'] = 'Retro e fronte non possono essere la stessa foto'; -
extensions/Back2Front/language/lv_LV/plugin.lang.php
r11238 r12361 22 22 $lang['Backside management'] = 'Aizmugures daļas pārvalde'; 23 23 $lang['Move backside to private album'] = 'Pārvietot attēla aizmugures daļu uz privātu albūmu'; 24 $lang['This picture has a backside : '] = 'Šim attēlam ir aizmugure :';24 $lang['This picture has a backside :'] = 'Šim attēlam ir aizmugure :'; 25 25 26 26 $lang['Backside and frontside can\'t be the same picture'] = 'Aizmugure un priekšpuse nevar būt viens un tas pats attēls'; -
extensions/Back2Front/main.inc.php
r11219 r12361 24 24 } 25 25 26 if (script_basename() == 'index') 27 { 28 add_event_handler('loc_end_index_thumbnails', 'Back2Front_thumbnails', 99, 2); 29 } 30 26 31 if (script_basename() == 'admin') 27 32 { 28 33 add_event_handler('loc_begin_admin_page', 'Back2Front_picture_modify'); 29 34 30 31 32 33 34 35 36 37 35 add_event_handler('get_admin_plugin_menu_links', 'Back2Front_admin_menu'); 36 function Back2Front_admin_menu($menu) 37 { 38 array_push($menu, array( 39 'NAME' => 'Back2Front', 40 'URL' => get_root_url().'admin.php?page=plugin-' . B2F_DIR)); 41 return $menu; 42 } 38 43 } 39 44 -
extensions/Back2Front/maintain.inc.php
r11219 r12361 4 4 include_once(PHPWG_PLUGINS_PATH.'back2front/functions.inc.php'); 5 5 6 function plugin_install() { 7 global $prefixeTable; 6 function plugin_install() 7 { 8 global $prefixeTable; 8 9 9 /* create table for recto/ver ospairs | stores original verso categories */10 10 /* create table for recto/verso pairs | stores original verso categories */ 11 pwg_query("CREATE TABLE IF NOT EXISTS `" . $prefixeTable . "image_verso` ( 11 12 `image_id` mediumint(8) unsigned NOT NULL DEFAULT '0', 12 13 `verso_id` mediumint(8) unsigned NOT NULL DEFAULT '0', … … 14 15 PRIMARY KEY (`image_id`), 15 16 UNIQUE KEY (`verso_id`) 16 17 ) DEFAULT CHARSET=utf8;"); 17 18 18 19 /* create a virtual category to store versos */ … … 36 37 /* config parameter */ 37 38 pwg_query("INSERT INTO `" . CONFIG_TABLE . "` 38 VALUES ('back2front', '".$versos_cat['id'].",click,none ', 'Configuration for Back2Front plugin');");39 VALUES ('back2front', '".$versos_cat['id'].",click,none,top,".serialize(array('default'=>null)).",1', 'Configuration for Back2Front plugin');"); 39 40 } 40 41 … … 43 44 global $conf; 44 45 45 if (!isset($conf['back2front'])) { 46 if (!isset($conf['back2front'])) 47 { 46 48 pwg_query("INSERT INTO `" . CONFIG_TABLE . "` 47 VALUES ('back2front', '".$versos_cat['id'].",click,none', 'Configuration for Back2Front plugin');"); 48 } else { 49 VALUES ('back2front', '".$versos_cat['id'].",click,none,top,".serialize(array('default'=>null)).",1', 'Configuration for Back2Front plugin');"); 50 } 51 else 52 { 49 53 $conf['back2front'] = explode(',', $conf['back2front']); 50 if (!isset($conf['back2front'][3])) { 54 55 if (!isset($conf['back2front'][3])) 56 { 51 57 $conf['back2front'][3] = 'top'; 52 58 $conf['back2front'][4] = serialize(array('default'=>null)); 53 conf_update_param('back2front', implode (',', $conf['back2front']));54 59 } 60 if (!isset($conf['back2front'][5])) 61 { 62 $conf['back2front'][5] = true; 63 } 64 65 conf_update_param('back2front', implode (',', $conf['back2front'])); 55 66 } 56 67 } … … 58 69 59 70 function plugin_uninstall() { 60 71 global $conf, $prefixeTable; 61 72 62 73 $conf['back2front'] = explode(',',$conf['back2front']); -
extensions/Back2Front/template/admin.tpl
r11219 r12361 23 23 24 24 <div class="titrePage"> 25 25 <h2>Back2Front</h2> 26 26 </div> 27 27 28 28 <form method="post" action="" class="properties" ENCTYPE="multipart/form-data"> 29 30 <legend>{'Display'|@translate}</legend> 31 <ul> 29 <fieldset> 30 <legend>{'Display'|@translate}</legend> 31 <ul> 32 32 <li> 33 33 <span class="property">{'Link position'|@translate}</span> … … 36 36 <label><input type="radio" name="position" value="toolbar" {if $POSITION == 'toolbar'}checked="checked"{/if}/> {'Toolbar'|@translate}</label> 37 37 </li> 38 <li> 39 <span class="property">{'Switch mode'|@translate}</span> 40 <label><input type="radio" name="switch_mode" value="click" {if $SWITCH_MODE == 'click'}checked="checked"{/if}/> {'Click'|@translate}</label> 41 <label><input type="radio" name="switch_mode" value="hover" {if $SWITCH_MODE == 'hover'}checked="checked"{/if}/> {'Mouseover'|@translate}</label> 42 </li> 43 <li> 44 <span class="property">{'Transition'|@translate}</span> 45 <label><input type="radio" name="transition" value="none" {if $TRANSITION == 'none'}checked="checked"{/if}/> {'None'|@translate}</label> 46 <label><input type="radio" name="transition" value="fade" {if $TRANSITION == 'fade'}checked="checked"{/if}/> {'Fade'|@translate}</label> 47 </li> 38 <li> 39 <span class="property">{'Switch mode'|@translate}</span> 40 <label><input type="radio" name="switch_mode" value="click" {if $SWITCH_MODE == 'click'}checked="checked"{/if}/> {'Click'|@translate}</label> 41 <label><input type="radio" name="switch_mode" value="hover" {if $SWITCH_MODE == 'hover'}checked="checked"{/if}/> {'Mouseover'|@translate}</label> 42 </li> 43 <li> 44 <span class="property">{'Transition'|@translate}</span> 45 <label><input type="radio" name="transition" value="none" {if $TRANSITION == 'none'}checked="checked"{/if}/> {'None'|@translate}</label> 46 <label><input type="radio" name="transition" value="fade" {if $TRANSITION == 'fade'}checked="checked"{/if}/> {'Fade'|@translate}</label> 47 </li> 48 <li> 49 <span class="property">{'Display a mark on thumbnails list'|@translate}</span> 50 <input type="checkbox" name="show_thumbnail" value="1" {if $SHOW_THUMBNAIL == '1'}checked="checked"{/if}/> 51 </li> 48 52 49 53 <li> … … 60 64 <a class="lang_help" title="{'Seperate the two labels with the | symbol. Leave blank to use default translation.'|@translate}">i</a> 61 65 </li> 62 63 64 65 66 </ul> 67 </fieldset> 68 69 <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" /></p> 66 70 </form> -
extensions/Back2Front/template/admin_button.tpl
r10823 r12361 1 1 {strip}<a href="{$VERSO_U_ADMIN}" title="{'Modify backside information'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> 2 < span class="pwg-icon pwg-icon-edit"> </span><span class="pwg-button-text">{'edit'|@translate}</span>2 <img src="{$B2F_PATH}template/rotate_edit.png"/><span class="pwg-button-text">{'edit'|@translate}</span> 3 3 </a>{/strip} -
extensions/Back2Front/template/picture_content.tpl
r11599 r12361 97 97 98 98 {if $b2f_position != 'toolbar'}<div>{/if} 99 <a class="reverse" rel="front" {if $b2f_position == 'toolbar'}style="border:none !important;"{/if}99 <a class="reverse" rel="front" class="pwg-state-default pwg-button" title="{$b2f_see_back}" {if $b2f_position == 'toolbar'}style="border:none !important;"{/if} 100 100 {if $b2f_switch_mode == 'hover' and isset($VERSO_HD)}href="javascript:phpWGOpenWindow('{$VERSO_HD}','{$high.UUID}','scrollbars=yes,toolbar=no,status=no,resizable=yes')"{/if}> 101 101 <img src="{$B2F_PATH}template/rotate_1.png"/> {$b2f_see_back} -
extensions/Back2Front/template/style.css
r11219 r12361 2 2 display:inline-block; 3 3 border:1px solid #666 !important; 4 padding: 3px 5px;4 padding:5px 5px; 5 5 margin-bottom:10px; 6 6 font-size:15px;
Note: See TracChangeset
for help on using the changeset viewer.