$Form->checkbox('dtyp_searcheng', $dtyp_searcheng, T_('Search engines'));
    $Form->checkbox('dtyp_aggregator', $dtyp_aggregator, T_('Feed aggregators'));
    $Form->checkbox('dtyp_email', $dtyp_email, T_('Email domains'));
    $Form->checkbox('dtyp_unknown', $dtyp_unknown, T_('Unknown'));
}
if (get_param('ctrl') == 'antispam') {
    // Set url when we view this page from antispam controller
    $current_url = $admin_url . '?ctrl=antispam&tab3=domains';
} else {
    // Default url for stats controller
    $current_url = $admin_url . '?ctrl=stats&tab=domains&tab3=' . $tab3 . '&blog=' . $blog;
}
$Results->filter_area = array('callback' => 'filter_basedomains', 'url_ignore' => 'results_refdom_page,dtyp_normal,dtyp_searcheng,dtyp_aggregator,dtyp_unknown', 'presets' => array('browser' => array(T_('Regular'), $current_url . '&dtyp_normal=1'), 'robot' => array(T_('Search engines'), $current_url . '&dtyp_searcheng=1'), 'rss' => array(T_('Aggregators'), $current_url . '&dtyp_aggregator=1'), 'email' => array(T_('Email'), $current_url . '&dtyp_email=1'), 'unknown' => array(T_('Unknown'), $current_url . '&dtyp_unknown=1'), 'all' => array(T_('All'), $current_url)));
$Results->title = $page_title . get_manual_link('referring-domains-tab');
$Results->cols[] = array('th' => T_('Domain name'), 'order' => 'dom_name', 'td' => '$dom_name$', 'total' => '<strong>' . T_('Global total') . '</strong>');
$Results->cols[] = array('th' => T_('Type'), 'order' => 'dom_type', 'td_class' => 'dom_type_edit', 'td' => $current_User->check_perm('stats', 'edit') ? '<a href="#" rel="$dom_type$">%stats_dom_type_title( #dom_type# )%</a>' : '%stats_dom_type_title( #dom_type# )%', 'total' => '');
$Results->cols[] = array('th' => T_('Status'), 'order' => 'dom_status', 'td_class' => 'dom_status_edit', 'td' => $current_User->check_perm('stats', 'edit') ? '<a href="#" rel="$dom_status$">%stats_dom_status_title( #dom_status# )%</a>' : '%stats_dom_status_title( #dom_status# )%', 'total' => '', 'extra' => array('style' => 'background-color: %stats_dom_status_color( "#dom_status#" )%;', 'format_to_output' => false));
if ($tab3 == 'top') {
    // Display the hit counts
    $Results->cols[] = array('th' => T_('Hit count'), 'order' => 'hit_count', 'td_class' => 'right', 'total_class' => 'right', 'td' => '$hit_count$', 'total' => $total_hit_count);
    $Results->cols[] = array('th' => T_('Hit %'), 'order' => 'hit_count', 'td_class' => 'right', 'total_class' => 'right', 'td' => '%percentage( #hit_count#, ' . $total_hit_count . ' )%', 'total' => '%percentage( 100, 100 )%');
}
// Display results:
$Results->display();
if ($current_User->check_perm('stats', 'edit')) {
    // Check permission to edit Domains:
    // Print JS to edit a domain type
    echo_editable_column_js(array('column_selector' => '.dom_type_edit', 'ajax_url' => get_secure_htsrv_url() . 'async.php?action=dom_type_edit&' . url_crumb('domtype'), 'options' => stats_dom_type_titles(true), 'new_field_name' => 'new_dom_type', 'ID_value' => 'jQuery( ":first", jQuery( this ).parent() ).text()', 'ID_name' => 'dom_name'));
    // Print JS to edit a domain status
    echo_editable_column_js(array('column_selector' => '.dom_status_edit', 'ajax_url' => get_secure_htsrv_url() . 'async.php?action=dom_status_edit&' . url_crumb('domstatus'), 'options' => stats_dom_status_titles(true), 'new_field_name' => 'new_dom_status', 'ID_value' => 'jQuery( ":first", jQuery( this ).parent() ).text()', 'ID_name' => 'dom_name', 'colored_cells' => true));
}
 * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
 * See also {@link https://github.com/b2evolution/b2evolution}.
 *
 * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
 *
 * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}.
 * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $edited_Domain;
// Determine if we are creating or updating...
global $action;
$creating = $action == 'domain_new';
$Form = new Form(NULL, 'domain_checkchanges', 'post', 'compact');
$Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action,domain_ID'));
$Form->begin_form('fform', $creating ? T_('New Domain') : T_('Domain'));
$Form->add_crumb('domain');
$Form->hidden('action', 'domain_update');
$Form->hidden('dom_ID', $edited_Domain->ID);
$Form->hidden_ctrl();
$Form->hidden('tab', get_param('tab'));
$Form->hidden('tab_from', get_param('tab_from'));
$Form->hidden('tab3', get_param('tab3'));
$Form->text_input('dom_name', $edited_Domain->get('name'), 50, T_('Name'), '', array('maxlength' => 250, 'required' => true));
$Form->select_input_array('dom_type', $edited_Domain->get('type'), stats_dom_type_titles(), T_('Referrer type'), '', array('force_keys_as_values' => true, 'required' => true));
$Form->select_input_array('dom_status', $edited_Domain->get('status'), stats_dom_status_titles(), T_('Spam status'), '', array('force_keys_as_values' => true, 'background_color' => stats_dom_status_colors(), 'required' => true));
$Form->end_form(array(array('submit', 'submit', $creating ? T_('Record') : T_('Save Changes!'), 'SaveButton')));
示例#3
0
/**
 * Get domain type title by value
 *
 * @param string Domain type value
 * @param boolean TRUE to escape quotes in titles
 * @return string Domain type title
 */
function stats_dom_type_title($dom_type, $escape_quotes = false)
{
    $dom_type_titles = stats_dom_type_titles($escape_quotes);
    return isset($dom_type_titles[$dom_type]) ? $dom_type_titles[$dom_type] : $dom_type;
}