Changeset 16064


Ignore:
Timestamp:
06/26/12 22:16:55 (7 years ago)
Author:
mistic100
Message:
  • add logout link (Flickr requirements)
  • stylish a bit main menu and albums list
Location:
extensions/flickr2piwigo/admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/flickr2piwigo/admin/import.php

    r16063 r16064  
    4040} 
    4141 
    42 if (!isset($_GET['action'])) $_GET['action'] = 'choice'; 
     42if (!isset($_GET['action'])) $_GET['action'] = 'main'; 
    4343 
    4444 
     
    6767  } 
    6868   
     69  // logout 
     70  case 'logout': 
     71  { 
     72    unset($_SESSION['phpFlickr_auth_token']); 
     73    $_SESSION['page_infos'][] = l10n('Logued out'); 
     74    redirect(FLICKR_ADMIN.'-import'); 
     75    break; 
     76  } 
     77   
    6978  // main menu 
    70   case 'choice': 
    71   { 
    72     $template->assign('list_albums_url', FLICKR_ADMIN.'-import&action=list_albums'); 
    73     $template->assign('import_all_url', FLICKR_ADMIN.'-import&action=list_all'); 
     79  case 'main': 
     80  { 
     81    $u = $flickr->people_getInfo($u['id']); 
     82    $template->assign(array( 
     83      'username' => $conf['flickr2piwigo']['username'], 
     84      'user_url' => $u['photosurl'], 
     85      'logout_url' => FLICKR_ADMIN.'-import&action=logout', 
     86      'list_albums_url' => FLICKR_ADMIN.'-import&action=list_albums', 
     87      'import_all_url' => FLICKR_ADMIN.'-import&action=list_all', 
     88      )); 
    7489    break; 
    7590  } 
  • extensions/flickr2piwigo/admin/template/import.tpl

    r16063 r16064  
    66 
    77{if $ACTION == 'init_login'} 
    8 <p><a href="{$flickr_login}">{'Login'|@translate}</a></p> 
     8<p><input type="submit" onClick="javascript:window.location.href ='{$flickr_login}';" value="{'Login'|@translate}"></p> 
    99 
    10 {elseif $ACTION == 'choice'} 
     10{elseif $ACTION == 'main'} 
    1111<p> 
    12   <a href="{$list_albums_url}">{'List my albums'|@translate}</a> - 
    13   <a href="{$import_all_url}">{'Import all my pictures'|@translate}</a> 
     12  <b>{'Logued as'|@translate}</b> : <a href="{$profile_url}" target="_blank">{$username}</a><br><br> 
     13  <input type="submit" onClick="javascript:window.location.href ='{$logout_url}';" value="{'Logout'|@translate}"> 
     14</p> 
     15<br> 
     16<p> 
     17  <input type="submit" onClick="javascript:window.location.href ='{$list_albums_url}';" value="{'List my albums'|@translate}"> 
     18  <input type="submit" onClick="javascript:window.location.href ='{$import_all_url}';" value="{'Import all my pictures'|@translate}"> 
    1419</p> 
    1520 
    1621{elseif $ACTION == 'list_albums'} 
    17 <h3>{'%d albums'|@translate}|@sprintf:$total_albums}</h3> 
    18 <ul> 
     22<h3>{'%d albums'|@translate|@sprintf:$total_albums}</h3> 
     23<ul id="albumsList"> 
    1924{foreach from=$albums item=album} 
    20   <li> 
    21     <b><a href="{$album.U_LIST}">{$album.title}</a></b> <i>{'(%d photos)'|@translate|@sprintf:$album.photos}</i>  
     25  <li {if $album.id == "not_in_set"}class="not_in_set"{/if}> 
     26    <b><a href="{$album.U_LIST}">{$album.title}</a></b> <i>{'(%d photos)'|@translate|@sprintf:$album.photos}</i> {if $album.description}- {$album.description|@truncate:100}{/if} 
    2227    {*- <a href="{$album.U_IMPORT_ALL}">{'Import all pictures of this album'|@translate}</a>*} 
    23     {*<p>{$album.description}</p>*} 
    2428  </li> 
    2529{/foreach} 
  • extensions/flickr2piwigo/admin/template/style.css

    r16063 r16064  
     1#albumsList li { 
     2  list-style-type:square; 
     3  margin-top:5px; 
     4} 
     5#albumsList li.not_in_set { 
     6  margin-top:20px; 
     7} 
Note: See TracChangeset for help on using the changeset viewer.