Ignore:
Timestamp:
Dec 6, 2010, 3:47:33 AM (13 years ago)
Author:
LucMorizur
Message:

Implement 'Smart Fieldsets'

Location:
extensions/event_cats/admin
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/event_cats/admin/evntcats_admin.php

    r7832 r8004  
    388388*/
    389389
    390 $template->assign(
    391  'HeaderIncTPL', realpath('plugins/event_cats/admin/template/header.inc.tpl')
    392 );
    393 
    394 $template->assign(
    395  'FooterIncTPL', realpath('plugins/event_cats/admin/template/footer.inc.tpl')
    396 );
     390$template->assign(array(
     391 'HeaderIncTPL'        =>
     392  realpath('plugins/event_cats/admin/template/header.inc.tpl'),
     393 'SmartFieldsetIncTPL' =>
     394  realpath('plugins/event_cats/admin/template/ec_smart_fieldset.inc.tpl'),
     395 'FooterIncTPL'        =>
     396  realpath('plugins/event_cats/admin/template/footer.inc.tpl'),
     397));
    397398
    398399$template->assign(
  • extensions/event_cats/admin/template/autolog_new.js

    r7985 r8004  
    3232var ec_up_code_lbl_forced_txt   = '';
    3333var ec_original_old_user        = '';
     34var ec_plus_bullet_path         = '';
     35var ec_minus_bullet_path        = '';
    3436var ec_selected_old_entry       = '-1';
    3537var ec_selected_old_code        = '-1';
     
    172174           (ec_selected_old_group) ? 'checked' : '';
    173175          de('ec_act2_id').value                    = '-1';
    174           de('first_fieldset_value_id').innerHTML = ec_new_code_text;
     176          de('first_cache_id').innerHTML            = ec_new_code_text;
    175177          ec_update_comment(ec_new_comment_text);
    176178        break;
     
    188190          ec_selected_old_user               =
    189191           ec_lists['user_id'][ec_selected_old_code];
    190           de('first_fieldset_value_id').innerHTML =
     192          de('first_cache_id').innerHTML    =
    191193           ec_lists['code'][t2.options[t2.selectedIndex].value];
    192194          ec_update_comment(
     
    244246          de('ec_in_up_newgroup_id').checked       = '';
    245247          de('ec_in_up_usr_list_id').selectedIndex = '-1';
    246           de('second_fieldset_value_id').innerHTML = '';
     248          de('second_cache_id').innerHTML = '';
    247249        break;
    248250        case 'ec_sel_user_new': // New user
     
    257259           (ec_selected_old_group) ? 'checked' : '';
    258260          de('ec_in_up_usr_list_id').selectedIndex = '-1';
    259           de('second_fieldset_value_id').innerHTML = ec_new_user_text;
     261          de('second_cache_id').innerHTML = ec_new_user_text;
    260262        break;
    261263        case 'ec_sel_user_old': // "Old" user
     
    268270          de('ec_in_up_newgroup_id').checked       = '';
    269271          de('ec_in_up_usr_list_id').value         = ec_selected_old_user;
    270           de('second_fieldset_value_id').innerHTML =
     272          de('second_cache_id').innerHTML =
    271273           t.options[t.selectedIndex].label;
    272274        break;
     
    10131015  }
    10141016  ec_mark_help('');
     1017  ec_init_smart_fieldset('first_fieldset_id', 'first_cache_id',
     1018   ec_plus_bullet_path, ec_minus_bullet_path, '', false);
     1019  ec_init_smart_fieldset('second_fieldset_id', 'second_cache_id',
     1020   ec_plus_bullet_path, ec_minus_bullet_path, '', false);
    10151021  jQuery(document).ready(function(){
     1022    jQuery('#first_cache_id').after(document.createElement('span'));
     1023    jQuery('#first_cache_id').next().attr('id', 'first_fieldset_comment_id');
    10161024    jQuery('#ec_tmp_img').attr(
    10171025      'src', jQuery('img.ui-datepicker-trigger:first').attr('src')
    10181026    );
    10191027    ec_check_validity_on();
    1020     jQuery('#reduced_first_fieldset_legend_id').click(function(){
    1021       ec_toggle_fieldset(
    1022         '#reduced_first_fieldset_id', '#maximized_first_fieldset_id'
    1023       );
    1024     });
    1025     jQuery('#reduced_second_fieldset_legend_id').click(function(){
    1026       ec_toggle_fieldset(
    1027         '#reduced_second_fieldset_id', '#maximized_second_fieldset_id'
    1028       );
    1029     });
    1030     jQuery('#maximized_first_fieldset_legend_id').click(function(){
    1031       ec_toggle_fieldset(
    1032         '#reduced_first_fieldset_id', '#maximized_first_fieldset_id'
    1033       );
    1034     });
    1035     jQuery('#maximized_second_fieldset_legend_id').click(function(){
    1036       ec_toggle_fieldset(
    1037         '#reduced_second_fieldset_id', '#maximized_second_fieldset_id'
    1038       );
    1039     });
    10401028    jQuery('.ui-datepicker').click(function(){
    10411029      ec_validity_check_min();
     
    10551043      ec_check_validity_on();
    10561044    });
    1057     jQuery('.reduced_fieldsets').css({
    1058       'padding-left'   : jQuery('fieldset').css('padding-left'),
    1059       'padding-right'  : jQuery('fieldset').css('padding-right'),
    1060       'margin-left'    : jQuery('fieldset').css('margin-left'),
    1061       'margin-right'   : jQuery('fieldset').css('margin-right'),
    1062       'margin-top'     : jQuery('fieldset').css('margin-top'),
    1063       'margin-bottom'  : jQuery('fieldset').css('margin-bottom'),
    1064     });
    1065     jQuery('.plus_bullets').css(
    1066       'padding-left', jQuery('legend').css('padding-left')
    1067     );
    1068     jQuery('.reduced_fieldsets_legend').css({
    1069       'padding-left'   : jQuery('fieldset').css('border-left-width'),
    1070       'padding-top'    : jQuery('fieldset').css('border-top-width'),
    1071       'letter-spacing' : jQuery('legend').css('letter-spacing'),
    1072     });
    10731045  });
    10741046  return false;
  • extensions/event_cats/admin/template/autolog_new.tpl

    r7985 r8004  
    55{include file = $HeaderIncTPL}
    66{include file = 'include/datepicker.inc.tpl'}
     7{include file = $SmartFieldsetIncTPL}
    78
    89{* <!-- Specific CSS --> *}
    9 {html_head} {literal}
     10{html_head}
     11{literal}
    1012  <link rel = "stylesheet" type = "text/css" href = "{$RACINE_URL}themes/default/js/ui/theme/ui.datepicker.css">
    1113  <style type = "text/css">
     
    1315      display:none;
    1416    }
    15     .reduced_fieldsets {
    16       margin:0;
    17       padding:0;
    18     }
    19     .fieldsets_legend {
    20       cursor:pointer;
    21     }
    2217  </style>
    23 {/literal} {/html_head}
     18{/literal}
     19{/html_head}
    2420
    2521{* <!-- JS functions --> *}
     
    5955{* <!-- Parameters list --> *}
    6056<form class = "filter" method = "post" name = "ec_new_code" action = "" onsubmit = "return ec_check_submit();">
    61   <p>
     57  <p style = "display:none;">
    6258    <input type = "hidden" id = "ec_act1_id" name = "ec_act1">
    6359    <input type = "hidden" id = "ec_act2_id" name = "ec_entry_sel">
     
    8480 
    8581  {* <!-- [ [ [New] / [existing] code] / [Existing entry] ] selection --> *}
    86   <div id = "reduced_first_fieldset_id" class = "reduced_fieldsets" style = "display:none;">
    87     <span style = "font-weight:bold;" class = "reduced_fieldsets_legend fieldsets_legend" id = "reduced_first_fieldset_legend_id"
    88      ><img class = "plus_bullets" alt = "" title = "" src = "{$EVNTCATS_URLS.ROOT}icon/plus.png"
    89      >&nbsp;<span id = "first_fieldset_legend_id"
    90      >{if $ec_is_creation}{'Code'|@translate}{else}{'Selected entry'|@translate}{/if}</span>&nbsp;: </span
    91      ><span id = "first_fieldset_value_id"></span><span id = "first_fieldset_comment_id"></span>
    92   </div>
    93   <fieldset id = "maximized_first_fieldset_id">
    94     <legend style = "font-weight:bold;" class = "fieldsets_legend" id = "maximized_first_fieldset_legend_id">
    95       <img class = "minus_bullets" alt = "" title = "" src = "{$EVNTCATS_URLS.ROOT}icon/minus.png">
    96       <script type = "text/javascript">d.write(de('first_fieldset_legend_id').innerHTML);</script>
     82  <fieldset id = "first_fieldset_id">
     83    <legend style = "font-weight:bold;">
     84      {if $ec_is_creation}
     85        {'Code'|@translate}
     86      {else}
     87        {'Selected entry'|@translate}
     88      {/if}
    9789    </legend>
    9890    <ul>
     
    188180 
    189181  {* <!-- User to identify --> *}
    190   <div id = "reduced_second_fieldset_id" class = "reduced_fieldsets" style = "display:none;">
    191     <span style = "font-weight:bold;" class = "reduced_fieldsets_legend fieldsets_legend" id = "reduced_second_fieldset_legend_id"
    192      ><img class = "plus_bullets" alt = "" title = "" src = "{$EVNTCATS_URLS.ROOT}icon/plus.png"
    193      >&nbsp;{'Identified user'|@translate}&nbsp;: </span><span id = "second_fieldset_value_id"></span>
    194   </div>
    195   <fieldset id = "maximized_second_fieldset_id">
    196     <legend style = "font-weight:bold;" class = "fieldsets_legend" id = "maximized_second_fieldset_legend_id">
    197       <img class = "minus_bullets" alt = "" title = "" src = "{$EVNTCATS_URLS.ROOT}icon/minus.png">
     182  <fieldset id = "second_fieldset_id">
     183    <legend style = "font-weight:bold;">
    198184      {'Identified user'|@translate}
    199       <span style = "font-weight:bold; color:red;" id = "ec_in_up_pwd_warn">&nbsp;</span><br>
     185      <span style = "font-weight:bold; color:red;" id = "ec_in_up_pwd_warn">&nbsp;</span><br />
    200186    </legend>
    201187      <ul>
     
    539525  ec_default_entry                        = "{$ec_default_entry}";
    540526  ec_auto_code_digits_nb                  = "{$ec_def_auto_code_dg_nb}";
     527  ec_plus_bullet_path                     = "{$EVNTCATS_URLS.ROOT}icon/plus.png";
     528  ec_minus_bullet_path                    = "{$EVNTCATS_URLS.ROOT}icon/minus.png";
    541529  {if $ec_is_creation}
    542530    {foreach from = $ec_lists.duplicable_codes.ids key = ec_key item = ec_val}
Note: See TracChangeset for help on using the changeset viewer.