本文整理汇总了PHP中Results::global_icon方法的典型用法代码示例。如果您正苦于以下问题:PHP Results::global_icon方法的具体用法?PHP Results::global_icon怎么用?PHP Results::global_icon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Results
的用法示例。
在下文中一共展示了Results::global_icon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_name_for_itemtype
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&action=update_type&post_ID=' . $edited_Item->ID . '&ityp_ID=' . $ityp_ID . $from_tab_param . $duplicated_item_param . '&' . 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:
示例2: ctry_td_actions
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));
}
示例3: get_samedomain_htsrv_url
{
global $dispatcher;
$r = '';
if ($city_enabled == true) {
$r .= action_icon(T_('Disable the city!'), 'deactivate', regenerate_url('action', 'action=disable_city&city_ID=' . $city_ID . '&' . url_crumb('city')));
} else {
$r .= action_icon(T_('Enable the city!'), 'activate', regenerate_url('action', 'action=enable_city&city_ID=' . $city_ID . '&' . url_crumb('city')));
}
$r .= action_icon(T_('Edit this city...'), 'edit', regenerate_url('action', 'city_ID=' . $city_ID . '&action=edit'));
$r .= action_icon(T_('Duplicate this city...'), 'copy', regenerate_url('action', 'city_ID=' . $city_ID . '&action=new'));
$r .= action_icon(T_('Delete this city!'), 'delete', regenerate_url('action', 'city_ID=' . $city_ID . '&action=delete&' . 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') . ' »', 3, 4);
$Results->global_icon(T_('Import cities from CSV file ...'), 'new', regenerate_url('action', 'action=csv'), T_('Import CSV') . ' »', 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 )
示例4: SQL
// 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&action=new', T_('Add invitation code') . ' »', 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&action=edit&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&ivc_ID=' . $row->ivc_ID . '&action=edit')) . action_icon(T_('Duplicate this invitation code...'), 'copy', regenerate_url('ctrl,action', 'ctrl=invitations&ivc_ID=' . $row->ivc_ID . '&action=new')) . action_icon(T_('Delete this invitation code!'), 'delete', regenerate_url('ctrl,action', 'ctrl=invitations&ivc_ID=' . $row->ivc_ID . '&action=delete&' . url_crumb('invitation')));
return $r;
}
$Results->cols[] = array('th' => T_('Actions'), 'td_class' => 'shrinkwrap', 'td' => '%ivc_actions( {row} )%');
}
示例5: die
* 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() . '&' . 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>';
}
示例6: items_edited_results_block
/**
* 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&user_tab=activity&action=delete_all_posts_edited&user_ID=' . $edited_User->ID . '&' . 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>';
}
}
示例7: plugin_results_td_actions
}
$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&action=disable_plugin&plugin_ID=' . $Plugin->ID);
} elseif ($Plugin->status != 'broken') {
$r .= action_icon(T_('Enable the plugin!'), 'activate', 'admin.php?ctrl=plugins&action=enable_plugin&plugin_ID=' . $Plugin->ID);
}
$r .= $Plugin->get_edit_settings_link();
$r .= action_icon(T_('Un-install this plugin!'), 'delete', 'admin.php?ctrl=plugins&action=uninstall&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
示例8: filter_email_blocked
$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&tab=blocked&action=blocked_new', T_('Add an email address') . ' »', 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&tab=blocked&statuses[]=unknown&statuses[]=redemption&statuses[]=warning&statuses[]=suspicious1&statuses[]=suspicious2&statuses[]=suspicious3&statuses[]=prmerror&statuses[]=spammer'), 'errors' => array(T_('Errors'), $admin_url . '?ctrl=email&tab=blocked&statuses[]=warning&statuses[]=suspicious1&statuses[]=suspicious2&statuses[]=suspicious3&statuses[]=prmerror&statuses[]=spammer'), 'attention' => array(T_('Need Attention'), $admin_url . '?ctrl=email&tab=blocked&statuses[]=redemption&statuses[]=warning&statuses[]=suspicious3')));
示例9: array
// 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&ufdf_ID=' . $row->ufdf_ID . '&action=move_up&' . 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&ufdf_ID=' . $row->ufdf_ID . '&action=move_down&' . 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&ufdf_ID=' . $row->ufdf_ID . '&action=edit')) . action_icon(T_('Duplicate this user field...'), 'copy', regenerate_url('ctrl,action', 'ctrl=userfields&ufdf_ID=' . $row->ufdf_ID . '&action=new')) . action_icon(T_('Delete this user field!'), 'delete', regenerate_url('ctrl,action', 'ctrl=userfields&ufdf_ID=' . $row->ufdf_ID . '&action=delete&' . 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') . ' »', 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') . ' »', 3, 4);
}
// Display results:
$Results->display();
示例10: array
$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&link_ID=' . $link_ID . '&action=unlink&' . 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&link_type=' . $LinkOwner->type . '&link_object_ID=' . $LinkOwner->get_ID()), T_('Attach files'), 3, 4);
}
$Results->display();
示例11: array
$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&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&tab3=ipranges&iprange_ID=$aipr_ID$&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&tab3=ipranges&iprange_ID=$aipr_ID$&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&tab3=ipranges&iprange_ID=$aipr_ID$&action=iprange_edit') . action_icon(T_('Delete this IP range!'), 'delete', regenerate_url('iprange_ID,action', 'iprange_ID=$aipr_ID$&action=iprange_delete&' . url_crumb('iprange'))));
}
$Results->global_icon(T_('Add a new IP range...'), 'new', regenerate_url('action', 'action=iprange_new'), T_('New IP range') . ' »', 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 );
示例12: plugin_results_td_actions
* 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&action=disable_plugin&plugin_ID=' . $Plugin->ID . '&' . url_crumb('plugin'));
} elseif ($Plugin->status != 'broken') {
$r .= action_icon(T_('Enable the plugin!'), 'activate', $admin_url . '?ctrl=plugins&action=enable_plugin&plugin_ID=' . $Plugin->ID . '&' . url_crumb('plugin'));
}
$r .= $Plugin->get_edit_settings_link();
$r .= action_icon(T_('Un-install this plugin!'), 'delete', $admin_url . '?ctrl=plugins&action=uninstall&plugin_ID=' . $Plugin->ID . '&' . 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') . '&' . 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');
示例13: blogs_all_results_block
/**
* 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&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>';
}
}
示例14: Form
/**
* @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 «%s»'), '<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:
示例15: filter_email_blocked
$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&tab=blocked&action=blocked_new', T_('Add an email address') . ' »', 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&tab=blocked&statuses[]=unknown&statuses[]=warning&statuses[]=suspicious1&statuses[]=suspicious2&statuses[]=suspicious3&statuses[]=prmerror&statuses[]=spammer'), 'errors' => array(T_('Errors'), $admin_url . '?ctrl=email&tab=blocked&statuses[]=warning&statuses[]=suspicious1&statuses[]=suspicious2&statuses[]=suspicious3&statuses[]=prmerror&statuses[]=spammer'), 'attention' => array(T_('Need Attention'), $admin_url . '?ctrl=email&tab=blocked&statuses[]=warning&statuses[]=suspicious3')));