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

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.