<commit_before><?php if ($sf_user->hasFlash('notice')): ?>
  <div class="notice"><?php echo $sf_user->getFlash('notice'); ?></div>
<?php endif; ?>

<?php if (0 < count($currentCategories)) : ?>
  <h2>Current categories</h2>
  <table>
    <thead>
      <tr>
        <th>Title</th>
        <th># items</th>
        <th>Move</th>
        <th>Is active</th>
        <th>Actions</th>
      </tr>
    </thead>
    <tbody>
      <?php foreach ($currentCategories as $category) :
        $count = $category->getItemCount();
        $total = $count['active'] + $count['inactive']; ?>
        <tr>
          <td><?php echo $category->getTitle(); ?></td>
          <td>
            <?php echo $count['active']; ?> active / <?php echo $count['inactive']; ?> inactive
            (<?php echo $count['hidden']?> hidden)
          </td>
          <td>
            <span><a href="?upCategory=<?php echo $category->id . '#'.$formTarget; ?>" title="Move up"><?php echo image_tag('/sfCmsPlugin/images/up.png'); ?></a></span>
            <span><a href="?downCategory=<?php echo $category->id . '#'.$formTarget; ?>" title="Move down"><?php echo image_tag('/sfCmsPlugin/images/down.png'); ?></a></span>
          </td>
          <td>&nbsp;<?php if ($category->is_active) : ?><img alt="Checked" title="Checked" src="/sfCmsPlugin/images/tick.png"><?php endif; ?></td>
          <td>
            <span style="background: url(/sfDoctrinePlugin/images/edit.png) no-repeat 0px 0px; padding-left: 20px;"><a href="?editCategory=<?php echo $category->id . '#'.$formTarget; ?>">Edit</a></span>
            <?php if (0 == $total) : ?><span style="background: url(/sfDoctrinePlugin/images/delete.png) no-repeat 0px 0px; padding-left: 20px;"><a href="?deleteCategory=<?php echo $category->id . '#'.$formTarget; ?>" class="delete_cat">Delete</a></span><?php endif; ?>
          </td>
        </tr>
      <?php endforeach; ?>
    </tbody>
  </table>
  
  <p><em>*</em> Only categories with no items can be deleted / Only active categories can be assigned to items (and only ones with items are available on the frontend).</p>
  
  <?php $content = get_slot('cms_js');  ?>
  <?php slot('cms_js');
    if (sfConfig::get('app_site_use_slots', false)) echo $content; // If using slot, combine them ?>
    
    <script type="text/javascript">
      $(document).addEvent('domready', function () <commit_msg>Fixes #43 - merged pull request<commit_after><?php if ($sf_user->hasFlash('notice')): ?>
  <div class="notice"><?php echo $sf_user->getFlash('notice'); ?></div>
<?php endif; ?>

<?php if (0 < count($currentCategories)) : ?>
  <h2>Current categories</h2>
  <table>
    <thead>
      <tr>
        <th>Title</th>
        <th># items</th>
        <th>Move</th>
        <th>Is active</th>
        <th>Actions</th>
      </tr>
    </thead>
    <tbody>
      <?php foreach ($currentCategories as $category) :
        $count = $category->getItemCount();
        $total = $count['active'] + $count['inactive']; ?>
        <tr>
          <td><?php echo $category->getTitle(); ?></td>
          <td>
            <?php echo $count['active']; ?> active / <?php echo $count['inactive']; ?> inactive
            (<?php echo $count['hidden']?> hidden)
          </td>
          <td>
            <span><a href="?upCategory=<?php echo $category->id . '#'.$formTarget; ?>" title="Move up"><?php echo image_tag('/sfCmsPlugin/images/up.png'); ?></a></span>
            <span><a href="?downCategory=<?php echo $category->id . '#'.$formTarget; ?>" title="Move down"><?php echo image_tag('/sfCmsPlugin/images/down.png'); ?></a></span>
          </td>
          <td>&nbsp;<?php if ($category->is_active) : ?><img alt="Checked" title="Checked" src="/sfCmsPlugin/images/tick.png"><?php endif; ?></td>
          <td>
            <span style="background: url(/sfDoctrinePlugin/images/edit.png) no-repeat 0px 0px; padding-left: 20px;"><a href="?editCategory=<?php echo $category->id . '#'.$formTarget; ?>">Edit</a></span>
            <?php if (0 == $total) : ?><span style="background: url(/sfDoctrinePlugin/images/delete.png) no-repeat 0px 0px; padding-left: 20px;"><a href="?deleteCategory=<?php echo $category->id . '#'.$formTarget; ?>" class="delete_cat">Delete</a></span><?php endif; ?>
          </td>
        </tr>
      <?php endforeach; ?>
    </tbody>
  </table>
  
  <p><em>*</em> Only categories with no items can be deleted / Only active categories can be assigned to items (and only ones with items are available on the frontend).</p>
  
  <?php $content = get_slot('cms_js');  ?>
    <?php slot('cms_js');
    if (sfConfig::get('app_site_use_slots', false)) echo $content; // If using slot, combine them ?>
    
    <script type="text/javascript">
      $(document).addEvent('domready', function () 
{'fraction_non_alphanumeric': 0.21314237573715247, 'fraction_numerical': 0.005475989890480202, 'mean_word_length': 3.034834324553951, 'pattern_counts': {'":': 0, '<': 161, '<?xml version=': 0, '>': 177, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4817503', 'n_tokens_mistral': 1546, 'n_tokens_neox': 1534, 'n_words': 350}