<commit_before>[?php

require_once(dirname(__FILE__).'/../lib/Base<?php echo ucfirst($this->moduleName) ?>GeneratorConfiguration.class.php');
require_once(dirname(__FILE__).'/../lib/Base<?php echo ucfirst($this->moduleName) ?>GeneratorHelper.class.php');

/**
 * <?php echo $this->getModuleName() ?> actions.
 *
 * @package    ##PROJECT_NAME##
 * @subpackage <?php echo $this->getModuleName()."\n" ?>
 * @author     ##AUTHOR_NAME##
 */
abstract class <?php echo $this->getGeneratedModuleName() ?>Actions extends <?php echo $this->getActionsBaseClass()."\n" ?>
{
  public function preExecute()
  {
    $this->configuration = new <?php echo $this->getModuleName() ?>GeneratorConfiguration();

    if (!$this->getUser()->hasCredential($this->configuration->getCredentials($this->getActionName())))
    {
      $this->forward(sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
    }

    $this->dispatcher->notify(new sfEvent($this, 'admin.pre_execute', array('configuration' => $this->configuration)));

    $this->helper = new <?php echo $this->getModuleName() ?>GeneratorHelper();

    $route_options = $this->getRoute()->getOptions();
    $skip = array('new', 'create', 'edit', 'update');
    if ($route_options['type'] == 'object' && !in_array($this->getActionName(), $skip))
    {
      $method = sfInflector::camelize('can_'.$this->getActionName());
      if (method_exists($this->getRoute()->getObject(), $method) && !call_user_func(array($this->getRoute()->getObject(), $method)))
      {
        $verb = strtolower(sfInflector::humanize($this->getActionName()));
        $verb .= (substr($verb, -1) == 'e') ? 'd' : 'ed';
        $this->getUser()->setFlash('error', "The item cannot be $verb.");
        $this->redirect('@<?php echo $this->getUrlForAction('list') ?>');
      }
    }
  }

<?php include dirname(__FILE__).'/../../parts/actions/indexAction.php' ?>

<?php if ($this->configuration->hasFilterForm()): ?>
<?php include dirname(__FILE__).'/../../parts/actions/filterAction.php' ?>
<?php endif; ?>

<?php include dirname(__FILE__).'/../../parts/actions/newAction.php' ?>

<?php include dirname(__FILE__).'/../../parts/actions/createAction.php' ?>

<?php include dirname(__FILE__).'/../../parts/actions/editAction.php' ?>

<?php include dirname(__FILE__).'/../../parts/actions/updateAction.php' ?>

<?php include dirname(__FILE__).'/../../parts/actions/deleteAction.php' ?><commit_msg>bugfix: now works add a custom action<commit_after>[?php

require_once(dirname(__FILE__).'/../lib/Base<?php echo ucfirst($this->moduleName) ?>GeneratorConfiguration.class.php');
require_once(dirname(__FILE__).'/../lib/Base<?php echo ucfirst($this->moduleName) ?>GeneratorHelper.class.php');

/**
 * <?php echo $this->getModuleName() ?> actions.
 *
 * @package    ##PROJECT_NAME##
 * @subpackage <?php echo $this->getModuleName()."\n" ?>
 * @author     ##AUTHOR_NAME##
 */
abstract class <?php echo $this->getGeneratedModuleName() ?>Actions extends <?php echo $this->getActionsBaseClass()."\n" ?>
{
  public function preExecute()
  {
    $this->configuration = new <?php echo $this->getModuleName() ?>GeneratorConfiguration();

    if (!$this->getUser()->hasCredential($this->configuration->getCredentials($this->getActionName())))
    {
      $this->forward(sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
    }

    $this->dispatcher->notify(new sfEvent($this, 'admin.pre_execute', array('configuration' => $this->configuration)));

    $this->helper = new <?php echo $this->getModuleName() ?>GeneratorHelper();

    $route_options = $this->getRoute()->getOptions();
    $skip = array('new', 'create', 'edit', 'update');
    if (isset($route_options['type']) && $route_options['type'] == 'object' && !in_array($this->getActionName(), $skip))
    {
      $method = sfInflector::camelize('can_'.$this->getActionName());
      if (method_exists($this->getRoute()->getObject(), $method) && !call_user_func(array($this->getRoute()->getObject(), $method)))
      {
        $verb = strtolower(sfInflector::humanize($this->getActionName()));
        $verb .= (substr($verb, -1) == 'e') ? 'd' : 'ed';
        $this->getUser()->setFlash('error', "The item cannot be $verb.");
        $this->redirect('@<?php echo $this->getUrlForAction('list') ?>');
      }
    }
  }

<?php include dirname(__FILE__).'/../../parts/actions/indexAction.php' ?>

<?php if ($this->configuration->hasFilterForm()): ?>
<?php include dirname(__FILE__).'/../../parts/actions/filterAction.php' ?>
<?php endif; ?>

<?php include dirname(__FILE__).'/../../parts/actions/newAction.php' ?>

<?php include dirname(__FILE__).'/../../parts/actions/createAction.php' ?>

<?php include dirname(__FILE__).'/../../parts/actions/editAction.php' ?>

<?php include dirname(__FILE__).'/../../parts/actions/updateAction.php' ?>

<?php include dirname(__FILE__).'/../../parts/actions/deleteAction.php' ?>
{'fraction_non_alphanumeric': 0.22798774259448418, 'fraction_numerical': 0.00040858018386108274, 'mean_word_length': 4.557321225879682, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 109, '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': '3751903', 'n_tokens_mistral': 1535, 'n_tokens_neox': 1508, 'n_words': 243}