Changeset 10326


Ignore:
Timestamp:
04/12/11 17:20:10 (9 years ago)
Author:
flop25
Message:

all the admin page works
real icon set added
todo: front end, localization

Location:
extensions/Icons_Set
Files:
8 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/Icons_Set/admin.php

    r10299 r10326  
    1212{ 
    1313        check_pwg_token(); 
     14        $conf_iconset = @unserialize($conf['iconset']);//pwg_db_real_escape_string(serialize($conf_iconset)) 
     15        $conf_themes=$conf_iconset['themes']; 
     16        $conf_icons=$conf_iconset['icons']; 
     17        $conf_icons=$conf_iconset['icons']; 
     18        $error_update=''; 
     19        $update_ok=''; 
     20        foreach ($conf_themes as $theme_id => $iconset) // theme supprimé 
     21        { 
     22                if (isset($_POST[$theme_id]) and isset($conf_themes[$theme_id]) and $conf_themes[$theme_id]!=$_POST[$theme_id] and in_array($_POST[$theme_id], $conf_icons)) 
     23                { 
     24                        $conf_themes[$theme_id]=$_POST[$theme_id]; 
     25                        $update_ok.=$theme_id.' / '; 
     26                } 
     27                elseif (empty($_POST[$theme_id]) and $conf_themes[$theme_id]!=$_POST[$theme_id]) 
     28                { 
     29                        $conf_themes[$theme_id]=''; 
     30                        $update_ok.=$theme_id.' / '; 
     31                } 
     32                elseif (!isset($_POST[$theme_id]) or !isset($conf_themes[$theme_id]) or (!in_array($_POST[$theme_id], $conf_icons) and !empty($_POST[$theme_id])) ) 
     33                { 
     34                        $error_update.=$theme_id.' / '; 
     35                } 
     36        } 
     37        $conf['iconset']=array( 
     38                'themes'=>$conf_themes, 
     39                'icons'=>$conf_icons 
     40                ); 
     41  $query = ' 
     42    UPDATE '.CONFIG_TABLE.' 
     43    SET value="'.pwg_db_real_escape_string(serialize($conf['iconset'])).'" 
     44    WHERE param="iconset" 
     45    LIMIT 1'; 
     46  pwg_query($query); 
     47        if (!empty($error_update)) {    array_push($page['infos'], l10n('iconset_error_update').$error_update );         } 
     48        if (!empty($update_ok)) {       array_push($page['infos'], l10n('iconset_update_ok').$update_ok );       } 
     49        load_conf_from_db(); 
    1450} 
    1551//////////////////////////////////////////////// 
     
    117153    LIMIT 1'; 
    118154  pwg_query($query); 
     155        load_conf_from_db(); 
    119156        if (!empty($info_new_theme)) {  array_push($page['infos'], l10n('iconset_info_new_theme').$info_new_theme );     } 
    120157        if (!empty($info_new_icon)) {   array_push($page['infos'], l10n('iconset_info_new_icon').$info_new_icon );       } 
     
    144181$values=array(); 
    145182$output=array(); 
     183$template->func_combine_css(array( 
     184        'path' => 'themes/default/iconset.css', 
     185        ), 
     186        $smarty 
     187); 
     188 
    146189foreach ($conf_icons as $iconset) 
    147190{ 
     
    153196  'icon_file' => $iconsetconf['icon_file'], 
    154197  'css_file' => $iconsetconf['css_file'], 
     198  'css_file_admin' => $iconsetconf['css_file_admin'], 
    155199        ); 
    156200        $values[]=$iconset; 
    157201        $output[]=$iconsetconf['name']; 
     202        $template->func_combine_css(array( 
     203                'path' => $iconsetconf['css_file_admin'], 
     204                ), 
     205                $smarty 
     206        ); 
    158207} 
    159208$template->assign(array( 
     
    173222        $smarty 
    174223); 
     224 
    175225$template->set_filename('plugin_admin_content', dirname(__FILE__) .'/template/admin.tpl'); 
    176226$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 
  • extensions/Icons_Set/icons/old_sylvia/iconset.conf.php

    r10297 r10326  
    33  'name' => 'Old Sylvia', 
    44  'id' => 'old_sylvia', 
    5   'icon_file' => ICONSET_PATH.'icons/old_sylvia/icon.png', 
     5  'icon_file' => ICONSET_PATH.'icons/old_sylvia/showimage.png', 
    66  'css_file' => ICONSET_PATH.'icons/old_sylvia/icon.css', 
     7  'css_file_admin' => ICONSET_PATH.'icons/old_sylvia/icon_admin.css', 
    78); 
    89 
  • extensions/Icons_Set/template/admin.css

    r10299 r10326  
    22 
    33.iconBox { 
    4     background-color: #333333; 
    5     border-radius: 5px 5px 5px 5px; 
    6     display: inline-table; 
    7     height: 50px; 
    8     margin: 5px; 
    9     overflow: hidden; 
    10     text-align: center; 
    11                 width:100%; 
     4        background-color: #333333; 
     5        border-radius: 5px 5px 5px 5px; 
     6        display: inline-table; 
     7        height: 50px; 
     8        margin: 5px; 
     9        overflow: hidden; 
     10        text-align: center; 
     11        width:100%; 
    1212} 
     13.iconShot LI { 
     14        float:left; 
     15        list-style:none; 
     16} 
     17.iconName { 
     18        float:left; 
     19        line-height: 50px; 
     20        width:200px; 
     21        text-align:center; 
     22        font-weight: bold; 
     23} 
     24.iconShot { 
     25        float:left; 
     26        padding-left:50p; 
     27        height: 50px; 
     28} 
     29.see_all { 
     30        margin-left:10px; 
     31} 
     32.iconShot a:hover { 
     33        text-decoration:none; 
     34        border-bottom:none; 
     35} 
  • extensions/Icons_Set/template/admin.tpl

    r10299 r10326  
    11<div class="titrePage"> 
    2   <h2>{'Installed Themes'|@translate}</h2> 
     2  <h2>{'iconset_configpage'|@translate}</h2> 
    33</div> 
    4  
    54<div id="themesContent"> 
    6 <fieldset> 
    7 <legend>{'iconset_All_Themes'|@translate}</legend> 
    8 <form action="" method="post" name="externe"> 
    9 <div class="themeBoxes"> 
    10 {foreach from=$all_themes item=theme} 
    11   <div class="themeBox"> 
    12     <div class="themeName">{$theme.name}</div> 
    13     <div class="themeShot"><img src="{$theme.screenshot}" alt="screenshot"></div> 
    14     <div class="themeActions"> 
    15       <div> 
    16       <select name="set"> 
    17         <option value="NULL">{'iconset_nothing'|@translate}</option> 
    18         {html_options output=$output values=$values selected=$theme.icon} 
    19       </select> 
     5  <fieldset> 
     6    <legend>{'iconset_All_Themes'|@translate}</legend> 
     7    <form action="" method="post" name="externe"> 
     8      <div class="themeBoxes"> {foreach from=$all_themes item=theme} 
     9        <div class="themeBox"> 
     10          <div class="themeName">{$theme.name}</div> 
     11          <div class="themeShot"><img src="{$theme.screenshot}" alt="screenshot"></div> 
     12          <div class="themeActions"> 
     13            <div> 
     14              <select name="{$theme.id}"> 
     15                <option value="">{'iconset_nothing'|@translate}</option> 
     16                                        {html_options output=$output values=$values selected=$theme.icon} 
     17              </select> 
     18            </div> 
     19          </div> 
     20          <!-- themeActions -->  
     21        </div> 
     22        {/foreach} </div> 
     23      <!-- themeBoxes --> 
     24      <input name="envoi_config" type="hidden" value="iconset" /> 
     25      <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> 
     26      <input type="submit" name="button2" id="button2" value="{'iconset_send'|@translate}" style=" width:100%" /> 
     27    </form> 
     28  </fieldset> 
     29  <fieldset> 
     30    <legend>{'iconset_All_Icons'|@translate}</legend> 
     31    <div class="iconBoxes"> {foreach from=$all_icons item=icons} 
     32      <div class="iconBox" id="iconBox_{$icons.id}"> 
     33        <div class="iconName">{$icons.name}</div> 
     34        <div class="iconShot"> 
     35          <ul> 
     36            <li><a href="#" title="{'slideshow'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> <span class="pwg-icon pwg-icon-slideshow"> </span><span class="pwg-button-text">{'slideshow'|@translate}</span> </a></li> 
     37            <li><a href="#" title="{'Show file metadata'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> <span class="pwg-icon pwg-icon-camera-info"> </span><span class="pwg-button-text">{'Show file metadata'|@translate}</span> </a></li> 
     38            <li><a href="{$current.U_DOWNLOAD}" title="{'download this file'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> <span class="pwg-icon pwg-icon-save"> </span><span class="pwg-button-text">{'download'|@translate}</span> </a></li> 
     39            <li><a href="#" title="{if $favorite.IS_FAVORITE}{'delete this photo from your favorites'|@translate}{else}{'add this photo to your favorites'|@translate}{/if}" class="pwg-state-default pwg-button" rel="nofollow"> <span class="pwg-icon pwg-icon-favorite-{if $favorite.IS_FAVORITE}del{else}add{/if}"> </span><span class="pwg-button-text">{'Favorites'|@translate}</span> </a></li> 
     40            <li><a href="#" title="{'set as album representative'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> <span class="pwg-icon pwg-icon-representative"> </span><span class="pwg-button-text">{'representative'|@translate}</span> </a></li> 
     41            <li><a href="#" title="{'Modify information'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> <span class="pwg-icon pwg-icon-edit"> </span><span class="pwg-button-text">{'edit'|@translate}</span> </a></li> 
     42            <li><span class="pwg-state-disabled pwg-button"> <span class="pwg-icon pwg-icon-arrowstop-w">&nbsp;</span><span class="pwg-button-text">{'First'|@translate}</span> </span></li> 
     43            <li><span class="pwg-state-disabled pwg-button"> <span class="pwg-icon pwg-icon-arrow-w">&nbsp;</span><span class="pwg-button-text">{'Previous'|@translate}</span> </span></li> 
     44            <li><a href="#" title="{'Thumbnails'|@translate}" class="pwg-state-default pwg-button"> <span class="pwg-icon pwg-icon-arrow-n">&nbsp;</span><span class="pwg-button-text">{'Thumbnails'|@translate}</span> </a></li> 
     45            <li><a href="#" title="{'Next'|@translate} : {$next.TITLE}" class="pwg-state-default pwg-button pwg-button-icon-right"> <span class="pwg-icon pwg-icon-arrow-e">&nbsp;</span><span class="pwg-button-text">{'Next'|@translate}</span> </a></li> 
     46            <li><a href="#" title="{'Last'|@translate} : {$last.TITLE}" class="pwg-state-default pwg-button pwg-button-icon-right"> <span class="pwg-icon pwg-icon-arrowstop-e"></span><span class="pwg-button-text">{'Last'|@translate}</span> </a></li> 
     47            <li>{strip}<a href="#" title="{'display all photos in all sub-albums'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> <span class="pwg-icon pwg-icon-category-view-flat"> </span><span class="pwg-button-text">{'display all photos in all sub-albums'|@translate}</span> </a>{/strip}</li> 
     48            <li>{strip}<a href="#" title="{'return to normal view mode'|@translate}" class="pwg-state-default pwg-button"> <span class="pwg-icon pwg-icon-category-view-normal"> </span><span class="pwg-button-text">{'return to normal view mode'|@translate}</span> </a>{/strip}</li> 
     49            <li>{strip}<a href="#" title="{'display a calendar by posted date'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> <span class="pwg-icon pwg-icon-calendar"> </span><span class="pwg-button-text">{'Calendar'|@translate}</span> </a>{/strip}</li> 
     50            <li>{strip}<a href="#" title="{'display a calendar by creation date'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> <span class="pwg-icon pwg-icon-camera-calendar"> </span><span class="pwg-button-text">{'Calendar'|@translate}</span> </a>{/strip}</li> 
     51            <li><a class="see_all" href="{$icons.icon_file}" title="{'iconset_seeall'|@translate}" > {'iconset_seeall'|@translate} </a></li> 
     52          </ul> 
     53        </div> 
    2054      </div> 
    21     </div> <!-- themeActions --> 
    22   </div> 
    23 {/foreach} 
    24 </div> <!-- themeBoxes --> 
    25   <input name="envoi_config" type="hidden" value="iconset" /> 
    26   <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> 
    27   <input type="submit" name="button2" id="button2" value="{'iconset_send'|@translate}" /> 
    28 </form> 
    29 </fieldset> 
    30  
    31 <fieldset> 
    32 <legend>{'iconset_All_Icons'|@translate}</legend> 
    33 <div class="iconBoxes"> 
    34 {foreach from=$all_icons item=icons} 
    35   <div class="iconBox"> 
    36     <div class="iconName">{$icons.name}</div> 
    37     <div class="iconShot"><img src="{$icons.png}" alt=""></div> 
    38   </div> 
    39 {/foreach} 
    40 </div> <!-- themeBoxes --> 
    41 </fieldset> 
    42 </div> <!-- themesContent --> 
     55      {/foreach} </div> 
     56    <!-- themeBoxes --> 
     57  </fieldset> 
     58</div> 
     59<!-- themesContent -->  
Note: See TracChangeset for help on using the changeset viewer.