Changeset 11499 for extensions/set_plugins
- Timestamp:
- Jun 23, 2011, 3:33:26 PM (13 years ago)
- Location:
- extensions/set_plugins
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/set_plugins/include/affiche.php
r11497 r11499 20 20 21 21 $liste = set_plugins::set_var('liste',array()); 22 $liste= array_unique($liste); 22 $liste= array_unique($liste); 23 23 24 $state=set_plugins::set_var('state',"active"); 24 25 $list_visible=set_plugins::set_var('list_visible',"on,on,on,on"); … … 50 51 // $infos_message .= set_plugins::memo_var("STORE"); 51 52 break; 53 54 } 52 55 53 }54 55 56 } 56 if($add_plugins!="" ){ 57 58 59 if($add_plugins!="" ){ 57 60 $infos_message .=$add_plugins; 58 61 if(!array_search($add_plugins, $liste)){ … … 72 75 } 73 76 if(count($liste)>0) { 74 $liste= array_unique($liste); 77 $liste= array_unique($liste); 78 75 79 } 80 76 81 //$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); 82 //$infos_message .= "liste".set_plugins::memo_var($liste_mem); 83 78 84 79 85 if ( $set=="true"){ 86 $infos_message .= l10n("save"); 80 87 set_plugins::save_config(); 81 88 82 89 } 90 91 92 83 93 //======================================================= 84 94 if(isset($liste) && count($liste)>0) $liste_plugins =$liste; … … 88 98 array_keys($liste_plugins) 89 99 ); 90 91 100 $liste_tpl=array(); 92 101 foreach($plugins->fs_plugins as $plugin_id => $fs_plugin) { … … 112 121 'STATE' =>$State_id, 113 122 'COLOR' => $couleur 114 123 ); 115 124 $liste_tpl[$plugin_id]= $tpl_plugin ; 116 } 117 } 125 } 126 } 118 127 } 119 128 $edited_file=set_plugins::get_file_name(); -
extensions/set_plugins/js/field_set.js
r11497 r11499 74 74 jQuery("input[name=list_visible]").val(liste_visible); 75 75 } 76 if (typeof (liste_visible)=="string")77 76 liste_visible = liste_visible.split(reg); 78 77 reg = new RegExp("['off']", "g"); … … 80 79 h_min = 0; 81 80 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"); 81 id0 = jQuery(this).attr("id"); 82 if (id0 == "") jQuery(this).attr("id", "fieldset_" + i); 83 jQuery(this).attr("rel", i); 84 85 if (!jQuery(this).hasClass("field_set")) 86 jQuery(this).addClass("field_set"); 87 87 if (liste_visible[i] == "off") { 88 88 liste_visible[i] = "off"; 89 jQuery(this).height(h_min + 0); 90 jQuery("#" + this.id + ' legend').prepend( 89 jQuery(this).height(h_min + 0); 90 91 jQuery("#" + this.id + ' legend').prepend( 91 92 '<img alt = "" title = ""' + 'src = "' + plus_path + '"' + '> ' 92 93 } else {93 ); 94 } else { 94 95 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'); 96 jQuery(this).addClass("visible"); 97 jQuery("#" + this.id + ' legend').prepend( 98 '<img alt = "" title = ""' + 99 'src = "' + minus_path + '"' + '> ' 100 ); 101 } 102 103 jQuery("#" + this.id + ' legend').css('cursor', 'pointer'); 102 104 id0 = jQuery(this).attr("id"); 103 105 104 jQuery("#" + id0 + ' legend').click(function (event) { 105 n = jQuery(this).parent().hasClass("visible"); 106 107 jQuery("#" + id0 + ' legend').click(function (event) { 108 109 n = jQuery(this).parent().hasClass("visible"); 106 110 i = jQuery(jQuery(this).parent()).attr("rel"); 107 111 108 if (typeof liste_visible == "undefined") {109 liste_visible = "on,on,on,on";110 jQuery("input[name=list_visible]").val(liste_visible);111 }112 if (typeof liste_visible == "undefined") { 113 liste_visible = "on,on,on,on"; 114 jQuery("input[name=list_visible]").val(liste_visible); 115 } 112 116 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 // src = jQuery(this).find("img").attr("src"); 118 if (n) { 119 jQuery(this).parent().height(h_min + 0); 120 jQuery(this).parent().removeClass("visible"); 117 121 liste_visible[i] = "off"; 118 jQuery(this).find("img").attr({ 119 src: plus_path 120 }); 122 jQuery(this).find("img").attr({ 123 src: plus_path 124 125 }); 121 126 } else { 122 jQuery(this).parent().css("height", "auto");123 jQuery(this).parent().addClass("visible");127 jQuery(this).parent().css("height", "auto"); 128 jQuery(this).parent().addClass("visible"); 124 129 liste_visible[i] = "on"; 125 jQuery(this).find("img").attr({ 126 src: minus_path 127 }); 128 } 130 jQuery(this).find("img").attr({ 131 src: minus_path 132 133 }); 134 } 129 135 val = liste_visible.join(","); 130 jQuery("input[name=list_visible]").val(val);131 136 jQuery("input[name=list_visible]").val(val); 137 jQuery('#set').val("true"); 132 138 jQuery("#set").click(); 133 139 134 140 135 141 }); // click 136 }); //each fieldset142 }); //each fieldset 137 143 //========================================================== 138 144 … … 145 151 liste_des_plugins_activés.push(jQuery(this).attr('id')); 146 152 }); 147 153 148 154 //============================================================== 149 jQuery("input .button").each(155 jQuery("input").each( 150 156 function (i) { 151 157 jQuery(this).click(function (event) { … … 178 184 send_val({ 179 185 liste_des_plugins_activés: liste_des_plugins_activés, 180 add_plugins: query.plugin,181 set: "true",182 action: query.action186 add_plugins: query.plugin, 187 set: "true", 188 action: query.action 183 189 }); 190 191 184 192 /* */ 193 185 194 } 186 195 187 196 }); 188 197 }); // load 189 }); 198 }); //ready 190 199 -
extensions/set_plugins/main.inc.php
r11484 r11499 14 14 define('SET_PLUGINS_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 15 15 16 //$SET_PLUGINS_PATH_ABS = str_replace('\\','/',dirname(__FILE__));16 $SET_PLUGINS_PATH_ABS = str_replace('\\','/', realpath(SET_PLUGINS_PATH)."\\" ); 17 17 if (!defined('SET_PLUGINS_PATH_ABS')) 18 18 define( 19 'SET_PLUGINS_PATH_ABS', realpath(SET_PLUGINS_PATH)."\\"19 'SET_PLUGINS_PATH_ABS', $SET_PLUGINS_PATH_ABS 20 20 ); 21 21 -
extensions/set_plugins/set_plugins_class.php
r11497 r11499 16 16 function begin_admin() { 17 17 global $erreur_message,$liste_des_plugins_activés,$liste_active_plugins,$page; 18 //========= Liste des plugins actifs =================19 20 21 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'){ 22 22 $plugins = new plugins(); 23 23 $plugins->sort_fs_plugins('name'); 24 24 $liste_des_plugins_activés = array(); 25 26 27 28 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 29 array_push($liste_des_plugins_activés,$plugin_id); 30 }30 } 31 31 } //foreach 32 if (isset($_GET['set'])){ 33 //pwg_set_session_var('plugins_new_order', $_GET['plugins_new_order']); 34 //exit; 32 if (isset($_GET['set'])){ 35 33 $ret['config']=$_GET; 36 34 $ret['liste_plugins']=$liste_des_plugins_activés; … … 39 37 set_plugins::save_config(); 40 38 echo json_encode($ret); 41 42 43 39 40 exit; 41 } 44 42 $liste_active_plugins=$liste_des_plugins_activés; 45 43 } 46 44 } 47 45 //============================================================================ … … 217 215 $template->set_filenames( 218 216 array( 'cl_plugin' => SET_PLUGINS_PATH_ABS.'template/admin.tpl' ) 219 217 ); 220 218 221 219 //=========================================================== … … 253 251 function get_file_name(){ 254 252 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"); 253 $dir=realpath('./local/plugins/set_plugins'); 264 254 if (!is_dir($dir)){ 265 $dir= realpath('./local/plugins'). "\\set_plugins"; 266 $umask = umask(0); 267 $mkd = @mkdir($dir, 0755, true ); 268 umask($umask); 269 if ($mkd==false){ 270 fatal_error( "$dir ".l10n('no write access')); 271 } 272 // $file = $dir.'\\.htaccess'; 273 // @file_put_contents( $file, 'allow from all' ); 274 } 275 $dir=realpath('./local/plugins/set_plugins'); 255 $dir=realpath('./local/plugins'); 256 if (!is_dir($dir)){ 257 $dir=str_replace("\\","/",realpath('./local').'/plugins'); 258 $umask = umask(0); 259 $mkd = @mkdir($dir, 0755, true ); 260 umask($umask); 261 if ($mkd==false){ 262 fatal_error( "1°) $dir ".l10n('no write access')); 263 } 264 } 265 //===================================================== 266 $dir=realpath('./local/plugins/set_plugins'); 267 if (!is_dir($dir)){ 268 269 $dir=str_replace("\\","/",realpath('./local/plugins').'/set_plugins'); 270 $umask = umask(0); 271 $mkd = @mkdir($dir, 0755, true ); 272 umask($umask); 273 if ($mkd==false){ 274 fatal_error( "2°) $dir ".l10n('no write access')); 275 } 276 //$file = $dir.'\\.htaccess'; 277 //@file_put_contents( $file, 'allow from all' ); 278 } 279 $dir=realpath('./local/plugins/set_plugins'); 280 } 281 276 282 if(!isset($edited_file) || $edited_file=="") 277 283 $edited_file=$dir."/config.txt"; 278 284 $edited_file=str_replace("\\","/", $edited_file); 285 286 279 287 return $edited_file ; 280 288 } -
extensions/set_plugins/template/admin.tpl
r11497 r11499 34 34 </span> 35 35 36 36 {/if} 37 37 </td> 38 38 -
extensions/set_plugins/template/menu.tpl
r11497 r11499 1 1 </legend> 2 2 <form action="{$action}" method="POST" name="form_set_plugins" id="form_set_plugins"> 3 <input name="add_plugins" type="hidden" id="add_plugins" value="{$add_plugins}" /> 4 <input type="submit" class="button" style="display:none" id="set" name="set" value="{$set}" /> 5 <input name="list_visible" style="display:none" id="list_visible" type="text" class="button" 6 value="{$list_visible}" /> 7 <input name="submit" type="submit" value="{'Deactivate'|@translate}" class="button cluetip" 3 <input type="submit" style="display: none" id="set" name="set" value="{$set}" /> 4 5 <input name="submit" type="submit" value="{'Deactivate'|@translate}" class="cluetip button" 8 6 title="{'s_pl_action4'|@translate}" /> 9 <input name="submit" type="submit" value="{'Activate'|@translate}" class=" buttoncluetip"7 <input name="submit" type="submit" value="{'Activate'|@translate}" class="cluetip" 10 8 title="{'s_pl_action5'|@translate}" /> 11 12 9 <label class="cluetip" title="{'s_pl_action6'|@translate}"> 13 10 {'nb'|@translate}:</label> 14 11 <input name="nb" type="text" value="{$nb}" size="5" /> 15 16 17 <input type="submit" name="submit" class="cluetip button" title="{'s_pl_action7'|@translate}"12 <input name="list_visible" id="list_visible" type="text" value="{$list_visible}" /> 13 <input name="add_plugins" type="hidden" id="add_plugins" value="{$add_plugins}" /> 14 <input type="submit" name="submit" class="cluetip" title="{'s_pl_action7'|@translate}" 18 15 value="{'store'|@translate}" /> 19 <input class="cluetip button" title="{'s_pl_action8'|@translate} {$edited_file}"20 type="submit"value="{'save_file'|@translate}" name="submit" />16 <input class="cluetip" title="{'s_pl_action8'|@translate} {$edited_file}" type="submit" 17 value="{'save_file'|@translate}" name="submit" /> 21 18 {if $restore} 22 <input class="cluetip button " title="{'s_pl_action9'|@translate} {$edited_file}"23 type="submit"value="{'restore'|@translate}" name="submit" onclick="return confirm('{'restore_confirm'|@translate|escape:'javascript'}');" />19 <input class="cluetip" title="{'s_pl_action9'|@translate} {$edited_file}" type="submit" 20 value="{'restore'|@translate}" name="submit" onclick="return confirm('{'restore_confirm'|@translate|escape:'javascript'}');" /> 24 21 {/if}
Note: See TracChangeset
for help on using the changeset viewer.