<commit_before><?php
/**
* @version      $Id$
* @category		Nooku
* @package		Nooku Components
* @subpackage	Logs
* @copyright    Copyright (C) 2007 - 2011 <NAME>. All rights reserved.
* @license      GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
*/

/**
 * Delete button class for a toolbar
 *
 * @author      <NAME> <<EMAIL>>
 * @category	Nooku
 * @package    	Nooku_Components
 * @subpackage 	Logs
 */
class ComLogsToolbarButtonDelete extends ComDefaultToolbarButtonDefault
{
    public function getOnClick()
    {
        $url  = KRequest::url();
        $query = $url->getQuery(true);
        $query['option'] = 'com_logs';
        $url->setQuery($query);

        $json = "{method:'post', url:'$url&'+id, params:{action:'delete', '$this->_token_name':'$this->_token_value'}}";

        $msg    = JText::_('Please select an item from the list');
        return 'var id = Koowa.Grid.getIdQuery();'
            .'if(id){new Koowa.Form('.$json.').submit();} '
            .'else { alert(\''.$msg.'\'); return false; }';
    }
}<commit_msg>re #15 - Refactored the toolbar delete button to adjust with the new toolbar refactoring from Nooku Framework.<commit_after><?php
/**
* @version      $Id$
* @category		Nooku
* @package		Nooku Components
* @subpackage	Logs
* @copyright    Copyright (C) 2007 - 2011 <NAME>. All rights reserved.
* @license      GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
*/

/**
 * Delete button class for a toolbar
 *
 * @author      <NAME> <<EMAIL>>
 * @category	Nooku
 * @package    	Nooku_Components
 * @subpackage 	Logs
 */
class ComLogsToolbarButtonDelete extends ComDefaultToolbarButtonDefault
{
    
    public function getOnClick()
	{
		return "$$('.-koowa-grid').each(function(form){
            form.addEvent('before.delete', function(e){
                this.options.url = 'index.php?option=com_logs&view=log';
            });
        });";
	}
}
{'fraction_non_alphanumeric': 0.16110227874933758, 'fraction_numerical': 0.010598834128245893, 'mean_word_length': 2.966386554621849, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3020109', 'n_tokens_mistral': 640, 'n_tokens_neox': 617, 'n_words': 142}