Ignore:
Timestamp:
Jul 22, 2009, 12:34:42 AM (15 years ago)
Author:
tiico
Message:

Some corrections
Add EN translation (only for the core, not for modules)
Add comment options (%ID)

Location:
extensions/Flash_Gallery/admin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/Flash_Gallery/admin/add_module.php

    r3531 r3663  
    4141                WHERE id = ' . $_GET['edit'] . ';');
    4242
     43    // Force le submit pour sauvegarder les données éventuellement modifiées lors du RAZ des paramètres. Pas de redirection dans ce cas
     44    $_POST['submit'] = 'no_redirect';
    4345}
    4446
     
    5759    else
    5860    {
    59 // id, pos, name, descr, type, datas, users, groups, show_title, on_home, on_cats, cats, recurs_cats, replace_thumb, replace_cats, height, transparent, id_line
    6061      $module_name = $_POST['module_name'];
    6162      $desc = (!empty($_POST['module_desc']) ? '"' . $_POST['module_desc'] . '"' : 'NULL');
     
    7879       
    7980          $height = (!empty($_POST['flashgal_height']) ? '"'.$_POST['flashgal_height'].'"' : "NULL");
     81      $maxcomment = (!empty($_POST['flashgal_max_comment']) ? '"'.$_POST['flashgal_max_comment'].'"' : "0");;
    8082         
    81 //        $sav_datas = (!empty($datas) ? '"' . addslashes(serialize($datas)) . '"' : 'NULL');
    8283          $sav_ext_datas = (!empty($ext_datas) ? '"' . addslashes(serialize($ext_datas)) . '"' : 'NULL');
    8384       
     
    9697        if (isset($_GET['edit']))
    9798      {         
    98 // // id, pos, name, descr, type, datas, users, groups, show_title, on_home, on_cats, cats, recurs_cats, replace_thumb, replace_cats, height, transparent       
    9999         
    100100        pwg_query('
     
    118118                                transparent=' . $transparent .',
    119119                                fullscreen=' . $fullscreen .',
    120                                 bgcolor="' . $bgcolor .'"
     120                                bgcolor="' . $bgcolor .'",
     121                maxcomment=' . $maxcomment . '
    121122
    122123                        WHERE id = ' . $_GET['edit'] . ';');
     
    132133               
    133134        $query = '
    134 INSERT INTO ' . FLASHGAL_TABLE . ' ( id, pos, name, descr, type, datas, ext_datas, users, groups, show_title, on_home, on_home_global, on_cats, cats, recurs_cats, replace_thumb, replace_cats, height, transparent, fullscreen, bgcolor)
     135INSERT INTO ' . FLASHGAL_TABLE . ' ( id, pos, name, descr, type, datas, ext_datas, users, groups, show_title, on_home, on_home_global, on_cats, cats, recurs_cats, replace_thumb, replace_cats, height, transparent, fullscreen, bgcolor, maxcomment)
    135136VALUES (' . $next_element_id . ' ,
    136137        ' . $pos . ',
     
    153154        ' . $transparent .',
    154155        ' . $fullscreen .',
    155         "' . $bgcolor .'"
     156        "' . $bgcolor .'",
     157    ' . $maxcomment . '
    156158  );';
    157159 
     
    161163      }
    162164
    163       redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php');
     165      if ($_POST['submit'] != 'no_redirect')
     166        redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php');
    164167    }
    165168  }
     
    194197    'replace_thumb_CHECKED' => ($module['replace_thumb'] == 'true' ? 'checked="checked"' : ''),
    195198    'replace_cats_CHECKED' => ($module['replace_cats'] == 'true' ? 'checked="checked"' : ''),
    196         'ENABLERESTORE' => true
     199        'ENABLERESTORE' => true,
     200    'FLASHGAL_MAX_COMMENT'  => (isset($module['maxcomment']) ? $module['maxcomment'] : '0')
    197201       
    198202        ));
     
    218222    'FLASHGAL_FULLSCREEN' =>  'checked="checked"',
    219223        'FLASHGAL_BGCOLOR' => '#FFFFFF',       
    220         'ENABLERESTORE' => false
    221        
     224        'ENABLERESTORE' => false,
     225        'FLASHGAL_MAX_COMMENT'  => '0'
    222226       
    223227        ));
     
    239243}
    240244
    241 ///
    242 // tiico : ajouter la récupération des données par défaut (présentes dans le fichier module.inc.php)
    243 ///
     245
     246// Recuperation des données pour les informations a parametrer dans le flux
    244247        foreach ($module_data['datas'] as $key => $value)
    245248        {
     
    247250                {
    248251                        $template->append( 'FlashGal_Param', array(
    249 //                                      $key                    => true,
    250252                                        'name'  => $key,                                                // nom du parametre
    251253                                        'lib'           => l10n($key),          // libelle du parametre
     
    267269            true);
    268270
    269 //    $datas = array($key => $datas[$key]);
    270        
    271271
    272272// Configuration supplémentaire du module (dans le cas ou il y a d'autres parametres)
  • extensions/Flash_Gallery/admin/admin.php

    r3531 r3663  
    5151}
    5252
     53//cyclage sur le parametre on_home
     54if (isset($_GET['id']) and isset($_GET['home']) and !is_adviser())
     55{
     56    $home = $_GET['home'];
     57    $global = isset($_GET['global']) ? $_GET['global'] : 'selective';
     58    // ordre : homeOFF -> HomeON -> HomeONGlobal
     59    if ($home == 'true' and $global == 'selective')
     60        $global = 'global';
     61    elseif ($home == 'true' and $global == 'global')
     62        $home = 'false';
     63    else
     64    {
     65        $home = 'true';
     66        $global = 'selective';
     67    }
     68
     69        pwg_query( 'UPDATE ' . FLASHGAL_TABLE . '
     70                SET on_home="' . $home. '", on_home_global="' . $global . '"   
     71                WHERE id=' . $_GET['id'] . ' LIMIT 1');
     72
     73  redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php');
     74}
     75//cyclage sur le parametre on_cats
     76if (isset($_GET['id']) and isset($_GET['cats']) and !is_adviser())
     77{
     78    // ordre : catsOFF -> catsON
     79        pwg_query( 'UPDATE ' . FLASHGAL_TABLE . '
     80                SET on_cats="' . ($_GET['cats'] == 'true' ? 'false' : 'true'). '"
     81                WHERE id=' . $_GET['id'] . ' LIMIT 1');
     82
     83  redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php');
     84}
     85
     86if (isset($_GET['id']) and isset($_GET['recurs']) and !is_adviser())
     87{
     88    // ordre : recursOFF -> recursON
     89        pwg_query( 'UPDATE ' . FLASHGAL_TABLE . '
     90                SET recurs_cats="' . ($_GET['recurs'] == 'true' ? 'false' : 'true'). '"
     91                WHERE id=' . $_GET['id'] . ' LIMIT 1');
     92
     93  redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php');
     94}
     95
    5396//Récupération des modules disponibles
    5497$modules = get_flashgal_modules();
  • extensions/Flash_Gallery/admin/manage.php

    r3531 r3663  
    5353        'ICON_INFO'                     => FLASHGAL_PATH . 'img/infos.png',
    5454        'SCREEN'                        => FLASHGAL_PATH . '/modules/'. $module['type'].'/screenshot.jpg',
    55     'U_EDIT' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadd_module.php&type=' . $module['type'] . '&edit=' . $module['id'],
    56     'U_DELETE' => !is_adviser() ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php&del=' . $module['id'] : '',
     55    'U_EDIT'            => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadd_module.php&type=' . $module['type'] . '&edit=' . $module['id'],
     56    'U_DELETE'          => !is_adviser() ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php&del=' . $module['id'] : '',
     57    'U_HOME'            => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php&id=' . $module['id'] .'&home=' . $module['on_home'] . '&global=' .$module['on_home_global'],
     58    'U_CATS'            => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php&id=' . $module['id'] .'&cats=' . $module['on_cats'],
     59    'U_RECURS'          => PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php&id=' . $module['id'] .'&recurs=' . $module['recurs_cats'],
    5760  ));
    5861}
  • extensions/Flash_Gallery/admin/template/add_module.tpl

    r3531 r3663  
    7575                        <td colspan="3"><input type="checkbox" name="show_title" value="1" {$show_title_CHECKED}>&nbsp;&nbsp;{'flashgal_show_title'|@translate}</td>
    7676                </tr>
    77                 <tr><td><br></td></tr>
     77                <tr><td colspan="3">&nbsp;</td></tr>
    7878
    7979                <tr>
     
    8181                        <td colspan="2"><input type="text" size="3" maxlength="3" value="{$FLASHGAL_HEIGHT}" name="flashgal_height">&nbsp;px</td>
    8282                </tr>
     83                <tr><td colspan="3">&nbsp;</td></tr>
     84                <tr>
     85                        <td> &nbsp; </td>
     86                    <td colspan="2">
     87                                 - <input type="checkbox" name="flashgal_transparent" {$FLASHGAL_TRANSPARENT}/>&nbsp; {'flashgal_transparent'|@translate}
     88                        </td>
     89                </tr>
    8390                <tr>
    8491                        <td> {'flashgal_cfg_option'|@translate} &nbsp; </td>
    8592                    <td colspan="2">
    86                                  - <input type="checkbox" name="flashgal_transparent" {$FLASHGAL_TRANSPARENT}/>&nbsp; {'flashgal_transparent'|@translate}
    87                                  <br/>
    8893                                 - <input type="checkbox" name="flashgal_fullscreen" {$FLASHGAL_FULLSCREEN}/>&nbsp; {'flashgal_fullscreen'|@translate}
    89                                  <br/>
     94                        </td>
     95                <tr>
     96                        <td> &nbsp; </td>
     97                    <td colspan="2">
    9098                                 - {'flashgal_bgcolor'|@translate}&nbsp;  <input type="text" size="7" maxlength="7" name="flashgal_bgcolor" class="colorwell" value="{$FLASHGAL_BGCOLOR}" />
    91                                  <br/>
     99                        </td>
     100                </tr>
     101                <tr>
     102                        <td> &nbsp; </td>
     103                    <td colspan="2">
    92104                                 - <input type="checkbox" name="flashgal_recurs_cats" {$FLASHGAL_RECURS_CATS}/>&nbsp; {'flashgal_recurs_cats'|@translate}
    93105                        </td>
    94                 </tr>
    95                 <tr>
    96                         <td></td>
    97                         <td><br><hr></td>
    98                         <td></td>
     106                <tr><td colspan="3">&nbsp;</td></tr>
     107                <tr><td colspan="3">&nbsp;</td></tr>
     108       
     109        </table>
     110        <table>
     111                <tr>
     112            <td></td>
     113            <td><br><hr></td>
     114            <td></td>
    99115                </tr>
    100116                <tr>
     
    232248                 <td> &nbsp; </td>
    233249          </tr>
     250          <tr>
     251                 <td> <b>%ID</b> : <input type="text" size="1" maxlength="1" value="{$FLASHGAL_MAX_COMMENT}" name="flashgal_max_comment" /> {'img_comment_legend'|@translate} </td>
     252                 <td> &nbsp; </td>
     253                 <td> &nbsp; </td>
     254          </tr>
    234255        </table>
    235256       
  • extensions/Flash_Gallery/admin/template/manage.tpl

    r3531 r3663  
    7979      {if $module.TYPE != 'MainBlock'}
    8080      <ul class="categoryActions">
    81                 <li><img src="{$module.ON_HOME}"  title="{$module.ON_HOME_LIB}"/></li>       
    82                 <li><img src="{$module.ON_CATS}"   title="{$module.ON_CATS_LIB}"/></a></li>       
    83         <li><img src="{$module.RECURS_CATS}"  title="{$module.RECURS_CATS_LIB}"/></a></li>       
     81                <li><a href="{$module.U_HOME}" title="{$module.ON_HOME_LIB}"><img src="{$module.ON_HOME}"  title="{$module.ON_HOME_LIB}"/></a></li>       
     82                <li><a href="{$module.U_CATS}" title="{$module.ON_CATS_LIB}"><img src="{$module.ON_CATS}"   title="{$module.ON_CATS_LIB}"/></a></li>       
     83        <li><a href="{$module.U_RECURS}" title="{$module.RECURS_CATS_LIB}"><img src="{$module.RECURS_CATS}"  title="{$module.RECURS_CATS_LIB}"/></a></li>       
    8484               
    8585                <li><a href="{$module.U_EDIT}" title="{'flashgal_edit'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'flash_edit'|@translate}"/></a></li>
Note: See TracChangeset for help on using the changeset viewer.