<div class="nodesSort">
<?php $this->_e('Sort by ');$this->HTML->selectToRemote('sortby', $widget_requested_sortby, 'plugg-admin', array('order,ASC' => $this->_('Order, ascending'), 'order,DESC' => $this->_('Order, descending'), 'active,ASC' => $this->_('Active, ascending'), 'active,DESC' => $this->_('Active, descending')), array('path' => '/widget/list'), $this->_('Go'), array('params' => array(Plugg::REGION => 'plugg_admin')));?>
</div>
<?php $this->HTML->formTag('post', array('path' => '/widget/submit', 'params' => array('sortby' => $widget_requested_sortby, 'page' => $widget_page_requested)), array('id' => 'plugg-admin-form'));?>
  <table class="horizontal">
    <thead>
      <tr>
        <th><?php $this->_e('Name');?></th>
        <th><?php $this->_e('Plugin');?></th>
        <th><?php $this->_e('Private');?></th>
        <th><?php $this->_e('Active');?></th>
        <th><?php $this->_e('Order');?></th>
        <th><?php $this->_e('Mini');?></th> 
      </tr>
    </thead>
    <tfoot>
      <tr>
        <td class="right" colspan="3">
          <input type="submit" value="<?php $this->_e('Update');?>" />
        </td>
        <td class="right" colspan="3"><?php $this->PageNavRemote->write('plugg-admin', $widget_pages, $widget_page_requested, array('path' => '/widget/list', 'params' => array('sortby' => $widget_requested_sortby)), array('params' => array(Plugg::REGION => 'plugg_admin')));?></td>
      </tr>
    </tfoot>
    <tbody>
<?php if ($widgets->count() > 0):?>
<?php   foreach ($widgets as $widget):?>
<?php     $widget_id = $widget->getId(); if (!isset($widget_names[$widget->plugin][$widget->name])) continue;?>
      <tr>
        <td><?php _h($widget_names[$widget->plugin][$widget->name]['nicename']);?> <small>(<?php _h($widget->name);?>)</small></td>
        <td><?php _h($widget_names[$widget->plugin][$widget->name]['plugin_nicename']);?> <small>(<?php _h($widget->plugin);?>)</small></td>
        <td>
<?php     if ($widget->isType(Plugg_User_Plugin::WIDGET_TYPE_PUBLIC)):?>
          <input type="checkbox" name="widgets[<?php echo $widget_id;?>][private]" value="1" <?php if ($widget->private):?>checked="checked"<?php endif;?>" />
<?php     else:?>
          <input type="checkbox" <?php if ($widget->private):?>checked="checked"<?php endif;?>" disabled="disabled" />
<?php     endif;?>
        </td>
        <td><input type="checkbox" name="widgets[<?php echo $widget_id;?>][active]" value="1" <?php if ($widget->active):?>checked="checked"<?php endif;?> /></td>
        <td><input type="text" name="widgets[<?php echo $widget_id;?>][order]" value="<?php echo $widget->order;?>" size="4" /></td>
        <td>
<?php     if (!$widget->isType(Plugg_User_Plugin::WIDGET_TYPE_MINI)):?>
          <input type="checkbox" name="widgets[<?php echo $widget_id;?>][mini]" value="1" <?php if ($widget->mini):?>checked="checked"<?php endif;?> />
<?php     else:?>
          <input type="checkbox" <?php if ($widget->mini):?>checked="checked"<?php endif;?> disabled="disabled" />
<?php     endif; ?>
        </td>
      </tr>
<?php   endforeach;?>
<?php else:?>
      <tr><td colspan="6"></td></tr>
<?php endif;?>
    </tbody>
  </table>
<input type="hidden" name="_TOKEN" value="<?php $this->Token->write('user_admin_widget_submit');?>" />
<?php $this->HTML->formTagEnd();?>