Changeset 11497 for extensions/set_plugins
- Timestamp:
- Jun 23, 2011, 2:29:02 PM (13 years ago)
- Location:
- extensions/set_plugins
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/set_plugins/include/affiche.php
r11484 r11497 7 7 global $list_visible, $state,$liste_plugins; 8 8 global $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 9 global $nb,$liste,$state,$list_visible,$add_plugins,$edited_file,$set; 13 10 $plugins = new plugins(); 14 11 $plugins->sort_fs_plugins('name'); … … 18 15 $action_url = $base_url.'&plugin='.'%s'.'&pwg_token='.get_pwg_token(); 19 16 17 if (isset($conf['set_plugins'])) $set_plugins_parametres = unserialize($conf['set_plugins']); 18 19 $nb=set_plugins::set_var('nb','10'); 20 20 21 $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); 25 23 $state=set_plugins::set_var('state',"active"); 26 24 $list_visible=set_plugins::set_var('list_visible',"on,on,on,on"); 27 25 $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 //================================================================ 30 29 31 if ( isset($_POST)) { 32 $set="true"; 33 }else{ 34 $set="false"; 30 31 if (isset($_POST) && count($_POST)>0){ 32 if (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 35 55 } 36 global $edited_file; 37 if (isset($_POST['submit']) && $_POST['submit']==l10n('save_file')){ 38 set_plugins::save_to_file($liste); 56 if($add_plugins!="" ){ 57 $infos_message .=$add_plugins; 58 if(!array_search($add_plugins, $liste)){ 59 array_push($liste, $add_plugins ); 60 $set=="true"; 39 61 } 40 41 ///================================================================42 if (isset($_POST['restore']) ){43 $liste=set_plugins::restore_from_file();44 62 } 45 63 46 64 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 67 if (isset($liste_des_plugins_activés)) 68 foreach($liste_des_plugins_activés as $plugin_id) { 58 69 if(!array_search($plugin_id, $liste)){ 59 70 array_push($liste, $plugin_id ); 60 71 } 61 72 } 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; 73 if(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); 66 78 67 79 if ( $set=="true"){ 68 80 set_plugins::save_config(); 69 unset($_POST['list_visible']); 70 unset($_POST['nb']); 81 71 82 } 72 73 74 75 83 //======================================================= 76 if( $liste) $liste_plugins = array_combine($liste,$liste);84 if(isset($liste) && count($liste)>0) $liste_plugins =$liste; 77 85 else $liste_plugins =array(); 78 86 //========================================================== … … 80 88 array_keys($liste_plugins) 81 89 ); 90 82 91 $liste_tpl=array(); 83 92 foreach($plugins->fs_plugins as $plugin_id => $fs_plugin) { 84 93 //==== test si $plugin_id fait partie de $liste_plugins ============== 85 94 $key = array_search($plugin_id, $liste_plugins,false); 95 86 96 if ($key!== false){ 97 87 98 if(isset( $plugins->db_plugins_by_id[$plugin_id])){ 99 $key = array_search($plugin_id, $liste_mem,false); 100 88 101 $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 89 109 $tpl_plugin = array( 90 110 'NAME' => $fs_plugin['name'], 91 111 'U_ACTION' => sprintf($action_url, $plugin_id), 92 'STATE' =>$State_id 93 ); 112 'STATE' =>$State_id, 113 'COLOR' => $couleur 114 ); 94 115 $liste_tpl[$plugin_id]= $tpl_plugin ; 95 } 96 97 } 98 116 } 117 } 99 118 } 100 $template->assign( array( 'liste_plugins' => $liste_tpl));101 119 $edited_file=set_plugins::get_file_name(); 102 103 $template->assign( array( 120 $template->assign( array( 104 121 'PHPWG_VERSION' => PHPWG_VERSION , 105 122 'cl_plugins' => $cl_set_plugins_plugin , … … 109 126 'SET_PLUGINS_PATH' => SET_PLUGINS_PATH, 110 127 'SET_PLUGINS_PATH_ABS' => SET_PLUGINS_PATH_ABS, 128 'liste_plugins' => $liste_tpl, 111 129 'set' => $set , 112 130 'nb' => ($nb>0)?$nb:1, -
extensions/set_plugins/js/field_set.js
r11484 r11497 3 3 // jQuery("#form_set_plugins").submit(); 4 4 } 5 6 //=============================================================================== 7 function 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 5 35 jQuery().ready(function () { 6 36 jQuery('.cluetip').tipTip({ maxWidth:'600px' ,'delay': 0, 'fadeIn': 200, 'fadeOut': 200 }); … … 10 40 jQuery(document).ready(function () { 11 41 jQuery(window).unload(function () { 12 // jQuery("#form_set_plugins").submit(); 42 13 43 }); 14 44 if (typeof plus_path == "undefined") { … … 17 47 } 18 48 var h_min = 0; 19 var liste_des_plugins = new Array();49 var liste_des_plugins_activés = new Array(); 20 50 21 51 jQuery(window).load(function (event) { … … 44 74 jQuery("input[name=list_visible]").val(liste_visible); 45 75 } 46 liste = liste_visible.split(reg); 76 if (typeof (liste_visible)=="string") 77 liste_visible = liste_visible.split(reg); 47 78 reg = new RegExp("['off']", "g"); 48 79 h_min = jQuery("fieldset legend").height(); 49 80 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 + '"' + '> ' 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 + '"' + '> ' 99 ); 100 } 101 jQuery("#" + this.id + ' legend').css('cursor', 'pointer'); 102 id0 = jQuery(this).attr("id"); 52 103 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"); 56 107 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(); 59 133 60 134 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 + '"' + '> ' 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 + '"' + '> ' 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 121 137 //========================================================== 122 138 123 124 125 126 //=========================================================127 128 139 var liste_action = { active: "", deactive: "" }; 129 jQuery("input[name=list_visible]").val(liste .join(","));140 jQuery("input[name=list_visible]").val(liste_visible.join(",")); 130 141 jQuery("fieldset").show(); 131 142 } // fielset 132 143 //==================================================================== 133 144 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 139 148 //============================================================== 140 jQuery("input ").each(149 jQuery("input.button").each( 141 150 function (i) { 142 151 jQuery(this).click(function (event) { 143 152 jQuery(this).css("color", "red"); 144 153 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 145 163 }); // click 146 164 … … 156 174 n = query.pwg_token; 157 175 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"' + '> ' 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 183 183 }); 184 185 186 184 /* */ 187 188 185 } 189 186 190 }) 191 187 }); 192 188 }); // load 193 }); //ready189 }); //ready 194 190 -
extensions/set_plugins/set_plugins_class.php
r11484 r11497 15 15 //============================================================================ 16 16 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'){ 27 22 $plugins = new plugins(); 28 23 $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 } 45 46 } 46 47 //============================================================================ 47 48 function set_plugins_add() { 48 49 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; 50 51 if (!isset($page['body_id'])) return; 51 52 … … 139 140 //=================================================================== 140 141 function Affiche_set_plugins(){ 141 global $infos_message,$liste_des_plugins ,$erreur_message ;142 global $infos_message,$liste_des_plugins_activés,$erreur_message ; 142 143 143 144 include_once(SET_PLUGINS_PATH."include/constants.php"); 144 145 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'])){ 149 148 $state=""; 150 if( isset($_POST['unset_plugins']) )149 if($_POST['submit']==l10n("Deactivate") ) 151 150 $state='inactive'; 152 elseif( isset($_POST['set_plugins']) )151 elseif($_POST['submit']==l10n("Activate") ) 153 152 $state='active'; 154 153 if($state!=""){ … … 157 156 else 158 157 $sens="ASC"; 159 $infos_message .="-----> $state $sens<br />";158 160 159 //============================ 161 160 $query = 'SELECT * … … 166 165 '; 167 166 $result = pwg_query($query); 168 //======= mise àjour =========167 //======= mise à jour ========= 169 168 if($result){ 170 169 $query = ' … … 187 186 } 188 187 } 189 190 191 }else if (isset($_POST['init_plugins'])){ 188 }else if ($_POST['submit']==l10n('store') ){ 192 189 $liste = array(); 193 190 $state="active"; … … 220 217 $template->set_filenames( 221 218 array( 'cl_plugin' => SET_PLUGINS_PATH_ABS.'template/admin.tpl' ) 222 );219 ); 223 220 224 221 //=========================================================== … … 226 223 <h2>'.l10n("set_plugins").l10n("Version").": ".$cl_set_plugins_plugin['version'] .'</h2> 227 224 </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); 234 229 } 235 230 … … 251 246 //============================================== 252 247 function restore_from_file(){ 253 global $infos_message; 254 $edited_file=set_plugins::get_file_name(); 248 global $infos_message,$edited_file; 255 249 $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) ; 259 251 } 260 252 //=============================================== 261 253 function get_file_name(){ 262 global $edited_file; 263 $dir=realpath('./local/plugins/set_plugins'); 264 if (!is_dir($dir)){ 254 global $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)){ 265 265 $dir= realpath('./local/plugins'). "\\set_plugins"; 266 266 $umask = umask(0); … … 270 270 fatal_error( "$dir ".l10n('no write access')); 271 271 } 272 $file = $dir.'\\.htaccess';273 @file_put_contents( $file, 'allow from all' );272 // $file = $dir.'\\.htaccess'; 273 // @file_put_contents( $file, 'allow from all' ); 274 274 } 275 275 $dir=realpath('./local/plugins/set_plugins'); … … 280 280 } 281 281 282 283 282 }// fin classe 284 283 ?> -
extensions/set_plugins/template/admin.tpl
r11484 r11497 1 1 <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 2 2 <meta http-equiv="X-UA-Compatible" content="IE=IE9" /> 3 {html_head} 3 4 4 {if $PHPWG_VERSION < 2.2 } 5 6 5 {include file= $SET_PLUGINS_PATH_ABS|@cat:'template/header_2_1.tpl'} 7 6 {else} 8 7 {include file= $SET_PLUGINS_PATH_ABS|@cat:'template/header_2_2.tpl'} 9 8 {/if} 10 {/html_head} 9 11 10 12 11 <fieldset > … … 24 23 {$nb_plugins}</label>/ 25 24 <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'} 41 27 <p> 42 28 {/if} … … 45 31 <td width="50%" align="left" name="plugins_name" rel="actif" class="pluginBoxNameCell" > 46 32 {if $plugin.STATE == 'active'} 47 {$plugin.NAME} 48 {else} 49 {/if} 33 <span style="color: {$plugin.COLOR}" > {$plugin.NAME} 34 </span> 35 36 {/if} 50 37 </td> 51 38 … … 79 66 {if $smarty.foreach.plugins_name.total==0} 80 67 [{$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'} 98 69 <p> 99 70 {/if} … … 101 72 </form> 102 73 </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" } 2 3 {known_script id="field_set" src= $SET_PLUGINS_PATH|@cat:"js/field_set.js" } 4 {/html_head} 5 6 <script type="text/javascript"> 7 8 var root = '{$SET_PLUGINS_PATH}'; 9 var get_post = "{$SET_PLUGINS_PATH}include/set_post.php"; 10 var 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 2 2 {footer_script } 3 3 {combine_script id="field_set" load="footer" path=$SET_PLUGINS_PATH|@cat:"js/field_set.js" require="jquery"} 4 {/footer_script} 4 5 var root = '{$SET_PLUGINS_PATH}'; 6 var get_post = "{$SET_PLUGINS_PATH}include/set_post.php"; 7 var 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.