Changeset 4276 for extensions/event_cats
- Timestamp:
- Nov 16, 2009, 1:26:06 AM (14 years ago)
- Location:
- extensions/event_cats
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/event_cats/admin/duplication.inc.php
r4263 r4276 1 1 <?php 2 3 4 5 6 7 8 /* */ 9 10 11 12 13 2 14 3 15 … … 16 28 17 29 18 /* */19 20 21 30 ?> -
extensions/event_cats/admin/evntcats_admin.php
r4247 r4276 71 71 if (!isset($ec_debug)) $ec_debug = array(); 72 72 73 // +-----------------------------------------------------------------------+ 74 // | $_POST analysis, to determine which tab to display (tabsheet prep.) 75 // +-----------------------------------------------------------------------+ 76 77 // If needed, stores in the DB the new value of the number of digits of 78 // automatically created codes 73 79 if ( 74 80 isset($_POST['ec_in_up_auto_code_length']) and … … 76 82 ) change_ec_conf('auto_code_dg_nb', $_POST['ec_in_up_auto_code_length']); 77 83 84 85 // If needed, stores in the DB that acknowledgement message has been displayed 78 86 if ($ec_howto = (read_ec_conf('howto') == '0')) change_ec_conf('howto', '1'); 79 87 80 88 build_ec_lists(); // in evntcats_main_funcs.php 81 89 82 // +-----------------------------------------------------------------------+ 83 // | Tabsheet 84 // +-----------------------------------------------------------------------+ 85 90 // If no entry exist, default page is 'autolog_new'. 86 91 $page['tab'] = (!($ec_exist_entries = (mysql_num_rows(pwg_query(" 87 SELECT * FROM `".EVNTCATS_ TABLE."`88 WHERE `code` IS NOT NULL 92 SELECT * FROM `".EVNTCATS_AUTOLOG_TABLE."` 93 WHERE `code` IS NOT NULL ; 89 94 ")) != 0))) ? 'autolog_new' : 'autolog_entries'; 90 95 91 // Rajouter un test pour que si $ec_exist_entries est faux, mais qu'il y a 92 // quand même des entrées dans la table (donc pour gérer la duplication de 93 // compte), l'onglet sélectionné par défaut soit celui de la gestion de la 94 // duplication de compte. 96 $ec_exist_duplic = ((mysql_num_rows(pwg_query(" 97 SELECT * FROM `".EVNTCATS_DUPLIC_TABLE."` ; 98 ")) != 0) or 99 (read_ec_conf('duplic_gen') != 0) or 100 (read_ec_conf('duplic_type') != 0) 101 ); 102 103 // If no entry exist, but some duplication management entries exist, default tab is 'duplication'. 104 if (!$ec_exist_entries and $ec_exist_duplic) $page['tab'] = 'duplication'; 105 106 107 /* 108 109 if (isset($_POST[''])) { 110 } 111 112 113 if (isset($_POST['ec_duplic_conf_submit'])) { 114 } 115 116 if (isset($_POST['deny_groups_submit'])) { 117 } 118 119 if (isset($_POST['grant_groups_submit'])) { 120 } 121 122 if (isset($_POST['deny_types_submit'])) { 123 } 124 125 if (isset($_POST['grant_types_submit'])) { 126 } 127 128 if (isset($_POST['deny_users_submit'])) { 129 } 130 131 if (isset($_POST['grant_users_submit'])) { 132 } 133 134 135 136 137 */ 138 139 140 141 95 142 96 143 if (isset($_POST['ec_act1'])) { … … 140 187 if (isset($_GET['tab'])) switch ($_GET['tab']) { 141 188 case 'autolog_modif': 189 if ($ec_exist_entries) $page['tab'] = $_GET['tab']; 190 break; 191 case 'duplication': 192 if ($ec_exist_duplic) $page['tab'] = $_GET['tab']; 193 break; 142 194 case 'autolog_new': 143 case 'duplication':144 195 case 'config': 145 196 $page['tab'] = $_GET['tab']; … … 148 199 } 149 200 201 // +-----------------------------------------------------------------------+ 202 // | Tabsheet 203 // +-----------------------------------------------------------------------+ 204 150 205 $ec_exist_entries = (mysql_num_rows(pwg_query(" 151 SELECT * FROM `".EVNTCATS_ TABLE."`206 SELECT * FROM `".EVNTCATS_AUTOLOG_TABLE."` 152 207 WHERE `code` IS NOT NULL 153 208 ")) != 0); 209 210 $ec_exist_duplic = ((mysql_num_rows(pwg_query(" 211 SELECT * FROM `".EVNTCATS_DUPLIC_TABLE."` ; 212 ")) != 0) or 213 (read_ec_conf('duplic_gen') != 0) or 214 (read_ec_conf('duplic_type') != 0) 215 ); 154 216 155 217 $tabsheet = new tabsheet(); … … 165 227 l10n('ec_tab_autoid_new'), 166 228 $my_base_url.'&tab=autolog_new'); 167 $tabsheet->add('duplication',229 if ($ec_exist_duplic) $tabsheet->add('duplication', 168 230 l10n('ec_tab_duplication'), 169 231 $my_base_url.'&tab=duplication'); -
extensions/event_cats/admin/template/duplication.tpl
r4263 r4276 12 12 13 13 {* <!-- Duplication configuration parameters --> *} 14 <form class = "titrePage" name = "ec_duplic_conf">14 <form action = "" method = "post" class = "titrePage" name = "ec_duplic_conf"> 15 15 <fieldset> 16 16 <legend>{'ec_duplication_config'|@translate}</legend> … … 22 22 <td> 23 23 <label for = "ec_dup_conf_none_id"> 24 <input type = "radio" name = "ec_dup_conf " id = "ec_dup_conf_none_id" />24 <input type = "radio" name = "ec_dup_conf[]" value = "none" id = "ec_dup_conf_none_id" /> 25 25 {'ec_dup_allowance_none'|@translate} 26 26 </label><br> 27 27 <label for = "ec_dup_conf_group_id"> 28 <input type = "radio" name = "ec_dup_conf " id = "ec_dup_conf_group_id" />28 <input type = "radio" name = "ec_dup_conf[]" value = "group" id = "ec_dup_conf_group_id" /> 29 29 {'ec_dup_allowance_group'|@translate} 30 </label><br> {* <!-- 31 <label for = "ec_dup_conf_gen_id"> 32 <input type = "radio" name = "ec_dup_conf" id = "ec_dup_conf_gen_id" /> 33 {'ec_dup_allowance_gen'|@translate} 34 </label><br> --> *} 30 </label><br> 35 31 <label for = "ec_dup_conf_all_id"> 36 <input type = "radio" name = "ec_dup_conf " id = "ec_dup_conf_all_id" />32 <input type = "radio" name = "ec_dup_conf[]" value = "all" id = "ec_dup_conf_all_id" /> 37 33 {'ec_dup_allowance_all'|@translate} 38 34 </label> … … 46 42 {* <!-- Duplication settings by groups / types / user ids --> *} 47 43 <form action = "" method = "post" name = "ec_duplic_set" id="categoryPermissions"> 48 44 49 45 <h4>{'Groups'|@translate}</h4> 50 46 51 47 <fieldset> 52 48 <legend>{'ec_duplic_ok'|@translate}</legend> 53 49 <ul> 54 {foreach from=$group _granted_ids item=id}50 {foreach from=$groups_granted_ids item=id} 55 51 <li><label><input type = "checkbox" name = "deny_groups[]" value = "{$id}" /> {$all_groups[$id]}</label></li> 56 52 {/foreach} … … 58 54 <input class = "submit" type = "submit" name = "deny_groups_submit" value = "{'ec_dup_grp_ok_sbmt_lbl'|@translate}" /> 59 55 </fieldset> 60 56 61 57 <fieldset> 62 58 <legend>{'ec_duplic_nok'|@translate}</legend> 63 59 <ul> 64 {foreach from=$group _denied_ids item=id}60 {foreach from=$groups_denied_ids item=id} 65 61 <li><label><input type = "checkbox" name = "grant_groups[]" value = "{$id}"> {$all_groups[$id]}</label></li> 66 62 {/foreach} … … 68 64 <input class = "submit" type = "submit" name = "grant_groups_submit" value = "{'ec_dup_grp_nok_sbmt_lbl'|@translate}" /> 69 65 </fieldset> 70 66 71 67 <h4>{'ec_dup_types'|@translate}</h4> 72 68 73 69 <fieldset> 74 70 <legend>{'ec_duplic_ok'|@translate}</legend> 75 71 <ul> 76 <li><label><input type = "checkbox" name = "ec_dup_types_generic_ok" value = "ec_dup_types_generic_ok_id" /> {'user_status_generic'|@translate}</label></li> 72 {if $ec_gen_granted} 73 <li><label><input type = "checkbox" name = "deny_generic" {* id = "ec_dup_types_generic_nok_id" *} /> {'user_status_generic'|@translate}</label></li> 77 74 <br /> 78 <li><label><input type = "checkbox" name = "ec_dup_types_contacts_ok" value = "ec_dup_types_contacts_ok_id" /> {'Level 1'|@translate}</label></li> 79 <li><label><input type = "checkbox" name = "ec_dup_types_friends_ok" value = "ec_dup_types_friends_ok_id" /> {'Level 2'|@translate}</label></li> 80 <li><label><input type = "checkbox" name = "ec_dup_types_family_ok" value = "ec_dup_types_family_ok_id" /> {'Level 4'|@translate}</label></li> 75 {/if} 76 {foreach from=$types_granted_ids item=id} 77 <li><label><input type = "checkbox" name = "deny_types[]" value = "{$id}" /> {$all_types[$id]}</label></li> 78 {/foreach} 81 79 </ul> 82 <input class = "submit" type = "submit" name = "deny_ users_submit" value = "{'ec_dup_typ_sbmt_lbl'|@translate}" />80 <input class = "submit" type = "submit" name = "deny_types_submit" value = "{'ec_dup_typ_sbmt_nok_lbl'|@translate}" /> 83 81 </fieldset> 84 82 83 <fieldset> 84 <legend>{'ec_duplic_nok'|@translate}</legend> 85 <ul> 86 {if !$ec_gen_granted} 87 <li><label><input type = "checkbox" name = "grant_generic" {* id = "ec_dup_types_generic_ok_id" *} /> {'user_status_generic'|@translate}</label></li> 88 <br /> 89 {/if} 90 {foreach from=$types_denied_ids item=id} 91 <li><label><input type = "checkbox" name = "grant_types[]" value = "{$id}" /> {$all_types[$id]}</label></li> 92 {/foreach} 93 </ul> 94 <input class = "submit" type = "submit" name = "grant_types_submit" value = "{'ec_dup_typ_sbmt_ok_lbl'|@translate}" /> 95 </fieldset> 96 85 97 <h4>{'Users'|@translate}</h4> 86 98 87 99 <fieldset> 88 100 <legend>{'ec_duplic_ok'|@translate}</legend> 89 101 <ul> 90 {foreach from=$user _granted_direct_ids item=id}102 {foreach from=$users_granted_direct_ids item=id} 91 103 <li><label><input type = "checkbox" name = "deny_users[]" value = "{$id}" /> {$all_users[$id]}</label></li> 92 104 {/foreach} … … 94 106 <input class = "submit" type = "submit" name = "deny_users_submit" value = "{'ec_dup_usr_ok_sbmt_lbl'|@translate}" /> 95 107 </fieldset> 96 108 97 109 <fieldset> 98 110 <legend>{'ec_duplic_ok_groups'|@translate}</legend> … … 105 117 {/if} 106 118 </fieldset> 107 119 108 120 <fieldset> 109 121 <legend>{'ec_duplic_nok'|@translate}</legend> 110 122 <ul> 111 {foreach from=$user _denied_ids item=id}123 {foreach from=$users_denied_ids item=id} 112 124 <li><label><input type = "checkbox" name = "grant_users[]" value = "{$id}"> {$all_users[$id]}</label></li> 113 125 {/foreach} … … 115 127 <input class = "submit" type = "submit" name = "grant_users_submit" value = "{'ec_dup_usr_nok_sbmt_lbl'|@translate}" /> 116 128 </fieldset> 117 129 118 130 </form> 119 131 -
extensions/event_cats/include/evntcats_admin_funcs.inc.php
r4221 r4276 376 376 " 377 377 SELECT `id` 378 FROM `".EVNTCATS_ TABLE."`378 FROM `".EVNTCATS_AUTOLOG_TABLE."` 379 379 WHERE `code` = '".$ec_code."' 380 380 AND `user_id` ".$ec_user_idp." … … 393 393 $t1 = mysql_fetch_row(pwg_query(" 394 394 SELECT `code` 395 FROM `".EVNTCATS_ TABLE."`395 FROM `".EVNTCATS_AUTOLOG_TABLE."` 396 396 WHERE `id` = ".$_POST['ec_entry_sel'] 397 397 ))) === false … … 399 399 $r = pwg_query(" 400 400 SELECT `id` 401 FROM `".EVNTCATS_ TABLE."`401 FROM `".EVNTCATS_AUTOLOG_TABLE."` 402 402 WHERE `code` = '".$t1[0]."' 403 403 AND `id` <> ".$_POST['ec_entry_sel'] … … 425 425 if ( 426 426 pwg_query(" 427 INSERT INTO `".EVNTCATS_ TABLE."` (427 INSERT INTO `".EVNTCATS_AUTOLOG_TABLE."` ( 428 428 `code`, 429 429 `user_id`, … … 459 459 if ( 460 460 pwg_query(" 461 UPDATE `".EVNTCATS_ TABLE."`461 UPDATE `".EVNTCATS_AUTOLOG_TABLE."` 462 462 SET 463 463 `user_id` = ".$ec_user_id.", … … 493 493 global $page; 494 494 if (!pwg_query(" 495 DELETE FROM `".EVNTCATS_ TABLE."`495 DELETE FROM `".EVNTCATS_AUTOLOG_TABLE."` 496 496 WHERE `id` = ".$ec_id 497 497 )) { -
extensions/event_cats/include/evntcats_main_funcs.inc.php
r4263 r4276 155 155 if ($new_action == '') { 156 156 if (!pwg_query(" 157 UPDATE `".EVNTCATS_ TABLE."`157 UPDATE `".EVNTCATS_AUTOLOG_TABLE."` 158 158 SET `forced` = 'false' 159 159 WHERE `id` = ".$ec_entry['id'] … … 247 247 248 248 $q = pwg_query(" 249 SELECT * FROM `".EVNTCATS_ TABLE."`249 SELECT * FROM `".EVNTCATS_AUTOLOG_TABLE."` 250 250 WHERE `code` IS NOT NULL 251 251 ORDER BY `id` … … 352 352 */ 353 353 function build_dup_arrays($append_tpl = false) { 354 global $template, $ec_lists, $conf , $ec_debug;354 global $template, $ec_lists, $conf; 355 355 356 356 if (count($ec_lists['user_ids']) == 0) build_ec_userids(); … … 368 368 369 369 // groups granted to duplication 370 $group _granted_ids = order_by_name(370 $groups_granted_ids = order_by_name( 371 371 array_from_query(" 372 SELECT `arg2` 373 FROM ".EVNTCATS_TABLE." 374 WHERE `code` IS NULL 375 AND `arg1` = '1' 376 AND `arg2` IS NOT NULL 372 SELECT `val` 373 FROM ".EVNTCATS_DUPLIC_TABLE." 374 WHERE `item` = 'grp' 377 375 ;", 378 ' arg2'376 'val' 379 377 ), 380 378 $groups … … 384 382 $users_granted_direct_ids = order_by_name( 385 383 array_from_query(" 386 SELECT `arg2` 387 FROM ".EVNTCATS_TABLE." 388 WHERE `code` IS NULL 389 AND `arg1` = '2' 390 AND `arg2` IS NOT NULL 384 SELECT `val` 385 FROM ".EVNTCATS_DUPLIC_TABLE." 386 WHERE `item` = 'usr' 391 387 ;", 392 ' arg2'388 'val' 393 389 ), 394 390 $ec_lists['user_ids'] … … 398 394 // certain group (in groups, level (friends, family, contacts), 399 395 // or user status (generic)) 400 $user _granted_ids = array();401 396 $users_granted_ids = array(); 397 402 398 $users_granted_thks_gen_ids = array(); 403 if ( read_ec_conf('duplic_gen') != '0') {399 if ($ec_gen_granted = (read_ec_conf('duplic_gen') != '0')) { 404 400 $users_granted_thks_gen_ids = order_by_name( 405 401 array_diff( … … 415 411 ); 416 412 foreach ($users_granted_thks_gen_ids as $user_id) 417 $user_granted_ids[$user_id] = l10n('user_status_generic'); 418 } global $ec_debug; $ec_debug['1'] = $user_granted_ids; 419 413 $users_granted_ids[$user_id] = l10n('user_status_generic'); 414 } 415 416 $types = array( 417 '1' => l10n('Level 1'), 418 '2' => l10n('Level 2'), 419 '4' => l10n('Level 4'), 420 ); 421 $types_granted_ids = array(); 420 422 $users_granted_thks_types_ids = array(); 421 423 $c = intval(read_ec_conf('duplic_type')); 422 424 if ($c != 0) { 423 $t = array(); 424 if (($c & 1) != 0) $t[] = '1'; 425 if (($c & 2) != 0) $t[] = '2'; 426 if (($c & 4) != 0) $t[] = '4'; 427 if (count($t) > 0) { 428 $types = array( 429 '1' => l10n('Level 1'), 430 '2' => l10n('Level 2'), 431 '4' => l10n('Level 4'), 432 ); 425 if (($c & 1) != 0) $types_granted_ids[] = '1'; 426 if (($c & 2) != 0) $types_granted_ids[] = '2'; 427 if (($c & 4) != 0) $types_granted_ids[] = '4'; 428 if (count($types_granted_ids) > 0) { 433 429 $user_granted_from_type = array(); 434 430 $result = pwg_query(" 435 431 SELECT `user_id`, `level` 436 432 FROM `".USER_INFOS_TABLE."` 437 WHERE `level` IN (".implode(',', $t ).");433 WHERE `level` IN (".implode(',', $types_granted_ids)."); 438 434 "); 439 435 while ($row = mysql_fetch_array($result)) { … … 459 455 foreach ($user_granted_from_type as $type_id => $type_users) { 460 456 if (in_array($user_id, $type_users)) { 461 $user _granted_ids[$user_id]= $types[$type_id];457 $users_granted_ids[$user_id]= $types[$type_id]; 462 458 break; 463 459 } 464 460 } 465 461 } 466 } $ec_debug['2'] = $user_granted_ids;462 } 467 463 468 464 $users_granted_thks_groups_ids = array(); 469 if (count($group _granted_ids) > 0) {465 if (count($groups_granted_ids) > 0) { 470 466 $granted_groups = array(); 471 467 … … 473 469 SELECT `user_id`, `group_id` 474 470 FROM `".USER_GROUP_TABLE."` 475 WHERE `group_id` IN (".implode(',', $group _granted_ids).");471 WHERE `group_id` IN (".implode(',', $groups_granted_ids)."); 476 472 "); 477 473 while ($row = mysql_fetch_array($result)) { … … 499 495 foreach ($granted_groups as $group_id => $group_users) 500 496 if (in_array($user_id, $group_users)) { 501 $user _granted_ids[$user_id]= $groups[$group_id];497 $users_granted_ids[$user_id]= $groups[$group_id]; 502 498 break; 503 499 } 504 500 505 } $ec_debug['3'] = $user_granted_ids;501 } 506 502 507 503 if ($append_tpl) { 508 $user _denied_ids = order_by_name(504 $users_denied_ids = order_by_name( 509 505 array_diff( 510 506 array_keys($ec_lists['user_ids']), … … 517 513 ); 518 514 519 foreach ($user _granted_ids as $u => $g) $template->append(515 foreach ($users_granted_ids as $u => $g) $template->append( 520 516 'user_granted_indirects', 521 517 array( … … 525 521 ); 526 522 527 $ec_debug['4'] = $user_granted_ids;528 523 $template->assign('all_groups', $groups); 529 $template->assign('group_granted_ids', $group_granted_ids); 530 $template->assign('group_denied_ids',order_by_name( 531 array_diff(array_keys($groups), $group_granted_ids), $groups 524 $template->assign('groups_granted_ids', $groups_granted_ids); 525 $template->assign('groups_denied_ids', order_by_name( 526 array_diff(array_keys($groups), $groups_granted_ids), $groups 527 )); 528 $template->assign('ec_gen_granted', $ec_gen_granted); 529 $template->assign('all_types', $types); 530 $template->assign('types_granted_ids', $types_granted_ids); 531 $template->assign('types_denied_ids', order_by_name( 532 array_diff(array_keys($types), $types_granted_ids), $types 532 533 )); 533 534 $template->assign('all_users', $ec_lists['user_ids']); 534 535 $template->assign('users_granted_direct_ids', $users_granted_direct_ids); 535 $template->assign('user _denied_ids', $user_denied_ids);536 } 537 $user_granted_ids = array_merge(538 $user_granted_ids,536 $template->assign('users_denied_ids', $users_denied_ids); 537 } 538 $users_granted_ids = array_merge( 539 array_keys($users_granted_ids), 539 540 $users_granted_direct_ids 540 ); 541 return $user_granted_ids; 541 ); 542 543 // Returns an array which values are all the user_ids allowed to display a 544 // "duplicate" link. The keys of this array are strange (for direct allowed 545 // users, keys are usernames), but normally not used 546 return $users_granted_ids; 542 547 } 543 548 -
extensions/event_cats/language/fr_FR/plugin.lang.php
r4263 r4276 93 93 $lang['ec_dup_grp_ok_sbmt_lbl'] = 'Interdire la duplication aux groupes sélectionnés'; 94 94 $lang['ec_dup_grp_nok_sbmt_lbl'] = 'Autoriser la duplication aux groupes sélectionnés'; 95 $lang['ec_dup_typ_sbmt_nok_lbl'] = 'Interdire la duplication aux types sélectionnés'; 96 $lang['ec_dup_typ_sbmt_ok_lbl'] = 'Autoriser la duplication aux types sélectionnés'; 95 97 $lang['ec_dup_usr_ok_sbmt_lbl'] = 'Interdire la duplication aux utilisateurs sélectionnés'; 96 98 $lang['ec_dup_usr_nok_sbmt_lbl'] = 'Autoriser la duplication aux utilisateurs sélectionnés'; 97 $lang['ec_dup_typ_sbmt_lbl'] = 'Sauvegarder';98 99 $lang['ec_dup_conf_sbmt_lbl'] = 'Sauvegarder la configuration de la duplication'; 99 100 // JS checks -
extensions/event_cats/main.inc.php
r4263 r4276 43 43 define('EVNTCATS_INFO_VERSION','1.0.0'); 44 44 define('EVNTCATS_PATH',PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)). '/'); 45 define('EVNTCATS_TABLE',$prefixeTable.'event_cats'); 45 define('EVNTCATS_AUTOLOG_TABLE', $prefixeTable.'event_cats_autolog'); 46 define('EVNTCATS_DUPLIC_TABLE', $prefixeTable.'event_cats_duplic'); 46 47 define('ROOT_URL',get_absolute_root_url()); 47 48 -
extensions/event_cats/maintain.inc.php
r4239 r4276 36 36 include_once(EVNTCATS_PATH.'include/ec_conf.inc.php'); 37 37 38 // *********************************************************************** 38 39 function plugin_uninstall() { 39 global $prefixeTable , $ec_conf;40 global $prefixeTable; 40 41 41 unset($ec_conf);42 42 pwg_query("DELETE FROM `".CONFIG_TABLE."` WHERE `param` = 'event_cats' LIMIT 1;"); 43 return pwg_query('DROP TABLE IF EXISTS `'.$prefixeTable.'event_cats`;'); 43 pwg_query('DROP TABLE IF EXISTS `'.$prefixeTable.'event_cats_duplic`;'); 44 return pwg_query('DROP TABLE IF EXISTS `'.$prefixeTable.'event_cats_autolog`;'); 44 45 } 45 46 47 // *********************************************************************** 46 48 function plugin_install() { 47 49 global $prefixeTable; 48 50 49 51 plugin_uninstall(); 52 50 53 // create table for plugin, if it doesn't exist yet 51 $ q =pwg_query("52 CREATE TABLE `".$prefixeTable."event_cats ` (54 $r = (pwg_query(" 55 CREATE TABLE `".$prefixeTable."event_cats_autolog` ( 53 56 `id` SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT , 54 57 `code` VARCHAR(32) DEFAULT NULL , … … 63 66 ) 64 67 DEFAULT CHARACTER SET utf8; 65 ") ;68 ") !== false); 66 69 67 70 /* … … 131 134 132 135 */ 133 pwg_query(" 136 137 if ($r) $r = (pwg_query(" 138 CREATE TABLE `".$prefixeTable."event_cats_duplic` ( 139 `item` VARCHAR(5) NOT NULL , 140 `val` VARCHAR(32) NOT NULL , 141 KEY `item` (`item`), 142 KEY `val` (`val`) 143 ) 144 DEFAULT CHARACTER SET utf8; 145 ") !== false); 146 147 /* 148 Explanations on table structure : 149 150 item : the code used as "autolog" argument. If thie code provided by the 151 visitor does not exist in the table, the administrator can choose 152 whether the visitor is redirected to the home page (nothing 153 happens) or to the "access denied" page ; 154 value : the account concerned in following values ; 155 156 */ 157 158 if ($r) $r = (pwg_query(" 134 159 INSERT INTO `".CONFIG_TABLE."` (`param`,`value`,`comment`) 135 160 VALUES ('event_cats','0','Paramètres du plugin Event Cats'); 136 "); 137 change_ec_conf('activated', '0'); 138 return $q; 161 ") !== false); 162 163 if ($r) $r = (change_ec_conf('activated', '0')); 164 165 if ($r) return true; 166 else { 167 plugin_uninstall(); 168 return false; 169 } 139 170 } 140 171 172 // *********************************************************************** 141 173 function plugin_activate() { 142 174 change_ec_conf('activated', '1'); 143 175 } 144 176 177 // *********************************************************************** 145 178 function plugin_deactivate() { 146 179 change_ec_conf('activated', '0');
Note: See TracChangeset
for help on using the changeset viewer.