listFieldsets.smarty 1.81 KB
<h2>Document Fieldsets</h2>

{ if $fieldsets}
<h3>Existing document fieldsets</h3>

<table class="listing" cellpadding="1.5em" cellspacing="0">
  <thead>
    <tr>
      <th colspan="2">Name</th>
      <th>Generic</th>
      <th>Fields</th>
    </tr>
  </thead>
  <tbody>
{foreach from=$fieldsets item=oFieldset}
    <tr>
	  <td>
	     <a href="?action=delete&fFieldsetId={$oFieldset->getId()}"class="ktAction ktDelete">Delete</a>
	  </td>
      <td>
        <a href="?action=edit&fFieldsetId={$oFieldset->getId()}"> { $oFieldset->getName() }
        </a>
      </td>
      <td>
{if $oFieldset->getIsGeneric()}
	Yes
{else}
	No
{/if}
      </td>
      <td>
{assign var="aFields" value=$oFieldset->getFields()}
{if $aFields}
<ul>
{foreach from=$aFields item=oField}
  <li>{$oField->getName()}</li>
{/foreach}
</ul>
{else}
&nbsp;
{/if}
      </td>
    </tr>
  </tbody>
{/foreach}
</table>
{/if}

<h3>Create a new document fieldset</h3>

<form method="POST" action="{$smarty.server.PHP_SELF}">
<input type="hidden" name="action" value="new">
<table class="prettysw" cellpadding="0" cellspacing="0">
<tr><th>Name</th><td><input type="textbox" name="name" /></td></tr>
<tr>
  <th>Generic</th>
  <td style="text-align: left">
    <input type="checkbox" name="generic" value="true" /><br />
    <p class="helpText">A generic fieldset is one that
    is available for every document by default.  These fieldsets
    will be available for users to edit and add for every document in
    the document management system.</p>
  </td>
</tr>
<tr>
  <th>System</th>
  <td>
    <input type="checkbox" name="system" value="true" /><br />
    <p class="helpText">A system fieldset is one that
    is never displayed to a user, and is used only by the document
    management system.</p>
  </td>
</tr>
</table>
<input type="submit" name="submit" value="Create" />
</form>