listFieldsets.smarty 1.24 KB
<h1>Document Fields</h1>

{ if $fieldsets}
<h2>Existing generic document fields</h2>

<table class="pretty" cellspacing="0" cellpadding="0">
  <thead>
    <tr>
      <th>Name</th>
      <th>Generic</th>
      <th>Fields</th>
    </tr>
  </thead>
  <tbody>
{foreach from=$fieldsets item=oFieldset}
    <tr>
      <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}

<h2>Create a new document field set</h2>

<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>Namespace</th><td><input type="textbox" name="namespace" /></td></tr>
<tr><th>Generic</th><td><input type="checkbox" name="generic" value="true" /></td></tr>
</table>
<input type="submit" name="submit" value="Create" />
</form>