<commit_before><?php

/**
 * Listens to template.filter_parameters to add the following variables to the view:
 *   * sf_sympal_context
 *   * sf_sympal_content
 *   * sf_sympal_menu_item
 * 
 * @package     
 * @subpackage  
 * @author      <NAME> <<EMAIL>>
 * @since       2010-03-27
 * @version     svn:$Id$ $Author$
 */
class sfSympalTemplateFilterParametersListener extends sfSympalListener
{
  public function getEventName()
  {
    return 'template.filter_parameters';
  }

  /**
   * @TODO How does this compare with the variables passed to the view
   * via sfSympalContentRenderer. This seems more all-encompassing, but
   * still possibly redundant.
   */
  public function run(sfEvent $event, $parameters)
  {
    $sympalContext = $this->_invoker;

    $parameters['sf_sympal_context'] = $sympalContext;
    
    $parameters['sf_sympal_site'] = $sympalContext->getService('site_manager')->getSite();

    if ($content = $sympalContext->getService('site_manager')->getCurrentContent())
    {
      $parameters['sf_sympal_content'] = $content;
    }

    if ($menuItem = $sympalContext->getService('menu_manager'))
    {
      $parameters['sf_sympal_menu_item'] = $menuItem;
    }

    return $parameters;
  }
}<commit_msg>[1.0][sfSympalPlugin] Fixing bad variable name for the menu manager.<commit_after><?php

/**
 * Listens to template.filter_parameters to add the following variables to the view:
 *   * sf_sympal_context
 *   * sf_sympal_content
 *   * sf_sympal_menu_item
 * 
 * @package     
 * @subpackage  
 * @author      <NAME> <<EMAIL>>
 * @since       2010-03-27
 * @version     svn:$Id$ $Author$
 */
class sfSympalTemplateFilterParametersListener extends sfSympalListener
{
  public function getEventName()
  {
    return 'template.filter_parameters';
  }

  /**
   * @TODO How does this compare with the variables passed to the view
   * via sfSympalContentRenderer. This seems more all-encompassing, but
   * still possibly redundant.
   */
  public function run(sfEvent $event, $parameters)
  {
    $sympalContext = $this->_invoker;

    $parameters['sf_sympal_context'] = $sympalContext;
    
    $parameters['sf_sympal_site'] = $sympalContext->getService('site_manager')->getSite();

    if ($content = $sympalContext->getService('site_manager')->getCurrentContent())
    {
      $parameters['sf_sympal_content'] = $content;
    }

    if ($menuItem = $sympalContext->getService('menu_manager'))
    {
      $parameters['sf_sympal_menu_manager'] = $menuItem;
    }

    return $parameters;
  }
}
{'fraction_non_alphanumeric': 0.12361331220285261, 'fraction_numerical': 0.0071315372424722665, 'mean_word_length': 3.6672828096118297, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, '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': '7058038', 'n_tokens_mistral': 805, 'n_tokens_neox': 778, 'n_words': 166}