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&action=disable_country&ctry_ID=' . $ctry_ID . '&redirect_ctrl=' . $redirect_ctrl . '&' . url_crumb('country')));
    } else {
        $r .= action_icon(T_('Enable the country!'), 'activate', regenerate_url('ctrl,action', 'ctrl=countries&action=enable_country&ctry_ID=' . $ctry_ID . '&redirect_ctrl=' . $redirect_ctrl . '&' . url_crumb('country')));
    }
    $r .= action_icon(T_('Edit this country...'), 'edit', regenerate_url('ctrl,action', 'ctrl=countries&ctry_ID=' . $ctry_ID . '&action=edit'));
    $r .= action_icon(T_('Duplicate this country...'), 'copy', regenerate_url('ctrl,action', 'ctrl=countries&ctry_ID=' . $ctry_ID . '&action=new'));
    $r .= action_icon(T_('Delete this country!'), 'delete', regenerate_url('ctrl,action', 'ctrl=countries&ctry_ID=' . $ctry_ID . '&action=delete&' . 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&action=new'), T_('New country') . ' »', 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));
}
echo $ChapterCache->recurse($callbacks, $subset_ID, NULL, 0, 0, array('sorted' => true));
$Table->display_body_end();
$Table->display_list_end();
echo $Table->params['content_end'];
echo $results_params['after'];
/* fp> TODO: maybe... (a general group move of posts would be more useful actually)
echo '<p class="note">'.T_('<strong>Note:</strong> Deleting a category does not delete posts from that category. It will just assign them to the parent category. When deleting a root category, posts will be assigned to the oldest remaining category in the same collection (smallest category number).').'</p>';
*/
global $Settings, $dispatcher;
// Use a wrapper div to have margin around the form
echo '<div id="form_wrapper" style="margin: 2ex auto 1ex">';
$Form = new Form(NULL, 'cat_order_checkchanges', 'post', 'compact');
$Form->begin_form('fform', T_('Category order') . get_manual_link('categories_order'));
$Form->add_crumb('collection');
$Form->hidden('ctrl', 'coll_settings');
$Form->hidden('action', 'update');
$Form->hidden('blog', $Blog->ID);
$Form->hidden('tab', 'chapters');
$Form->radio_input('category_ordering', $Blog->get_setting('category_ordering'), array(array('value' => 'alpha', 'label' => T_('Alphabetically')), array('value' => 'manual', 'label' => T_('Manually'))), T_('Sort categories'), array('note' => '(' . T_('Note: can be overridden for sub-categories') . ')'));
$Form->end_form(array(array('submit', 'submit', T_('Save Changes!'), 'SaveButton')));
echo '</div>';
// form wrapper end
if (!$Settings->get('allow_moving_chapters')) {
    // TODO: check perm
    echo '<p class="alert alert-info">' . sprintf(T_('<strong>Note:</strong> Moving categories across blogs is currently disabled in the %sblogs settings%s.'), '<a href="' . $dispatcher . '?ctrl=collections&tab=blog_settings#fieldset_wrapper_categories">', '</a>') . '</p> ';
}
//Flush fadeout
$Session->delete('fadeout_array');
// Print JS to edit order of the chapters inline
echo_editable_column_js(array('column_selector' => '.cat_order_edit', 'ajax_url' => get_secure_htsrv_url() . 'async.php?action=cat_order_edit&blogid=' . $Blog->ID . '&' . url_crumb('catorder'), 'new_field_name' => 'new_cat_order', 'ID_value' => 'jQuery( this ).attr( "rel" )', 'ID_name' => 'cat_ID', 'field_type' => 'text'));
$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));
}
// Initialize funky display vars now:
global $postIDlist, $postIDarray;
$postIDlist = $ItemList->get_page_ID_list();
$postIDarray = $ItemList->get_page_ID_array();
// DISPLAY table now:
$ItemList->display(NULL, $result_fadeout);
// Print JS to edit a task priority
echo_editable_column_js(array('column_selector' => '.task_priority_edit', 'ajax_url' => get_secure_htsrv_url() . 'async.php?action=item_task_edit&field=priority&' . url_crumb('itemtask'), 'options' => item_priority_titles(), 'new_field_name' => 'new_priority', 'ID_value' => 'jQuery( this ).attr( "rel" )', 'ID_name' => 'post_ID', 'colored_cells' => true));
// Print JS to edit a task assigned
// Load current blog members into cache:
$UserCache =& get_UserCache();
// Load only first 21 users to know when we should display an input box instead of full users list
$UserCache->load_blogmembers($Blog->ID, 21, false);
// Init this array only for <select> when we have less than 21 users, otherwise we use <input> field with autocomplete feature
$field_type = count($UserCache->cache) < 21 ? 'select' : 'text';
$task_assignees = array(0 => T_('No user'));
if ($field_type == 'select') {
    foreach ($UserCache->cache as $User) {
        $task_assignees[$User->ID] = $User->login;
    }
}
echo_editable_column_js(array('column_selector' => '.task_assigned_edit', 'ajax_url' => get_secure_htsrv_url() . 'async.php?action=item_task_edit&field=assigned&' . url_crumb('itemtask'), 'options' => $task_assignees, 'new_field_name' => $field_type == 'select' ? 'new_assigned_ID' : 'new_assigned_login', 'ID_value' => 'jQuery( this ).attr( "rel" )', 'ID_name' => 'post_ID', 'field_type' => $field_type, 'field_class' => 'autocomplete_login only_assignees', 'null_text' => TS_('No user')));
// Print JS to edit a task status
$ItemStatusCache =& get_ItemStatusCache();
$ItemStatusCache->load_all();
$task_statuses = array(0 => T_('No status'));
foreach ($ItemStatusCache->cache as $ItemStatus) {
    $task_statuses[$ItemStatus->ID] = $ItemStatus->name;
}
echo_editable_column_js(array('column_selector' => '.task_status_edit', 'ajax_url' => get_secure_htsrv_url() . 'async.php?action=item_task_edit&field=status&' . url_crumb('itemtask'), 'options' => $task_statuses, 'new_field_name' => 'new_status', 'ID_value' => 'jQuery( this ).attr( "rel" )', 'ID_name' => 'post_ID'));
示例#5
0
}
$Results->cols[] = array('th' => T_('Back-office access'), 'order' => 'gset_value', 'td' => '%grp_row_backoffice( #gset_value# )%', 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap');
$Results->cols[] = array('th' => T_('Level'), 'th_class' => 'shrinkwrap small', 'td_class' => 'shrinkwrap small' . ($has_perm_users_edit ? ' group_level_edit' : ''), 'order' => 'grp_level', 'default_dir' => 'D', 'td' => $has_perm_users_edit ? '<a href="#" rel="$grp_level$">$grp_level$</a>' : '$grp_level$');
function grp_actions(&$row)
{
    global $usedgroups, $Settings, $current_User;
    $r = '';
    if ($current_User->check_perm('users', 'edit', false)) {
        $r = action_icon(T_('Edit this group...'), 'edit', regenerate_url('ctrl,action', 'ctrl=groups&amp;action=edit&amp;grp_ID=' . $row->grp_ID));
        $r .= action_icon(T_('Duplicate this group...'), 'copy', regenerate_url('ctrl,action', 'ctrl=groups&amp;action=new&amp;grp_ID=' . $row->grp_ID));
        if ($row->grp_ID != 1 && $row->grp_ID != $Settings->get('newusers_grp_ID') && !in_array($row->grp_ID, $usedgroups)) {
            // delete
            $r .= action_icon(T_('Delete this group!'), 'delete', regenerate_url('ctrl,action', 'ctrl=groups&amp;action=delete&amp;grp_ID=' . $row->grp_ID . '&amp;' . url_crumb('group')));
        } else {
            $r .= get_icon('delete', 'noimg');
        }
    }
    return $r;
}
$Results->cols[] = array('th' => T_('Actions'), 'th_class' => 'shrinkwrap small', 'td_class' => 'shrinkwrap', 'td' => '%grp_actions( {row} )%');
// Display results:
$Results->display();
if ($current_User->check_perm('users', 'edit', false)) {
    // If user can edit the users - Init js to edit group level by AJAX
    $group_levels = array();
    for ($l = 0; $l <= 10; $l++) {
        $group_levels[$l] = $l;
    }
    // Print JS to edit a group level
    echo_editable_column_js(array('column_selector' => '.group_level_edit', 'ajax_url' => get_secure_htsrv_url() . 'async.php?action=group_level_edit&' . url_crumb('grouplevel'), 'options' => $group_levels, 'new_field_name' => 'new_group_level', 'ID_value' => 'jQuery( ":first", jQuery( this ).parent() ).text()', 'ID_name' => 'group_ID'));
}
示例#6
0
		}
	});
} );

<?php 
global $current_User;
if (is_admin_page() && is_logged_in() && $current_User->check_perm('users', 'moderate', false)) {
    // If user can edit the users - Init js to edit user level by AJAX
    ?>
jQuery(document).ready( function()
{
	jQuery('.user_level_edit').each( function()
	{
		if( jQuery( this ).find( 'a' ).length == 0 )
		{
			jQuery( this ).removeClass( 'user_level_edit' );
		}
	} );
<?php 
    $user_levels = array();
    for ($l = 0; $l <= 10; $l++) {
        $user_levels[$l] = $l;
    }
    // Print JS to edit an user level
    echo_editable_column_js(array('column_selector' => '.user_level_edit', 'ajax_url' => get_secure_htsrv_url() . 'async.php?action=user_level_edit&' . url_crumb('userlevel'), 'options' => $user_levels, 'new_field_name' => 'new_user_level', 'ID_value' => 'jQuery( ":first", jQuery( this ).parent() ).text()', 'ID_name' => 'user_ID', 'print_init_tags' => false));
    ?>
});
<?php 
}
?>
</script>