<commit_before><?php
/**
 * Button helpers
 * Provide shortcuts to buttons for nav and nav4lists
 *
 * @version $Id: ButtonHelper.php 2531 2007-12-19 15:32:44Z alex $
 */
  
function button_create($module)
{
    return link_to(__("Create new $module"),
                   "@document_edit?module=$module&id=&lang=",
                   array('title' => __("Create new $module"),
                         'class' => 'action_create nav_edit'));
}

function button_changes($module)
{
    return link_to(__('Recent changes'),
                   "@module_whatsnew?module=$module",
                   array('title' => __('View latest changes for this kind of documents'),
                         'class' => 'action_list nav_edit'));
}

function button_rss($module, $lang, $id=null, $mode=null)
{
    if ($id)
    {
        return link_to(__('RSS feed'),
                       "@document_feed?module=$module&id=$id&lang=$lang",
                       array('title' => __('Subscribe to this document-s latest editions'),
                             'class' => 'action_rss nav_edit'));
    }
    else
    {
        switch ($mode)
        {      
            case 'creations':
                return link_to(__('RSS feed creations'),
                               "@creations_feed?module=$module&lang=$lang",
                               array('title' => __("Subscribe to latest $module creations"),
                                     'class' => 'action_rss_new nav_edit'));
        
            default:
                return link_to(__('RSS feed'),
                               "@feed?module=$module&lang=$lang",
                               array('title' => __("Subscribe to latest $module editions"),
                                     'class' => 'action_rss nav_edit'));
        }
    }
}

function get_rsslist_path($module)
{
    $request = sfContext::getInstance()->getRequest();
    $path = $request->getPathInfo();
    if (substr($path, 1) == $module)
    {
        $path .= '/rss';
    }
    else
    {
        $path = str_replace('list', 'rss', $path);
    }
    return $request->getUriPrefix() . $path;
}

function button_rsslist($module)
{
    return link_to(__('RSS list'), get_rsslist_path($module),
                   array('title' => __('Get current list in RSS format'),
                         'class' => 'action_rss nav_edit'));
}

function button_search($module)
{
    return link_to(__('Search'),
                   "@filter?module=$module",
                   array('title' => __("Search a $module"), 'class' => 'action_query nav_edit'));
}

function button_delete($module, $id)
{
    return link_to(__('Delete'),
                   "@doc_delete?module=$module&id=$id",
                   array('title' => __('Delete this document'),
                         'class' => 'action_delete nav_edit',
                         'post' => true,
                         'confirm' => __('Are you sure you want to delete this document in every language?')));
}

function button_delete_culture($module, $id, $culture)
{
    return link_to(__('Delete culture'),
                   "@culture_delete?module=$module&id=$id&lang=$culture",
                   array('title' => __('Delete this document culture'),
                         'class' => 'action_delete nav_edit',
                         'post' => true,
                         'confirm' => __('Are you sure you want to delete this document in '.$culture)));
}

function button_delete_geom($module, $id)
{
    return link_to(__('Delete geometry'),
                   "@geom_delete?module=$module&id=$id",
                   array('title' => __('Delete this documents geometry'),
                         'class' => 'action_delete nav_edit',
                         'post' => true,
                         'confirm' => __('Are you sure you want to delete this documents geometry?')));
}

function button_clear_cache($module, $id)
{
    return link_to(__('Clear document cache (short)'),
                   "@cache_clear?module=$module&id=$id",
                   array('title' => __('Clear document cache'),
                         'class' => 'action_delete nav_edit',
                         'post' => true));
}

function button_refresh_geo_associations($module, $id)
{
    return link_to(__('Refresh geoassociations'),
                   "@doc_geoass_refresh?module=$module&id=$id",
                   array('title' => __('Refresh the geoassociations of this document'),
                         'class' => 'picto_maps nav_edit',
                         'post' => true));
}

