Changeset 11497


Ignore:
Timestamp:
Jun 23, 2011, 2:29:02 PM (13 years ago)
Author:
cljosse
Message:

[extensions] set_plugins add functions

Location:
extensions/set_plugins
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/set_plugins/include/affiche.php

    r11484 r11497  
    77global $list_visible, $state,$liste_plugins;
    88global $set_plugins_parametres;
    9 global $nb,$liste,$state,$list_visible,$add_plugins;
    10 if (isset($conf['set_plugins'])) $set_plugins_parametres =  unserialize($conf['set_plugins']);
    11   $nb=set_plugins::set_var('nb','10');
    12  
     9global $nb,$liste,$state,$list_visible,$add_plugins,$edited_file,$set;
    1310  $plugins = new plugins();
    1411  $plugins->sort_fs_plugins('name');
     
    1815  $action_url = $base_url.'&plugin='.'%s'.'&pwg_token='.get_pwg_token();
    1916
     17if (isset($conf['set_plugins'])) $set_plugins_parametres =  unserialize($conf['set_plugins']);
     18 
     19 $nb=set_plugins::set_var('nb','10');
     20
    2021  $liste = set_plugins::set_var('liste',array());
    21    if (isset($liste[0]) && is_array($liste[0]))
    22             $liste = array();
    23    $liste= array_unique($liste);
    24 
     22  $liste= array_unique($liste);
    2523  $state=set_plugins::set_var('state',"active");
    2624  $list_visible=set_plugins::set_var('list_visible',"on,on,on,on");
    2725  $add_plugins=set_plugins::set_var('add_plugins',"");
    28  
    29 global $set;
     26  $set=set_plugins::set_var('set',false);
     27  $edited_file=set_plugins::get_file_name();
     28//================================================================ 
    3029
    31 if ( isset($_POST)) {
    32       $set="true";
    33 }else{
    34      $set="false";
     30
     31if (isset($_POST) && count($_POST)>0){   
     32if (isset($_POST['submit']))
     33  switch($_POST['submit']){
     34           case l10n('save_file'):
     35              set_plugins::save_to_file($liste_des_plugins_activés);
     36              break;
     37            case l10n('restore'):
     38               $liste_r = set_plugins::restore_from_file();
     39                if(count($liste_r)>0)
     40                $liste=$liste_r;
     41                  $infos_message .= set_plugins::memo_var($liste);
     42              break;
     43              case l10n('Deactivate'):
     44               //   $infos_message .= set_plugins::memo_var("DEACTIVER");
     45              break;
     46              case l10n('Activate'):
     47               //   $infos_message .= set_plugins::memo_var("ACTIVER");
     48              break;
     49              case l10n('store'):
     50              //    $infos_message .= set_plugins::memo_var("STORE");
     51              break;
     52
     53            }
     54         
    3555}
    36 global  $edited_file;
    37  if (isset($_POST['submit']) && $_POST['submit']==l10n('save_file')){
    38   set_plugins::save_to_file($liste);
     56if($add_plugins!=""  ){ 
     57$infos_message .=$add_plugins;
     58 if(!array_search($add_plugins, $liste)){
     59  array_push($liste,  $add_plugins );
     60   $set=="true";
    3961 }
    40 
    41 ///================================================================ 
    42 if (isset($_POST['restore']) ){
    43 $liste=set_plugins::restore_from_file();
    4462}
    4563
    4664
    47 if($add_plugins!=""  ){
    48  
    49 $infos_message .=$add_plugins;
    50  if(!array_search($add_plugins, $liste)){
    51   array_push($liste,  $add_plugins );
    52  }
    53  // $add_plugins="";
    54  // unset( $_POST['add_plugins']);
    55 }
    56 if (isset($liste_des_plugins))
    57 foreach($liste_des_plugins as $plugin_id) { 
     65$liste_mem=$liste;
     66
     67if (isset($liste_des_plugins_activés))
     68foreach($liste_des_plugins_activés as $plugin_id) { 
    5869if(!array_search($plugin_id, $liste)){
    5970  array_push($liste,  $plugin_id );
    6071 }
    6172}
    62 if(count($liste)>0) $liste= array_unique($liste);
    63 
    64 if(count($liste )>0)   
    65    $liste_plugins=isset($_POST['liste_plugins'])?$_POST['liste_plugins']:$liste;
     73if(count($liste)>0) {
     74  $liste= array_unique($liste);
     75}
     76//$infos_message .= "liste_des_plugins_activés".set_plugins::memo_var($liste_des_plugins_activés);
     77//$infos_message .= "liste".set_plugins::memo_var($liste_mem);
    6678
    6779if ( $set=="true"){   
    6880    set_plugins::save_config();
    69     unset($_POST['list_visible']);
    70     unset($_POST['nb']);
     81
    7182 } 
    72 
    73 
    74 
    7583 //=======================================================
    76  if($liste)  $liste_plugins = array_combine($liste,$liste);
     84 if(isset($liste) && count($liste)>0)  $liste_plugins =$liste;
    7785 else $liste_plugins =array();
    7886//==========================================================
     
    8088  array_keys($liste_plugins) 
    8189  );
     90
    8291$liste_tpl=array();
    8392foreach($plugins->fs_plugins as $plugin_id => $fs_plugin) {   
    8493//==== test si $plugin_id fait partie de $liste_plugins ============== 
    8594    $key = array_search($plugin_id, $liste_plugins,false);
     95   
    8696    if ($key!== false){
     97 
    8798    if(isset( $plugins->db_plugins_by_id[$plugin_id])){
     99   $key =  array_search($plugin_id, $liste_mem,false);
     100
    88101    $State_id=$plugins->db_plugins_by_id[$plugin_id]['state'] ;
     102   if( $key !==false) {
     103   $couleur="black";
     104   
     105    }
     106    else
     107     $couleur="red";
     108
    89109      $tpl_plugin = array(
    90110        'NAME' => $fs_plugin['name'],
    91111        'U_ACTION' => sprintf($action_url, $plugin_id),       
    92         'STATE' =>$State_id
    93       );
     112        'STATE' =>$State_id,
     113        'COLOR' => $couleur
     114        );
    94115      $liste_tpl[$plugin_id]=  $tpl_plugin ;   
    95       }
    96      
    97   }
    98  
     116      }       
     117  } 
    99118}           
    100 $template->assign( array(  'liste_plugins' => $liste_tpl));       
    101119$edited_file=set_plugins::get_file_name();
    102 
    103  $template->assign( array(   
     120 $template->assign( array(                       
    104121                    'PHPWG_VERSION' =>  PHPWG_VERSION ,
    105122                    'cl_plugins' => $cl_set_plugins_plugin ,
     
    109126                    'SET_PLUGINS_PATH' => SET_PLUGINS_PATH,
    110127                    'SET_PLUGINS_PATH_ABS' => SET_PLUGINS_PATH_ABS,
     128                    'liste_plugins' => $liste_tpl,
    111129                    'set' => $set ,
    112130                    'nb' => ($nb>0)?$nb:1,
  • extensions/set_plugins/js/field_set.js

    r11484 r11497  
    33 // jQuery("#form_set_plugins").submit();
    44}
     5
     6//===============================================================================
     7function send_val(datas) {
     8  jQuery.ajax({
     9    method: 'GET',
     10    // url: get_post,
     11    data: datas,
     12    async: true,
     13    dataType: 'json',
     14    success: function (data) {
     15      if (jQuery("#progressbar").length > 0) {
     16
     17      } else
     18        jQuery("#titrePage").before(
     19                '<img id="progressbar" alt = "" width="300px" title = ""' +
     20                'src = "./plugins/set_plugins/js/icon/ajax-loader-bar.gif"' + '>'
     21              );
     22      //    location.reload();
     23      if (!data) return;
     24
     25      if (data['liste_plugins'] != undefined)
     26        liste_des_plugins_activés = data['liste_plugins'];
     27      if (data['config']['liste_visible'])
     28        jQuery("#liste_visible").val(data['config']['liste_visible']);
     29
     30    }
     31  });
     32} //send val
     33//===================================================================================
     34
    535jQuery().ready(function () {
    636  jQuery('.cluetip').tipTip({  maxWidth:'600px' ,'delay': 0, 'fadeIn': 200, 'fadeOut': 200 }); 
     
    1040jQuery(document).ready(function () {
    1141  jQuery(window).unload(function () {
    12     // jQuery("#form_set_plugins").submit();
     42
    1343  });
    1444  if (typeof plus_path == "undefined") {
     
    1747  }
    1848  var h_min = 0;
    19   var liste_des_plugins = new Array();
     49  var liste_des_plugins_activés = new Array();
    2050
    2151  jQuery(window).load(function (event) {
     
    4474        jQuery("input[name=list_visible]").val(liste_visible);
    4575      }
    46       liste = liste_visible.split(reg);
     76      if (typeof (liste_visible)=="string")
     77      liste_visible = liste_visible.split(reg);
    4778      reg = new RegExp("['off']", "g");
    4879      h_min = jQuery("fieldset legend").height();
    4980      h_min = 0;
    50       jQuery("fieldset").each(
    51         function (i) {
     81      jQuery("fieldset").each(function (i) {
     82        id0 = jQuery(this).attr("id");
     83        if (id0 == "") jQuery(this).attr("id", "fieldset_" + i);
     84        jQuery(this).attr("rel", i);
     85        if (!jQuery(this).hasClass("field_set"))
     86          jQuery(this).addClass("field_set");
     87        if (liste_visible[i] == "off") {
     88          liste_visible[i] = "off";
     89          jQuery(this).height(h_min + 0);
     90          jQuery("#" + this.id + ' legend').prepend(
     91            '<img alt = "" title = ""' + 'src = "' + plus_path + '"' + '>&nbsp;'
     92            );
     93        } else {
     94          liste_visible[i] = "on";
     95          jQuery(this).addClass("visible");
     96          jQuery("#" + this.id + ' legend').prepend(
     97              '<img alt = "" title = ""' +
     98              'src = "' + minus_path + '"' + '>&nbsp;'
     99            );
     100        }
     101        jQuery("#" + this.id + ' legend').css('cursor', 'pointer');
     102        id0 = jQuery(this).attr("id");
    52103
    53           id0 = jQuery(this).attr("id");
    54           if (id0 == "") jQuery(this).attr("id", "fieldset_" + i);
    55           jQuery(this).attr("rel", i);
     104        jQuery("#" + id0 + ' legend').click(function (event) {
     105          n = jQuery(this).parent().hasClass("visible");
     106          i = jQuery(jQuery(this).parent()).attr("rel");
    56107
    57           if (!jQuery(this).hasClass("field_set"))
    58             jQuery(this).addClass("field_set");
     108          if (typeof liste_visible == "undefined") {
     109            liste_visible = "on,on,on,on";
     110            jQuery("input[name=list_visible]").val(liste_visible);
     111          }
     112          liste_visible = jQuery("input[name=list_visible]").val().split(",");
     113          // src = jQuery(this).find("img").attr("src");
     114          if (n) {
     115            jQuery(this).parent().height(h_min + 0);
     116            jQuery(this).parent().removeClass("visible");
     117            liste_visible[i] = "off";
     118            jQuery(this).find("img").attr({
     119              src: plus_path
     120            });
     121          } else {
     122            jQuery(this).parent().css("height", "auto");
     123            jQuery(this).parent().addClass("visible");
     124            liste_visible[i] = "on";
     125            jQuery(this).find("img").attr({
     126              src: minus_path
     127            });
     128          }
     129          val = liste_visible.join(",");
     130          jQuery("input[name=list_visible]").val(val);
     131         
     132          jQuery("#set").click();
    59133
    60134
    61           if (liste[i] == "off") {
    62             liste[i] = "off";
    63 
    64 
    65             jQuery(this).height(h_min + 0);
    66 
    67             jQuery("#" + this.id + ' legend').prepend(
    68           '<img alt = "" title = ""' +
    69           'src = "' + plus_path + '"' + '>&nbsp;'
    70         );
    71           } else {
    72             liste[i] = "on";
    73             jQuery(this).addClass("visible");
    74             jQuery("#" + this.id + ' legend').prepend(
    75           '<img alt = "" title = ""' +
    76           'src = "' + minus_path + '"' + '>&nbsp;'
    77         );
    78           }
    79 
    80           jQuery("#" + this.id + ' legend').css('cursor', 'pointer');
    81 
    82 
    83           id0 = jQuery(this).attr("id");
    84           jQuery("#" + id0 + ' legend').click(function (event) {
    85 
    86             n = jQuery(this).parent().hasClass("visible");
    87             //   jQuery(this).css("color", "red");
    88 
    89             i = jQuery(jQuery(this).parent()).attr("rel");
    90             liste_visible = jQuery("input[name=list_visible]").val();
    91             if (typeof liste_visible == "undefined") {
    92               liste_visible = "on,on,on,on";
    93               jQuery("input[name=list_visible]").val(liste_visible);
    94             }
    95             // src = jQuery(this).find("img").attr("src");
    96             if (n) {
    97               jQuery(this).parent().height(h_min + 0);
    98               jQuery(this).parent().removeClass("visible");
    99               liste[i] = "off";
    100               jQuery(this).find("img").attr({
    101                 src: plus_path
    102 
    103               });
    104             }
    105             else {
    106               jQuery(this).parent().css("height", "auto");
    107               jQuery(this).parent().addClass("visible");
    108               liste[i] = "on";
    109               jQuery(this).find("img").attr({
    110                 src: minus_path
    111 
    112               });
    113             }
    114             val = liste.join(",");
    115             jQuery("input[name=list_visible]").val(val);
    116             jQuery('#set').val("true");
    117           }); // click
    118 
    119 
    120         }); //each fieldset
     135        }); // click
     136      }); //each fieldset
    121137      //==========================================================
    122138
    123 
    124 
    125 
    126       //=========================================================
    127 
    128139      var liste_action = { active: "", deactive: "" };
    129       jQuery("input[name=list_visible]").val(liste.join(","));
     140      jQuery("input[name=list_visible]").val(liste_visible.join(","));
    130141      jQuery("fieldset").show();
    131142    } // fielset
    132143    //====================================================================
    133144    jQuery(".plugin_list").each(function (i) {
    134       liste_des_plugins.push(jQuery(this).attr('id'));
    135     }
    136 
    137     )
    138 
     145      liste_des_plugins_activés.push(jQuery(this).attr('id'));
     146    });
     147   
    139148    //==============================================================
    140     jQuery("input").each(
     149    jQuery("input.button").each(
    141150        function (i) {
    142151          jQuery(this).click(function (event) {
    143152            jQuery(this).css("color", "red");
    144153            jQuery('#set').val("true");
     154            jQuery("#titrePage").before(
     155                '<img id="progressbar" alt = "" width="300px" title = ""' +
     156                'src = "./plugins/set_plugins/js/icon/ajax-loader-bar.gif"' + '>'
     157              );
     158            send_val({liste_visible:liste_visible,
     159              set: "true"
     160
     161            });
     162
    145163          }); // click
    146164
     
    156174        n = query.pwg_token;
    157175        action = query.action;
    158         val = liste.join(",");
    159         val2 = liste_des_plugins.join(",");
    160         jQuery.ajax({
    161           method: 'GET',
    162           // url: get_post,
    163           data: { get_post: get_post,
    164             liste_des_plugins: true,
    165             liste: val,
    166             add_plugins: query.plugin,
    167             set: "true",
    168             action: query.action
    169           },
    170            async: false,
    171           dataType: 'json',
    172           success: function (data) {
    173             n = eval(data);
    174             jQuery("#titrePage").after(
    175           '<img alt = "" width="50px" title = ""' +
    176           'src = "themes/default/images/colorbox-loading.gif"' + '>&nbsp;'
    177         );
    178 
    179 
    180             liste_des_plugins = data;
    181             n = data;
    182           }
     176        val = liste_visible.join(",");
     177        val2 = liste_des_plugins_activés.join(",");
     178        send_val({
     179          liste_des_plugins_activés: liste_des_plugins_activés,
     180          add_plugins: query.plugin,
     181          set: "true",
     182          action: query.action
    183183        });
    184 
    185 
    186184        /* */
    187 
    188185      }
    189186
    190     })
    191 
     187    });
    192188  }); // load
    193 });                                                                                  //ready           
     189});                                                                                         //ready           
    194190           
  • extensions/set_plugins/set_plugins_class.php

    r11484 r11497  
    1515  //============================================================================
    1616  function begin_admin() {
    17   global $erreur_message,$liste_des_plugins,$liste_active_plugins,$page; 
    18       //========= Liste des plugins actifs =================
    19      
    20 
    21 if (!isset($page['body_id'])) return;
    22 if($page['body_id']!='theAdminPage' ) return ;
    23 if($page['page']=='plugins_list' || $page['page']=='plugins'){
    24          
    25          
    26 
     17    global $erreur_message,$liste_des_plugins_activés,$liste_active_plugins,$page; 
     18    //========= Liste des plugins actifs =================   
     19    if (!isset($page['body_id'])) return;
     20    if($page['body_id']!='theAdminPage' ) return ;
     21    if($page['page']=='plugins_list' || $page['page']=='plugins'){
    2722      $plugins = new plugins();
    2823      $plugins->sort_fs_plugins('name');
    29       $liste_des_plugins = array();
    30   foreach ($plugins->fs_plugins as $plugin_id => $fs_plugin){
    31       if(isset( $plugins->db_plugins_by_id[$plugin_id])){
    32         $State_id=$plugins->db_plugins_by_id[$plugin_id]['state'] ;
    33         if($State_id=="active" && $plugin_id!="set_plugins")
    34           array_push($liste_des_plugins,$plugin_id);
    35      }     
    36   }
    37 
    38 if (isset($_GET['liste_des_plugins'])){ 
    39  array_push($liste_des_plugins,$_GET);
    40     echo json_encode($liste_des_plugins);
    41    exit;
    42 }
    43 $liste_active_plugins=$liste_des_plugins;
    44    }
     24      $liste_des_plugins_activés = array();
     25      foreach ($plugins->fs_plugins as $plugin_id => $fs_plugin){
     26        if(isset( $plugins->db_plugins_by_id[$plugin_id])){
     27          $State_id=$plugins->db_plugins_by_id[$plugin_id]['state'] ;
     28          if($State_id=="active" && $plugin_id!="set_plugins")
     29            array_push($liste_des_plugins_activés,$plugin_id);
     30        }     
     31      }   //foreach
     32      if (isset($_GET['set'])){       
     33  //pwg_set_session_var('plugins_new_order', $_GET['plugins_new_order']);
     34  //exit;
     35        $ret['config']=$_GET;
     36        $ret['liste_plugins']=$liste_des_plugins_activés;
     37        //  array_push($ret,$liste_des_plugins_activés);
     38        if($_GET['config']['liste_visible'])
     39             set_plugins::save_config();
     40        echo json_encode($ret);   
     41 
     42        exit;
     43      }
     44      $liste_active_plugins=$liste_des_plugins_activés;
     45    }
    4546  }
    4647  //============================================================================
    4748  function set_plugins_add() {
    4849    global $user, $template, $val,$page,$conf,$erreur_message,$infos_message;
    49     global $liste_des_plugins,$liste_active_plugins;
     50    global $liste_des_plugins_activés,$liste_active_plugins;
    5051    if (!isset($page['body_id'])) return;
    5152
     
    139140  //===================================================================
    140141function Affiche_set_plugins(){
    141 global $infos_message,$liste_des_plugins,$erreur_message ;
     142global $infos_message,$liste_des_plugins_activés,$erreur_message ;
    142143
    143144  include_once(SET_PLUGINS_PATH."include/constants.php");
    144145   include(SET_PLUGINS_PATH.'include/affiche.php');
    145    $all_tpl_vars = $template->get_template_vars('plugins');
    146   if(!$all_tpl_vars)  return;
    147 
    148   if( $set=="true" ){     
     146
     147  if(  isset($_POST['submit'])){     
    149148    $state="";
    150     if(isset($_POST['unset_plugins'])  )
     149    if($_POST['submit']==l10n("Deactivate")  )
    151150        $state='inactive';
    152     elseif(isset($_POST['set_plugins'])  )
     151    elseif($_POST['submit']==l10n("Activate")  )
    153152      $state='active';
    154153    if($state!=""){
     
    157156      else
    158157          $sens="ASC";
    159             $infos_message .="-----> $state $sens<br />";
     158     
    160159      //============================
    161160      $query = 'SELECT *
     
    166165      ';
    167166      $result = pwg_query($query);
    168       //======= mise à jour =========
     167      //======= mise à jour =========
    169168      if($result){
    170169        $query = '
     
    187186        }
    188187      }
    189 
    190 
    191     }else if  (isset($_POST['init_plugins'])){
     188    }else if  ($_POST['submit']==l10n('store') ){
    192189      $liste = array();
    193190      $state="active";
     
    220217  $template->set_filenames(
    221218    array(    'cl_plugin' => SET_PLUGINS_PATH_ABS.'template/admin.tpl'  )
    222   );
     219    );
    223220
    224221  //===========================================================
     
    226223  <h2>'.l10n("set_plugins").l10n("Version").": ".$cl_set_plugins_plugin['version'] .'</h2>
    227224  </div>';
    228   $bpplus=$header_1.$template->parse('cl_plugin', true);
    229    
    230   $template-> assign('ADMIN_CONTENT',$bpplus);
    231   $bpplus=$template->parse('plugins', true);
    232   $template-> concat('ADMIN_CONTENT',$bpplus);
    233 
     225    $bpplus=$header_1.$template->parse('cl_plugin', true); 
     226    $all_tpl_vars = $template->get_template_vars('ADMIN_CONTENT');
     227    $template-> assign('ADMIN_CONTENT',$bpplus);
     228    $template-> concat('ADMIN_CONTENT',$all_tpl_vars);
    234229}
    235230
     
    251246//==============================================
    252247function restore_from_file(){
    253   global $infos_message;
    254   $edited_file=set_plugins::get_file_name();
     248  global $infos_message,$edited_file;
    255249  $content_file = file_get_contents($edited_file);
    256   $file =array();
    257   $liste= array_unique(unserialize($content_file));
    258   unset($_POST['restore']);
     250  return unserialize($content_file) ;
    259251}
    260252//===============================================
    261253function get_file_name(){
    262 global  $edited_file;
    263   $dir=realpath('./local/plugins/set_plugins');
    264   if (!is_dir($dir)){   
     254global  $edited_file,$infos_message;
     255 
     256  $dir = realpath("./local/plugins");   
     257  if (!is_dir($dir)){ 
     258  $dir = realpath("./local")."\\plugins";   
     259   $umask = umask(0);
     260    $mkd = @mkdir($dir, 0755, true );
     261    umask($umask);
     262    }
     263   $dir = realpath("./local/plugins/set_plugins");   
     264  if (!is_dir($dir)){   
    265265    $dir= realpath('./local/plugins'). "\\set_plugins";
    266266    $umask = umask(0);
     
    270270      fatal_error( "$dir ".l10n('no write access'));       
    271271    }
    272     $file = $dir.'\\.htaccess';
    273     @file_put_contents( $file, 'allow from all' );
     272  //  $file = $dir.'\\.htaccess';
     273   // @file_put_contents( $file, 'allow from all' );
    274274  }   
    275275  $dir=realpath('./local/plugins/set_plugins');
     
    280280}
    281281
    282 
    283282}// fin classe
    284283?>
  • extensions/set_plugins/template/admin.tpl

    r11484 r11497  
    11<meta http-equiv="X-UA-Compatible" content="IE=edge" />
    22<meta http-equiv="X-UA-Compatible" content="IE=IE9" />
    3 {html_head}
     3
    44{if $PHPWG_VERSION < 2.2 }
    5 
    65{include file= $SET_PLUGINS_PATH_ABS|@cat:'template/header_2_1.tpl'}
    76{else}
    87{include file= $SET_PLUGINS_PATH_ABS|@cat:'template/header_2_2.tpl'}
    98{/if}
    10 {/html_head}
     9
    1110
    1211<fieldset >
     
    2423      {$nb_plugins}</label>/
    2524      <label class="cluetip" title="{'s_pl_action3'|@translate}">
    26       {$smarty.foreach.plugins_loop.total}</label>] </legend>
    27 <form action="{$action}" method="post" name="form_set_plugins" id="form_set_plugins">
    28   <input   name="unset_plugins" type="submit" value="{'Deactivate'|@translate}" class="cluetip button" title="{'s_pl_action4'|@translate}" />
    29   <input   name="set_plugins" type="submit" value="{'Activate'|@translate}" class="cluetip" title="{'s_pl_action5'|@translate}" />   
    30   <label class="cluetip" title="{'s_pl_action6'|@translate}"> {'nb'|@translate}:</label>
    31   <input name="nb" type="text" value="{$nb}" size="5" />
    32   <input name="list_visible" id="list_visible" type="hidden" value="{$list_visible}" />   
    33   <input name="add_plugins" type="hidden" id="add_plugins" value="{$add_plugins}" />
    34   <input type="submit" name="init_plugins" class="cluetip"  title="{'s_pl_action7'|@translate}" value="{'store'|@translate}" />
    35   <input type="hidden" id="set" name="set" value="{$set}" />
    36   <input class="cluetip" title="{'s_pl_action8'|@translate}  {$edited_file}" type="submit"       value="{'save_file'|@translate}" name="submit" />
    37   {if $restore}
    38   <input class="cluetip" title="{'s_pl_action9'|@translate}  {$edited_file}" type="submit"
    39   value="{'restore'|@translate}" name="restore" onclick="return confirm('{'restore_confirm'|@translate|escape:'javascript'}');" />
    40   {/if}
     25      {$smarty.foreach.plugins_loop.total}</label>]
     26      {include file=$SET_PLUGINS_PATH_ABS|@cat:'template/menu.tpl'}
    4127 <p>
    4228{/if}
     
    4531<td width="50%" align="left" name="plugins_name" rel="actif" class="pluginBoxNameCell" >
    4632    {if $plugin.STATE == 'active'}
    47 {$plugin.NAME}
    48 {else}
    49 {/if}
     33    <span style="color: {$plugin.COLOR}" > {$plugin.NAME}
     34    </span>
     35       
     36    {/if}
    5037</td>       
    5138
     
    7966 {if $smarty.foreach.plugins_name.total==0}
    8067  [{$smarty.foreach.plugins_name.total}/{$nb_plugins}]
    81    </legend>
    82    <form action="{$action}" method="post" name="form_set_plugins" id="form1">
    83    <input name="unset_plugins" type="submit" value="{'Deactivate'|@translate}" class="cluetip button"
    84      title="{'s_pl_action4'|@translate}" />
    85    <input name="set_plugins" type="submit" value="{'Activate'|@translate}" class="cluetip"
    86      title="{'s_pl_action5'|@translate}" />
    87    <label class="cluetip" title="{'s_pl_action6'|@translate}">
    88      {'nb'|@translate}:</label>
    89    <input name="nb" type="text" value="{$nb}" size="5" />
    90    <input name="list_visible" id="Hidden1" type="hidden" value="{$list_visible}" />
    91    <input name="add_plugins" type="hidden" id="add_plugins" value="{$add_plugins}" />
    92    <input type="submit" name="init_plugins" class="cluetip" title="{'s_pl_action7'|@translate}" value="{'store'|@translate}" />
    93    <input type="hidden" id="Hidden3" name="set" value="{$set}" />
    94    <input class="cluetip" title="{'s_pl_action8'|@translate}  {$edited_file}" type="submit" value="{'save_file'|@translate}" name="submit" />
    95    {if $restore}
    96    <input class="cluetip" title="{'s_pl_action9'|@translate}  {$edited_file}" type="submit" value="{'restore'|@translate}" name="restore" onclick="return confirm('{'restore_confirm'|@translate|escape:'javascript'}');" />
    97    {/if}
     68  {include file=$SET_PLUGINS_PATH_ABS|@cat:'template/menu.tpl'}
    9869   <p>
    9970     {/if}
     
    10172      </form>
    10273  </fieldset>
    103 {*/if*}
    104 
    105 {footer_script}
    106 var root = '{$SET_PLUGINS_PATH}';
    107  var get_post = "{$SET_PLUGINS_PATH}include/set_post.php";
    108 var list_visible = '{$list_visible}';
    109  var nb = '{$nb}';
    110  {if $liste_plugins}
    111  liste_plugins=new Array();
    112  {foreach from=$liste_plugins item=plugin name=plugins_name}
    113  
    114   liste_plugins.push('{$plugin.NAME}') ;
    115  {/foreach}
    116   {else}
    117   var liste_plugins = new Array();
    118   {/if}
    119   {literal}
    120   jQuery(document).ready(function() {
    121   jQuery.ajax({ method: 'POST',
    122 url: get_post,
    123  data: { root:root,list_visible:list_visible,nb:nb },
    124   dataType: 'json',
    125 success: function(data) {
    126  n=data;
    127  } });
    128   });
    129    {/literal}{/footer_script}
  • extensions/set_plugins/template/header_2_1.tpl

    r11462 r11497  
    1  {known_script id="jquery" src = $ROOT_URL|@cat:"themes/default/js/jquery.packed.js"  }
     1 {html_head}
     2  {known_script id="jquery" src = $ROOT_URL|@cat:"themes/default/js/jquery.packed.js"  }
    23 {known_script id="field_set" src= $SET_PLUGINS_PATH|@cat:"js/field_set.js" }
     4 {/html_head}
     5 
     6<script type="text/javascript">
     7 
     8var root = '{$SET_PLUGINS_PATH}';
     9 var get_post = "{$SET_PLUGINS_PATH}include/set_post.php";
     10var list_visible = '{$list_visible}';
     11 var nb = '{$nb}';
     12 {if $liste_plugins}
     13 liste_plugins=new Array();
     14 {foreach from=$liste_plugins item=plugin name=plugins_name}
     15 
     16  liste_plugins.push('{$plugin.NAME}') ;
     17 {/foreach}
     18  {else}
     19  var liste_plugins = new Array();
     20  {/if}
     21   </script>
     22 
  • extensions/set_plugins/template/header_2_2.tpl

    r11462 r11497  
    22 {footer_script }
    33 {combine_script id="field_set" load="footer" path=$SET_PLUGINS_PATH|@cat:"js/field_set.js" require="jquery"}
    4   {/footer_script}
     4 
     5var root = '{$SET_PLUGINS_PATH}';
     6 var get_post = "{$SET_PLUGINS_PATH}include/set_post.php";
     7var list_visible = '{$list_visible}';
     8 var nb = '{$nb}';
     9 {if $liste_plugins}
     10 liste_plugins=new Array();
     11 {foreach from=$liste_plugins item=plugin name=plugins_name}
     12 
     13  liste_plugins.push('{$plugin.NAME}') ;
     14 {/foreach}
     15  {else}
     16  var liste_plugins = new Array();
     17  {/if}
     18
     19 {/footer_script}
Note: See TracChangeset for help on using the changeset viewer.