Ignore:
Timestamp:
Oct 22, 2012, 4:47:26 PM (12 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4, add option: SelMax / Autosize (default setting)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/admin/admin_autosize.php

    r17503 r18716  
    4242include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
    4343
     44
    4445$my_base_url = get_admin_plugin_menu_link(__FILE__);
    45 
    4646
    4747
     
    8888// |                          Sélection de l'onglet                        |
    8989// *************************************************************************
    90 global $infos_message ; 
    91 global $erreur_message;
     90global $infos_message , $erreur_message ,$warnings_message ;
    9291global $conf;
    9392global $autosize_parametres;
     
    9796 $visible=true;
    9897 $path = AUTOSIZE_PATH;
    99 global $has_pamoorama,$select_type,$autosize_parametres;
    100 global $defined_types,$maxi_img ,$pictureDeriv ,$liste_type,$SRC_IMG;
    101   $defined_types = array_keys(ImageStdParams::get_defined_type_map()); 
    102   $autosize_parametres = cl_autosize_Get_Options();
    103          
     98global $has_pamoorama,$autosize_parametres;
     99global $defined_types,$pictureDeriv ,$liste_type,$SRC_IMG;
     100global $pictureSelType ;
     101 $reload=false ;
     102  include (AUTOSIZE_PATH."include/affiche.php");                 
     103     $autosize_parametres = cl_autosize_Get_Options();   
     104    $types = array_intersect(array_keys(ImageStdParams::get_defined_type_map()), array("Autosize","SelMaxi"));
     105    if (count($types)==0){ 
     106        if(!isset($warnings_message)) $warnings_message="";     
     107        include_once (AUTOSIZE_PATH.'maintain.inc.php');
     108        if (isset($conf['cl_derivatives_sav']))  {   
     109            plugin_deactivate() ;             
     110        }   
     111          plugin_activate();
     112          $warnings_message .= "Set :";
     113          $defined_types = array_keys(ImageStdParams::get_defined_type_map());
     114          $warnings_message .= cl_print_var($defined_types);         
     115          $reload=true ;
     116    }
     117  $defined_types = array_keys(ImageStdParams::get_defined_type_map());   
     118
    104119   if (isset($_POST['submit']))  { 
    105120          if ($_POST['submit'] == l10n('cl_autosize_save'))  { 
    106121                 cl_autosize_sauve_options_inf() ;
    107                      unset($_POST);
     122                  //   unset($_POST);
    108123                 }
    109124        }       
     
    112127                 unset($_POST);
    113128                 }
    114   include (AUTOSIZE_PATH."include/affiche.php");                 
     129
    115130//================================================================================
    116131$base_url = get_root_url().'admin_autosize.php';
     
    119134  case 'autosize_admin':
    120135    $template->set_filenames(array('plugin_admin_content' => realpath(AUTOSIZE_PATH . 'admin/template/admin.tpl')));
     136    $template->assign(
     137                                        array( 'reload' =>  $reload,
     138   
     139   ));
    121140    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
    122141    break;
     
    152171 $template->set_filenames(array( 'plugin_admin_content' => realpath(AUTOSIZE_PATH . 'admin/template/help.tpl' )));
    153172 $template->assign(
    154                                         array(
    155    'message' =>  $message  ,
     173                                        array( 
     174   'message' =>  $message 
    156175   ));
    157176
     
    160179 break;
    161180  }
    162        if (!isset($infos_message)){
     181    if (!isset($infos_message)){
    163182                  $infos_message = "";
    164                 }                
     183                }
    165184                if  ($infos_message != "")  {
    166185                   array_push($page['infos'],  $infos_message);
     
    170189                  $erreur_message = "";
    171190                }               
    172                 if  ($erreur_message != "")  {
    173        
     191                if  ($erreur_message != "")  { 
    174192                  array_push($page['errors'], $erreur_message);
    175                   $erreur_message="";
    176        
    177                  
    178                  }               
     193                  $erreur_message="";           
     194                 }             
     195    if (!isset($warnings_message)){
     196                  $warnings_message = "";
     197                } 
     198                 
     199    if  ($warnings_message != "")  {
     200                   array_push($page['warnings'],  $warnings_message);
     201                   $warnings_message="";
     202                 }
     203           
    179204                 
    180205//================================================================
Note: See TracChangeset for help on using the changeset viewer.