Page 1 of 1

Change settings template in FE users?

Posted: Sat Dec 15, 2007 1:07 pm
by Gillian.Hesse
Hi there,

I am using FE Users 1.3.1 and the Change settings template produces the entry form twice.  Looking at the template it appears that there are two seperate parts of code each generating a similar form, but the second uses javascript and a table.

I have commented out the 2nd part of code, and everything works fine, but was wondering whether this was an accident, or which of the two sections is better to use.

For info I have included the template.  Note that this is the default template, I didn't modify it...

Code: Select all

<!-- change settings template -->
{$title}
{if $message != ''}
  {if $error != ''}
    <p><font color="red">{$message}</font></p>
  {else}
    <p>{$message}</p>
  {/if}
{/if}
{$startform}
 {if $controlcount > 0}
  <center>
  <table width="75%">
     {foreach from=$controls item=control}
  <tr>
     <td>{$control->hidden}<font color="{$control->color}">{$control->prompt}{$control->marker}</font></td>
     <td>
       {if isset($control->image)}{$control->image}<br/>{/if}
       {$control->control}{$control->addtext}
       {if $control->required != true}
         {if isset($control->control2)}{$control->prompt2} {$control->control2}<br/>{/if}
       {/if}
     </td>
  </tr>
 {/foreach}
  </table>
  </center>
 {/if}
 {$hidden}{$hidden2}{$submit}{$cancel}
{$endform}
<!-- change settings template --><!-- change settings template -->
{literal}
<__script__ LANGUAGE="JavaScript">
function readonlyControl(id) {
  var controls = document.getElementsByName(id);
  if( typeof(controls[0]) != 'undefined' ) controls[0].disabled = true;
}
</__script>
{/literal}
{$title}
{if $message != ''}
  {if $error != ''}
    <p><font color="red">{$message}</font></p>
  {else}
    <p>{$message}</p>
  {/if}
{/if}
{$startform}
 {if $controlcount > 0}
  <center>
  <table width="75%">
     {foreach from=$controls item=control}
  <tr>
     <td>{$control->hidden}<font color="{$control->color}">{$control->prompt}{$control->marker}</font></td>
     <td>
       {if isset($control->image)}{$control->image}<br/>{/if}
       {$control->control}{$control->addtext}
       {if $control->required != true}
         {if isset($control->control2)}{$control->prompt2} {$control->control2}<br/>{/if}
       {/if}
       {if $control->status == 4}{* readonly property *}
          <__script__ language="javascript">
             readonlyControl('{$control->id}');
          </__script>
       {/if}
     </td>
 {/foreach}
  </table>
  </center>
 {/if}
 {$hidden}{$hidden2}{$submit}{$cancel}
{$endform}

<!-- change settings template -->


thanks

Gill