<commit_before><?php
/**
* @version      $Id: helpers.php 506 2008-10-04 14:40:02Z mathias $
* @category     Koowa
* @package      Koowa_Template
* @subpackage   Filter
* @copyright    Copyright (C) 2007 - 2010 <NAME>. All rights reserved.
* @license      GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link         http://www.nooku.org
*/

/**
 * Template read filter for aliases such as @template, @text, @helper, @route etc
 *
 * @author      <NAME> <<EMAIL>>
 * @category    Koowa
 * @package     Koowa_Template
 * @subpackage  Filter
 */
class KTemplateFilterAlias extends KTemplateFilterAbstract implements KTemplateFilterRead, KTemplateFilterWrite
{
    /**
     * The alias read map
     *
     * @var array
     */
    protected $_alias_read = array(
        '@helper('      => '$this->loadHelper(',
        '@date('        => '$this->loadHelper(\'date.format\',',
        '@overlay('     => '$this->loadHelper(\'behavior.overlay\', ',
        '@text('        => 'JText::_(',
        '@template('    => '$this->loadIdentifier(',
        '@route('       => '$this->getView()->createRoute(',
        '@escape('      => '$this->getView()->escape(',
    );
    
    /**
     * The alias write map
     *
     * @var array
     */
    protected $_alias_write = array();
    
    /**
     * Initializes the options for the object
     *
     * Called from {@link __construct()} as a first step of object instantiation.
     *
     * @param   object  An optional KConfig object with configuration options
     * @return void
     */
    protected function _initialize(KConfig $config)
    {
        $config->append(array(
            'priority'   => KCommand::PRIORITY_HIGH,
        ));

        parent::_initialize($config);
    }
    
    /**
     * Append an alias 
     *
     * @param array     An array of aliases to be appended
     * @return KTemplateFilterAlias
     */
    public function append(array $alias, $mode = KTemplateFilter::MODE_READ)
    {
        if($mode & KTemplateFilter::MODE_READ) {
            $this->_alias_read = array_merge($this->_alias_read, $alias); 
        }
        
        if($mode & KTemplateFilter::MODE_WRITE) {<commit_msg>- Renamed KTemplate::loadHelper to renderHelper. - Changed priority of alias template filter to normal instead of high.<commit_after><?php
/**
* @version      $Id: helpers.php 506 2008-10-04 14:40:02Z mathias $
* @category     Koowa
* @package      Koowa_Template
* @subpackage   Filter
* @copyright    Copyright (C) 2007 - 2010 <NAME>. All rights reserved.
* @license      GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link         http://www.nooku.org
*/

/**
 * Template read filter for aliases such as @template, @text, @helper, @route etc
 *
 * @author      <NAME> <<EMAIL>>
 * @category    Koowa
 * @package     Koowa_Template
 * @subpackage  Filter
 */
class KTemplateFilterAlias extends KTemplateFilterAbstract implements KTemplateFilterRead, KTemplateFilterWrite
{
    /**
     * The alias read map
     *
     * @var array
     */
    protected $_alias_read = array(
        '@helper('      => '$this->renderHelper(',
        '@date('        => '$this->renderHelper(\'date.format\',',
        '@overlay('     => '$this->renderHelper(\'behavior.overlay\', ',
        '@text('        => 'JText::_(',
        '@template('    => '$this->loadIdentifier(',
        '@route('       => '$this->getView()->createRoute(',
        '@escape('      => '$this->getView()->escape(',
    );
    
    /**
     * The alias write map
     *
     * @var array
     */
    protected $_alias_write = array();
     
    /**
     * Append an alias 
     *
     * @param array     An array of aliases to be appended
     * @return KTemplateFilterAlias
     */
    public function append(array $alias, $mode = KTemplateFilter::MODE_READ)
    {
        if($mode & KTemplateFilter::MODE_READ) {
            $this->_alias_read = array_merge($this->_alias_read, $alias); 
        }
        
        if($mode & KTemplateFilter::MODE_WRITE) {
{'fraction_non_alphanumeric': 0.14728682170542637, 'fraction_numerical': 0.013003250812703177, 'mean_word_length': 2.316749585406302, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '5517943', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1189, 'n_words': 283}