Exemplo n.º 1
0
    if (!$current_User->check_perm('blog_item_type_' . $item_type_perm_level, 'edit', false, $Blog->ID)) {
        unset($item_type_perm_levels[$i]);
    }
}
$item_type_perm_levels[] = '-1';
// to restrict all item types if no one is allowed
$SQL->WHERE('ityp_perm_level IN ( ' . $DB->quote($item_type_perm_levels) . ' )');
// Create result set:
$Results = new Results($SQL->get(), 'editityp_');
$Results->title = T_('Change Post Type');
if ($edited_Item->ID > 0) {
    $close_url = $admin_url . '?ctrl=items&action=edit&blog=' . $Blog->ID . '&restore=1&p=' . $edited_Item->ID;
} else {
    $close_url = $admin_url . '?ctrl=items&action=new&blog=' . $Blog->ID . '&restore=1';
}
$Results->global_icon(T_('Do NOT change the type'), 'close', $close_url);
/**
 * Callback to make post type name depending on post type id
 */
function get_name_for_itemtype($ityp_ID, $name)
{
    global $admin_url, $edited_Item, $from_tab;
    $current = $edited_Item->ityp_ID == $ityp_ID ? ' ' . T_('(current)') : '';
    $from_tab_param = empty($from_tab) ? '' : '&from_tab=' . $from_tab;
    $duplicated_item_param = get_param('p') > 0 ? '&p=' . get_param('p') : '';
    return '<strong><a href="' . $admin_url . '?ctrl=items&amp;action=update_type&amp;post_ID=' . $edited_Item->ID . '&amp;ityp_ID=' . $ityp_ID . $from_tab_param . $duplicated_item_param . '&amp;' . url_crumb('item') . '">' . $name . '</a></strong>' . $current;
}
$Results->cols[] = array('th' => T_('ID'), 'order' => 'ityp_ID', 'th_class' => 'shrinkwrap', 'td_class' => '%conditional( "' . $edited_Item->ityp_ID . '" == #ityp_ID#, "info shrinkwrap", "shrinkwrap" )%', 'td' => '$ityp_ID$');
$Results->cols[] = array('th' => T_('Name'), 'order' => 'ityp_name', 'td' => '%get_name_for_itemtype( #ityp_ID#, #ityp_name# )%', 'td_class' => '%conditional( "' . $edited_Item->ityp_ID . '" == #ityp_ID#, "info", "" )%');
$Results->cols[] = array('th' => T_('Template name'), 'order' => 'ityp_template_name', 'td' => '%conditional( #ityp_template_name# == "", "", #ityp_template_name#.".*.php" )%', 'th_class' => 'shrinkwrap', 'td_class' => 'center %conditional( "' . $edited_Item->ityp_ID . '" == #ityp_ID#, " info", "" )%');
// Display results:
Exemplo n.º 2
0
    return $regions_count;
}
$Results->cols[] = array('th' => T_('Regions'), 'td_class' => 'center', 'td' => '%country_regions_count( #ctry_ID# )%', 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap');
$Results->cols[] = array('th' => T_('Default Currency'), 'td_class' => 'center', 'order' => 'curr_code', 'td' => '$curr_shortcut$ $curr_code$');
/*
 * ACTIONS TD:
 */
function ctry_td_actions($ctry_enabled, $ctry_ID)
{
    $r = '';
    $redirect_ctrl = param('ctrl', 'string', 'countries');
    if ($ctry_enabled == true) {
        $r .= action_icon(T_('Disable the country!'), 'deactivate', regenerate_url('ctrl,action', 'ctrl=countries&amp;action=disable_country&amp;ctry_ID=' . $ctry_ID . '&amp;redirect_ctrl=' . $redirect_ctrl . '&amp;' . url_crumb('country')));
    } else {
        $r .= action_icon(T_('Enable the country!'), 'activate', regenerate_url('ctrl,action', 'ctrl=countries&amp;action=enable_country&amp;ctry_ID=' . $ctry_ID . '&amp;redirect_ctrl=' . $redirect_ctrl . '&amp;' . url_crumb('country')));
    }
    $r .= action_icon(T_('Edit this country...'), 'edit', regenerate_url('ctrl,action', 'ctrl=countries&amp;ctry_ID=' . $ctry_ID . '&amp;action=edit'));
    $r .= action_icon(T_('Duplicate this country...'), 'copy', regenerate_url('ctrl,action', 'ctrl=countries&amp;ctry_ID=' . $ctry_ID . '&amp;action=new'));
    $r .= action_icon(T_('Delete this country!'), 'delete', regenerate_url('ctrl,action', 'ctrl=countries&amp;ctry_ID=' . $ctry_ID . '&amp;action=delete&amp;' . url_crumb('country')));
    return $r;
}
if ($current_User->check_perm('options', 'edit', false)) {
    $Results->cols[] = array('th' => T_('Actions'), 'td' => '%ctry_td_actions( #ctry_enabled#, #ctry_ID# )%', 'td_class' => 'shrinkwrap');
    $Results->global_icon(T_('Create a new country ...'), 'new', regenerate_url('ctrl,action', 'ctrl=countries&amp;action=new'), T_('New country') . ' &raquo;', 3, 4, array('class' => 'action_icon btn-primary'));
}
$Results->display();
if ($current_User->check_perm('options', 'edit')) {
    // Check permission to edit Country:
    // Print JS to edit a country status
    echo_editable_column_js(array('column_selector' => '.country_status_edit', 'ajax_url' => get_secure_htsrv_url() . 'async.php?action=country_status_edit&' . url_crumb('country'), 'options' => ctry_status_titles(), 'new_field_name' => 'new_status', 'ID_value' => 'jQuery( this ).attr( "id" )', 'ID_name' => 'ctry_ID', 'colored_cells' => true));
}
Exemplo n.º 3
0
{
    global $dispatcher;
    $r = '';
    if ($city_enabled == true) {
        $r .= action_icon(T_('Disable the city!'), 'deactivate', regenerate_url('action', 'action=disable_city&amp;city_ID=' . $city_ID . '&amp;' . url_crumb('city')));
    } else {
        $r .= action_icon(T_('Enable the city!'), 'activate', regenerate_url('action', 'action=enable_city&amp;city_ID=' . $city_ID . '&amp;' . url_crumb('city')));
    }
    $r .= action_icon(T_('Edit this city...'), 'edit', regenerate_url('action', 'city_ID=' . $city_ID . '&amp;action=edit'));
    $r .= action_icon(T_('Duplicate this city...'), 'copy', regenerate_url('action', 'city_ID=' . $city_ID . '&amp;action=new'));
    $r .= action_icon(T_('Delete this city!'), 'delete', regenerate_url('action', 'city_ID=' . $city_ID . '&amp;action=delete&amp;' . url_crumb('city')));
    return $r;
}
if ($current_User->check_perm('options', 'edit', false)) {
    $Results->cols[] = array('th' => T_('Actions'), 'td' => '%city_td_actions( #city_enabled#, #city_ID# )%', 'td_class' => 'shrinkwrap');
    $Results->global_icon(T_('Create a new city ...'), 'new', regenerate_url('action', 'action=new'), T_('New city') . ' &raquo;', 3, 4);
    $Results->global_icon(T_('Import cities from CSV file ...'), 'new', regenerate_url('action', 'action=csv'), T_('Import CSV') . ' &raquo;', 3, 4);
}
$Results->display();
?>
<script type="text/javascript">
jQuery( '#c' ).change( function ()
{	// Load option list with regions for seleted country
	jQuery.ajax( {
	type: 'POST',
	url: '<?php 
echo get_samedomain_htsrv_url();
?>
anon_async.php',
	data: 'action=get_regions_option_list&mode=load_subregions&ctry_id=' + jQuery( this ).val(),
	success: function( result )
Exemplo n.º 4
0
// Create result set:
$SQL = new SQL();
$SQL->SELECT('SQL_NO_CACHE ivc_ID, ivc_code, ivc_expire_ts, ivc_source, ivc_grp_ID, grp_name, grp_level');
$SQL->FROM('T_users__invitation_code');
$SQL->FROM_add('INNER JOIN T_groups ON grp_ID = ivc_grp_ID');
$count_SQL = new SQL();
$count_SQL->SELECT('SQL_NO_CACHE COUNT( ivc_ID )');
$count_SQL->FROM('T_users__invitation_code');
$Results = new Results($SQL->get(), 'ivc_', '-D', $UserSettings->get('results_per_page'), $count_SQL->get());
$Results->title = T_('Invitation codes') . get_manual_link('invitation-codes-list');
/*
 * Table icons:
 */
if ($current_User->check_perm('users', 'edit', false)) {
    // create new group link
    $Results->global_icon(T_('Create a new invitation code...'), 'new', '?ctrl=invitations&amp;action=new', T_('Add invitation code') . ' &raquo;', 3, 4, array('class' => 'action_icon btn-primary'));
}
$Results->cols[] = array('th' => T_('ID'), 'order' => 'ivc_ID', 'th_class' => 'shrinkwrap', 'td_class' => 'right', 'td' => '$ivc_ID$');
$Results->cols[] = array('th' => T_('Expires'), 'order' => 'ivc_expire_ts', 'td_class' => 'shrinkwrap', 'td' => '$ivc_expire_ts$');
$Results->cols[] = array('th' => T_('Group'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap', 'order' => 'grp_name', 'td' => '$grp_name$ ($grp_level$)');
$Results->cols[] = array('th' => T_('Code'), 'order' => 'ivc_code', 'td' => $current_User->check_perm('users', 'edit', false) ? '<a href="' . $admin_url . '?ctrl=invitations&amp;action=edit&amp;ivc_ID=$ivc_ID$"><b>$ivc_code$</b></a>' : '$ivc_code$');
$Results->cols[] = array('th' => T_('Code'), 'order' => 'ivc_code', 'td' => '<a href="' . get_secure_htsrv_url() . 'register.php?invitation=$ivc_code$">' . T_('Link') . '</a>');
$Results->cols[] = array('th' => T_('Source'), 'order' => 'ivc_source', 'td' => '$ivc_source$');
if ($current_User->check_perm('users', 'edit', false)) {
    function ivc_actions(&$row)
    {
        $r = action_icon(T_('Edit this invitation code...'), 'edit', regenerate_url('ctrl,action', 'ctrl=invitations&amp;ivc_ID=' . $row->ivc_ID . '&amp;action=edit')) . action_icon(T_('Duplicate this invitation code...'), 'copy', regenerate_url('ctrl,action', 'ctrl=invitations&amp;ivc_ID=' . $row->ivc_ID . '&amp;action=new')) . action_icon(T_('Delete this invitation code!'), 'delete', regenerate_url('ctrl,action', 'ctrl=invitations&amp;ivc_ID=' . $row->ivc_ID . '&amp;action=delete&amp;' . url_crumb('invitation')));
        return $r;
    }
    $Results->cols[] = array('th' => T_('Actions'), 'td_class' => 'shrinkwrap', 'td' => '%ivc_actions( {row} )%');
}
Exemplo n.º 5
0
 * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
 *
 * @license http://b2evolution.net/about/license.html GNU General Public License (GPL)
 *
 * @package admin
 *
 * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
 * @author efy-asimo: Attila Simo.
 *
 * @version $Id: _broken_posts.view.php 3328 2013-03-26 11:44:11Z yura $
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
$SQL = new SQL();
$SQL->SELECT('post_ID, post_title, post_main_cat_ID, post_canonical_slug_ID');
$SQL->FROM('T_items__item');
$SQL->WHERE('post_main_cat_ID NOT IN (SELECT cat_ID FROM T_categories )');
$Results = new Results($SQL->get(), 'broken_posts_');
$Results->title = T_('Broken items with no matching category');
$Results->global_icon(T_('Cancel!'), 'close', regenerate_url('action'));
$Results->cols[] = array('th' => T_('Item ID'), 'th_class' => 'shrinkwrap', 'td_class' => 'small center', 'order' => 'post_ID', 'td' => '$post_ID$');
$Results->cols[] = array('th' => T_('Title'), 'th_class' => 'nowrap', 'order' => 'post_title', 'td' => '$post_title$', 'td_class' => 'small');
$Results->cols[] = array('th' => T_('Main Cat ID'), 'th_class' => 'shrinkwrap', 'order' => 'post_main_cat_ID', 'td' => '$post_main_cat_ID$', 'td_class' => 'small center');
$Results->cols[] = array('th' => T_('Canoncical Slug ID'), 'th_class' => 'shrinkwrap', 'order' => 'post_canonical_slug_ID', 'td' => '$post_canonical_slug_ID$', 'td_class' => 'small center');
$Results->display(array('page_url' => regenerate_url('blog,ctrl,action,results_' . $Results->param_prefix . 'page', 'action=' . param_action() . '&amp;' . url_crumb('tools'))));
if ($current_User->check_perm('options', 'edit', true) && $Results->get_num_rows()) {
    // display Delete link
    $redirect_to = regenerate_url('action', 'action=del_broken_posts&' . url_crumb('tools'));
    echo '<p>[<a href="' . $redirect_to . '">' . T_('Delete these posts') . '</a>]</p>';
}
Exemplo n.º 6
0
/**
 * Display the edited items results table
 *
 * @param array Params
 */
function items_edited_results_block($params = array())
{
    // Make sure we are not missing any param:
    $params = array_merge(array('edited_User' => NULL, 'results_param_prefix' => 'actv_postedit_', 'results_title' => T_('Posts edited by the user'), 'results_no_text' => T_('User has not edited any posts')), $params);
    if (!is_logged_in()) {
        // Only logged in users can access to this function
        return;
    }
    global $current_User;
    if (!$current_User->check_perm('users', 'edit')) {
        // Check minimum permission:
        return;
    }
    $edited_User = $params['edited_User'];
    if (!$edited_User) {
        // No defined User, probably the function is calling from AJAX request
        $user_ID = param('user_ID', 'integer', 0);
        if (empty($user_ID)) {
            // Bad request, Exit here
            return;
        }
        $UserCache =& get_UserCache();
        if (($edited_User =& $UserCache->get_by_ID($user_ID, false)) === false) {
            // Bad request, Exit here
            return;
        }
    }
    global $DB;
    param('user_tab', 'string', '', true);
    param('user_ID', 'integer', 0, true);
    $edited_versions_SQL = new SQL();
    $edited_versions_SQL->SELECT('DISTINCT( iver_itm_ID )');
    $edited_versions_SQL->FROM('T_items__version');
    $edited_versions_SQL->WHERE('iver_edit_user_ID = ' . $DB->quote($edited_User->ID));
    $SQL = new SQL();
    $SQL->SELECT('*');
    $SQL->FROM('T_items__item ');
    $SQL->WHERE('( ( post_lastedit_user_ID = ' . $DB->quote($edited_User->ID) . ' ) OR ( post_ID IN ( ' . $edited_versions_SQL->get() . ' ) ) )');
    $SQL->WHERE_and('post_creator_user_ID != ' . $DB->quote($edited_User->ID));
    // Create result set:
    $edited_items_Results = new Results($SQL->get(), $params['results_param_prefix'], 'D');
    $edited_items_Results->Cache =& get_ItemCache();
    $edited_items_Results->title = $params['results_title'];
    $edited_items_Results->no_results_text = $params['results_no_text'];
    // Get a count of the post which current user can delete
    $deleted_posts_edited_count = count($edited_User->get_deleted_posts('edited'));
    if ($edited_items_Results->total_rows > 0 && $deleted_posts_edited_count > 0) {
        // Display actino icon to delete all records if at least one record exists & current user can delete at least one item created by user
        $edited_items_Results->global_icon(sprintf(T_('Delete all post edited by %s'), $edited_User->login), 'delete', '?ctrl=user&amp;user_tab=activity&amp;action=delete_all_posts_edited&amp;user_ID=' . $edited_User->ID . '&amp;' . url_crumb('user'), ' ' . T_('Delete all'), 3, 4);
    }
    // Initialize Results object
    items_results($edited_items_Results, array('field_prefix' => 'post_', 'display_ord' => false, 'display_history' => false));
    if (is_ajax_content()) {
        // init results param by template name
        if (!isset($params['skin_type']) || !isset($params['skin_name'])) {
            debug_die('Invalid ajax results request!');
        }
        $edited_items_Results->init_params_by_skin($params['skin_type'], $params['skin_name']);
    }
    $display_params = array('before' => '<div class="results" style="margin-top:25px" id="edited_posts_result">');
    $edited_items_Results->display($display_params);
    if (!is_ajax_content()) {
        // Create this hidden div to get a function name for AJAX request
        echo '<div id="' . $params['results_param_prefix'] . 'ajax_callback" style="display:none">' . __FUNCTION__ . '</div>';
    }
}
Exemplo n.º 7
0
}
$Results->cols[] = array('th' => T_('Help'), 'td_class' => 'nowrap', 'td' => '% plugin_results_td_help( {Obj} ) %');
/*
 * ACTIONS TD:
 */
function plugin_results_td_actions($Plugin)
{
    $r = '';
    if ($Plugin->status == 'enabled') {
        $r .= action_icon(T_('Disable the plugin!'), 'deactivate', 'admin.php?ctrl=plugins&amp;action=disable_plugin&amp;plugin_ID=' . $Plugin->ID);
    } elseif ($Plugin->status != 'broken') {
        $r .= action_icon(T_('Enable the plugin!'), 'activate', 'admin.php?ctrl=plugins&amp;action=enable_plugin&amp;plugin_ID=' . $Plugin->ID);
    }
    $r .= $Plugin->get_edit_settings_link();
    $r .= action_icon(T_('Un-install this plugin!'), 'delete', 'admin.php?ctrl=plugins&amp;action=uninstall&amp;plugin_ID=' . $Plugin->ID);
    return $r;
}
if ($current_User->check_perm('options', 'edit', false)) {
    $Results->cols[] = array('th' => T_('Actions'), 'td' => '% plugin_results_td_actions( {Obj} ) %', 'td_class' => 'shrinkwrap');
}
// Action icons:
if ($current_User->check_perm('options', 'edit')) {
    // Display action link to reload plugins:
    $Results->global_icon(T_('Reload events and codes for installed plugins.'), 'reload', regenerate_url('action', 'action=reload_plugins'), T_('Reload plugins'), 3, 4);
}
$Results->global_icon(T_('Install new plugin...'), 'new', regenerate_url('action', 'action=list_available'), T_('Install new'), 3, 4);
// if there happened something with a plugin_ID, apply fadeout to the row:
$highlight_fadeout = empty($edit_Plugin) || !is_object($edit_Plugin) ? array() : array('plug_ID' => array($edit_Plugin->ID));
$Results->display(NULL, $highlight_fadeout);
unset($Results);
// free memory
Exemplo n.º 8
0
$count_SQL->SELECT('SQL_NO_CACHE COUNT(emadr_ID)');
$count_SQL->FROM('T_email__address');
if (!empty($email)) {
    // Filter by email
    $email = utf8_strtolower($email);
    $SQL->WHERE_and('emadr_address LIKE ' . $DB->quote($email));
    $count_SQL->WHERE_and('emadr_address LIKE ' . $DB->quote($email));
}
if (!empty($statuses)) {
    // Filter by statuses
    $SQL->WHERE_and('emadr_status IN (' . $DB->quote($statuses) . ')');
    $count_SQL->WHERE_and('emadr_status IN (' . $DB->quote($statuses) . ')');
}
$Results = new Results($SQL->get(), 'emadr_', '---D', $UserSettings->get('results_per_page'), $count_SQL->get());
$Results->title = T_('Email addresses') . get_manual_link('email-addresses');
$Results->global_icon(T_('Create a new email address...'), 'new', $admin_url . '?ctrl=email&amp;tab=blocked&amp;action=blocked_new', T_('Add an email address') . ' &raquo;', 3, 4, array('class' => 'action_icon btn-primary'));
/**
 * Callback to add filters on top of the result set
 *
 * @param Form
 */
function filter_email_blocked(&$Form)
{
    $Form->text_input('email', get_param('email'), 40, T_('Email'));
    $statuses = emadr_get_status_titles();
    foreach ($statuses as $status_value => $status_title) {
        // Display the checkboxes to filter by status
        $Form->checkbox('statuses[]', in_array($status_value, get_param('statuses')), $status_title, '', '', $status_value);
    }
}
$Results->filter_area = array('callback' => 'filter_email_blocked', 'presets' => array('all' => array(T_('All'), $admin_url . '?ctrl=email&amp;tab=blocked&amp;statuses[]=unknown&amp;statuses[]=redemption&amp;statuses[]=warning&amp;statuses[]=suspicious1&amp;statuses[]=suspicious2&amp;statuses[]=suspicious3&amp;statuses[]=prmerror&amp;statuses[]=spammer'), 'errors' => array(T_('Errors'), $admin_url . '?ctrl=email&amp;tab=blocked&amp;statuses[]=warning&amp;statuses[]=suspicious1&amp;statuses[]=suspicious2&amp;statuses[]=suspicious3&amp;statuses[]=prmerror&amp;statuses[]=spammer'), 'attention' => array(T_('Need Attention'), $admin_url . '?ctrl=email&amp;tab=blocked&amp;statuses[]=redemption&amp;statuses[]=warning&amp;statuses[]=suspicious3')));
Exemplo n.º 9
0
    // We have permission to modify:
    function order_actions(&$row)
    {
        global $userfields_group_sides;
        $r = '';
        if (in_array($row->ufdf_ID, $userfields_group_sides['first'])) {
            // First record, no change ordering, print blank icon
            $r .= get_icon('move_down', 'noimg');
        } else {
            $r .= action_icon(T_('Move up'), 'move_up', regenerate_url('ctrl,action', 'ctrl=userfields&amp;ufdf_ID=' . $row->ufdf_ID . '&amp;action=move_up&amp;' . url_crumb('userfield')));
        }
        if (in_array($row->ufdf_ID, $userfields_group_sides['last'])) {
            // Last record, no change ordering, print blank icon
            $r .= get_icon('move_down', 'noimg');
        } else {
            $r .= action_icon(T_('Move down'), 'move_down', regenerate_url('ctrl,action', 'ctrl=userfields&amp;ufdf_ID=' . $row->ufdf_ID . '&amp;action=move_down&amp;' . url_crumb('userfield')));
        }
        return $r;
    }
    $Results->cols[] = array('th' => T_('Order'), 'td' => '%order_actions( {row} )%', 'td_class' => 'shrinkwrap');
    function fld_actions(&$row)
    {
        $r = action_icon(T_('Edit this user field...'), 'edit', regenerate_url('ctrl,action', 'ctrl=userfields&amp;ufdf_ID=' . $row->ufdf_ID . '&amp;action=edit')) . action_icon(T_('Duplicate this user field...'), 'copy', regenerate_url('ctrl,action', 'ctrl=userfields&amp;ufdf_ID=' . $row->ufdf_ID . '&amp;action=new')) . action_icon(T_('Delete this user field!'), 'delete', regenerate_url('ctrl,action', 'ctrl=userfields&amp;ufdf_ID=' . $row->ufdf_ID . '&amp;action=delete&amp;' . url_crumb('userfield')));
        return $r;
    }
    $Results->cols[] = array('th' => T_('Actions'), 'td_class' => 'shrinkwrap', 'td' => '%fld_actions( {row} )%');
    $Results->global_icon(T_('Create a new user field...'), 'new', '?ctrl=userfields&action=new', T_('New user field') . ' &raquo;', 3, 4, array('class' => 'action_icon btn-primary'));
    $Results->global_icon(T_('Create a new user field group...'), 'new', '?ctrl=userfieldsgroups&action=new', T_('New user field group') . ' &raquo;', 3, 4);
}
// Display results:
$Results->display();
Exemplo n.º 10
0
$Results->cols[] = array('th' => T_('Destination'), 'td' => '%display_link()%');
if ($current_User->check_perm('files', 'view', false, $blog)) {
    function file_actions($link_ID)
    {
        /**
         * @var File
         */
        global $current_File;
        global $LinkOwner, $current_User;
        $r = '';
        if (isset($current_File) && $current_User->check_perm('files', 'view', false, $current_File->get_FileRoot())) {
            if ($current_File->is_dir()) {
                $title = T_('Locate this directory!');
            } else {
                $title = T_('Locate this file!');
            }
            $r = $current_File->get_linkedit_link($LinkOwner->type, $LinkOwner->get_ID(), get_icon('locate', 'imgtag', array('title' => $title)), $title) . ' ';
        }
        if ($LinkOwner->check_perm('edit', false)) {
            // Check that we have permission to edit LinkOwner object:
            $r .= action_icon(T_('Delete this link!'), 'unlink', regenerate_url('ctrl,p,itm_ID,action', 'ctrl=links&amp;link_ID=' . $link_ID . '&amp;action=unlink&amp;' . url_crumb('link')));
        }
        return $r;
    }
    $Results->cols[] = array('th' => T_('Actions'), 'td_class' => 'shrinkwrap', 'td' => '%file_actions( #link_ID# )%');
}
if ($current_User->check_perm('files', 'view', false, $blog) && $LinkOwner->check_perm('edit')) {
    // Check that we have permission to edit LinkOwner object:
    $Results->global_icon(T_('Link a file...'), 'link', url_add_param($Blog->get_filemanager_link(), 'fm_mode=link_object&amp;link_type=' . $LinkOwner->type . '&amp;link_object_ID=' . $LinkOwner->get_ID()), T_('Attach files'), 3, 4);
}
$Results->display();
Exemplo n.º 11
0
    $Form->text_input('ip_address', get_param('ip_address'), 40, T_('IP address'));
}
$Results->filter_area = array('callback' => 'filter_email_blocked', 'presets' => array('all' => array(T_('All'), $admin_url . '?ctrl=antispam&amp;tab3=ipranges')));
$Results->cols[] = array('th' => T_('ID'), 'td' => '$aipr_ID$', 'order' => 'aipr_ID', 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap');
$Results->cols[] = array('th' => T_('Status'), 'td' => $current_User->check_perm('spamblacklist', 'edit') ? '<a href="#" rel="$aipr_status$">%aipr_status_title( #aipr_status# )%</a>' : '%aipr_status_title( #aipr_status# )%', 'td_class' => 'iprange_status_edit', 'order' => 'aipr_status', 'extra' => array('style' => 'background-color: %aipr_status_color( "#aipr_status#" )%;', 'format_to_output' => false));
$Results->cols[] = array('th' => T_('IP Range Start'), 'td' => $current_User->check_perm('spamblacklist', 'edit') ? '<a href="' . $admin_url . '?ctrl=antispam&amp;tab3=ipranges&amp;iprange_ID=$aipr_ID$&amp;action=iprange_edit">%int2ip( #aipr_IPv4start# )%</a>' : '%int2ip( #aipr_IPv4start# )%', 'order' => 'aipr_IPv4start');
$Results->cols[] = array('th' => T_('IP Range End'), 'td' => $current_User->check_perm('spamblacklist', 'edit') ? '<a href="' . $admin_url . '?ctrl=antispam&amp;tab3=ipranges&amp;iprange_ID=$aipr_ID$&amp;action=iprange_edit">%int2ip( #aipr_IPv4end# )%</a>' : '%int2ip( #aipr_IPv4end# )%', 'order' => 'aipr_IPv4end');
$Results->cols[] = array('th' => T_('User count'), 'td' => '$aipr_user_count$', 'order' => 'aipr_user_count');
$Results->cols[] = array('th' => T_('Block count'), 'td' => '$aipr_block_count$', 'order' => 'aipr_block_count');
// Get additional columns from the Plugins
$Plugins->trigger_event('GetAdditionalColumnsTable', array('table' => 'ipranges', 'column' => 'aipr_IPv4start', 'Results' => $Results));
if ($current_User->check_perm('spamblacklist', 'edit')) {
    // Check permission to edit IP ranges:
    $Results->cols[] = array('th' => T_('Actions'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap', 'td' => action_icon(TS_('Edit this IP range...'), 'properties', $admin_url . '?ctrl=antispam&amp;tab3=ipranges&amp;iprange_ID=$aipr_ID$&amp;action=iprange_edit') . action_icon(T_('Delete this IP range!'), 'delete', regenerate_url('iprange_ID,action', 'iprange_ID=$aipr_ID$&amp;action=iprange_delete&amp;' . url_crumb('iprange'))));
}
$Results->global_icon(T_('Add a new IP range...'), 'new', regenerate_url('action', 'action=iprange_new'), T_('New IP range') . ' &raquo;', 3, 4);
$Results->display();
if ($current_User->check_perm('spamblacklist', 'edit')) {
    // Check permission to edit IP ranges:
    ?>
<script type="text/javascript">
jQuery( document ).ready( function()
{
	jQuery( '.iprange_status_edit' ).editable( htsrv_url + 'async.php?action=iprange_status_edit&<?php 
    echo url_crumb('iprange');
    ?>
',
	{
	data : function( value, settings )
		{
			value = ajax_debug_clear( value );
Exemplo n.º 12
0
 * ACTIONS TD:
 */
function plugin_results_td_actions($Plugin)
{
    global $admin_url;
    $r = '';
    if ($Plugin->status == 'enabled') {
        $r .= action_icon(T_('Disable the plugin!'), 'deactivate', $admin_url . '?ctrl=plugins&amp;action=disable_plugin&amp;plugin_ID=' . $Plugin->ID . '&amp;' . url_crumb('plugin'));
    } elseif ($Plugin->status != 'broken') {
        $r .= action_icon(T_('Enable the plugin!'), 'activate', $admin_url . '?ctrl=plugins&amp;action=enable_plugin&amp;plugin_ID=' . $Plugin->ID . '&amp;' . url_crumb('plugin'));
    }
    $r .= $Plugin->get_edit_settings_link();
    $r .= action_icon(T_('Un-install this plugin!'), 'delete', $admin_url . '?ctrl=plugins&amp;action=uninstall&amp;plugin_ID=' . $Plugin->ID . '&amp;' . url_crumb('plugin'));
    return $r;
}
if ($current_User->check_perm('options', 'edit', false)) {
    $Results->cols[] = array('th' => T_('Actions'), 'td' => '% plugin_results_td_actions( {Obj} ) %', 'td_class' => 'shrinkwrap');
}
// Action icons:
if ($current_User->check_perm('options', 'edit')) {
    // Display action link to reload plugins:
    $Results->global_icon(T_('Reload events and codes for installed plugins.'), 'reload', regenerate_url('action', 'action=reload_plugins') . '&amp;' . url_crumb('plugin'), T_('Reload plugins'), 3, 4);
}
$Results->global_icon(T_('Install new plugin...'), 'new', regenerate_url('action', 'action=list_available'), T_('Install new'), 3, 4, array('class' => 'action_icon btn-primary'));
// if there happened something with a plugin, apply fadeout to the row:
$highlight_fadeout = empty($fadeout_id) ? array() : array('plug_ID' => array($fadeout_id));
$Results->display(NULL, $highlight_fadeout);
unset($Results);
// free memory
//Flush fadeout
$Session->delete('fadeout_id');
Exemplo n.º 13
0
/**
 * Display all blogs results table
 *
 * @param array Params
 */
function blogs_all_results_block($params = array())
{
    // Make sure we are not missing any param:
    $params = array_merge(array('results_param_prefix' => 'blog_', 'results_title' => T_('List of Collections configured on this system') . get_manual_link('site-collection-list'), 'results_no_text' => T_('No blog has been created yet!'), 'results_no_perm_text' => T_('Sorry, you have no permission to edit/view any blog\'s properties.')), $params);
    if (!is_logged_in()) {
        // Only logged in users can access to this function
        return;
    }
    global $current_User;
    if (is_ajax_content()) {
        $order_action = param('order_action', 'string');
        if ($order_action == 'update') {
            // Update an order to new value
            $new_value = (int) param('new_value', 'string', 0);
            $order_data = param('order_data', 'string');
            $order_obj_ID = (int) str_replace('order-blog-', '', $order_data);
            if ($order_obj_ID > 0) {
                // Update blog order
                $BlogCache =& get_BlogCache();
                if ($updated_Blog =& $BlogCache->get_by_ID($order_obj_ID, false)) {
                    if ($current_User->check_perm('blog_properties', 'edit', false, $updated_Blog->ID)) {
                        // Check permission to edit this Blog
                        $updated_Blog->set('order', $new_value);
                        $updated_Blog->dbupdate();
                        $BlogCache->clear();
                    }
                }
            }
        }
    }
    $SQL = new SQL();
    $SQL->SELECT('T_blogs.*, user_login');
    $SQL->FROM('T_blogs INNER JOIN T_users ON blog_owner_user_ID = user_ID');
    if (!$current_User->check_perm('blogs', 'view')) {
        // We do not have perm to view all blogs... we need to restrict to those we're a member of:
        $SQL->FROM_add('LEFT JOIN T_coll_user_perms ON (blog_advanced_perms <> 0' . ' AND blog_ID = bloguser_blog_ID' . ' AND bloguser_user_ID = ' . $current_User->ID . ' )' . ' LEFT JOIN T_coll_group_perms ON (blog_advanced_perms <> 0' . ' AND blog_ID = bloggroup_blog_ID' . ' AND bloggroup_group_ID = ' . $current_User->grp_ID . ' )');
        $SQL->WHERE('blog_owner_user_ID = ' . $current_User->ID . ' OR bloguser_ismember <> 0' . ' OR bloggroup_ismember <> 0');
        $no_results = $params['results_no_perm_text'];
    } else {
        $no_results = $params['results_no_text'];
    }
    // Create result set:
    $blogs_Results = new Results($SQL->get(), $params['results_param_prefix'], '---------A');
    $blogs_Results->Cache =& get_BlogCache();
    $blogs_Results->title = $params['results_title'];
    $blogs_Results->no_results_text = $no_results;
    if ($current_User->check_perm('blogs', 'create')) {
        global $admin_url;
        $blogs_Results->global_icon(T_('New Collection') . '...', 'new', url_add_param($admin_url, 'ctrl=collections&amp;action=new'), T_('New Collection') . '...', 3, 4, array('class' => 'action_icon btn-primary'));
    }
    // Initialize Results object
    blogs_results($blogs_Results);
    if (is_ajax_content()) {
        // init results param by template name
        if (!isset($params['skin_type']) || !isset($params['skin_name'])) {
            debug_die('Invalid ajax results request!');
        }
        $blogs_Results->init_params_by_skin($params['skin_type'], $params['skin_name']);
    }
    $blogs_Results->display(NULL, 'session');
    if (!is_ajax_content()) {
        // Create this hidden div to get a function name for AJAX request
        echo '<div id="' . $params['results_param_prefix'] . 'ajax_callback" style="display:none">' . __FUNCTION__ . '</div>';
    }
}
Exemplo n.º 14
0
/**
 * @var LinkOwner
 */
global $LinkOwner;
global $mode;
if ($mode != 'upload') {
    // If not opearting in a popup opened from post edit screen:
    $Form = new Form(NULL, 'fm_links', 'post', 'fieldset');
    $Form->begin_form('fform');
    $Form->hidden_ctrl();
    $SQL = $LinkOwner->get_SQL();
    $Results = new Results($SQL->get(), 'link_');
    $view_link_title = $LinkOwner->translate('View this xxx...');
    $Results->title = sprintf(T_('Files linked to &laquo;%s&raquo;'), '<a href="' . $LinkOwner->get_view_url() . '" title="' . $view_link_title . '">' . $LinkOwner->get('title') . '</a>');
    if ($LinkOwner->check_perm('edit', false)) {
        $Results->global_icon($LinkOwner->translate('Edit this xxx...'), 'edit', $LinkOwner->get_edit_url(), T_('Edit'));
    }
    // Close link mode and continue in File Manager (remember the Item_ID though):
    $Results->global_icon(T_('Quit link mode!'), 'close', regenerate_url('fm_mode'));
    // TYPE COLUMN:
    function file_type(&$row)
    {
        global $LinkOwner, $current_File;
        $Link = $LinkOwner->get_link_by_link_ID($row->link_ID);
        // Instantiate a File object for this line
        $current_File = $Link->get_File();
        // Return Link tag
        return $Link->get_preview_thumb();
    }
    $Results->cols[] = array('th' => T_('File'), 'order' => 'link_ID', 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap', 'td' => '%file_type( {row} )%');
    // PATH COLUMN:
Exemplo n.º 15
0
$CountSQL = new SQL();
$CountSQL->SELECT('SQL_NO_CACHE COUNT(emblk_ID)');
$CountSQL->FROM('T_email__blocked');
if (!empty($email)) {
    // Filter by email
    $SQL->WHERE_and('emblk_address LIKE ' . $DB->quote($email));
    $CountSQL->WHERE_and('emblk_address LIKE ' . $DB->quote($email));
}
if (!empty($statuses)) {
    // Filter by statuses
    $SQL->WHERE_and('emblk_status IN (' . $DB->quote($statuses) . ')');
    $CountSQL->WHERE_and('emblk_status IN (' . $DB->quote($statuses) . ')');
}
$Results = new Results($SQL->get(), 'emblk_', '---D', $UserSettings->get('results_per_page'), $CountSQL->get());
$Results->title = T_('Email addresses');
$Results->global_icon(T_('Create a new email address...'), 'new', $admin_url . '?ctrl=email&amp;tab=blocked&amp;action=blocked_new', T_('Add an email address') . ' &raquo;', 3, 4);
/**
 * Callback to add filters on top of the result set
 *
 * @param Form
 */
function filter_email_blocked(&$Form)
{
    $Form->text_input('email', get_param('email'), 40, T_('Email'));
    $statuses = emblk_get_status_titles();
    foreach ($statuses as $status_value => $status_title) {
        // Display the checkboxes to filter by status
        $Form->checkbox('statuses[]', in_array($status_value, get_param('statuses')), $status_title, '', '', $status_value);
    }
}
$Results->filter_area = array('callback' => 'filter_email_blocked', 'presets' => array('all' => array(T_('All'), $admin_url . '?ctrl=email&amp;tab=blocked&amp;statuses[]=unknown&amp;statuses[]=warning&amp;statuses[]=suspicious1&amp;statuses[]=suspicious2&amp;statuses[]=suspicious3&amp;statuses[]=prmerror&amp;statuses[]=spammer'), 'errors' => array(T_('Errors'), $admin_url . '?ctrl=email&amp;tab=blocked&amp;statuses[]=warning&amp;statuses[]=suspicious1&amp;statuses[]=suspicious2&amp;statuses[]=suspicious3&amp;statuses[]=prmerror&amp;statuses[]=spammer'), 'attention' => array(T_('Need Attention'), $admin_url . '?ctrl=email&amp;tab=blocked&amp;statuses[]=warning&amp;statuses[]=suspicious3')));
Exemplo n.º 16
0
$s = param('s', 'string', '', true);
if (!empty($s)) {
    $select_SQL->WHERE_and('CONCAT_WS( " ", u.user_login, u.user_firstname, u.user_lastname, u.user_nickname, msg_text ) LIKE "%' . $DB->escape($s) . '%"');
    $count_SQL->FROM('T_messaging__message mm LEFT OUTER JOIN T_users u ON u.user_ID = mm.msg_author_user_ID');
    $count_SQL->WHERE('mm.msg_thread_ID = ' . $edited_Thread->ID);
    $count_SQL->WHERE_and('CONCAT_WS( " ", u.user_login, u.user_firstname, u.user_lastname, u.user_nickname, msg_text ) LIKE "%' . $DB->escape($s) . '%"');
} else {
    $count_SQL->FROM('T_messaging__message');
    $count_SQL->WHERE('msg_thread_ID = ' . $edited_Thread->ID);
}
// Create result set:
$Results = new Results($select_SQL->get(), 'msg_', '', 0, $count_SQL->get());
$Results->Cache =& get_MessageCache();
$Results->title = $params['messages_list_title'];
if (is_admin_page()) {
    $Results->global_icon(T_('Cancel!'), 'close', '?ctrl=threads');
}
/**
 * Callback to add filters on top of the result set
 *
 * @param Form
 */
function filter_messages(&$Form)
{
    $Form->text('s', get_param('s'), 30, T_('Search'), '', 255);
}
$Results->filter_area = array('submit_title' => T_('Filter messages'), 'callback' => 'filter_messages', 'presets' => array('all' => array(T_('All'), get_dispctrl_url('messages', 'thrd_ID=' . $edited_Thread->ID))));
/*
 * Author col:
 */
/**
Exemplo n.º 17
0
    // We have permission to modify:
    function order_actions(&$row)
    {
        global $userfields_group_sides;
        $r = '';
        if (in_array($row->ufdf_ID, $userfields_group_sides['first'])) {
            // First record, no change ordering, print blank icon
            $r .= get_icon('move_down', 'noimg');
        } else {
            $r .= action_icon(T_('Move up'), 'move_up', regenerate_url('ctrl,action', 'ctrl=userfields&amp;ufdf_ID=' . $row->ufdf_ID . '&amp;action=move_up&amp;' . url_crumb('userfield')));
        }
        if (in_array($row->ufdf_ID, $userfields_group_sides['last'])) {
            // Last record, no change ordering, print blank icon
            $r .= get_icon('move_down', 'noimg');
        } else {
            $r .= action_icon(T_('Move down'), 'move_down', regenerate_url('ctrl,action', 'ctrl=userfields&amp;ufdf_ID=' . $row->ufdf_ID . '&amp;action=move_down&amp;' . url_crumb('userfield')));
        }
        return $r;
    }
    $Results->cols[] = array('th' => T_('Order'), 'td' => '%order_actions( {row} )%', 'td_class' => 'shrinkwrap');
    function fld_actions(&$row)
    {
        $r = action_icon(T_('Edit this user field...'), 'edit', regenerate_url('ctrl,action', 'ctrl=userfields&amp;ufdf_ID=' . $row->ufdf_ID . '&amp;action=edit')) . action_icon(T_('Duplicate this user field...'), 'copy', regenerate_url('ctrl,action', 'ctrl=userfields&amp;ufdf_ID=' . $row->ufdf_ID . '&amp;action=new')) . action_icon(T_('Delete this user field!'), 'delete', regenerate_url('ctrl,action', 'ctrl=userfields&amp;ufdf_ID=' . $row->ufdf_ID . '&amp;action=delete&amp;' . url_crumb('userfield')));
        return $r;
    }
    $Results->cols[] = array('th' => T_('Actions'), 'td_class' => 'shrinkwrap', 'td' => '%fld_actions( {row} )%');
    $Results->global_icon(T_('Create a new user field...'), 'new', '?ctrl=userfields&action=new', T_('New user field') . ' &raquo;', 3, 4);
    $Results->global_icon(T_('Create a new user field group...'), 'new', '?ctrl=userfieldsgroups&action=new', T_('New user field group') . ' &raquo;', 3, 4);
}
// Display results:
$Results->display();
Exemplo n.º 18
0
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $blog, $admin_url, $rsc_url;
global $Session;
$perm_options_edit = $current_User->check_perm('options', 'edit', false);
/**
 * View funcs
 */
require_once dirname(__FILE__) . '/_stats_view.funcs.php';
// Create query:
$SQL = new SQL();
$SQL->SELECT('gcat_ID, gcat_name, gcat_color');
$SQL->FROM('T_track__goalcat');
// Create result set:
$Results = new Results($SQL->get(), 'gcats_', '-A');
$Results->Cache =& get_GoalCategoryCache();
$Results->title = T_('Goal categories') . get_manual_link('goal-category-settings');
$Results->cols[] = array('th' => T_('ID'), 'order' => 'gcat_ID', 'td_class' => 'shrinkwrap', 'td' => '$gcat_ID$');
$Results->cols[] = array('th' => T_('Name'), 'order' => 'gcat_name', 'td' => $perm_options_edit ? '<a href="' . $admin_url . '?ctrl=goals&amp;tab3=cats&amp;action=cat_edit&amp;blog=' . $blog . '&amp;gcat_ID=$gcat_ID$" style="color:$gcat_color$;font-weight:bold">$gcat_name$</a>' : '<b style="color:$gcat_color$">$gcat_name$</b>');
$Results->cols[] = array('th' => T_('Color'), 'order' => 'gcat_color', 'td_class' => 'shrinkwrap', 'td' => '$gcat_color$', 'extra' => array('style' => 'color:#gcat_color#'));
if ($perm_options_edit) {
    // We have permission to modify:
    $Results->cols[] = array('th' => T_('Actions'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap', 'td' => '%action_icon( "' . T_('Edit this goal category...') . '", "edit", "' . $admin_url . '?ctrl=goals&amp;tab3=cats&amp;action=cat_edit&amp;blog=' . $blog . '&amp;gcat_ID=#gcat_ID#" )%' . '%action_icon( "' . T_('Copy this goal category...') . '", "copy", "' . $admin_url . '?ctrl=goals&amp;tab3=cats&amp;action=cat_copy&amp;blog=' . $blog . '&amp;gcat_ID=#gcat_ID#" )%' . '~conditional( #gcat_ID# > 1, \'%action_icon( "' . T_('Delete this goal category...') . '", "delete", "' . $admin_url . '?ctrl=goals&amp;tab3=cats&amp;action=cat_delete&amp;blog=' . $blog . '&amp;gcat_ID=#gcat_ID#&amp;' . url_crumb('goalcat') . '" )%\', "" )~');
    $Results->global_icon(T_('Create a new goal category...'), 'new', regenerate_url('action', 'action=cat_new'), T_('New goal category') . ' &raquo;', 3, 4, array('class' => 'action_icon btn-primary'));
}
// Display results:
$Results->display();
Exemplo n.º 19
0
			( grp_ID = bloggroup_group_ID AND bloggroup_blog_ID = ' . $edited_Blog->ID . ' )');
$SQL->ORDER_BY('bloggroup_ismember DESC, *, grp_name, grp_ID');
if (!empty($keywords)) {
    $SQL->add_search_field('grp_name');
    $SQL->WHERE_keywords($keywords, 'AND');
}
// Display wide layout:
?>

<div id="userlist_wide" class="clear">

<?php 
$Results = new Results($SQL->get(), 'collgroup_');
if (!empty($keywords)) {
    // Display a button to reset the filters
    $Results->global_icon(T_('Reset all filters!'), 'reset_filters', $admin_url . '?ctrl=coll_settings&amp;tab=permgroup&amp;blog=' . $Blog->ID, T_('Reset filters'), 3, 3, array('class' => 'action_icon btn-warning'));
}
// Tell the Results class that we already have a form for this page:
$Results->Form =& $Form;
$Results->title = T_('Group permissions') . get_manual_link('advanced-group-permissions');
$Results->filter_area = array('submit' => 'actionArray[filter1]', 'callback' => 'filter_collobjectlist', 'url_ignore' => 'results_collgroup_page,keywords1,keywords2', 'presets' => array('all' => array(T_('All users'), regenerate_url('action,results_collgroup_page,keywords1,keywords2', 'action=edit'))));
/*
 * Grouping params:
 */
$Results->group_by = 'bloggroup_ismember';
$Results->ID_col = 'grp_ID';
/*
 * Group columns:
 */
$Results->grp_cols[] = array('td_colspan' => 0, 'td' => '~conditional( #bloggroup_ismember#, \'' . format_to_output(T_('Members'), 'htmlattr') . '\', \'' . format_to_output(T_('Non members'), 'htmlattr') . '\' )~');
/*
Exemplo n.º 20
0
    // No calc the counts
    $sql_select = '';
}
// Create result set:
$SQL->SELECT('SQL_NO_CACHE dom_name, dom_status, dom_type' . $sql_select);
$SQL->GROUP_BY('dom_ID');
$count_SQL = new SQL();
$count_SQL->SELECT('SQL_NO_CACHE COUNT( DISTINCT dom_ID )');
$count_SQL->FROM($SQL->get_from(''));
$count_SQL->WHERE($SQL->get_where(''));
$Results = new Results($SQL->get(), 'refdom_', '---D', $UserSettings->get('results_per_page'), $count_SQL->get());
if ($current_User->check_perm('stats', 'edit')) {
    // Current user has a permission to create new domain
    global $tab_from;
    $tab_from_param = empty($tab_from) ? '' : '&amp;tab_from=' . $tab_from;
    $Results->global_icon(T_('Add domain'), 'new', $admin_url . '?ctrl=stats&amp;tab=domains&amp;tab3=' . $tab3 . '&amp;action=domain_new' . $tab_from_param . (empty($blog) ? '' : '&amp;blog=' . $blog), T_('Add domain') . ' &raquo;', 3, 4, array('class' => 'action_icon btn-primary'));
}
/**
 * Callback to add filters on top of the result set
 *
 * @param Form
 */
function filter_basedomains(&$Form)
{
    global $blog, $dtyp_normal, $dtyp_searcheng, $dtyp_aggregator, $dtyp_email, $dtyp_unknown;
    $Form->text_input('dname', get_param('dname'), 20, T_('Domain name'), '', array('maxlength' => 250));
    $Form->checkbox('dtyp_normal', $dtyp_normal, T_('Regular sites'));
    $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'));
$Results->cols[] = array('th' => T_('Anon. contact form submits'), 'td' => '$aipr_contact_email_count$', 'order' => 'aipr_contact_email_count', 'default_dir' => 'D');
$Results->cols[] = array('th' => T_('Block count'), 'td' => '$aipr_block_count$', 'order' => 'aipr_block_count', 'default_dir' => 'D');
// Get additional columns from the Plugins
$Plugins->trigger_event('GetAdditionalColumnsTable', array('table' => 'ipranges', 'column' => 'aipr_IPv4start', 'Results' => $Results));
if ($current_User->check_perm('spamblacklist', 'edit')) {
    // Check permission to edit IP ranges:
    /**
     * Get actions links for IP range
     *
     * @param integer IP range ID
     * @param string Current tab value
     * @return string HTML links to edit and delete IP range
     */
    function antispam_ipranges_actions($aipr_ID, $tab_param)
    {
        global $admin_url;
        // A link to edit IP range
        $r = action_icon(T_('Edit this IP range...'), 'properties', $admin_url . '?ctrl=antispam' . $tab_param . '&amp;tab3=ipranges&amp;iprange_ID=' . $aipr_ID . '&amp;action=iprange_edit');
        // A link to delete IP range
        $r .= action_icon(T_('Delete this IP range!'), 'delete', regenerate_url('iprange_ID,action', 'iprange_ID=' . $aipr_ID . '&amp;action=iprange_delete&amp;' . url_crumb('iprange')));
        return $r;
    }
    $Results->cols[] = array('th' => T_('Actions'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap', 'td' => '%antispam_ipranges_actions( #aipr_ID#, "' . $tab_param . '" )%');
}
$Results->global_icon(T_('Add a new IP range...'), 'new', regenerate_url('action', 'action=iprange_new'), T_('New IP range') . ' &raquo;', 3, 4, array('class' => 'action_icon btn-primary'));
$Results->display();
if ($current_User->check_perm('spamblacklist', 'edit')) {
    // Check permission to edit IP ranges:
    // Print JS to edit status of IP range
    echo_editable_column_js(array('column_selector' => '.iprange_status_edit', 'ajax_url' => get_secure_htsrv_url() . 'async.php?action=iprange_status_edit&' . url_crumb('iprange'), 'options' => aipr_status_titles(), 'new_field_name' => 'new_status', 'ID_value' => 'jQuery( ":first", jQuery( this ).parent() ).text()', 'ID_name' => 'iprange_ID', 'colored_cells' => true));
}
Exemplo n.º 22
0
if (!empty($datestart)) {
    // Filter by start date
    $timestart_value = empty($timestart) ? '00:00:00' : $timestart;
    $SQL->WHERE_and('( ctsk_start_datetime >= ' . $DB->quote($datestart . ' ' . $timestart_value) . '
		OR clog_realstart_datetime >= ' . $DB->quote($datestart . ' ' . $timestart_value) . ' )');
}
if (!empty($datestop)) {
    // Filter by end date
    $timestop_value = empty($timestop) ? '23:59:59' : $timestop;
    $SQL->WHERE_and('( ctsk_start_datetime <= ' . $DB->quote($datestop . ' ' . $timestop_value) . '
		OR clog_realstop_datetime <= ' . $DB->quote($datestop . ' ' . $timestop_value) . ' )');
}
$SQL->ORDER_BY('*, ctsk_ID');
$Results = new Results($SQL->get(), 'crontab_', '-D');
$Results->title = T_('Scheduled jobs') . get_manual_link('scheduled-jobs-list');
$Results->global_icon(T_('Refresh'), 'refresh', regenerate_url(), T_('Refresh'), 3, 4);
if ($current_User->check_perm('options', 'edit', false, NULL)) {
    // Permission to edit settings:
    $Results->global_icon(T_('Create a new scheduled job...'), 'new', regenerate_url('action,cjob_ID', 'action=new'), T_('New job') . ' &raquo;', 3, 4, array('class' => 'action_icon btn-primary'));
}
/**
 * Callback to add filters on top of the result set
 *
 * @param Form
 */
function filter_crontab(&$Form)
{
    global $ctst_pending, $ctst_started, $ctst_timeout, $ctst_error, $ctst_finished;
    global $datestart, $timestart, $datestop, $timestop;
    $Form->checkbox('ctst_pending', $ctst_pending, T_('Pending'));
    $Form->checkbox('ctst_started', $ctst_started, T_('Started'));
Exemplo n.º 23
0
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $current_User;
$current_User->check_perm('blogs', 'editall', true);
param_action('emptytrash', true);
$SQL = new SQL();
$SQL->SELECT('DISTINCT(blog_ID), blog_name, count(comment_ID) as comments_number');
// select target_title for sorting
$SQL->FROM('T_blogs LEFT OUTER JOIN T_categories ON blog_ID = cat_blog_ID');
$SQL->FROM_add('LEFT OUTER JOIN T_items__item ON cat_ID = post_main_cat_ID');
$SQL->FROM_add('LEFT OUTER JOIN T_comments ON post_ID = comment_item_ID');
$SQL->WHERE('comment_status = "trash"');
$SQL->GROUP_BY('blog_ID');
$count_SQL = new SQL();
$count_SQL->SELECT('COUNT( comment_ID )');
$count_SQL->FROM('T_comments');
$count_SQL->WHERE('comment_status = "trash"');
// Create result set:
$Results = new Results($SQL->get(), 'emptytrash_', '', NULL, $count_SQL->get());
$Results->title = T_('Comment recycle bins') . ' (' . $Results->get_total_rows() . ')';
$Results->cols[] = array('th' => T_('Blog ID'), 'th_class' => 'shrinkwrap', 'order' => 'blog_ID', 'td' => '$blog_ID$', 'td_class' => 'shrinkwrap');
$Results->cols[] = array('th' => T_('Blog name'), 'order' => 'blog_name', 'td' => '$blog_name$');
$Results->cols[] = array('th' => T_('Comments in recycle bin'), 'th_class' => 'shrinkwrap', 'order' => 'comments_number', 'td' => '$comments_number$', 'td_class' => 'shrinkwrap');
$Results->cols[] = array('th' => T_('Actions'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap', 'td' => action_icon(TS_('Empty blog\'s recycle bin'), 'recycle_empty', regenerate_url('action', 'blog_ID=$blog_ID$&amp;action=trash_delete') . '&amp;' . url_crumb('comment')));
$Results->global_icon(T_('Cancel empty recycle bin'), 'close', regenerate_url('action', 'action=list&filter=reset'), 3, 4);
echo '<p>[<a href="' . regenerate_url('action,blog_ID', 'action=trash_delete') . '&amp;' . url_crumb('comment') . '">' . T_('Empty all blogs\' recycle bin') . '</a>]</p>';
$Results->display();
        global $goal_ID;
        $GoalCache =& get_GoalCache();
        $GoalCache->load_all();
        $Form->select_object('goal_ID', $goal_ID, $GoalCache, T_('Goal'), '', true);
    }
    $Form->text_input('goal_name', get_param('goal_name'), 20, T_('Goal names starting with'), '', array('maxlength' => 50));
    $Form->checkbox_basic_input('split_engines', get_param('split_engines'), T_('Split search engines'));
}
$today = date('Y-m-d', $localtimenow);
$Results->filter_area = array('callback' => 'filter_keyphrases', 'url_ignore' => 'goal_ID,datestartinput,datestart,datestopinput,datestop,goal_name,split_engines', 'presets' => array('all' => array(T_('All'), '?ctrl=stats&amp;tab=refsearches&amp;tab3=keywords&amp;blog=' . $blog), 'today' => array(T_('Today'), '?ctrl=stats&amp;tab=refsearches&amp;tab3=keywords&amp;blog=' . $blog . '&amp;datestart=' . $today . '&amp;datestop=' . $today)));
if ($split_engines) {
    // Search engine:
    $Results->cols[] = array('th' => T_('Search engine'), 'order' => 'dom_name', 'td_class' => 'nowrap', 'td' => '<a href="$hit_referer$">$dom_name$</a>', 'total' => T_('TOTAL'));
}
// Keywords:
$Results->cols[] = array('th' => T_('Search keywords'), 'order' => 'keyp_phrase', 'td' => '%stats_search_keywords( #keyp_phrase#, 45 )%', 'total' => $sql_count . ' ' . T_('keyphrases'));
// Count:
if (empty($goal_ID)) {
    // We're not restricting to a Goal
    $Results->cols[] = array('th' => T_('Unique IP hits'), 'order' => 'count', 'default_dir' => 'D', 'td_class' => 'right', 'td' => '$count$', 'total_class' => 'right', 'total' => $total);
} else {
    // We ARE retsrticting to a Goal
    $Results->cols[] = array('th' => T_('Goal hits'), 'order' => 'count', 'default_dir' => 'D', 'td_class' => 'right', 'td' => '$count$', 'total_class' => 'right', 'total' => $total);
}
$Results->cols[] = array('th' => T_('Refered searches'), 'order' => 'keyp_count_refered_searches', 'td' => '$keyp_count_refered_searches$', 'td_class' => 'nowrap right');
$Results->cols[] = array('th' => T_('Internal searches'), 'order' => 'keyp_count_internal_searches', 'td' => '$keyp_count_internal_searches$', 'td_class' => 'nowrap right');
$Results->cols[] = array('th' => '%', 'order' => 'count', 'default_dir' => 'D', 'td_class' => 'right', 'td' => '%percentage( #count#, ' . $total . ' )%', 'total_class' => 'right', 'total' => '100.0 %');
$Results->cols[] = array('th' => T_('Cumulative'), 'td_class' => 'right', 'td' => '%addup_percentage( #count#, ' . $total . ' )%');
$Results->global_icon(T_('Reset counters'), 'file_delete', regenerate_url('action', 'action=reset_counters'), T_('Reset counters') . ' &raquo;', 3, 4);
// Display results:
$Results->display();
Exemplo n.º 25
0
}
$Results->cols[] = array('th' => T_('Code'), 'td_class' => 'center', 'order' => 'rgn_code', 'td' => '<strong>$rgn_code$</strong>', 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap');
if ($current_User->check_perm('options', 'edit', false)) {
    // We have permission to modify:
    $Results->cols[] = array('th' => T_('Name'), 'order' => 'rgn_name', 'td' => '<a href="?ctrl=regions&amp;rgn_ID=$rgn_ID$&amp;action=edit" title="' . T_('Edit this region...') . '"><strong>$rgn_name$</strong></a>');
} else {
    // View only:
    $Results->cols[] = array('th' => T_('Name'), 'order' => 'rgn_name', 'td' => '$rgn_name$');
}
/*
 * ACTIONS TD:
 */
function rgn_td_actions($rgn_enabled, $rgn_ID)
{
    global $dispatcher;
    $r = '';
    if ($rgn_enabled == true) {
        $r .= action_icon(T_('Disable the region!'), 'deactivate', regenerate_url('action', 'action=disable_region&amp;rgn_ID=' . $rgn_ID . '&amp;' . url_crumb('region')));
    } else {
        $r .= action_icon(T_('Enable the region!'), 'activate', regenerate_url('action', 'action=enable_region&amp;rgn_ID=' . $rgn_ID . '&amp;' . url_crumb('region')));
    }
    $r .= action_icon(T_('Edit this region...'), 'edit', regenerate_url('action', 'rgn_ID=' . $rgn_ID . '&amp;action=edit'));
    $r .= action_icon(T_('Duplicate this region...'), 'copy', regenerate_url('action', 'rgn_ID=' . $rgn_ID . '&amp;action=new'));
    $r .= action_icon(T_('Delete this region!'), 'delete', regenerate_url('action', 'rgn_ID=' . $rgn_ID . '&amp;action=delete&amp;' . url_crumb('region')));
    return $r;
}
if ($current_User->check_perm('options', 'edit', false)) {
    $Results->cols[] = array('th' => T_('Actions'), 'td' => '%rgn_td_actions( #rgn_enabled#, #rgn_ID# )%', 'td_class' => 'shrinkwrap');
    $Results->global_icon(T_('Create a new region...'), 'new', regenerate_url('action', 'action=new'), T_('New region') . ' &raquo;', 3, 4);
}
$Results->display();
Exemplo n.º 26
0
 *
 * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $admin_url, $UserSettings;
// Create result set:
$SQL = new SQL();
$SQL->SELECT('SQL_NO_CACHE ecmp_ID, ecmp_date_ts, ecmp_name, ecmp_email_title, ecmp_email_html, ecmp_email_text, ecmp_sent_ts');
$SQL->FROM('T_email__campaign');
$SQL->GROUP_BY('ecmp_ID');
$count_SQL = new SQL();
$count_SQL->SELECT('SQL_NO_CACHE COUNT( ecmp_ID )');
$count_SQL->FROM('T_email__campaign');
$Results = new Results($SQL->get(), 'emcmp_', 'D', $UserSettings->get('results_per_page'), $count_SQL->get());
$Results->title = T_('Email campaigns') . get_manual_link('email-campaigns');
if ($current_User->check_perm('emails', 'edit')) {
    // User must has a permission to edit emails
    $Results->global_icon(T_('Create new campaign') . '...', 'new', $admin_url . '?ctrl=campaigns&amp;action=new', T_('Create new campaign') . ' &raquo;', 3, 4, array('class' => 'action_icon btn-primary'));
}
$Results->cols[] = array('th' => T_('ID'), 'order' => 'ecmp_ID', 'th_class' => 'shrinkwrap', 'td_class' => 'right', 'td' => '$ecmp_ID$');
$Results->cols[] = array('th' => T_('Date'), 'order' => 'ecmp_date_ts', 'default_dir' => 'D', 'th_class' => 'shrinkwrap', 'td_class' => 'timestamp compact_data', 'td' => '%mysql2localedatetime_spans( #ecmp_date_ts#, "M-d" )%');
$Results->cols[] = array('th' => T_('Name'), 'order' => 'ecmp_name', 'td' => '<a href="' . $admin_url . '?ctrl=campaigns&amp;action=edit&amp;ecmp_ID=$ecmp_ID$"><b>$ecmp_name$</b></a>', 'th_class' => 'shrinkwrap', 'td_class' => 'nowrap');
$Results->cols[] = array('th' => T_('Email title'), 'order' => 'ecmp_email_title', 'td' => '$ecmp_email_title$');
$Results->cols[] = array('th' => T_('Sent'), 'order' => 'ecmp_sent_ts', 'default_dir' => 'D', 'th_class' => 'shrinkwrap', 'td_class' => 'timestamp compact_data', 'td' => '%mysql2localedatetime_spans( #ecmp_sent_ts#, "M-d" )%');
$Results->cols[] = array('th' => T_('Actions'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap', 'td' => action_icon(T_('Edit this email campaign...'), 'properties', $admin_url . '?ctrl=campaigns&amp;action=edit&amp;ecmp_ID=$ecmp_ID$') . action_icon(T_('Delete this email address!'), 'delete', regenerate_url('ecmp_ID,action', 'ecmp_ID=$ecmp_ID$&amp;action=delete&amp;' . url_crumb('campaign'))));
// Display results:
$Results->display();
Exemplo n.º 27
0
            $status_icon_title = sprintf(T_('The item type is not the default for %s.'), $Blog->get('shortname'));
        }
        $status_icon = get_icon('bullet_empty_grey', 'imgtag', array('title' => $status_icon_title));
    }
    if (isset($status_url)) {
        return '<a href="' . $status_url . '">' . $status_icon . '</a>';
    } else {
        return $status_icon;
    }
}
$Results->cols[] = array('th' => sprintf(T_('Default for<br />%s'), $Blog->get('shortname')), 'order' => 'ityp_perm_level', 'td' => '%ityp_row_default( #ityp_ID# )%', 'th_class' => 'shrinkwrap', 'td_class' => 'center');
$Results->cols[] = array('th' => T_('Name'), 'order' => 'ityp_name', 'td' => '%get_name_for_itemtype(#ityp_ID#, #ityp_name#)%');
function ityp_row_perm_level($level, $id)
{
    if (ItemType::is_reserved($id)) {
        // It is reserved item type, Don't display perm level
        return '';
    }
    $perm_levels = array('standard' => T_('Standard'), 'restricted' => T_('Restricted'), 'admin' => T_('Admin'));
    return isset($perm_levels[$level]) ? $perm_levels[$level] : $level;
}
$Results->cols[] = array('th' => T_('Perm Level'), 'order' => 'ityp_perm_level', 'td' => '%ityp_row_perm_level( #ityp_perm_level#, #ityp_ID# )%', 'th_class' => 'shrinkwrap', 'td_class' => 'center');
$Results->cols[] = array('th' => T_('Back-office tab'), 'order' => 'ityp_backoffice_tab', 'td' => '$ityp_backoffice_tab$', 'th_class' => 'shrinkwrap', 'td_class' => 'center');
$Results->cols[] = array('th' => T_('Template name'), 'order' => 'ityp_template_name', 'td' => '%conditional( #ityp_template_name# == "", "", #ityp_template_name#.".*.php" )%', 'th_class' => 'shrinkwrap', 'td_class' => 'center');
if ($current_User->check_perm('options', 'edit', false)) {
    // We have permission to modify:
    $Results->cols[] = array('th' => T_('Actions'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap', 'td' => '%get_actions_for_itemtype( #ityp_ID# )%');
    $Results->global_icon(T_('Create a new element...'), 'new', regenerate_url('action', 'action=new'), T_('New Post Type') . ' &raquo;', 3, 4, array('class' => 'action_icon btn-primary'));
}
// Display results:
$Results->display();
Exemplo n.º 28
0
if ($ctst_started) {
    $SQL->WHERE_or('clog_status = "started"');
}
if ($ctst_timeout) {
    $SQL->WHERE_or('clog_status = "timeout"');
}
if ($ctst_error) {
    $SQL->WHERE_or('clog_status = "error"');
}
if ($ctst_finished) {
    $SQL->WHERE_or('clog_status = "finished"');
}
$SQL->ORDER_BY('*, ctsk_ID');
$Results = new Results($SQL->get(), 'crontab_', '-D');
$Results->title = T_('Scheduled jobs') . get_manual_link('scheduler');
$Results->global_icon(T_('Refresh'), 'refresh', regenerate_url(), T_('Refresh'), 3, 4);
if ($current_User->check_perm('options', 'edit', false, NULL)) {
    // Permission to edit settings:
    $Results->global_icon(T_('Create a new scheduled job...'), 'new', regenerate_url('action,cjob_ID', 'action=new'), T_('New job') . ' &raquo;', 3, 4);
}
/**
 * Callback to add filters on top of the result set
 *
 * @param Form
 */
function filter_crontab(&$Form)
{
    global $ctst_pending, $ctst_started, $ctst_timeout, $ctst_error, $ctst_finished;
    $Form->checkbox('ctst_pending', $ctst_pending, T_('Pending'));
    $Form->checkbox('ctst_started', $ctst_started, T_('Started'));
    $Form->checkbox('ctst_timeout', $ctst_timeout, T_('Timed out'));
Exemplo n.º 29
0
}
// Create result set:
$SQL = new SQL();
$SQL->SELECT('T_skins__skin.*, COUNT( DISTINCT( cset_coll_ID ) ) AS nb_blogs');
$SQL->FROM('T_skins__skin LEFT JOIN T_coll_settings ON skin_ID = cset_value AND
			( cset_name = "normal_skin_ID" OR cset_name = "mobile_skin_ID" OR cset_name = "tablet_skin_ID" )');
$SQL->GROUP_BY('skin_ID');
$CountSQL = new SQL();
$CountSQL->SELECT('COUNT( * )');
$CountSQL->FROM('T_skins__skin');
$Results = new Results($SQL->get(), 'skin_', '', NULL, $CountSQL->get());
$Results->Cache =& get_SkinCache();
$Results->title = T_('Installed skins') . get_manual_link('installed_skins');
if ($current_User->check_perm('options', 'edit', false)) {
    // We have permission to modify:
    $Results->cols[] = array('th' => T_('Name'), 'order' => 'skin_name', 'td' => '<strong><a href="' . regenerate_url('', 'skin_ID=$skin_ID$&amp;action=edit') . '" title="' . TS_('Edit skin properties...') . '">$skin_name$</a></strong>');
} else {
    // We have NO permission to modify:
    $Results->cols[] = array('th' => T_('Name'), 'order' => 'skin_name', 'td' => '<strong>$skin_name$</strong>');
}
$Results->cols[] = array('th' => T_('Skin type'), 'order' => 'skin_type', 'td_class' => 'center', 'td' => '$skin_type$');
$Results->cols[] = array('th' => T_('Blogs'), 'order' => 'nb_blogs', 'th_class' => 'shrinkwrap', 'td_class' => 'center', 'td' => '~conditional( (#nb_blogs# > 0), #nb_blogs#, \'&nbsp;\' )~');
$Results->cols[] = array('th' => T_('Skin Folder'), 'order' => 'skin_folder', 'td' => '$skin_folder$');
if ($current_User->check_perm('options', 'edit', false)) {
    // We have permission to modify:
    $Results->cols[] = array('th' => T_('Actions'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap', 'td' => action_icon(TS_('Edit skin properties...'), 'properties', '%regenerate_url( \'\', \'skin_ID=$skin_ID$&amp;action=edit\')%') . action_icon(TS_('Reload containers!'), 'reload', '%regenerate_url( \'\', \'skin_ID=$skin_ID$&amp;action=reload&amp;' . url_crumb('skin') . '\')%') . '~conditional( #nb_blogs# < 1, \'' . action_icon(TS_('Uninstall this skin!'), 'delete', '%regenerate_url( \'\', \'skin_ID=$skin_ID$&amp;action=delete&amp;' . url_crumb('skin') . '\')%') . '\', \'' . get_icon('delete', 'noimg') . '\' )~');
    $Results->global_icon(T_('Install new skin...'), 'new', regenerate_url('action,blog', 'action=new'), T_('Install new'), 3, 4);
}
// $fadeout_array = array( 'skin_ID' => array(6) );
$fadeout_array = NULL;
$Results->display(NULL, 'session');
Exemplo n.º 30
0
/**
 * @var User
 */
global $current_User;
/**
 * @var GeneralSettings
 */
global $Settings;
global $dispatcher;
$SQL = new SQL();
$SQL->SELECT('T_blogs.*, user_login');
$SQL->FROM('T_blogs INNER JOIN T_users ON blog_owner_user_ID = user_ID');
if (!$current_User->check_perm('blogs', 'view')) {
    // We do not have perm to view all blogs... we need to restrict to those we're a member of:
    $SQL->FROM_add('LEFT JOIN T_coll_user_perms ON (blog_advanced_perms <> 0' . ' AND blog_ID = bloguser_blog_ID' . ' AND bloguser_user_ID = ' . $current_User->ID . ' )' . ' LEFT JOIN T_coll_group_perms ON (blog_advanced_perms <> 0' . ' AND blog_ID = bloggroup_blog_ID' . ' AND bloggroup_group_ID = ' . $current_User->grp_ID . ' )');
    $SQL->WHERE('blog_owner_user_ID = ' . $current_User->ID . ' OR bloguser_ismember <> 0' . ' OR bloggroup_ismember <> 0');
    $no_results = T_('Sorry, you have no permission to edit/view any blog\'s properties.');
} else {
    $no_results = T_('No blog has been created yet!');
}
// Create result set:
$Results = new Results($SQL->get(), 'blog_');
$Results->Cache =& get_BlogCache();
$Results->title = T_('Blog list');
$Results->no_results_text = $no_results;
if ($current_User->check_perm('blogs', 'create')) {
    $Results->global_icon(T_('New blog...'), 'new', url_add_param($dispatcher, 'ctrl=collections&amp;action=new'), T_('New blog...'), 3, 4);
}
// Initialize Results object
blogs_results($Results);
$Results->display(NULL, 'session');