Ignore:
Timestamp:
Jul 30, 2009, 10:58:32 PM (15 years ago)
Author:
tiico
Message:

Suppress render for comment and author
Add double select in piclenswall admin page + jquery
Add compatibility with wat.tv video and correct rdd feed to adapt with cooliris 1.11
Correct %I2 param for parser : without picture name, display picture file
Suppress slashes in "name" and "descriptions" parameters
Change version to 0.4.1

Location:
extensions/piclens/admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/piclens/admin/piclenswallconfig.php

    r3645 r3708  
    1313
    1414 $template->set_filenames(
    15                 array('plugin_admin_content' => PICLENS_ROOT.'/admin/piclenswallconfig.tpl'               
     15                array('plugin_admin_content' => PICLENS_ROOT.'/admin/piclenswallconfig.tpl',
     16                          'double_select' => 'double_select.tpl'
    1617                        ) );
    1718
     19
     20
     21// Switch  on right side (=> )
     22if ( isset($_POST['falsify']) and !is_adviser()
     23    and $_POST['from']=='wallcat'
     24    and isset($_POST['cat_true']) and count($_POST['cat_true']) > 0)
     25{
     26        foreach ($_POST['cat_true'] as $cat)
     27                unset($me->my_config['piclens_wall_categories'][array_search($cat,$me->my_config['piclens_wall_categories'])]);
     28
     29        $me->save_config();
     30
     31}
     32// Switch  on left side ( <=)
     33if ( isset($_POST['trueify']) and !is_adviser()
     34    and $_POST['from']=='wallcat'
     35    and isset($_POST['cat_false']) and count($_POST['cat_false']) > 0)
     36{
     37
     38        $query = '
     39          SELECT id, name, uppercats, global_rank
     40          FROM '.CATEGORIES_TABLE.
     41          ' WHERE id IN ("'.implode('","', $_POST['cat_false']).'");';
     42
     43        $result = pwg_query($query);
     44        $categories = array();
     45        if (!empty($result))
     46        {
     47                while ($row = mysql_fetch_assoc($result))
     48                        array_push($categories, $row);                 
     49        }
     50        usort($categories, 'global_rank_compare');
     51
     52        if (!empty($result))
     53        {
     54                foreach ($categories as $cat)
     55                {
     56                        array_push($me->my_config['piclens_wall_categories'], $cat['id']);
     57                }
     58        }
     59
     60        $me->save_config();
     61}
    1862                       
    1963
     
    2266  $me->my_config['piclens_wall_title'] = $_POST['piclens_wall_title'];
    2367  $me->my_config['piclens_wall_height'] =   $_POST['piclens_wall_height'];
    24   $me->my_config['piclens_wall_categories'] = isset($_POST['categories']) ?
    25                           array_map("mysql_escape_string", $_POST['categories']) :
    26                           array();
    2768
    2869  $me->my_config['piclens_wall_nav'] = isset($_POST['piclens_wall_nav']);
     
    68109  FROM '.CATEGORIES_TABLE.';';
    69110
    70 display_select_cat_wrapper($query,
    71     $me->my_config['piclens_wall_categories'],
    72     'categories',
    73     true);
    74 
    75 display_select_cat_wrapper($query,
     111  display_select_cat_wrapper($query,
    76112    $me->my_config['piclens_wall_cat_nav_replace'],
    77113    'categories_nav',
    78114    true);
    79115       
    80 
     116       
     117// Test double select wall categories
     118// Categories non prises en compte
     119$query = '
     120  SELECT id, name, uppercats, global_rank
     121  FROM '.CATEGORIES_TABLE.
     122  ' WHERE id not IN ("'.implode('","', $me->my_config['piclens_wall_categories']).'");';
     123
     124  $result = pwg_query($query);
     125  $categories = array();
     126if (!empty($result))
     127{
     128        while ($row = mysql_fetch_assoc($result))
     129                array_push($categories, $row);
     130}
     131usort($categories, 'global_rank_compare');
     132
     133$tpl = array();
     134if (!empty($result))
     135{
     136                foreach ($categories as $cat)
     137        {
     138                $tpl[$cat['id']] = get_cat_display_name_cache($cat['uppercats'],
     139                                           null,
     140                                           false);
     141       
     142        }
     143}
     144$template->assign( 'category_option_false', $tpl);
     145$template->assign( 'category_option_false_selected', array());
     146
     147
     148
     149
     150// Categories prises en compte
     151
     152$query = '
     153  SELECT id, name, uppercats, global_rank
     154  FROM '.CATEGORIES_TABLE.
     155  ' WHERE id IN ("'.implode('","', $me->my_config['piclens_wall_categories']).'");';
     156
     157$result = pwg_query($query);
     158  $categories = array();
     159if (!empty($result))
     160{
     161        while ($row = mysql_fetch_assoc($result))
     162                array_push($categories, $row);
     163}
     164usort($categories, 'global_rank_compare');
     165$tpl2 = array();
     166if (!empty($result))
     167{
     168                foreach ($categories as $cat)
     169        {
     170                $tpl2[$cat['id']] = get_cat_display_name_cache($cat['uppercats'],
     171                                           null,
     172                                           false);
     173       
     174        }
     175}
     176$template->assign( 'category_option_true', $tpl2);
     177$template->assign( 'category_option_true_selected', array());
     178
     179
     180$template->assign(Array(
     181        'F_ACTION' => '',
     182        'L_CAT_OPTIONS_TRUE' => l10n('SelectedCat'),
     183        'L_CAT_OPTIONS_FALSE' => l10n('NonSelectedCat'),
     184));
    81185
    82186
     
    104208        ));
    105209
     210$template->assign_var_from_handle('DOUBLE_SELECT', 'double_select');
    106211$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
    107212
  • extensions/piclens/admin/piclenswallconfig.tpl

    r3637 r3708  
    8282                        <td><input type="text" size="3" maxlength="3" value="{$PICLENS_WALL_HEIGHT}" name="piclens_wall_height">&nbsp;px</td>
    8383                </tr>
    84                 <br>
     84                <tr>
     85                        <td colspan="2"><br>&nbsp;</td>
     86                </tr>
    8587                <tr>
    8688                    <td align="right">{'piclens_wallcfg_param'|@translate} &nbsp;</td>
     
    9597                </tr>
    9698                <TR>
    97                         <td align="right">{'piclens_wallcfg_cat'|@translate}&nbsp;</td>
    98                         <td align="center">
    99                       <select class="categoryList" name="categories[]" multiple="multiple" size="30">
    100                         {html_options options=$categories selected=$categories_selected value=$categories_value}
    101                       </select>
     99                        <td align="center" colspan="2">
     100                                <div id="cat_select0">
     101                                <b><u>{'piclens_wallcfg_cat'|@translate}&nbsp;</u></b>
     102                                </div>
     103                        </td>
     104                </tr>
     105                <tr>
     106                        <td colspan="2">
     107                        <div id="cat_select">
     108                                {$DOUBLE_SELECT}
     109                                <div><input type="hidden" name="from" value="wallcat" /></div>
     110                        </div>
    102111                        </td>
    103112                </tr>
     
    116125                        </TD>
    117126                </TR>
    118                 <TR>
     127                <TR class="cat_replace" style="display:none;">
    119128                        <td align="right">{'piclens_wallcfg_cat_nav1'|@translate}&nbsp;</td>
    120129                        <td align="center">
    121                       <select class="categoryList" name="categories_nav[]" multiple="multiple" size="30">
     130                      <select class="categoryList1" name="categories_nav[]" multiple="multiple" size="10" style="width:300px">
    122131                        {html_options options=$categories_nav selected=$categories_nav_selected value=$categories_nav_value}
    123132                      </select>
     
    129138                                 - <input type="checkbox" name="piclens_wall_spec" {$PICLENS_WALL_SPEC}/> {'piclens_wallcfg_spec_nav'|@translate}
    130139                        </TD>
    131                         <TD align="rignt">
     140                        <TD class="spec_selection" style="display:none;" align="rignt">
    132141                                 <input type="checkbox" name="piclens_wall_spec_favorites" {$PICLENS_WALL_SPEC_FAVORITES}/> {'piclens_favorites_label'|@translate}
    133142                    <br/>
     
    148157{literal}
    149158<script type="text/javascript">
    150   jQuery().ready(function(){
    151     // Resize possible for categories selection
    152     jQuery('.categoryList').resizable({
     159resize = false;
     160function show_cat_list()
     161{
     162  jQuery('.cat_replace').show();
     163  if (!resize)
     164  {
     165    resize = true;
     166    jQuery('.categoryList1').resizable({
    153167      handles: "all",
    154168      animate: true,
     
    160174      ghost: true
    161175    });
     176  }
     177}
     178
     179function hide_cat_list()
     180{
     181  jQuery('.cat_replace').hide();
     182}
     183
     184
     185jQuery().ready( function () {
     186jQuery("input[name='piclens_wall_nav']").click( function() {
     187    if (this.checked)
     188    {
     189        show_cat_list();
     190    }
     191    else
     192    {
     193      hide_cat_list();
     194    }
    162195  });
     196jQuery("input[name='piclens_wall_spec']").click( function() {
     197    if (this.checked)
     198    {
     199                jQuery('.spec_selection').show();
     200    }
     201    else
     202    {
     203                jQuery('.spec_selection').hide();
     204    }
     205  });
     206       
     207});
     208
     209if (document.getElementsByName("piclens_wall_nav")[0].checked)
     210{
     211    show_cat_list();
     212}
     213if (document.getElementsByName("piclens_wall_spec")[0].checked)
     214{
     215                jQuery('.spec_selection').show();
     216}
     217
    163218</script>
    164219{/literal}
  • extensions/piclens/admin/rssfeed.php

    r3649 r3708  
    4949        $me->my_config['piclens_sort_cat'] = 1;         // defaut PIWIGO
    5050
    51   $me->my_config['piclens_rss_name'] = $_POST['piclens_rss_name'];
    52   $me->my_config['piclens_rss_desc'] = $_POST['piclens_rss_desc'];
     51  $me->my_config['piclens_rss_name'] = stripslashes($_POST['piclens_rss_name']);
     52  $me->my_config['piclens_rss_desc'] = stripslashes($_POST['piclens_rss_desc']);
    5353  $me->my_config['piclens_exclude_double'] = isset($_POST['piclens_exclude_double']);
    5454  $me->my_config['piclens_maxcomment_nb'] = $_POST['piclens_maxcomment_nb'];
     
    138138        'PICLENS_VIDEO'         =>  $me->my_config['piclens_video'] ? 'checked="checked"' : '',
    139139        'PICLENS_CAT_VIEW'      => $me->my_config['piclens_cat_view'] ? 'checked="checked"' : '',
    140         'PICLENS_RSS_NAME'      =>  $me->my_config['piclens_rss_name'],
    141         'PICLENS_RSS_DESC'      =>   $me->my_config['piclens_rss_desc'],
     140        'PICLENS_RSS_NAME'      =>  stripslashes($me->my_config['piclens_rss_name']),
     141        'PICLENS_RSS_DESC'      =>   stripslashes($me->my_config['piclens_rss_desc']),
    142142        'PICLENS_EXCLUDE_DOUBLE'        =>  $me->my_config['piclens_exclude_double'] ? 'checked="checked"' : '',
    143143        'PICLENS_MAXCOMMENT_NB'         => $me->my_config['piclens_maxcomment_nb'],
  • extensions/piclens/admin/rssfeed.tpl

    r3649 r3708  
    227227    <tr>
    228228        <td>{'piclens_rsscfg_name'|@translate}&nbsp;:</td>
    229         <td><input type="text" size="65" maxlength="255" value="{$PICLENS_RSS_NAME}" name="piclens_rss_name" /></td>
     229        <td>
     230                        <textarea cols="50" rows="1" name="piclens_rss_name" id="piclens_rss_name" style="height: 2em">{$PICLENS_RSS_NAME}</textarea>
     231                </td>
    230232    </tr>
    231233    <tr>
    232234        <td>{'piclens_rsscfg_desc'|@translate}&nbsp;:</td>
    233         <td><input type="text" size="65" maxlength="255" value="{$PICLENS_RSS_DESC}" name="piclens_rss_desc" /></td>
     235        <td>
     236                        <textarea cols="50" rows="1" name="piclens_rss_desc" id="piclens_rss_desc" style="height: 2em">{$PICLENS_RSS_DESC}</textarea>
     237                </td>
    234238    </tr>
    235239 
Note: See TracChangeset for help on using the changeset viewer.