Changeset 7905


Ignore:
Timestamp:
Nov 28, 2010, 1:01:06 PM (13 years ago)
Author:
cljosse
Message:

[cl_conflit] save?

Location:
extensions/cl_conflit
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • extensions/cl_conflit/admin/admin_conflit.php

    r7880 r7905  
    9292
    9393        $path = CONFLIT_PATH;
    94           $plg_data = implode( '', file($path.'main.inc.php') );
    95           if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) )
    96           {
    97             $plugin['name'] = trim( $val[1] );
    98           }
    99           if (preg_match("|Version: (.*)|", $plg_data, $val))
    100           {
    101             $plugin['version'] = trim($val[1]);
    102           }
    103           if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) )
    104           {
    105             $plugin['uri'] = trim($val[1]);
    106           }
    107           if ($desc = load_language('description.txt', $path.'/', array('return' => true)))
    108           {
    109             $plugin['description'] = trim($desc);
    110           }
    111           elseif ( preg_match("|Description: (.*)|", $plg_data, $val) )
    112           {
    113             $plugin['description'] = trim($val[1]);
    114           }
    115           if ( preg_match("|Author: (.*)|", $plg_data, $val) )
    116           {
    117             $plugin['author'] = trim($val[1]);
    118           }
    119           if ( preg_match("|Author URI: (.*)|", $plg_data, $val) )
    120           {
    121             $plugin['author uri'] = trim($val[1]);
    122           }
    123           if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid='))
    124           {
    125             list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']);
    126             if (is_numeric($extension)) $plugin['extension'] = $extension;
    127           }
    128           // IMPORTANT SECURITY !
    129           $plugin = array_map('htmlspecialchars', $plugin);
    13094
    131 $version = $plugin['version'] ;
    13295         $conflit_parametres = cl_conflit_Get_Options();
    13396
  • extensions/cl_conflit/admin/cl_conflit_admin.php

    r7880 r7905  
    9191        $visible=true; 
    9292
    93         $path = CONFLIT_PATH;
    9493
    95           $plg_data = implode( '', file($path.'main.inc.php') );
    96           if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) )
    97           {
    98             $plugin['name'] = trim( $val[1] );
    99           }
    100           if (preg_match("|Version: (.*)|", $plg_data, $val))
    101           {
    102             $plugin['version'] = trim($val[1]);
    103           }
    104           if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) )
    105           {
    106             $plugin['uri'] = trim($val[1]);
    107           }
    108           if ($desc = load_language('description.txt', $path.'/', array('return' => true)))
    109           {
    110             $plugin['description'] = trim($desc);
    111           }
    112           elseif ( preg_match("|Description: (.*)|", $plg_data, $val) )
    113           {
    114             $plugin['description'] = trim($val[1]);
    115           }
    116           if ( preg_match("|Author: (.*)|", $plg_data, $val) )
    117           {
    118             $plugin['author'] = trim($val[1]);
    119           }
    120           if ( preg_match("|Author URI: (.*)|", $plg_data, $val) )
    121           {
    122             $plugin['author uri'] = trim($val[1]);
    123           }
    124           if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid='))
    125           {
    126             list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']);
    127             if (is_numeric($extension)) $plugin['extension'] = $extension;
    128           }
    129           // IMPORTANT SECURITY !
    130           $plugin = array_map('htmlspecialchars', $plugin);
    13194
    132                         $version = $plugin['version'] ;
    133                         $cl_conflit_parametres = cl_conflit_Get_Options();
     95$cl_conflit_parametres = cl_conflit_Get_Options();
    13496                if (isset($_POST['submit']))  { 
    13597                        if ($_POST['submit'] == l10n('cl_conflit_save'))  { 
  • extensions/cl_conflit/admin/template/admin.tpl

    r7880 r7905  
    22 <script type="text/javascript">
    33     var DEBUG = '{$DEBUG}';
     4     var theme = '{$theme}';
     5     var cl_version = '{$cl_version}';
     6     var cl_plugin = '{$cl_plugin}';
     7
    48     var thumbnail = '{$thumbnail}';
    59     var theme = '{$theme}';
    6      var version = '{$version}';
    7      var scaled_width = '{$SCALED_WIDTH}'; // valeur par defaut
    8      var scaled_height = '{$SCALED_HEIGHT}'; // valeur par defaut
    9      var img_width = '{$IMG_WIDTH }';
    10      var img_height = '{ $IMG_HEIGHT }';
    11 
    12      var marge_basse = '{ $MARGE_BASSE }';
    13      var echelle_max = '{ $ECHELLE_MAX }';
    14      var mini_width = '{ $MINI_WIDTH   }';
    15      var mini_height = '{ $MINI_HEIGHT   }';
    16 
    17      var webmaster_width = '{$webmaster_width   }';
    18      var webmaster_height = '{ $webmaster_height   }';
    19      var admin_width = '{ $admin_width   }';
    20      var admin_height = '{ $admin_height   }';
    21      var generic_width = '{ $generic_width   }';
    22      var generic_height = '{ $generic_height   }';
    23      var guest_width = '{ $guest_width   }';
    24      var guest_height = '{$guest_height}';
    25      var normal_width = '{$normal_width}';
    26      var normal_height = '{$normal_height}';
    27      var user_status = '{$user_status}';
    28 
    29      var check_auto_w = '{$check_auto_w}';
    30 
    31      var check_desc_v = '{$check_desc_v}';
     10     var cl_Query = '{$cl_query}';
     11     var cl_type = '{$cl_type}';
    3212
    3313     </script>
     
    5535</script>
    5636{/literal}
    57 <!--============== assign visible =======================-->   
    58 {assign var="affiche_cde" value="true"}
    59 {if $affiche_cde == "true"}
    60   {assign var="visible" value="block"}
    61 {else}
    62   {assign var="visible" value="none"}
    63 {/if}
    64 {if $check_auto_w == true}
    65      {assign var="visible_w" value="visible"}
    66   {else}
    67      {assign var="visible_w" value="hidden"}
    68 {/if}
     37 
    6938<div class="titrePage">
    70                 <h2>{'Autosize'|translate} {'version'|translate}{$version}</h2>
     39                <h2>{'cl_conflit'} {'version'|translate}{$cl_version}</h2>
    7140</div>
    72   <span>{'cl_conflit_Howto'|translate}</span>
     41 
    7342
    7443
    75 
    76 <!--============== !DIV ==={$IMG_WIDTH  }=={$IMG_HEIGHT  }======-->     
     44   
    7745<table >
    78   <form action="" method="post" name="form_conflit" id="form_conflit"    >
    79 
    80   <table id="table0" style=" background:none;border:outset;width:90%; z-index:-500 " >
    81     <fieldset>
    82         <legend class="cluetip" title="{'cl_conflit_config_title_1'|@translate}|{'cl_conflit_hlp_line1'|@translate}">{'cl_conflit_config_title_1'|@translate}</legend>
    83         <td>{'User status'|@translate}</td>
    84         <td>{'cl_conflit_height'|@translate}</td>
    85         <td style="visibility:visible">{'cl_conflit_width'|@translate}
    86          <input type="checkbox" name="check_auto_w" value="on"  {$check_auto_w}  /></td>
    87          <td style="visibility:visible">{'cl_conflit_enabled'|@translate}
    88         </td>
    89 
    90         <tr>
    91         <td>{'user_status_webmaster'|@translate}</td>
    92         <td><input name="webmaster_height" id="Text7" type="text"  value ="{$webmaster_height}" /></td>
    93         <td style="visibility:{$visible_w}"><input name="webmaster_width" id="webmaster_width" type="text"  value ="{$webmaster_width}" /></td>
    94          <td ><input name="webmaster_enabled" id="webmaster_enabled" type="checkbox"  value ="on" {$webmaster_enabled}  /></td>
    95         </tr>
    96         <tr>
    97         <td>{'user_status_admin'|@translate}</td>
    98         <td><input name="admin_height" id="admin_height" type="text"  value ="{$admin_height}" /></td>
    99         <td style="visibility:{$visible_w}"><input name="admin_width" id="admin_width" type="text"  value ="{$admin_width}" /></td>
    100           <td ><input name="admin_enabled" id="admin_enabled" type="checkbox"  value ="on" {$admin_enabled} /></td>
    101         </tr>
    102         <tr>
    103         <td>{'user_status_generic'|@translate}</td>
    104         <td><input name="generic_height" id="Text1" type="text"  value ="{$generic_height}" /></td>
    105         <td style="visibility:{$visible_w}"><input name="generic_width" id="generic_width" type="text"  value ="{$generic_width}" /></td>
    106         <td ><input name="generic_enabled" id="generic_enabled" type="checkbox"  value ="on" {$generic_enabled} /></td>
    107         </tr>
    108         <tr>
    109         <td>{'user_status_guest'|@translate}</td>
    110         <td><input name="guest_height" id="Text3" type="text"  value ="{$guest_height}" /></td>
    111         <td style="visibility:{$visible_w}"><input name="guest_width" id="guest_width" type="text"  value ="{$guest_width}" /></td>
    112          <td ><input name="guest_enabled" id="guest_enabled" type="checkbox"  value ="on" {$guest_enabled} /></td>
    113         </tr>
    114         <tr>
    115         <td>{'user_status_normal'|@translate}</td>
    116         <td><input name="normal_height" id="Text5" type="text"  value ="{$normal_height}" /></td>
    117         <td style="visibility:{$visible_w}"><input name="normal_width" id="normal_width" type="text"  value ="{$normal_width}" /></td>
    118          <td ><input name="normal_enabled" id="normal_enabled" type="checkbox"  value ="on" {$normal_enabled} /></td>
    119         </tr>
    120 
    121   </fieldset>
    122 
    123   </table>
    124 
    125 <br />
    126  <table id="table_d" style=" background:none;border:outset;width:90%; z-index:-500 " >
    127    <fieldset>
    128         <legend class="cluetip" title="{'cl_conflit_config_title_2'|@translate}|{'cl_conflit_hlp_line2'|@translate}">{'cl_conflit_config_title_2'|@translate}</legend>
     46  <form action="" method="post" name="form_conflit" id="form_conflit"    > 
    12947 
    130     <!--======== Dimensions HL ===================-->   
    131     <tr>
    132       <td class="cluetip" title="{'cl_conflit_miniheight'|@translate}|{'cl_conflit_hlp_line3'|@translate}" >{'cl_conflit_miniheight'|translate}</td>
    133       <td ><input name="mini_height" id="mini_height" type="text"  value ="{$MINI_HEIGHT}" /> px
    134            </td>
    135          
    136      <td class="cluetip" title="{'cl_conflit_miniwidth'|translate}|{'cl_conflit_hlp_line3'|@translate}"  > {'cl_conflit_miniwidth'|translate}</td>
    137    <td  >
    138     <input name="mini_width"  id="mini_width" type="text" value =  "{$MINI_WIDTH}" /> px
    139        </tr>
    140    <!--======== Positions  ===================-->       
    141 <tr >
    142  <td class="cluetip" title="{'cl_conflit_echelle_max'|translate}|{'cl_conflit_hlp_line4'|@translate}" > {'cl_conflit_echelle_max'|translate}</td>
    143  <td  >
    144  <input name="echelle_max" id="echelle_max"  type="text" value ="{$ECHELLE_MAX}" />
    145  </td>
    146  
    147 </tr>
    148 
    149 <tr > 
    150 <td class="cluetip" title="{'cl_conflit_marge_basse'|translate}|{'cl_conflit_hlp_line5'|@translate}" > {'cl_conflit_marge_basse'|translate}</td>
    151 <td><input name="marge_basse" id="marge_basse"  type="text" value =  "{$MARGE_BASSE}" /> px</td>
    152 
    153 </tr>             
    154 
    155   <!--======================================================================================-->
    156      <tr >
    157          
    158          </tr>
    159 
    160 
    161   </fieldset>
    162  </table>
    163  <!--=================== Bloc choix =============================-->     
    164  <table>
    165   <tr><td style="visibility:visible">{'cl_conflit_icon_view'|@translate}
    166          <input type="checkbox" name="check_icon_v" value="on"  {$check_icon_v}  />
    167   </td>
    168   <td>{'cl_conflit_desc_view'|@translate}
    169          <input type="checkbox" name="check_desc_v" value="on"  {$check_desc_v}  />
    170   </td>
    171   <td>
    172   </td>
    173  
    174   </tr>
    175 </table>
    176  
    177   <table>
    178   <td><input name="submit" type="submit" value="{'cl_conflit_save'|@translate}" /></td>
    179 </table>
     48    <table>
     49       <td><input name="submit" type="submit" value="{'cl_conflit_save'|@translate}" /></td>
     50    </table>
    18051</form>
    18152 
  • extensions/cl_conflit/conflit.inc.php

    r7895 r7905  
    3333 static public function cl_conflit_script()
    3434        {
     35
     36
    3537           global  $template,$user,$conf,$picture ,$page,$cl_plugin;
     38 
    3639                $my_path =  basename(dirname(__FILE__)).'/' ;
    3740            $my_path = dirname(__FILE__).'/';
     
    4346                $template->assign(
    4447                                                array(
    45                                                 'version' => $cl_plugin['version'] ,
     48                                                'cl_version' => $cl_plugin['version'] ,
    4649                                                'name' => $cl_plugin['id'] ,
    4750                                                'cl_conflit' => $cl_conflit  ,
     
    5356                if(     $page['body_id'] == 'theAdminPage' ) return ;
    5457                return $template->parse( 'cl_conflit_init', false);
    55         }// function cl_autosize_script
     58        }// function cl_conflit_script
    5659//=================================================================================
    5760/*
     
    7073                        $template->assign(
    7174                                        array(                                         
    72                                             'version' => $cl_plugin['version'] ,
     75                                            'cl_version' => $cl_plugin['version'] ,
    7376                                                'name' => $cl_plugin['id'] ,
    7477                                                'ma_page' =>    $page['body_id'],
     
    8891
    8992
    90  }// function cl_autosize_script_2
     93 }// function cl_conflit_script_2
    9194
    9295 //=================================================================
     
    109112if ($ThePicture['is_picture'] <> 1 )    {  return $content;  ; }       
    110113
    111          $autosizejs = '<script type="text/javascript" charset="utf-8"  src="';
    112               $autocss =   $autosizejs.'themes/default/js/jquery.packed.js"></script>'."\n";
     114         $cl_conflitjs = '<script type="text/javascript" charset="utf-8"  src="';
     115              $autocss =   $cl_conflitjs.'themes/default/js/jquery.packed.js"></script>'."\n";
    113116                  $template->append('head_elements',$autocss);
    114117
     
    121124
    122125
    123  }// function cl_autosize_script_3
    124 
     126 }// function cl_conflit_script_3
     127        /*
     128        *
     129        */
     130        static public function cl_conflit_admin($menu)
     131                {
     132                global  $lang ;
     133                array_push($menu, array('NAME' => 'cl_conflit',
     134                'URL' => get_admin_plugin_menu_link(CONFLIT_PATH . 'admin/cl_conflit_admin.php')));
     135                return $menu;
     136        } //function cl_conflit_admin
    125137
    126138} // class
     139        /*
     140        *
     141        */
     142 function cl_conflit_Get_Options()
     143  {
     144                global $conf,$cl_conflit_parametres;
     145                $cl_conflit_parametres =  unserialize($conf['cl_conflit']);
     146                $cl_conflit_parametres =  cl_conflit_Set_Options();
     147                return $cl_conflit_parametres;
     148  }
     149        /*
     150        *
     151        */
     152function cl_conflit_Set_Options()
     153  {
    127154
     155  global $cl_conflit_parametres;
     156//=============================================================================
     157$cl_conflit_parametres->query =(isset($_POST['query'])) ? $_POST['query'] : ((isset($cl_conflit_parametres->query )) ? $cl_conflit_parametres->query : '' ) ;
     158$cl_conflit_parametres->type=(isset($_POST['type']))? $_POST['type']: ((isset($cl_conflit_parametres->type)) ? $cl_conflit_parametres->type:  '') ;
     159
     160 
     161return $cl_conflit_parametres;
     162}
     163        /*
     164        *
     165        */
     166function cl_conflit_sauve_options_inf()
     167{
     168global $options,$infos_message,$conf,$cl_conflit_parametres  ;
     169$infos_message .=l10n("cl_conflit_save_config")."<br>";
     170 $cl_conflit_parametres=cl_conflit_Set_Options();
     171
     172 if ( isset($cl_conflit_parametres) )
     173        {
     174 
     175                $query = '
     176                UPDATE '.CONFIG_TABLE.'
     177                SET value="'.addslashes(serialize($cl_conflit_parametres)).'"
     178                WHERE param = "cl_conflit"
     179                LIMIT 1';
     180                        pwg_query($query);
     181          }
     182         
     183 }
    128184
    129185
  • extensions/cl_conflit/include/affiche.php

    r7895 r7905  
    11<?php 
    22
    3           $plg_data = implode( '', file($path.'main.inc.php') );
    4           if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) )
    5           {
    6             $plugin['name'] = trim( $val[1] );
    7           }
    8           if (preg_match("|Version: (.*)|", $plg_data, $val))
    9           {
    10             $plugin['version'] = trim($val[1]);
    11           }
    12           if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) )
    13           {
    14             $plugin['uri'] = trim($val[1]);
    15           }
    16           if ($desc = load_language('description.txt', $path.'/', array('return' => true)))
    17           {
    18             $plugin['description'] = trim($desc);
    19           }
    20           elseif ( preg_match("|Description: (.*)|", $plg_data, $val) )
    21           {
    22             $plugin['description'] = trim($val[1]);
    23           }
    24           if ( preg_match("|Author: (.*)|", $plg_data, $val) )
    25           {
    26             $plugin['author'] = trim($val[1]);
    27           }
    28           if ( preg_match("|Author URI: (.*)|", $plg_data, $val) )
    29           {
    30             $plugin['author uri'] = trim($val[1]);
    31           }
    32           if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid='))
    33           {
    34             list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']);
    35             if (is_numeric($extension)) $plugin['extension'] = $extension;
    36           }
    37           // IMPORTANT SECURITY !
    38           $plugin = array_map('htmlspecialchars', $plugin);
    39 
    40 $version = $plugin['version'] ;
    41  
     3       
    424
    435$visible=(isset($visible))?$visible:false;
    446$img_width=isset($picture['current']['width'])?$picture['current']['width']:480;
    457$img_height=isset($picture['current']['height'])?$picture['current']['height']:320;
    46 $version=isset($version)?$version:"";
     8$cl_version=isset($cl_version)?$cl_version:"";
    479$theme=$user['theme'];
    4810 
     
    5012        $template->assign(
    5113                                        array(
    52                                         'version' => $version,
     14                                        'cl_version' => $cl_version,
    5315                                        'cl_plugin' => $cl_plugin,
    54                     'version' => $version,
     16                    'cl_version' => $cl_version,
    5517                    'CONFLIT_PATH' => CONFLIT_PATH,
    5618                    'theme' => $theme,
  • extensions/cl_conflit/include/constants.php

    r7880 r7905  
    22global $prefixeTable;
    33if (!defined('CL_CONFLIT_TABLE')) define('CL_CONFLIT_TABLE', $prefixeTable.'cl_conflit');
     4$path = CONFLIT_PATH;
     5          $plg_data = implode( '', file($path.'main.inc.php') );
     6          if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) )
     7          {
     8            $conflit_plugin['name'] = trim( $val[1] );
     9          }
     10          if (preg_match("|Version: (.*)|", $plg_data, $val))
     11          {
     12            $conflit_plugin['version'] = trim($val[1]);
     13          }
     14          if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) )
     15          {
     16            $conflit_plugin['uri'] = trim($val[1]);
     17          }
     18          if ($desc = load_language('description.txt', $path.'/', array('return' => true)))
     19          {
     20            $conflit_plugin['description'] = trim($desc);
     21          }
     22          elseif ( preg_match("|Description: (.*)|", $plg_data, $val) )
     23          {
     24            $conflit_plugin['description'] = trim($val[1]);
     25          }
     26          if ( preg_match("|Author: (.*)|", $plg_data, $val) )
     27          {
     28            $conflit_plugin['author'] = trim($val[1]);
     29          }
     30          if ( preg_match("|Author URI: (.*)|", $plg_data, $val) )
     31          {
     32            $conflit_plugin['author uri'] = trim($val[1]);
     33          }
     34          if (!empty($conflit_plugin['uri']) and strpos($conflit_plugin['uri'] , 'extension_view.php?eid='))
     35          {
     36            list( , $extension) = explode('extension_view.php?eid=', $conflit_plugin['uri']);
     37            if (is_numeric($extension)) $conflit_plugin['extension'] = $extension;
     38          }
     39          // IMPORTANT SECURITY !
     40          $conflit_plugin = array_map('htmlspecialchars', $conflit_plugin);
    441
    5 
    6 
     42global $cl_plugin, $cl_version;
     43 $cl_version = $conflit_plugin['version'] ;
     44 $cl_plugin  = $conflit_plugin;
     45 
    746?>
  • extensions/cl_conflit/main.inc.php

    r7895 r7905  
    22/*
    33Plugin Name: cl_conflit
    4 Version: 1.0.0
     4Version: 1.0.1
    55Description: gestion des conflits entre jQuery et les autres librairies
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=474
     
    1616         
    1717//============================================================================         
    18                   global $cl_version , $cl_plugin ;
    19                   $cl_version = $plugin;
    20                   $cl_plugin = $plugin;
     18  include ($path."include/constants.php");         
    2119//============================================================================
    2220include_once(CONFLIT_PATH.'conflit.inc.php');   
     21
    2322$conflit_controler = new conflit_controler();
     23add_event_handler('get_admin_plugin_menu_links', array(&$conflit_controler,'cl_conflit_admin')  );
    2424
    2525add_event_handler('loc_after_page_header', array(&$conflit_controler, 'cl_conflit_script'),  EVENT_HANDLER_PRIORITY_NEUTRAL+20 ,  2);
  • extensions/cl_conflit/template/autosize.tpl

    r7880 r7905  
    1515    var theme = '{$theme}';
    1616    var visible = '{$visible}';
    17     var version = '{$version}';
     17    var cl_version = '{$cl_version}';
    1818
    1919    var scaled_width =  '{$SCALED_WIDTH}'; // valeur par defaut
  • extensions/cl_conflit/template/conflit.tpl

    r7895 r7905  
    88    var DEBUG = '{$DEBUG}';
    99    var theme = '{$theme}';
    10     var Version = '{$version}';
     10    var cl_version = '{$cl_version}';
    1111    var cl_plugin = '{$cl_plugin}';
    1212</script>
Note: See TracChangeset for help on using the changeset viewer.