function button_merge($module, $id) 
{<commit_msg>change picto for cache clearing<commit_after><?php
/**
 * Button helpers
 * Provide shortcuts to buttons for nav and nav4lists
 *
 * @version $Id: ButtonHelper.php 2531 2007-12-19 15:32:44Z alex $
 */
  
function button_create($module)
{
    return link_to(__("Create new $module"),
                   "@document_edit?module=$module&id=&lang=",
                   array('title' => __("Create new $module"),
                         'class' => 'action_create nav_edit'));
}

function button_changes($module)
{
    return link_to(__('Recent changes'),
                   "@module_whatsnew?module=$module",
                   array('title' => __('View latest changes for this kind of documents'),
                         'class' => 'action_list nav_edit'));
}

function button_rss($module, $lang, $id=null, $mode=null)
{
    if ($id)
    {
        return link_to(__('RSS feed'),
                       "@document_feed?module=$module&id=$id&lang=$lang",
                       array('title' => __('Subscribe to this document-s latest editions'),
                             'class' => 'action_rss nav_edit'));
    }
    else
    {
        switch ($mode)
        {      
            case 'creations':
                return link_to(__('RSS feed creations'),
                               "@creations_feed?module=$module&lang=$lang",
                               array('title' => __("Subscribe to latest $module creations"),
                                     'class' => 'action_rss_new nav_edit'));
        
            default:
                return link_to(__('RSS feed'),
                               "@feed?module=$module&lang=$lang",
                               array('title' => __("Subscribe to latest $module editions"),
                                     'class' => 'action_rss nav_edit'));
        }
    }
}

function get_rsslist_path($module)
{
    $request = sfContext::getInstance()->getRequest();
    $path = $request->getPathInfo();
    if (substr($path, 1) == $module)
    {
        $path .= '/rss';
    }
    else
    {
        $path = str_replace('list', 'rss', $path);
    }
    return $request->getUriPrefix() . $path;
}

function button_rsslist($module)
{
    return link_to(__('RSS list'), get_rsslist_path($module),
                   array('title' => __('Get current list in RSS format'),
                         'class' => 'action_rss nav_edit'));
}

function button_search($module)
{
    return link_to(__('Search'),
                   "@filter?module=$module",
                   array('title' => __("Search a $module"), 'class' => 'action_query nav_edit'));
}

function button_delete($module, $id)
{
    return link_to(__('Delete'),
                   "@doc_delete?module=$module&id=$id",
                   array('title' => __('Delete this document'),
                         'class' => 'action_delete nav_edit',
                         'post' => true,
                         'confirm' => __('Are you sure you want to delete this document in every language?')));
}

function button_delete_culture($module, $id, $culture)
{
    return link_to(__('Delete culture'),
                   "@culture_delete?module=$module&id=$id&lang=$culture",
                   array('title' => __('Delete this document culture'),
                         'class' => 'action_delete nav_edit',
                         'post' => true,
                         'confirm' => __('Are you sure you want to delete this document in '.$culture)));
}

function button_delete_geom($module, $id)
{
    return link_to(__('Delete geometry'),
                   "@geom_delete?module=$module&id=$id",
                   array('title' => __('Delete this documents geometry'),
                         'class' => 'action_delete nav_edit',
                         'post' => true,
                         'confirm' => __('Are you sure you want to delete this documents geometry?')));
}

function button_clear_cache($module, $id)
{
    return link_to(__('Clear document cache (short)'),
                   "@cache_clear?module=$module&id=$id",
                   array('title' => __('Clear document cache'),
                         'class' => 'action_description nav_edit',
                         'post' => true));
}

function button_refresh_geo_associations($module, $id)
{
    return link_to(__('Refresh geoassociations'),
                   "@doc_geoass_refresh?module=$module&id=$id",
                   array('title' => __('Refresh the geoassociations of this document'),
                         'class' => 'picto_maps nav_edit',
                         'post' => true));
}

function button_merge($module, $id) 
{
{'fraction_non_alphanumeric': 0.14256310258910193, 'fraction_numerical': 0.0043332250027082655, 'mean_word_length': 1.882297845769591, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 73, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4029615', 'n_tokens_mistral': 2532, 'n_tokens_neox': 2415, 'n_words': 560}