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)

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