Added login request

This commit is contained in:
Nedim Uka
2018-06-20 18:03:43 +02:00
parent 4e52521fae
commit 593b445a21
4716 changed files with 1218265 additions and 57 deletions

View File

@@ -0,0 +1,47 @@
# Basic Authentication handler
This plugin adds Basic Authentication to a WordPress site.
Note that this plugin requires sending your username and password with every
request, and should only be used over SSL-secured connections or for local
development and testing. Without SSL we strongly recommend using the
[OAuth 1.0a][oauth] authentication handler in production environments.
## Installing
1. Download the plugin into your plugins directory
2. Enable in the WordPress admin
## Using
This plugin adds support for Basic Authentication, as specified in [RFC2617][].
Most HTTP clients will allow you to use this authentication natively. Some
examples are listed below.
### cURL
```sh
curl --user admin:password https://example.com/wp-json/
```
### WP_Http
```php
$args = array(
'headers' => array(
'Authorization' => 'Basic ' . base64_encode( $username . ':' . $password ),
),
);
```
### [node-wpapi][]
```js
const WPAPI = require('./wpapi')
const wp = new WPAPI({
endpoint: 'https://example.com/wp-json',
username: 'editor',
password: 'password'
});
```
[oauth]: https://github.com/WP-API/OAuth1
[RFC2617]: https://tools.ietf.org/html/rfc2617
[node-wpapi]: http://wp-api.org/node-wpapi/

View File

@@ -0,0 +1,62 @@
<?php
/**
* Plugin Name: JSON Basic Authentication
* Description: Basic Authentication handler for the JSON API, used for development and debugging purposes
* Author: WordPress API Team
* Author URI: https://github.com/WP-API
* Version: 0.1
* Plugin URI: https://github.com/WP-API/Basic-Auth
*/
function json_basic_auth_handler( $user ) {
global $wp_json_basic_auth_error;
$wp_json_basic_auth_error = null;
// Don't authenticate twice
if ( ! empty( $user ) ) {
return $user;
}
// Check that we're trying to authenticate
if ( !isset( $_SERVER['PHP_AUTH_USER'] ) ) {
return $user;
}
$username = $_SERVER['PHP_AUTH_USER'];
$password = $_SERVER['PHP_AUTH_PW'];
/**
* In multi-site, wp_authenticate_spam_check filter is run on authentication. This filter calls
* get_currentuserinfo which in turn calls the determine_current_user filter. This leads to infinite
* recursion and a stack overflow unless the current function is removed from the determine_current_user
* filter during authentication.
*/
remove_filter( 'determine_current_user', 'json_basic_auth_handler', 20 );
$user = wp_authenticate( $username, $password );
add_filter( 'determine_current_user', 'json_basic_auth_handler', 20 );
if ( is_wp_error( $user ) ) {
$wp_json_basic_auth_error = $user;
return null;
}
$wp_json_basic_auth_error = true;
return $user->ID;
}
add_filter( 'determine_current_user', 'json_basic_auth_handler', 20 );
function json_basic_auth_error( $error ) {
// Passthrough other errors
if ( ! empty( $error ) ) {
return $error;
}
global $wp_json_basic_auth_error;
return $wp_json_basic_auth_error;
}
add_filter( 'rest_authentication_errors', 'json_basic_auth_error' );

View File

@@ -0,0 +1,207 @@
/**
* Settings for admin dashboard.
* Based on the styles for Maintenance Mode plugin by Michael Wöhrer
*
* @version $Rev: 198515 $
* @author Jordi Canals
* @copyright Copyright (C) 2009, 2010 Jordi Canals
* @license GNU General Public License version 2
* @link http://alkivia.org
* @package Alkivia
* @subpackage CapsMan
*
Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* =========================================================== SETTINGS */
#icon-capsman-admin {
background: transparent url('images/cman32.png') no-repeat;
}
/* ====================================================== SIDEBAR ICONS */
td.sidebar a.capsman {
background-image: url('images/capsman.png');
}
a.cap_type {
text-decoration: none;
}
a.cap_type:hover {
text-decoration: underline;
}
ul.cme-listhoriz li {
text-align: center;
padding-right: 1em;
}
ul.cme-listhoriz li table{
text-align: center;
}
ul.cme-listhoriz {
width: 100%;
clear: both;
float: left;
margin: 0;
padding: 0;
}
ul.cme-listhoriz li {
list-style: none;
float: left;
margin: 0;
}
div.cme-listhoriz h3 {
margin: 0.2em;
}
table .cme-typecaps {
border: 1px solid black;
}
table .cme-typecaps td {
text-align: center;
height: 2em;
}
table .cme-typecaps th {
padding-left: 0.3em;
padding-right: 0.3em;
}
table.cme-typecaps span.cap-x {
display: none;
}
a.neg-cap, a.cap-on, a.type-on, a.neg-type-caps, a.cme-neg-all {
text-decoration: none;
}
span.cap-x, a.cme-neg-all {
color: red;
font-size: 1.5em;
padding-left: 1px;
padding-right: 1px;
vertical-align: middle;
}
a.cme-switch-all {
color: black;
font-size: 1.5em;
padding-right: 1px;
padding-right: 1px;
vertical-align: middle;
text-decoration: line-through;
}
td.cap-yes span {
color:green;font-weight:bold;
}
td.cap-no {
color:#777;
}
td.cap-neg label span {
color: red;
}
td.cap-neg input {
display:none;
}
td.cap-no span.cap-x, td.cap-yes span.cap-x {
display:none;
}
td.cap-neg span.cap-x {
display:inline;
}
td.cap-neg a.neg-cap {
display:none;
}
/*
span.cme-drop-cap {
color: #aaa;
}
*/
td.cap-metagroup label span {
color: #080 !important;
}
td.cap-locked label input {
display: inline !important;
}
td.cap-locked a.neg-cap {
display: none !important;
}
a.type-off, a.neg-cap, a.cme-neg-all, a.neg-type-caps {
color: #800;
}
a.type-on, a.cap-on, a.cme-switch-all {
color: black;
}
input.cme-check-all, a.cme-neg-all {
margin-right: 10px;
padding-right: 10px;
}
#akmin input.button {
margin-top: 5px;
}
#akmin td.sidebar {
width: 300px;
}
#akmin input.regular-text {
width: 200px;
}
#akmin input.tight-text {
width: 125px;
}
.cme-subtext {
color: #686868;
font-style: italic;
margin-top:5px;
}
/*
#wpbody-content{
padding-bottom: 30px;
}
*/
td.cm-has-via-pp {
background-color: #7f7;
}
/* EOF */

View File

@@ -0,0 +1,69 @@
jQuery(document).ready( function($) {
$('a.neg-cap').attr('title',cmeAdmin.negationCaption);
$('a.neg-type-caps').attr('title',cmeAdmin.typeCapsNegationCaption);
$('td.cap-unreg').attr('title',cmeAdmin.typeCapUnregistered);
$('a.normal-cap').attr('title',cmeAdmin.switchableCaption);
$('span.cap-x').attr('title',cmeAdmin.capNegated);
$('table.cme-checklist input[class!="cme-check-all"]').attr('title',cmeAdmin.chkCaption);
$('table.cme-checklist a.neg-cap').click( function(e) {
$(this).closest('td').removeClass('cap-yes').removeClass('cap-no').addClass('cap-neg');
var cap_name_attr = $(this).parent().find('input[type="checkbox"]').attr('name');
$(this).after('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');
return false;
});
//$('table.cme-typecaps span.cap-x,table.cme-checklist span.cap-x,table.cme-checklist td.cap-neg span').live( 'click', function(e) {
$(document).on( 'click', 'table.cme-typecaps span.cap-x,table.cme-checklist span.cap-x,table.cme-checklist td.cap-neg span', function(e) {
$(this).closest('td').removeClass('cap-neg').removeClass('cap-yes').addClass('cap-no');
$(this).parent().find('input[type="checkbox"]').prop('checked',false);
$(this).parent().find('input.cme-negation-input').remove();
return false;
});
$('input.cme-check-all').click( function(e) {
$(this).closest('table').find('input[type="checkbox"][disabled!="disabled"]:visible').prop('checked', $(this).is(":checked") );
});
$('a.cme-neg-all').click( function(e) {
$(this).closest('table').find('a.neg-cap:visible').click();
return false;
});
$('a.cme-switch-all').click( function(e) {
$(this).closest('table').find('td.cap-neg span').click();
return false;
});
$('table.cme-typecaps a.neg-type-caps').click( function(e) {
$(this).closest('tr').find('td[class!="cap-neg"]').filter('td[class!="cap-unreg"]').each( function(e) {
$(this).addClass('cap-neg');
var cap_name_attr = $(this).parent().find('input[type="checkbox"]').attr('name');
$(this).append('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');
});
return false;
});
//http://stackoverflow.com/users/803925/nbrooks
$('table.cme-typecaps th').click(function(){
var columnNo = $(this).index();
var check_val = ! $(this).prop('checked_all');
if ( $(this).hasClass('term-cap') )
var class_sel = '[class*="term-cap"]';
else
var class_sel = '[class*="post-cap"]';
$(this).closest("table")
.find("tr td" + class_sel + ":nth-child(" + (columnNo+1) + ') input[type="checkbox"]:visible')
.prop("checked", check_val);
$(this).prop('checked_all',check_val);
});
});

View File

@@ -0,0 +1,3 @@
jQuery(document).ready(function($){$('a.neg-cap').attr('title',cmeAdmin.negationCaption);$('a.neg-type-caps').attr('title',cmeAdmin.typeCapsNegationCaption);$('td.cap-unreg').attr('title',cmeAdmin.typeCapUnregistered);$('a.normal-cap').attr('title',cmeAdmin.switchableCaption);$('span.cap-x').attr('title',cmeAdmin.capNegated);$('table.cme-checklist input[class!="cme-check-all"]').attr('title',cmeAdmin.chkCaption);$('table.cme-checklist a.neg-cap').click(function(e){$(this).closest('td').removeClass('cap-yes').removeClass('cap-no').addClass('cap-neg');var cap_name_attr=$(this).parent().find('input[type="checkbox"]').attr('name');$(this).after('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');return false;});$(document).on('click','table.cme-typecaps span.cap-x,table.cme-checklist span.cap-x,table.cme-checklist td.cap-neg span',function(e){$(this).closest('td').removeClass('cap-neg').removeClass('cap-yes').addClass('cap-no');$(this).parent().find('input[type="checkbox"]').prop('checked',false);$(this).parent().find('input.cme-negation-input').remove();return false;});$('input.cme-check-all').click(function(e){$(this).closest('table').find('input[type="checkbox"][disabled!="disabled"]:visible').prop('checked',$(this).is(":checked"));});$('a.cme-neg-all').click(function(e){$(this).closest('table').find('a.neg-cap:visible').click();return false;});$('a.cme-switch-all').click(function(e){$(this).closest('table').find('td.cap-neg span').click();return false;});$('table.cme-typecaps a.neg-type-caps').click(function(e){$(this).closest('tr').find('td[class!="cap-neg"]').filter('td[class!="cap-unreg"]').each(function(e){$(this).addClass('cap-neg');var cap_name_attr=$(this).parent().find('input[type="checkbox"]').attr('name');$(this).append('<input type="hidden" class="cme-negation-input" name="'+cap_name_attr+'" value="" />');});return false;});$('table.cme-typecaps th').click(function(){var columnNo=$(this).index();var check_val=!$(this).prop('checked_all');if($(this).hasClass('term-cap'))
var class_sel='[class*="term-cap"]';else
var class_sel='[class*="post-cap"]';$(this).closest("table").find("tr td"+class_sel+":nth-child("+(columnNo+1)+') input[type="checkbox"]:visible').prop("checked",check_val);$(this).prop('checked_all',check_val);});});

View File

@@ -0,0 +1,140 @@
<?php
/**
* Capability Manager. Main Plugin File.
* Plugin to create and manage Roles and Capabilities.
*
* @package capability-manager-enhanced
* @author Jordi Canals, Kevin Behrens
* @copyright Copyright (C) 2009, 2010 Jordi Canals; modifications Copyright (C) 2012-2018 Kevin Behrens
* @license GNU General Public License version 3
* @link http://agapetry.net
* @version 1.5.8
*/
/*
Plugin Name: Capability Manager Enhanced
Plugin URI: http://presspermit.com/capability-manager
Description: Manage WordPress role definitions, per-site or network-wide. Organizes post capabilities by post type and operation.
Version: 1.5.8
Author: Jordi Canals, Kevin Behrens
Author URI: http://agapetry.net
Text Domain: capsman-enhanced
Domain Path: /lang/
License: GPLv3
*/
if ( ! defined( 'CAPSMAN_VERSION' ) ) {
define( 'CAPSMAN_VERSION', '1.5.8' );
define( 'CAPSMAN_ENH_VERSION', '1.5.8' );
}
if ( cme_is_plugin_active( 'capsman.php' ) ) {
$message = __( '<strong>Error:</strong> Capability Manager Extended cannot function because another copy of Capability Manager is active.', 'capsman-enhanced' );
add_action('admin_notices', create_function('', 'echo \'<div id="message" class="error fade" style="color: black">' . $message . '</div>\';'));
return;
} else {
define ( 'CME_FILE', __FILE__ );
define ( 'AK_CMAN_PATH', dirname(__FILE__) );
define ( 'AK_CMAN_LIB', AK_CMAN_PATH . '/includes' );
/**
* Sets an admin warning regarding required PHP version.
*
* @hook action 'admin_notices'
* @return void
*/
function _cman_php_warning() {
$data = get_plugin_data(__FILE__);
load_plugin_textdomain('capsman-enhanced', false, basename(dirname(__FILE__)) .'/lang');
echo '<div class="error"><p><strong>' . __('Warning:', 'capsman-enhanced') . '</strong> '
. sprintf(__('The active plugin %s is not compatible with your PHP version.', 'capsman-enhanced') .'</p><p>',
'&laquo;' . $data['Name'] . ' ' . $data['Version'] . '&raquo;')
. sprintf(__('%s is required for this plugin.', 'capsman-enhanced'), 'PHP-5 ')
. '</p></div>';
}
// ============================================ START PROCEDURE ==========
// Check required PHP version.
if ( version_compare(PHP_VERSION, '5.0.0', '<') ) {
// Send an armin warning
add_action('admin_notices', '_cman_php_warning');
} else {
global $pagenow;
if ( is_admin() &&
( isset($_REQUEST['page']) && in_array( $_REQUEST['page'], array( 'capsman', 'capsman-tool' ) )
|| ( ! empty($_SERVER['SCRIPT_NAME']) && strpos( $_SERVER['SCRIPT_NAME'], 'p-admin/plugins.php' ) && ! empty($_REQUEST['action'] ) )
|| ( isset($_GET['action']) && 'reset-defaults' == $_GET['action'] )
|| in_array( $pagenow, array( 'users.php', 'user-edit.php', 'profile.php', 'user-new.php' ) )
) ) {
global $capsman;
// Run the plugin
include_once ( AK_CMAN_PATH . '/framework/loader.php' );
include ( AK_CMAN_LIB . '/manager.php' );
$capsman = new CapabilityManager(__FILE__, 'capsman');
if ( isset($_REQUEST['page']) && ( 'capsman' == $_REQUEST['page'] ) ) {
add_action( 'admin_enqueue_scripts', '_cme_pp_scripts' );
}
} else {
load_plugin_textdomain('capsman-enhanced', false, basename(dirname(__FILE__)) .'/lang');
add_action( 'admin_menu', 'cme_submenus', 20 );
}
}
}
add_action( 'plugins_loaded', '_cme_act_pp_active', 1 );
function _cme_act_pp_active() {
if ( defined('PP_VERSION') || defined('PPC_VERSION') )
define( 'PP_ACTIVE', true );
}
function _cme_pp_scripts() {
wp_enqueue_style( 'plugin-install' );
wp_enqueue_script( 'plugin-install' );
add_thickbox();
}
// perf enchancement: display submenu links without loading framework and plugin code
function cme_submenus() {
$cap_name = ( is_super_admin() ) ? 'manage_capabilities' : 'restore_roles';
add_management_page(__('Capability Manager', 'capsman-enhanced'), __('Capability Manager', 'capsman-enhanced'), $cap_name, 'capsman' . '-tool', 'cme_fakefunc');
if ( did_action( 'pp_admin_menu' ) ) { // Put Capabilities link on Permissions menu if Press Permit is active and user has access to it
global $pp_admin;
$menu_caption = ( defined('WPLANG') && WPLANG && ( 'en_EN' != WPLANG ) ) ? __('Capabilities', 'capsman-enhanced') : 'Role Capabilities';
add_submenu_page( $pp_admin->get_menu('options'), __('Capability Manager', 'capsman-enhanced'), $menu_caption, 'manage_capabilities', 'capsman', 'cme_fakefunc' );
} else {
add_users_page( __('Capability Manager', 'capsman-enhanced'), __('Capabilities', 'capsman-enhanced'), 'manage_capabilities', 'capsman', 'cme_fakefunc');
}
}
function cme_is_plugin_active($check_plugin_file) {
if ( ! $check_plugin_file )
return false;
$plugins = get_option('active_plugins');
foreach ( $plugins as $plugin_file ) {
if ( false !== strpos($plugin_file, $check_plugin_file) )
return $plugin_file;
}
}
// if a role is marked as hidden, also default it for use by Press Permit as a Pattern Role (when PP Collaborative Editing is activated and Advanced Settings enabled)
function _cme_pp_default_pattern_role( $role ) {
if ( ! $pp_role_usage = get_option( 'pp_role_usage' ) )
$pp_role_usage = array();
if ( empty( $pp_role_usage[$role] ) ) {
$pp_role_usage[$role] = 'pattern';
update_option( 'pp_role_usage', $pp_role_usage );
}
}
if ( is_multisite() )
require_once ( AK_CMAN_PATH . '/includes/network.php' );

View File

@@ -0,0 +1,267 @@
<?php
/**
* Plugins related functions and classes.
*
* @version $Rev: 203758 $
* @author Jordi Canals
* @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
* @license GNU General Public License version 2
* @link http://alkivia.org
* @package Alkivia
* @subpackage Framework
*
Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Abtract class to be used as a plugin template.
* Must be implemented before using this class and it's recommended to prefix the class to prevent collissions.
* There are some special functions that have to be declared in implementations to perform main actions:
* - pluginActivate (Protected) Actions to run when activating the plugin.
* - pluginUpdate (Protected) Actions to update the plugin to a new version. (Updating version on DB is done after this).
* Takes plugin running version as a parameter.
*
* @author Jordi Canals
* @package Alkivia
* @subpackage Framework
* @link http://wiki.alkivia.org/framework/classes/plugin
*/
abstract class akPluginAbstract
{
/**
* Module ID. Is the module internal short name.
* Filled in constructor (as a constructor param). Used for translations textdomain.
*
* @var string
*/
public $ID;
/**
* Module version number.
*
* @since 0.8
*
* @var string
*/
public $version;
/**
* Full path to module main file.
* Main file is 'style.css' for themes and the php file with data header for plugins and components.
*
* @var string
*/
protected $mod_file;
/**
* URL to the module folder.
*
* @var string
*/
protected $mod_url;
/**
* Flag to see if module needs to be updated.
*
* @var boolean
*/
protected $needs_update = false;
/**
* Class constructor.
* Calls the implementated method 'startUp' if it exists. This is done at plugins loading time.
* Prepares admin menus by seting an action for the implemented method '_adminMenus' if it exists.
*
* @param string $mod_file Full main plugin's filename (absolute to root).
* @param string $ID Plugin short name (known as plugin ID).
* @return spostsPlugin|false The plugin object or false if not compatible.
*/
public function __construct( $mod_file, $ID = '' )
{
$this->mod_file = trim($mod_file);
$this->loadModuleData($ID);
add_action('plugins_loaded', array($this, 'pluginsInit'));
//if ( ! apply_filters('ak_' . $this->ID . '_disable_admin', $this->getOption('disable-admin-page')) ) {
add_action('admin_menu', array($this, 'adminMenus'), 5); // execute prior to PP, to use menu hook
//}
// Load styles
add_action('admin_print_styles', array($this, 'adminStyles'));
$this->moduleLoad();
// Activation and deactivation hooks.
register_activation_hook($this->mod_file, array($this, 'activate'));
add_action('plugins_loaded', array($this, 'init'));
}
/**
* Fires on plugin activation.
* @return void
*/
protected function pluginActivate () {}
/**
* Updates the plugin to a new version.
* @param string $version Old plugin version.
* @return void
*/
protected function pluginUpdate ( $version ) {}
/**
* Activates the plugin. Only runs on first activation.
* Saves the plugin version in DB, and calls the 'pluginActivate' method.
*
* @uses do_action() Calls 'ak_activate_<modID>_plugin' action hook.
* @hook register_activation_hook
* @access private
* @return void
*/
final function activate()
{
$this->pluginActivate();
// Save options and version
add_option($this->ID . '_version', $this->version);
// Do activated hook.
do_action('ak_activate_' . $this->ID . '_plugin');
}
/**
* Init the plugin (In action 'plugins_loaded')
* Here whe call the 'pluginUpdate' method.
* Also the plugin version and settings are updated here.
*
* @hook action plugins_loaded
* @uses do_action() Calls the 'ak_<modID>_updated' action hook.
*
* @access private
* @return void
*/
final function init()
{
// First, check if the plugin needs to be updated.
if ( $this->needs_update ) {
$version = get_option($this->ID . '_version');
$this->pluginUpdate($version);
update_option($this->ID . '_version', $this->version);
do_action('ak_' . $this->ID . '_updated');
}
}
/**
* Functions to execute after loading plugins.
*
* @return void
*/
final function pluginsInit ()
{
load_plugin_textdomain('capsman-enhanced', false, basename(dirname($this->mod_file)) . '/lang');
}
/**
* Enqueues additional administration styles.
* Send the framework admin.css file and additionally any other admin.css file
* found on the module direcotry.
*
* @hook action 'admin_print_styles'
* @uses apply_filters() Calls the 'ak_framework_style_admin' filter on the framework style url.
* @uses apply_filters() Calls the 'ak_<Mod_ID>_style_admin' filter on the style url.
* @access private
*
* @return void
*/
final function adminStyles()
{
if ( empty( $_REQUEST['page'] ) || ! in_array( $_REQUEST['page'], array( 'capsman', 'capsman-tool' ) ) )
return;
// FRAMEWORK admin styles.
$url = apply_filters('ak_framework_style_admin', AK_STYLES_URL . '/admin.css');
if ( ! empty($url) ) {
wp_register_style('ak_framework_admin', $url, false, get_option('ak_framework_version'));
wp_enqueue_style('ak_framework_admin');
}
// MODULE admin styles.
if ( file_exists(dirname($this->mod_file) . '/admin.css') ) {
$url = $this->mod_url . '/admin.css';
} else {
$url = '';
}
$url = apply_filters('ak_' . $this->ID . '_style_admin', $url);
if ( ! empty($url) ) {
wp_register_style('ak_' . $this->ID . '_admin', $url, array('ak_framework_admin'), $this->version);
wp_enqueue_style('ak_' . $this->ID . '_admin');
}
if ( file_exists(dirname($this->mod_file) . '/admin.js') ) {
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
$url = $this->mod_url . "/admin{$suffix}.js";
wp_enqueue_script( 'cme_admin', $url, array('jquery'), CAPSMAN_VERSION, true );
wp_localize_script( 'cme_admin', 'cmeAdmin', array(
'negationCaption' => __( 'Explicity negate this capability by storing as disabled', 'capsman-enhanced' ),
'typeCapsNegationCaption' => __( 'Explicitly negate these capabilities by storing as disabled', 'capsman-enhanced' ),
'typeCapUnregistered' => __( 'Post type registration does not define this capability distinctly', 'capsman-enhanced' ),
'capNegated' => __( 'This capability is explicitly negated. Click to add/remove normally.', 'capsman-enhanced' ),
'chkCaption' => __( 'Add or remove this capability from the WordPress role', 'capsman-enhanced' ),
'switchableCaption' => __( 'Add or remove capability from the role normally', 'capsman-enhanced' ) )
);
}
}
/**
* Loads module data and settings.
* Data is loaded from the module file headers. Settings from Database and alkivia.ini.
*
* @return void
*/
final private function loadModuleData ( $id )
{
$this->mod_url = plugins_url( '', CME_FILE );
if ( ! isset($this->ID) )
$this->ID = ( empty($id) ) ? strtolower(basename($this->mod_file, '.php')) : trim($id) ;
$old_version = get_option($this->ID . '_version');
if ( version_compare($old_version, $this->version, 'ne') ) {
$this->needs_update = true;
}
}
/**
* Executes as soon as module class is loaded.
*
* @return void
*/
protected function moduleLoad() {}
/**
* Fires at 'admin_menus' action hook.
*
* @return void
*/
public function adminMenus () {}
}

View File

@@ -0,0 +1,72 @@
<?php
/**
* Framework Initialization.
* This file is called at framework load time.
*
* @version $Rev: 199485 $
* @author Jordi Canals
* @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
* @license GNU General Public License version 2
* @link http://alkivia.org
* @package Alkivia
* @subpackage Framework
*
Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Creates and returns the framework URL.
*
* @return string Framework URL
*/
function ak_styles_url ()
{
$dir = str_replace('\\', '/', WP_CONTENT_DIR);
$fmw = str_replace('\\', '/', AKK_FRAMEWORK);
return str_replace($dir, content_url(), $fmw) . '/styles';
}
// ================================================= SET GLOBAL CONSTANTS =====
if ( ! defined('AK_STYLES_URL') ) {
/** Define the framework URL */
define ( 'AK_STYLES_URL', ak_styles_url() );
}
if ( ! defined('AK_INI_FILE') ) {
/** Define the alkivia.ini filename and absoilute location */
define ( 'AK_INI_FILE', WP_CONTENT_DIR . '/alkivia.ini');
}
if ( ! defined('AK_CLASSES') ) {
/** Define the classes folder */
define ( 'AK_CLASSES', AKK_FRAMEWORK . '/classes');
}
if ( ! defined('AK_LIB') ) {
/** Library folder for functions files */
define ( 'AK_LIB', AKK_FRAMEWORK . '/lib');
}
// ============================================== SET GLOBAL ACTION HOOKS =====
// ================================================ INCLUDE ALL LIBRARIES =====
require_once ( AK_LIB . '/formating.php' );
require_once ( AK_LIB . '/themes-agapetry.php' );
require_once ( AK_LIB . '/users.php' );

View File

@@ -0,0 +1,57 @@
<?php
/**
* General formating functions.
* Used to format output data and send messages to user.
*
* @version $Rev: 199485 $
* @author Jordi Canals
* @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
* @license GNU General Public License version 2
* @link http://alkivia.org
* @package Alkivia
* @subpackage Framework
*
Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Displays admin notices.
*
* @param $message Message to display.
* @return void
*/
function ak_admin_notify( $message = '' )
{
if ( is_admin() ) {
if ( empty($message) ) {
$message = __('Settings saved.', 'capsman-enhanced');
}
echo '<div id="message" class="updated fade"><p><strong>' . $message . '</strong></p></div>';
}
}
/**
* Displays admin ERRORS.
*
* @param $message Message to display.
* @return void
*/
function ak_admin_error( $message )
{
if ( is_admin() ) {
echo '<div id="error" class="error"><p><strong>' . $message . '</strong></p></div>';
}
}

View File

@@ -0,0 +1,30 @@
<?php
function agp_admin_authoring( $mod_id = '' ) {
return; // kevinB temp
?>
<dl>
<dt>Capability Manager</dt>
<dd>
<ul>
<li><a href="http://agapetry.com" class="capsman" target="_blank"><?php _e('Plugin Homepage', 'capsman-enhanced'); ?></a></li>
<li><a href="http://presspermit.com" class="docs" target="_blank"><?php _e('Documentation', 'capsman-enhanced'); ?></a></li>
<li><a href="http://agapetry.net/forum" class="help" target="_blank"><?php _e('Support Forum', 'capsman-enhanced'); ?></a></li>
<li><a href="http://agapetry.com" class="home" target="_blank"><?php _e('Author Homepage', 'capsman-enhanced')?></a></li>
<li><a href="http://agapetry.com" class="donate" target="_blank"><?php _e('Help donating', 'capsman-enhanced')?></a></li>
</ul>
</dd>
</dl>
<?php
}
function agp_admin_footer( $mod_id = '' ) {
?>
<p class="footer">
<a href="http://wordpress.org/extend/plugins/capability-manager-enhanced"><?php printf( __( 'Capability Manager Enhanced %s', 'capsman-enhanced' ), CAPSMAN_ENH_VERSION );?></a>
&nbsp;&nbsp;|&nbsp;&nbsp;&copy; <?php _e( 'Copyright 2010 Jordi Canals', 'capsman-enhanced' );?>
&nbsp;&nbsp;|&nbsp;&nbsp;
<?php
printf( __( 'Modifications &copy; Copyright %1$s %2$s', 'capsman-enhanced' ), '2012-2015', '<a href="http://agapetry.com">Kevin Behrens</a>' );?>
</p>
<?php
}

View File

@@ -0,0 +1,108 @@
<?php
/**
* Users, Roles and Capabilities related functions.
*
* @version $Rev: 203758 $
* @author Jordi Canals
* @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
* @license GNU General Public License version 2
* @link http://alkivia.org
* @package Alkivia
* @subpackage Framework
*
Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Returns all valid roles.
* The returned list can be translated or not.
*
* @uses apply_filters() Calls the 'alkivia_roles_translate' hook on translated roles array.
* @since 0.5
*
* @param boolean $translate If the returned roles have to be translated or not.
* @return array All defined roles. If translated, the key is the role name and value is the translated role.
*/
function ak_get_roles( $translate = false ) {
global $wp_roles;
if ( ! isset( $wp_roles ) ) {
$wp_roles = new WP_Roles();
}
$roles = $wp_roles->get_names();
if ( $translate ) {
foreach ($roles as $k => $r) {
$roles[$k] = _x($r, 'User role');
}
asort($roles);
return apply_filters('alkivia_roles_translate', $roles);
} else {
$roles = array_keys($roles);
asort($roles);
return $roles;
}
}
/**
* Generates the caps names from user level.
*
* @since 0.5
*
* @param int $level Level to convert to caps
* @return array Generated caps
*/
function ak_level2caps( $level ) {
$caps = array();
$level = min(10, intval($level));
for ( $i = $level; $i >= 0; $i--) {
$caps["level_{$i}"] = true;
}
return $caps;
}
/**
* Finds the proper level from a capabilities list.
*
* @since 0.5
*
* @uses _ak_level_reduce()
* @param array $caps List of capabilities.
* @return int Level found, if no level found, will return 0.
*/
function ak_caps2level( $caps ) {
$level = array_reduce( array_keys( $caps ), '_ak_caps2level_CB', 0);
return $level;
}
/**
* Callback function to find the level from caps.
* Taken from WordPress 2.7.1
*
* @since 0.5
* @access private
*
* @return int level Level found.
*/
function _ak_caps2level_CB( $max, $item ) {
if ( preg_match( '/^level_(10|[0-9])$/i', $item, $matches ) ) {
$level = intval( $matches[1] );
return max( $max, $level );
} else {
return $max;
}
}

View File

@@ -0,0 +1,280 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS

View File

@@ -0,0 +1,32 @@
<?php
/**
* Framework Loader.
* This file MUST always be included at startup when using the framework.
*
* @version $Rev: 203758 $
* @author Jordi Canals
* @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
* @license GNU General Public License version 2
* @link http://alkivia.org
* @package Alkivia
* @subpackage Framework
*
Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Define the framework path.
define ('AKK_FRAMEWORK', dirname(__FILE__) );
include_once( AKK_FRAMEWORK . '/init.php');

View File

@@ -0,0 +1,170 @@
/**
* Alkivia Framework.
* Styles for admin dashboard.
* Based on the styles for Maintenance Mode plugin by Michael Wöhrer
*
* @version $Rev: 198515 $
* @author Jordi Canals
* @copyright Copyright (C) 2009, 2010 Jordi Canals
* @license GNU General Public License version 2
* @link http://alkivia.org
* @package Alkivia
* @subpackage Framework
*
Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* =========================================================== SETTINGS */
table#akmin {
width: 100%;
border: 0 none;
padding: 0;
margin:0;
}
table#akmin fieldset {
border: 0 none;
padding: 0;
margin:0;
}
table#akmin td {
vertical-align: top;
}
table#akmin td dl {
padding: 0;
margin: 10px 0 20px 0;
background-color: white;
border: 1px solid #dfdfdf;
}
table#akmin td dl {
-moz-border-radius: 5px;
-khtml-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
table#akmin dl dt {
font-size: 13px;
font-weight: bold;
margin: 0;
padding: 4px 10px 4px 10px;
background: #dfdfdf url('images/dl-bg-gray.png') repeat-x left top;
}
table#akmin p {
padding: 5px 0 5px 0;
margin: 0;
}
table#akmin .footer {
text-align: center;
font-size: 10.5px;
}
table#akmin .footer a {
font-size: 10.5px;
text-decoration: none;
}
table#akmin .footer a:hover {
text-decoration: underline;
}
table#akmin td small {
font-size: 10.5px;
}
table#akmin hr {
border: none 0;
border-top: 1px solid #bbbbbb;
height: 1px;
}
table#akmin ul {
list-style: none;
}
table#akmin ul.ul-disc {
list-style: disc outside;
}
table#akmin ul.bullet {
list-style-type: disc;
padding-left: 20px;
}
/* ====================================================== ADMIN CONTENT */
table#akmin td.content {
padding: 0 8px 0 0;
}
table#akmin td.content dd {
margin: 0;
padding: 10px;
}
/* ====================================================== ADMIN SIDEBAR */
table#akmin td.sidebar {
width: 250px;
padding: 0 0 0 8px;
}
table#akmin td.sidebar ul, table#akmin td.sidebar ul li {
list-style: none;
padding: 0;
margin: 0;
}
table#akmin td.sidebar a {
text-decoration: none;
background-position: 0px 60%;
background-repeat: no-repeat;
padding: 4px 0px 4px 22px;
border: 0 none;
display: block;
}
table#akmin td.sidebar ul li {
margin: 0;
border-bottom: 1px dotted gray;
}
table#akmin td.sidebar dd {
margin: 0;
padding: 5px 10px 5px 10px;
}
/* ====================================================== SIDEBAR ICONS */
td.sidebar a.docs {
background-image: url('images/docs.png');
}
td.sidebar a.help {
background-image: url('images/help.png');
}
td.sidebar a.home {
}
/* EOF */

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,734 @@
<?php
/**
* General Admin for Capability Manager.
* Provides admin pages to create and manage roles and capabilities.
*
* @version $Rev: 198515 $
* @author Jordi Canals, Kevin Behrens
* @copyright Copyright (C) 2009, 2010 Jordi Canals, (C) 2012-2013 Kevin Behrens
* @license GNU General Public License version 2
* @link http://agapetry.net
*
Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
Modifications Copyright 2012-2015, Kevin Behrens <kevin@agapetry.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
$roles = $this->roles;
$default = $this->current;
if( defined('PP_ACTIVE') ) {
require_once( dirname(__FILE__).'/pp-ui.php' );
$pp_ui = new Capsman_PP_UI();
$pp_metagroup_caps = $pp_ui->get_metagroup_caps( $default );
} else
$pp_metagroup_caps = array();
?>
<div class="wrap">
<?php if( defined('PP_ACTIVE') ) :
pp_icon();
$style = 'style="height:60px;"';
?>
<?php else:
$style = '';
?>
<div id="icon-capsman-admin" class="icon32"></div>
<?php endif; ?>
<h1 <?php echo $style;?>><?php _e('Roles and Capabilities', 'capsman-enhanced') ?></h1>
<form method="post" action="admin.php?page=<?php echo $this->ID ?>">
<?php wp_nonce_field('capsman-general-manager'); ?>
<fieldset>
<table id="akmin">
<tr>
<td class="content">
<dl>
<dt><?php printf(__('Capabilities for %s', 'capsman-enhanced'), $roles[$default]); ?></dt>
<dd>
<div>
<?php _e( 'View and modify capabilities WordPress associates with each role. Changes <strong>remain in the database</strong> even if you deactivate this plugin.', 'capsman-enhanced' ); ?>
</div>
<?php
if ( defined( 'PP_ACTIVE' ) ) {
$pp_ui->show_capability_hints( $default );
} else {
global $capsman;
$img_url = $capsman->mod_url . '/images/';
echo '<div style="margin-top:5px">';
_e( "To further customize editing or viewing access, consider stepping up to <a href='#pp-more'>Press Permit</a>.", 'capsman-enhanced' );
echo '</div>';
?>
<script type="text/javascript">
/* <![CDATA[ */
jQuery(document).ready( function($) {
$('a[href=#pp-more]').click( function() {
$('#pp_features').show();
return false;
});
$('a[href=#pp-hide]').click( function() {
$('#pp_features').hide();
return false;
});
});
/* ]]> */
</script>
<style>
#pp_features {display:none;border:1px solid #eee;padding:5px;text-align:center;min-width:600px}
div.pp-logo { text-align: center }
div.features-wrap { margin-left: auto; margin-right: auto; text-align: center; width: 540px; }
ul.pp-features { list-style: none; padding-top:10px; text-align:left; margin-left: auto }
ul.pp-features li:before { content: "\2713\0020"; }
ul.pp-features li { padding-bottom: 5px }
img.cme-play { margin-bottom: -3px; margin-left: 5px;}
</style>
<?php /* play.png icon by Pavel: http://kde-look.org/usermanager/search.php?username=InFeRnODeMoN */ ?>
<br /><div id="pp_features"><div class="pp-logo"><a href="http://presspermit.com"><img src="<?php echo $img_url;?>pp-logo.png" /></a></div><div class="features-wrap"><ul class="pp-features">
<li>
<?php _e( "Automatically define type-specific capabilities for your custom post types and taxonomies", 'capsman-enhanced' );?>
<a href="http://presspermit.com/tutorial/regulate-post-type-access" target="_blank"><img class="cme-play" src="<?php echo $img_url;?>play.png" /></a></li>
<li>
<?php _e( "Assign standard WP roles supplementally for a specific post type", 'capsman-enhanced' );?>
<a href="http://presspermit.com/tutorial/regulate-post-type-access" target="_blank"><img class="cme-play" src="<?php echo $img_url;?>play.png" /></a></li>
<li>
<?php _e( "Assign custom WP roles supplementally for a specific post type <em>(Pro)</em>", 'capsman-enhanced' );?>
<a href="http://presspermit.com/tutorial/custom-role-usage" target="_blank"><img class="cme-play" src="<?php echo $img_url;?>play.png" /></a></li>
<li>
<?php _e( "Customize reading permissions per-category or per-post", 'capsman-enhanced' );?>
<a href="http://presspermit.com/tutorial/category-exceptions" target="_blank"><img class="cme-play" src="<?php echo $img_url;?>play.png" /></a></li>
<li>
<?php _e( "Customize editing permissions per-category or per-post <em>(Pro)</em>", 'capsman-enhanced' );?>
<a href="http://presspermit.com/tutorial/page-editing-exceptions" target="_blank"><img class="cme-play" src="<?php echo $img_url;?>play.png" /></a></li>
<li>
<?php _e( "Custom Post Visibility statuses, fully implemented throughout wp-admin <em>(Pro)</em>", 'capsman-enhanced' );?>
<a href="http://presspermit.com/tutorial/custom-post-visibility" target="_blank"><img class="cme-play" src="<?php echo $img_url;?>play.png" /></a></li>
<li>
<?php _e( "Custom Moderation statuses for access-controlled, multi-step publishing workflow <em>(Pro)</em>", 'capsman-enhanced' );?>
<a href="http://presspermit.com/tutorial/multi-step-moderation" target="_blank"><img class="cme-play" src="<?php echo $img_url;?>play.png" /></a></li>
<li>
<?php _e( "Regulate permissions for Edit Flow post statuses <em>(Pro)</em>", 'capsman-enhanced' );?>
<a href="http://presspermit.com/tutorial/edit-flow-integration" target="_blank"><img class="cme-play" src="<?php echo $img_url;?>play.png" /></a></li>
<li>
<?php _e( "Customize the moderated editing of published content with Revisionary or Post Forking <em>(Pro)</em>", 'capsman-enhanced' );?>
<a href="http://presspermit.com/tutorial/published-content-revision" target="_blank"><img class="cme-play" src="<?php echo $img_url;?>play.png" /></a></li>
<li>
<?php _e( "Grant Spectator, Participant or Moderator access to specific bbPress forums <em>(Pro)</em>", 'capsman-enhanced' );?>
<a href="http://presspermit.com/tutorial/bbpress-exceptions" target="_blank"><img class="cme-play" src="<?php echo $img_url;?>play.png" /></a></li>
<li>
<?php _e( "Grant supplemental content permissions to a BuddyPress group <em>(Pro)</em>", 'capsman-enhanced' );?>
<a href="http://presspermit.com/tutorial/buddypress-content-permissions" target="_blank"><img class="cme-play" src="<?php echo $img_url;?>play.png" /></a></li>
<li>
<?php _e( "WPML integration to mirror permissions to translations <em>(Pro)</em>", 'capsman-enhanced' );?>
</li>
<li>
<?php _e( "Member support forum", 'capsman-enhanced' );?>
</li>
</ul></div>
<?php
echo '<div>';
printf( __('%1$sgrab%2$s %3$s', 'capsman-enhanced'), '<strong>', '</strong>', '<span class="plugins update-message"><a href="' . cme_plugin_info_url('press-permit-core') . '" class="thickbox" title="' . sprintf( __('%s (free install)', 'capsman-enhanced'), 'Press Permit Core' ) . '">Press&nbsp;Permit&nbsp;Core</a></span>' );
echo '&nbsp;&nbsp;&bull;&nbsp;&nbsp;';
printf( __('%1$sbuy%2$s %3$s', 'capsman-enhanced'), '<strong>', '</strong>', '<a href="http://presspermit.com" target="_blank" title="' . sprintf( __('%s info/purchase', 'capsman-enhanced'), 'Press Permit Pro' ) . '">Press&nbsp;Permit&nbsp;Pro</a>' );
echo '&nbsp;&nbsp;&bull;&nbsp;&nbsp;';
echo '<a href="#pp-hide">hide</a>';
echo '</div></div>';
}
if ( MULTISITE ) {
global $wp_roles;
global $wpdb;
if ( ! empty($_REQUEST['cme_net_sync_role'] ) ) {
switch_to_blog(1);
wp_cache_delete( $wpdb->prefix . 'user_roles', 'options' );
}
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
}
global $capsman;
$capsman->reinstate_db_roles();
$current = get_role($default);
//print_r($current);
$rcaps = $current->capabilities;
// ========= Begin Kevin B mod ===========
$is_administrator = current_user_can( 'administrator' );
$custom_types = get_post_types( array( '_builtin' => false ), 'names' );
$custom_tax = get_taxonomies( array( '_builtin' => false ), 'names' );
$defined = array();
$defined['type'] = get_post_types( array( 'public' => true ), 'object' );
$defined['taxonomy'] = get_taxonomies( array( 'public' => true ), 'object' );
$unfiltered['type'] = apply_filters( 'pp_unfiltered_post_types', array('forum','topic','reply') ); // bbPress' dynamic role def requires additional code to enforce stored caps
$unfiltered['taxonomy'] = apply_filters( 'pp_unfiltered_taxonomies', array( 'post_status', 'topic-tag' ) ); // avoid confusion with Edit Flow administrative taxonomy
/*
if ( ( count($custom_types) || count($custom_tax) ) && ( $is_administrator || current_user_can( 'manage_pp_settings' ) ) ) {
$cap_properties[''] = array();
$force_distinct_ui = true;
}
*/
$cap_properties['edit']['type'] = array( 'edit_posts' );
foreach( $defined['type'] as $type_obj ) {
if ( 'attachment' != $type_obj->name ) {
if ( isset( $type_obj->cap->create_posts ) && ( $type_obj->cap->create_posts != $type_obj->cap->edit_posts ) ) {
$cap_properties['edit']['type'][]= 'create_posts';
break;
}
}
}
$cap_properties['edit']['type'][]= 'edit_others_posts';
$cap_properties['edit']['type'] = array_merge( $cap_properties['edit']['type'], array( 'publish_posts', 'edit_published_posts', 'edit_private_posts' ) );
$cap_properties['edit']['taxonomy'] = array( 'manage_terms' );
if ( ! defined( 'PP_ACTIVE' ) )
$cap_properties['edit']['taxonomy'] = array_merge( $cap_properties['edit']['taxonomy'], array( 'edit_terms', 'assign_terms' ) );
$cap_properties['delete']['type'] = array( 'delete_posts', 'delete_others_posts' );
$cap_properties['delete']['type'] = array_merge( $cap_properties['delete']['type'], array( 'delete_published_posts', 'delete_private_posts' ) );
if ( ! defined( 'PP_ACTIVE' ) )
$cap_properties['delete']['taxonomy'] = array( 'delete_terms' );
else
$cap_properties['delete']['taxonomy'] = array();
$cap_properties['read']['type'] = array( 'read_private_posts' );
$cap_properties['read']['taxonomy'] = array();
$stati = get_post_stati( array( 'internal' => false ) );
//if ( count($stati) > 5 ) {
$cap_type_names = array(
'' => __( '&nbsp;', 'capsman-enhanced' ),
'read' => __( 'Reading', 'capsman-enhanced' ),
'edit' => __( 'Editing Capabilities', 'capsman-enhanced' ),
'delete' => __( 'Deletion Capabilities', 'capsman-enhanced' )
);
//} else {
//}
$cap_tips = array(
'read_private' => __( 'can read posts which are currently published with private visibility', 'capsman-enhanced' ),
'edit' => __( 'has basic editing capability (but may need other capabilities based on post status and ownership)', 'capsman-enhanced' ),
'edit_others' => __( 'can edit posts which were created by other users', 'capsman-enhanced' ),
'edit_published' => __( 'can edit posts which are currently published', 'capsman-enhanced' ),
'edit_private' => __( 'can edit posts which are currently published with private visibility', 'capsman-enhanced' ),
'publish' => __( 'can make a post publicly visible', 'capsman-enhanced' ),
'delete' => __( 'has basic deletion capability (but may need other capabilities based on post status and ownership)', 'capsman-enhanced' ),
'delete_others' => __( 'can delete posts which were created by other users', 'capsman-enhanced' ),
'delete_published' => __( 'can delete posts which are currently published', 'capsman-enhanced' ),
'delete_private' => __( 'can delete posts which are currently published with private visibility', 'capsman-enhanced' ),
);
$default_caps = array( 'read_private_posts', 'edit_posts', 'edit_others_posts', 'edit_published_posts', 'edit_private_posts', 'publish_posts', 'delete_posts', 'delete_others_posts', 'delete_published_posts', 'delete_private_posts',
'read_private_pages', 'edit_pages', 'edit_others_pages', 'edit_published_pages', 'edit_private_pages', 'publish_pages', 'delete_pages', 'delete_others_pages', 'delete_published_pages', 'delete_private_pages',
'manage_categories'
);
$type_caps = array();
// Role Scoper and PP1 adjust attachment access based only on user's capabilities for the parent post
if ( defined('SCOPER_VERSION') || ( defined( 'PP_ACTIVE' ) && ! defined( 'PPC_VERSION' ) ) )
unset( $defined['type']['attachment'] );
echo '<ul class="cme-listhoriz">';
// cap_types: read, edit, deletion
foreach( array_keys($cap_properties) as $cap_type ) {
echo '<li>';
echo '<h3>' . $cap_type_names[$cap_type] . '</h3>';
echo '<table class="cme-typecaps">';
foreach( array_keys($defined) as $item_type ) {
if ( ( 'delete' == $cap_type ) && ( 'taxonomy' == $item_type ) ) {
if ( defined('SCOPER_VERSION') || defined('PP_ACTIVE') )
continue;
$any_term_deletion_caps = false;
foreach( array_keys($defined['taxonomy']) as $_tax ) {
if ( isset( $defined['taxonomy'][$_tax]->cap->delete_terms ) && ( 'manage_categories' != $defined['taxonomy'][$_tax]->cap->delete_terms ) && ! in_array( $_tax, $unfiltered['taxonomy'] ) ) {
$any_term_deletion_caps = true;
break;
}
}
if ( ! $any_term_deletion_caps )
continue;
}
//if ( ! $cap_type ) {
//} else {
echo '<th></th>';
if ( ! count( $cap_properties[$cap_type][$item_type] ) )
continue;
// label cap properties
foreach( $cap_properties[$cap_type][$item_type] as $prop ) {
$prop = str_replace( '_posts', '', $prop );
$prop = str_replace( '_pages', '', $prop );
$prop = str_replace( '_terms', '', $prop );
$tip = ( isset( $cap_tips[$prop] ) ) ? "title='{$cap_tips[$prop]}'" : '';
$prop = str_replace( '_', '<br />', $prop );
$th_class = ( 'taxonomy' == $item_type ) ? ' class="term-cap"' : ' class="post-cap"';
echo "<th $tip{$th_class}>";
echo ucwords($prop);
echo '</th>';
}
foreach( $defined[$item_type] as $key => $type_obj ) {
if ( in_array( $key, $unfiltered[$item_type] ) )
continue;
$row = "<tr class='cme_type_{$key}'>";
if ( $cap_type ) {
if ( empty($force_distinct_ui) && empty( $cap_properties[$cap_type][$item_type] ) )
continue;
$row .= "<td><a class='cap_type' href='#toggle_type_caps'>" . $type_obj->labels->name . '</a>';
$row .= '<a href="#" class="neg-type-caps">&nbsp;x&nbsp;</a>';
$row .= '</td>';
$display_row = ! empty($force_distinct_ui);
foreach( $cap_properties[$cap_type][$item_type] as $prop ) {
$td_classes = array();
$checkbox = '';
if ( ! empty($type_obj->cap->$prop) && ( in_array( $type_obj->name, array( 'post', 'page' ) )
|| ! in_array( $type_obj->cap->$prop, $default_caps )
|| ( ( 'manage_categories' == $type_obj->cap->$prop ) && ( 'manage_terms' == $prop ) && ( 'category' == $type_obj->name ) ) ) ) {
// if edit_published or edit_private cap is same as edit_posts cap, don't display a checkbox for it
if ( ( ! in_array( $prop, array( 'edit_published_posts', 'edit_private_posts', 'create_posts' ) ) || ( $type_obj->cap->$prop != $type_obj->cap->edit_posts ) )
&& ( ! in_array( $prop, array( 'delete_published_posts', 'delete_private_posts' ) ) || ( $type_obj->cap->$prop != $type_obj->cap->delete_posts ) )
) {
$cap_name = $type_obj->cap->$prop;
if ( 'taxonomy' == $item_type )
$td_classes []= "term-cap";
else
$td_classes []= "post-cap";
if ( ! empty($pp_metagroup_caps[$cap_name]) )
$td_classes []='cm-has-via-pp';
if ( $is_administrator || current_user_can($cap_name) ) {
if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
$title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
} else {
$title_text = $cap_name;
}
$disabled = '';
$checked = checked(1, ! empty($rcaps[$cap_name]), false );
$checkbox = '<input id=caps[' . $cap_name . '] type="checkbox" title="' . $title_text . '" name="caps[' . $cap_name . ']" value="1" ' . $checked . $disabled . ' />';
$type_caps [$cap_name] = true;
$display_row = true;
}
} else
$td_classes []= "cap-unreg";
if ( isset($rcaps[$cap_name]) && empty($rcaps[$cap_name]) )
$td_classes []= "cap-neg";
} else
$td_classes []= "cap-unreg";
$td_class = ( $td_classes ) ? 'class="' . implode(' ', $td_classes) . '"' : '';
$row .= "<td $td_class><span class='cap-x'>X</span>$checkbox";
if ( false !== strpos( $td_class, 'cap-neg' ) )
$row .= '<input type="hidden" class="cme-negation-input" name="caps[' . $cap_name . ']" value="" />';
$row .= "</td>";
}
}
if ( $display_row ) {
$row .= '</tr>';
echo $row;
}
}
//} // endif this iteration is for type caps checkbox display
} // end foreach item type
echo '</table>';
echo '</li>';
}
echo '</ul>';
// clicking on post type name toggles corresponding checkbox selections
?>
<script type="text/javascript">
/* <![CDATA[ */
jQuery(document).ready( function($) {
$('a[href="#toggle_type_caps"]').click( function() {
var chks = $(this).closest('tr').find('input');
$(chks).prop( 'checked', ! $(chks).first().is(':checked') );
return false;
});
});
/* ]]> */
</script>
<?php
$core_caps = array_fill_keys( array( 'switch_themes', 'edit_themes', 'activate_plugins', 'edit_plugins', 'edit_users', 'edit_files', 'manage_options', 'moderate_comments',
'manage_links', 'upload_files', 'import', 'unfiltered_html', 'read', 'delete_users', 'create_users', 'unfiltered_upload', 'edit_dashboard',
'update_plugins', 'delete_plugins', 'install_plugins', 'update_themes', 'install_themes',
'update_core', 'list_users', 'remove_users', 'add_users', 'promote_users', 'edit_theme_options', 'delete_themes', 'export' ), true );
ksort( $core_caps );
echo '<p>&nbsp;</p><h3>' . __( 'Other WordPress Core Capabilities', 'capsman-enhanced' ) . '</h3>';
echo '<table width="100%" class="form-table cme-checklist"><tr>';
$checks_per_row = get_option( 'cme_form-rows', 5 );
$i = 0; $first_row = true;
foreach( array_keys($core_caps) as $cap_name ) {
if ( ! $is_administrator && ! current_user_can($cap_name) )
continue;
if ( $i == $checks_per_row ) {
echo '</tr><tr>';
$i = 0;
}
if ( ! isset( $rcaps[$cap_name] ) )
$class = 'cap-no';
else
$class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
$class .= ' cap-metagroup';
$title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
} else {
$title_text = $cap_name;
}
$disabled = '';
$checked = checked(1, ! empty($rcaps[$cap_name]), false );
?>
<td class="<?php echo $class; ?>"><span class="cap-x">X</span><label for="caps[<?php echo $cap_name; ?>]" title="<?php echo $title_text;?>"><input id=caps[<?php echo $cap_name; ?>] type="checkbox" name="caps[<?php echo $cap_name; ?>]" value="1" <?php echo $checked . $disabled;?> />
<span>
<?php
echo str_replace( '_', ' ', $cap_name );
?>
</span></label><a href="#" class="neg-cap">&nbsp;x&nbsp;</a>
<?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
<input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
<?php endif; ?>
</td>
<?php
++$i;
}
if ( $i == $checks_per_row ) {
echo '</tr><tr>';
$i = 0;
} elseif ( ! $first_row ) {
// Now close a wellformed table
for ( $i; $i < $checks_per_row; $i++ ){
echo '<td>&nbsp;</td>';
}
echo '</tr>';
}
?>
<tr class="cme-bulk-select">
<td colspan="<?php echo $checks_per_row;?>">
<span style="float:right">
<input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
</span>
</td></tr>
</table>
<?php
echo '<p>&nbsp;</p><h3>' . __( 'Additional Capabilities', 'capsman-enhanced' ) . '</h3>';
?>
<table width='100%' class="form-table cme-checklist">
<tr>
<?php
$i = 0; $first_row = true;
$all_capabilities = apply_filters( 'capsman_get_capabilities', array_keys( $this->capabilities ), $this->ID );
$all_capabilities = apply_filters( 'members_get_capabilities', $all_capabilities );
foreach( $all_capabilities as $cap_name ) {
if ( ! isset($this->capabilities[$cap_name]) )
$this->capabilities[$cap_name] = str_replace( '_', ' ', $cap_name );
}
uasort( $this->capabilities, 'strnatcasecmp' ); // sort by array values, but maintain keys );
foreach ( $this->capabilities as $cap_name => $cap ) :
if ( isset( $type_caps[$cap_name] ) || isset($core_caps[$cap_name]) )
continue;
if ( ! $is_administrator && ! current_user_can($cap_name) )
continue;
// ============ End Kevin B mod ===============
// Levels are not shown.
if ( preg_match( '/^level_(10|[0-9])$/i', $cap_name ) ) {
continue;
}
if ( $i == $checks_per_row ) {
echo '</tr><tr>';
$i = 0; $first_row = false;
}
if ( ! isset( $rcaps[$cap_name] ) )
$class = 'cap-no';
else
$class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
$class .= ' cap-metagroup';
$title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
} else {
$title_text = $cap_name;
}
$disabled = '';
$checked = checked(1, ! empty($rcaps[$cap_name]), false );
if ( 'manage_capabilities' == $cap_name ) {
if ( ! current_user_can('administrator') ) {
continue;
} elseif ( 'administrator' == $default ) {
$class .= ' cap-locked';
$lock_manage_caps_capability = true;
$disabled = 'disabled="disabled"';
}
}
?>
<td class="<?php echo $class; ?>"><span class="cap-x">X</span><label for="caps[<?php echo $cap_name; ?>]" title="<?php echo $title_text;?>"><input id=caps[<?php echo $cap_name; ?>] type="checkbox" name="caps[<?php echo $cap_name; ?>]" value="1" <?php echo $checked . $disabled;?> />
<span>
<?php
echo str_replace( '_', ' ', $cap );
?>
</span></label><a href="#" class="neg-cap">&nbsp;x&nbsp;</a>
<?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
<input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
<?php endif; ?>
</td>
<?php
$i++;
endforeach;
if ( ! empty($lock_manage_caps_capability) ) {
echo '<input type="hidden" name="caps[manage_capabilities]" value="1" />';
}
if ( $i == $checks_per_row ) {
echo '</tr><tr>';
$i = 0;
} else {
if ( ! $first_row ) {
// Now close a wellformed table
for ( $i; $i < $checks_per_row; $i++ ){
echo '<td>&nbsp;</td>';
}
echo '</tr>';
}
}
?>
<tr class="cme-bulk-select">
<td colspan="<?php echo $checks_per_row;?>">
<span>
<?php
$level = ak_caps2level($rcaps);
?>
<?php _e('Level:', 'capsman-enhanced') ;?><select name="level">
<?php for ( $l = $this->max_level; $l >= 0; $l-- ) {?>
<option value="<?php echo $l; ?>" style="text-align:right;"<?php selected($level, $l); ?>>&nbsp;<?php echo $l; ?>&nbsp;</option>
<?php }
?>
</select>
</span>
<span style="float:right">
<input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>">&nbsp;&nbsp;<a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
</span>
</td></tr>
</table>
<br />
<?php if ( ! defined('PP_ACTIVE') || pp_get_option('display_hints') ) :?>
<div class="cme-subtext">
<?php _e( 'Note: Underscores replace spaces in stored capability name ("edit users" => "edit_users").', 'capsman-enhanced' ); ?>
</div>
<?php endif;?>
</span>
</dd>
</dl>
<?php
$support_pp_only_roles = ( defined('PP_ACTIVE') ) ? $pp_ui->pp_only_roles_ui( $default ) : false;
cme_network_role_ui( $default );
?>
<p class="submit">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="current" value="<?php echo $default; ?>" />
<input type="submit" name="SaveRole" value="<?php _e('Save Changes', 'capsman-enhanced') ?>" class="button-primary" /> &nbsp;
<?php if ( current_user_can('administrator') && 'administrator' != $default ) : ?>
<a class="ak-delete" title="<?php echo esc_attr(__('Delete this role', 'capsman-enhanced')) ?>" href="<?php echo wp_nonce_url("admin.php?page={$this->ID}&amp;action=delete&amp;role={$default}", 'delete-role_' . $default); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete the %s role.\n 'Cancel' to stop, 'OK' to delete.", 'capsman-enhanced'), $roles[$default])); ?>') ) { return true;}return false;"><?php _e('Delete Role', 'capsman-enhanced')?></a>
<?php endif; ?>
</p>
<br />
<?php agp_admin_footer(); ?>
<br />
</td>
<td class="sidebar">
<?php agp_admin_authoring($this->ID); ?>
<dl>
<dt><?php if ( defined('WPLANG') && WPLANG ) _e('Select New Role', 'capsman-enhanced'); else echo('Select Role to View / Edit'); ?></dt>
<dd style="text-align:center;">
<p><select name="role">
<?php
foreach ( $roles as $role => $name ) {
echo '<option value="' . $role .'"'; selected($default, $role); echo '> ' . $name . ' &nbsp;</option>';
}
?>
</select><span style="margin-left:20px"><input type="submit" name="LoadRole" value="<?php if ( defined('WPLANG') && WPLANG ) _e('Change', 'capsman-enhanced'); else echo('Load'); ?>" class="button" /></span></p>
</dd>
</dl>
<dl>
<dt><?php _e('Create New Role', 'capsman-enhanced'); ?></dt>
<dd style="text-align:center;">
<?php $class = ( $support_pp_only_roles ) ? 'tight-text' : 'regular-text'; ?>
<p><input type="text" name="create-name"" class="<?php echo $class;?>" placeholder="<?php _e('Name of new role', 'capsman-enhanced') ?>" />
<?php if( $support_pp_only_roles ) : ?>
<label for="new_role_pp_only" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"> <input type="checkbox" name="new_role_pp_only" id="new_role_pp_only" value="1"> <?php _e('hidden', 'capsman-enhanced'); ?> </label>
<?php endif; ?>
<br />
<input type="submit" name="CreateRole" value="<?php _e('Create', 'capsman-enhanced') ?>" class="button" />
</p>
</dd>
</dl>
<dl>
<dt><?php defined('WPLANG') && WPLANG ? _e('Copy this role to', 'capsman-enhanced') : printf( 'Copy %s Role', $roles[$default] ); ?></dt>
<dd style="text-align:center;">
<?php $class = ( $support_pp_only_roles ) ? 'tight-text' : 'regular-text'; ?>
<p><input type="text" name="copy-name" class="<?php echo $class;?>" placeholder="<?php _e('Name of copied role', 'capsman-enhanced') ?>" />
<?php if( $support_pp_only_roles ) : ?>
<label for="copy_role_pp_only" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"> <input type="checkbox" name="copy_role_pp_only" id="copy_role_pp_only" value="1"> <?php _e('hidden', 'capsman-enhanced'); ?> </label>
<?php endif; ?>
<br />
<input type="submit" name="CopyRole" value="<?php _e('Copy', 'capsman-enhanced') ?>" class="button" />
</p>
</dd>
</dl>
<dl>
<dt><?php _e('Add Capability', 'capsman-enhanced'); ?></dt>
<dd style="text-align:center;">
<p><input type="text" name="capability-name" class="regular-text" placeholder="<?php _e('capability name', 'capsman-enhanced') ?>" /><br />
<input type="submit" name="AddCap" value="<?php _e('Add to role', 'capsman-enhanced') ?>" class="button" /></p>
</dd>
</dl>
<?php if ( defined('PP_ACTIVE') )
$pp_ui->pp_types_ui( $defined );
?>
</td>
</tr>
</table>
</fieldset>
</form>
</div>
<?php
function cme_network_role_ui( $default ) {
if ( ! is_multisite() || ! is_super_admin() || ( 1 != get_current_blog_id() ) )
return false;
?>
<div style="float:right;margin-left:10px;margin-right:10px">
<?php
if ( ! $autocreate_roles = get_site_option( 'cme_autocreate_roles' ) )
$autocreate_roles = array();
$checked = ( in_array( $default, $autocreate_roles ) ) ? 'checked="checked"': '';
?>
<div style="margin-bottom: 5px">
<label for="cme_autocreate_role" title="<?php _e('Create this role definition in new (future) sites', 'capsman-enhanced');?>"><input type="checkbox" name="cme_autocreate_role" id="cme_autocreate_role" value="1" <?php echo $checked;?>> <?php _e('include in new sites', 'capsman-enhanced'); ?> </label>
</div>
<div>
<label for="cme_net_sync_role" title="<?php echo esc_attr(__('Copy / update this role definition to all sites now', 'capsman-enhanced'));?>"><input type="checkbox" name="cme_net_sync_role" id="cme_net_sync_role" value="1"> <?php _e('sync role to all sites now', 'capsman-enhanced'); ?> </label>
</div>
</div>
<?php
return true;
}
function cme_plugin_info_url( $plugin_slug ) {
return self_admin_url( "plugin-install.php?tab=plugin-information&plugin=$plugin_slug&TB_iframe=true&width=640&height=678" );
}

View File

@@ -0,0 +1,91 @@
<?php
class Capsman_BackupHandler
{
var $cm;
function __construct( $manager_obj ) {
if ( ! is_super_admin() && ! current_user_can( 'restore_roles' ) )
wp_die( __( 'You do not have permission to restore roles.', 'capsman-enhanced' ) );
$this->cm = $manager_obj;
}
/**
* Processes backups and restores.
*
* @return void
*/
function processBackupTool ()
{
if ( isset($_POST['Perform']) ) {
check_admin_referer('capsman-backup-tool');
global $wpdb;
$wp_roles = $wpdb->prefix . 'user_roles';
$cm_roles = 'capsman_backup';
switch ( $_POST['action'] ) {
case 'backup':
$roles = get_option($wp_roles);
update_option($cm_roles, $roles);
ak_admin_notify(__('New backup saved.', 'capsman-enhanced'));
break;
case 'restore':
$roles = get_option($cm_roles);
if ( $roles ) {
update_option($wp_roles, $roles);
ak_admin_notify(__('Roles and Capabilities restored from last backup.', 'capsman-enhanced'));
} else {
ak_admin_error(__('Restore failed. No backup found.', 'capsman-enhanced'));
}
break;
}
}
}
/**
* Resets roles to WordPress defaults.
*
* @return void
*/
function backupToolReset ()
{
check_admin_referer('capsman-reset-defaults');
require_once(ABSPATH . 'wp-admin/includes/schema.php');
if ( ! function_exists('populate_roles') ) {
ak_admin_error(__('Needed function to create default roles not found!', 'capsman-enhanced'));
return;
}
$roles = array_keys( ak_get_roles(true) );
foreach ( $roles as $role) {
remove_role($role);
}
populate_roles();
$this->cm->setAdminCapability();
$msg = __('Roles and Capabilities reset to WordPress defaults', 'capsman-enhanced');
if ( function_exists( 'pp_populate_roles' ) ) {
pp_populate_roles();
} else {
// force PP to repopulate roles
$pp_ver = get_option( 'pp_c_version', true );
if ( $pp_ver && is_array($pp_ver) ) {
$pp_ver['version'] = ( preg_match( "/dev|alpha|beta|rc/i", $pp_ver['version'] ) ) ? '0.1-beta' : 0.1;
} else {
$pp_ver = array( 'version' => '0.1', 'db_version' => '1.0' );
}
update_option( 'pp_c_version', $pp_ver );
delete_option( 'ppperm_added_role_caps_10beta' );
}
ak_admin_notify($msg);
}
}

View File

@@ -0,0 +1,83 @@
<?php
/**
* Capability Manager Backup Tool.
* Provides backup and restore functionality to Capability Manager.
*
* @version $Rev: 198515 $
* @author Jordi Canals
* @copyright Copyright (C) 2009, 2010 Jordi Canals
* @license GNU General Public License version 2
* @link http://alkivia.org
* @package Alkivia
* @subpackage CapsMan
*
Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<div class="wrap">
<div id="icon-capsman-admin" class="icon32"></div>
<h2><?php _e('Backup Tool for Capability Manager', 'capsman-enhanced') ?></h2>
<form method="post" action="tools.php?page=<?php echo $this->ID ?>-tool">
<?php wp_nonce_field('capsman-backup-tool'); ?>
<fieldset>
<table id="akmin">
<tr>
<td class="content">
<dl>
<dt><?php _e('Backup and Restore', 'capsman-enhanced'); ?></dt>
<dd>
<table width='100%' class="form-table">
<tr>
<th scope="row"><?php _e('Select action:', 'capsman-enhanced'); ?></th>
<td>
<select name="action">
<option value="backup"> <?php _e('Backup roles and capabilities', 'capsman-enhanced'); ?> </option>
<option value="restore"> <?php _e('Restore last saved backup', 'capsman-enhanced'); ?> </option>
</select> &nbsp;
<input type="submit" name="Perform" value="<?php _e('Do Action', 'capsman-enhanced') ?>" class="button-primary" />
</td>
</tr>
</table>
</dd>
</dl>
<dl>
<dt><?php if ( defined('WPLANG') && WPLANG && ( 'en_EN' != WPLANG ) ) _e('Reset WordPress Defaults', 'capsman-enhanced'); else echo 'Reset Roles to WordPress Defaults';?></dt>
<dd>
<p style="text-align:center;"><strong><span style="color:red;"><?php _e('WARNING:', 'capsman-enhanced'); ?></span> <?php if ( defined('WPLANG') && WPLANG && ( 'en_EN' != WPLANG ) ) _e('Reseting default Roles and Capabilities will set them to the WordPress install defaults.', 'capsman-enhanced'); else echo 'This will delete and/or modify stored role definitions.'; ?></strong><br />
<br />
<?php
_e('If you have installed any plugin that adds new roles or capabilities, these will be lost.', 'capsman-enhanced')?><br />
<strong><?php if ( defined('WPLANG') && WPLANG && ( 'en_EN' != WPLANG ) ) _e('It is recommended to use this only as a last resource!'); else echo('It is recommended to use this only as a last resort!');?></strong></p>
<p style="text-align:center;"><a class="ak-delete" title="<?php echo esc_attr(__('Reset Roles and Capabilities to WordPress defaults', 'capsman-enhanced')) ?>" href="<?php echo wp_nonce_url("tools.php?page={$this->ID}-tool&amp;action=reset-defaults", 'capsman-reset-defaults'); ?>" onclick="if ( confirm('<?php echo esc_js(__("You are about to reset Roles and Capabilities to WordPress defaults.\n 'Cancel' to stop, 'OK' to reset.", 'capsman-enhanced')); ?>') ) { return true;}return false;"><?php _e('Reset to WordPress defaults', 'capsman-enhanced')?></a>
</dd>
</dl>
<?php agp_admin_footer(); ?>
</td>
<td class="sidebar">
<?php agp_admin_authoring($this->ID); ?>
</td>
</tr>
</table>
</fieldset>
</form>
</div>

View File

@@ -0,0 +1,365 @@
<?php
class CapsmanHandler
{
var $cm;
function __construct( $manager_obj ) {
$this->cm = $manager_obj;
}
function processAdminGeneral( $post ) {
global $wp_roles;
// Create a new role.
if ( ! empty($post['CreateRole']) ) {
if ( $newrole = $this->createRole($post['create-name']) ) {
ak_admin_notify(__('New role created.', 'capsman-enhanced'));
$this->cm->current = $newrole;
} else {
if ( empty($post['create-name']) && ( ! defined('WPLANG') || ! WPLANG ) )
ak_admin_error( 'Error: No role name specified.', 'capsman-enhanced' );
else
ak_admin_error(__('Error: Failed creating the new role.', 'capsman-enhanced'));
}
// Copy current role to a new one.
} elseif ( ! empty($post['CopyRole']) ) {
$current = get_role($post['current']);
if ( $newrole = $this->createRole($post['copy-name'], $current->capabilities) ) {
ak_admin_notify(__('New role created.', 'capsman-enhanced'));
$this->cm->current = $newrole;
} else {
if ( empty($post['copy-name']) && ( ! defined('WPLANG') || ! WPLANG ) )
ak_admin_error( 'Error: No role name specified.', 'capsman-enhanced' );
else
ak_admin_error(__('Error: Failed creating the new role.', 'capsman-enhanced'));
}
// Save role changes. Already saved at start with self::saveRoleCapabilities().
} elseif ( ! empty($post['SaveRole']) ) {
if ( MULTISITE ) {
global $wp_roles;
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
}
$this->saveRoleCapabilities($post['current'], $post['caps'], $post['level']);
if ( defined( 'PP_ACTIVE' ) ) { // log customized role caps for subsequent restoration
// for bbPress < 2.2, need to log customization of roles following bbPress activation
$plugins = ( function_exists( 'bbp_get_version' ) && version_compare( bbp_get_version(), '2.2', '<' ) ) ? array( 'bbpress.php' ) : array(); // back compat
if ( ! $customized_roles = get_option( 'pp_customized_roles' ) )
$customized_roles = array();
$customized_roles[$post['role']] = (object) array( 'caps' => array_map( 'boolval', $post['caps'] ), 'plugins' => $plugins );
update_option( 'pp_customized_roles', $customized_roles );
global $wpdb;
$wpdb->query( "UPDATE $wpdb->options SET autoload = 'no' WHERE option_name = 'pp_customized_roles'" );
}
// Create New Capability and adds it to current role.
} elseif ( ! empty($post['AddCap']) ) {
if ( MULTISITE ) {
global $wp_roles;
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
}
$role = get_role($post['current']);
$role->name = $post['current']; // bbPress workaround
if ( $newname = $this->createNewName($post['capability-name']) ) {
$role->add_cap($newname['name']);
$this->cm->message = __('New capability added to role.');
// for bbPress < 2.2, need to log customization of roles following bbPress activation
$plugins = ( function_exists( 'bbp_get_version' ) && version_compare( bbp_get_version(), '2.2', '<' ) ) ? array( 'bbpress.php' ) : array(); // back compat
if ( ! $customized_roles = get_option( 'pp_customized_roles' ) )
$customized_roles = array();
$customized_roles[$post['role']] = (object) array( 'caps' => array_merge( $role->capabilities, array( $newname['name'] => 1 ) ), 'plugins' => $plugins );
update_option( 'pp_customized_roles', $customized_roles );
global $wpdb;
$wpdb->query( "UPDATE $wpdb->options SET autoload = 'no' WHERE option_name = 'pp_customized_roles'" );
} else {
$this->cm->message = __('Incorrect capability name.');
}
} elseif ( ! empty($post['update_filtered_types']) ) {
if ( cme_update_pp_usage() ) {
ak_admin_notify(__('Capability settings saved.', 'capsman-enhanced'));
} else {
ak_admin_error(__('Error saving capability settings.', 'capsman-enhanced'));
}
} else {
// TODO: Implement exceptions. This must be a fatal error.
ak_admin_error(__('Bad form received.', 'capsman-enhanced'));
}
if ( ! empty($newrole) && defined('PP_ACTIVE') ) {
if ( ( ! empty($post['CreateRole']) && ! empty( $_REQUEST['new_role_pp_only'] ) ) || ( ! empty($post['CopyRole']) && ! empty( $_REQUEST['copy_role_pp_only'] ) ) ) {
$pp_only = (array) pp_get_option( 'supplemental_role_defs' );
$pp_only[]= $newrole;
pp_update_option( 'supplemental_role_defs', $pp_only );
_cme_pp_default_pattern_role( $newrole );
pp_refresh_options();
}
}
}
/**
* Creates a new role/capability name from user input name.
* Name rules are:
* - 2-40 charachers lenght.
* - Only letters, digits, spaces and underscores.
* - Must to start with a letter.
*
* @param string $name Name from user input.
* @return array|false An array with the name and display_name, or false if not valid $name.
*/
private function createNewName( $name ) {
// Allow max 40 characters, letters, digits and spaces
$name = trim(substr($name, 0, 40));
$pattern = '/^[a-zA-Z][a-zA-Z0-9 _]+$/';
if ( preg_match($pattern, $name) ) {
$roles = ak_get_roles();
$name = strtolower($name);
$name = str_replace(' ', '_', $name);
if ( in_array($name, $roles) || array_key_exists($name, $this->cm->capabilities) ) {
return false; // Already a role or capability with this name.
}
$display = explode('_', $name);
$display = array_map('ucfirst', $display);
$display = implode(' ', $display);
return compact('name', 'display');
} else {
return false;
}
}
/**
* Creates a new role.
*
* @param string $name Role name to create.
* @param array $caps Role capabilities.
* @return string|false Returns the name of the new role created or false if failed.
*/
private function createRole( $name, $caps = array() ) {
if ( ! is_array($caps) )
$caps = array();
$role = $this->createNewName($name);
if ( ! is_array($role) ) {
return false;
}
$new_role = add_role($role['name'], $role['display'], $caps);
if ( is_object($new_role) ) {
return $role['name'];
} else {
return false;
}
}
/**
* Saves capability changes to roles.
*
* @param string $role_name Role name to change its capabilities
* @param array $caps New capabilities for the role.
* @return void
*/
private function saveRoleCapabilities( $role_name, $caps, $level ) {
$this->cm->generateNames();
$role = get_role($role_name);
// workaround to ensure db storage of customizations to bbp dynamic roles
$role->name = $role_name;
$stored_role_caps = ( ! empty($role->capabilities) && is_array($role->capabilities) ) ? array_intersect( $role->capabilities, array(true, 1) ) : array();
$old_caps = array_intersect_key( $stored_role_caps, $this->cm->capabilities);
$new_caps = ( is_array($caps) ) ? array_map('boolval', $caps) : array();
$new_caps = array_merge($new_caps, ak_level2caps($level));
// Find caps to add and remove
$add_caps = array_diff_key($new_caps, $old_caps);
$del_caps = array_diff_key($old_caps, $new_caps);
$changed_caps = array();
foreach( array_intersect_key( $new_caps, $old_caps ) as $cap_name => $cap_val ) {
if ( $new_caps[$cap_name] != $old_caps[$cap_name] )
$changed_caps[$cap_name] = $cap_val;
}
$add_caps = array_merge( $add_caps, $changed_caps );
if ( ! $is_administrator = current_user_can('administrator') ) {
unset($add_caps['manage_capabilities']);
unset($del_caps['manage_capabilities']);
}
if ( 'administrator' == $role_name && isset($del_caps['manage_capabilities']) ) {
unset($del_caps['manage_capabilities']);
ak_admin_error(__('You cannot remove Manage Capabilities from Administrators', 'capsman-enhanced'));
}
// Add new capabilities to role
foreach ( $add_caps as $cap => $grant ) {
if ( $is_administrator || current_user_can($cap) )
$role->add_cap( $cap, $grant );
}
// Remove capabilities from role
foreach ( $del_caps as $cap => $grant) {
if ( $is_administrator || current_user_can($cap) )
$role->remove_cap($cap);
}
if ( is_multisite() && is_super_admin() && ( 1 == get_current_blog_id() ) ) {
if ( ! $autocreate_roles = get_site_option( 'cme_autocreate_roles' ) )
$autocreate_roles = array();
$this_role_autocreate = ! empty($_REQUEST['cme_autocreate_role']);
if ( $this_role_autocreate && ! in_array( $role_name, $autocreate_roles ) ) {
$autocreate_roles []= $role_name;
update_site_option( 'cme_autocreate_roles', $autocreate_roles );
}
if ( ! $this_role_autocreate && in_array( $role_name, $autocreate_roles ) ) {
$autocreate_roles = array_diff( $autocreate_roles, array( $role_name ) );
update_site_option( 'cme_autocreate_roles', $autocreate_roles );
}
if ( ! empty($_REQUEST['cme_net_sync_role']) ) {
// loop through all sites on network, creating or updating role def
global $wpdb, $wp_roles, $blog_id;
$blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs ORDER BY blog_id" );
$orig_blog_id = $blog_id;
$role_caption = $wp_roles->role_names[$role_name];
$new_caps = ( is_array($caps) ) ? array_map('boolval', $caps) : array();
$new_caps = array_merge($new_caps, ak_level2caps($level) );
$admin_role = $wp_roles->get_role('administrator');
$main_admin_caps = array_merge( $admin_role->capabilities, ak_level2caps(10) );
foreach ( $blog_ids as $id ) {
if ( 1 == $id )
continue;
switch_to_blog( $id );
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
if ( $blog_role = $wp_roles->get_role( $role_name ) ) {
$stored_role_caps = ( ! empty($blog_role->capabilities) && is_array($blog_role->capabilities) ) ? array_intersect( $blog_role->capabilities, array(true, 1) ) : array();
$old_caps = array_intersect_key( $stored_role_caps, $this->cm->capabilities);
// Find caps to add and remove
$add_caps = array_diff_key($new_caps, $old_caps);
$del_caps = array_intersect_key( array_diff_key($old_caps, $new_caps), $main_admin_caps ); // don't mess with caps that are totally unused on main site
// Add new capabilities to role
foreach ( $add_caps as $cap => $grant ) {
$blog_role->add_cap( $cap, $grant );
}
// Remove capabilities from role
foreach ( $del_caps as $cap => $grant) {
$blog_role->remove_cap($cap);
}
} else {
$wp_roles->add_role( $role_name, $role_caption, $new_caps );
}
restore_current_blog();
}
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
}
} // endif multisite installation with super admin editing a main site role
}
/**
* Deletes a role.
* The role comes from the $_GET['role'] var and the nonce has already been checked.
* Default WordPress role cannot be deleted and if trying to do it, throws an error.
* Users with the deleted role, are moved to the WordPress default role.
*
* @return void
*/
function adminDeleteRole ()
{
global $wpdb, $wp_roles;
check_admin_referer('delete-role_' . $_GET['role']);
$this->cm->current = $_GET['role'];
$default = get_option('default_role');
if ( $default == $this->cm->current ) {
ak_admin_error(sprintf(__('Cannot delete default role. You <a href="%s">have to change it first</a>.', 'capsman-enhanced'), 'options-general.php'));
return;
}
$query = "SELECT ID FROM {$wpdb->usermeta} INNER JOIN {$wpdb->users} "
. "ON {$wpdb->usermeta}.user_id = {$wpdb->users}.ID "
. "WHERE meta_key='{$wpdb->prefix}capabilities' AND meta_value LIKE '%{$this->cm->current}%';";
$users = $wpdb->get_results($query);
// Array of all roles except the one being deleted, for use below
$role_names = array_diff_key( array_keys( $wp_roles->role_names ), array( $this->cm->current => true ) );
$count = 0;
foreach ( $users as $u ) {
$skip_role_set = false;
$user = new WP_User($u->ID);
if ( $user->has_cap($this->cm->current) ) { // Check again the user has the deleting role
// Role may have been assigned supplementally. Don't move a user to default role if they still have one or more roles following the deletion.
foreach( $role_names as $_role_name ) {
if ( $user->has_cap($_role_name) ) {
$skip_role_set = true;
break;
}
}
if ( ! $skip_role_set ) {
$user->set_role($default);
$count++;
}
}
}
remove_role($this->cm->current);
unset($this->cm->roles[$this->cm->current]);
if ( $customized_roles = get_option( 'pp_customized_roles' ) ) {
if ( isset( $customized_roles[$this->cm->current] ) ) {
unset( $customized_roles[$this->cm->current] );
update_option( 'pp_customized_roles', $customized_roles );
}
}
ak_admin_notify(sprintf(__('Role has been deleted. %1$d users moved to default role %2$s.', 'capsman-enhanced'), $count, $this->cm->roles[$default]));
$this->cm->current = $default;
}
}
if ( ! function_exists('boolval') ) {
function boolval( $val ) {
return (bool) $val;
}
}

View File

@@ -0,0 +1,478 @@
<?php
/**
* Capability Manager.
* Plugin to create and manage roles and capabilities.
*
* @version $Rev: 199485 $
* @author Jordi Canals
* @copyright Copyright (C) 2009, 2010 Jordi Canals; Copyright (C) 2012-2014 Kevin Behrens
* @license GNU General Public License version 2
* @link http://agapetry.net
*
Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
Modifications Copyright 2012-2015 Kevin Behrens <kevin@agapetry.net>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
include_once ( AK_CLASSES . '/abstract/plugin.php' );
add_action( 'init', 'cme_update_pp_usage' ); // update early so resulting post type cap changes are applied for this request's UI construction
function cme_update_pp_usage() {
if ( defined( 'PP_ACTIVE' ) && ( ! empty($_REQUEST['update_filtered_types']) || ! empty($_REQUEST['SaveRole']) ) ) {
require_once( dirname(__FILE__).'/pp-handler.php' );
return _cme_update_pp_usage();
}
}
/**
* Class cmanCapsManager.
* Sets the main environment for all Capability Manager components.
*
* @author Jordi Canals, Kevin Behrens
* @link http://agapetry.net
*/
class CapabilityManager extends akPluginAbstract
{
/**
* Array with all capabilities to be managed. (Depends on user caps).
* The array keys are the capability, the value is its screen name.
* @var array
*/
var $capabilities = array();
/**
* Array with roles that can be managed. (Depends on user roles).
* The array keys are the role name, the value is its translated name.
* @var array
*/
var $roles = array();
/**
* Current role we are managing
* @var string
*/
var $current;
/**
* Maximum level current manager can assign to a user.
* @var int
*/
private $max_level;
private $log_db_role_objects = array();
var $message;
function __construct( $mod_file, $ID = '' ) {
$this->ID = 'capsman';
parent::__construct( $mod_file, $ID );
}
/**
* Creates some filters at module load time.
*
* @see akPluginAbstract#moduleLoad()
*
* @return void
*/
protected function moduleLoad ()
{
// Only roles that a user can administer can be assigned to others.
add_filter('editable_roles', array($this, 'filterEditRoles'));
// Users with roles that cannot be managed, are not allowed to be edited.
add_filter('map_meta_cap', array(&$this, 'filterUserEdit'), 10, 4);
// ensure storage, retrieval of db-stored customizations to bbPress dynamic roles
global $wpdb;
$role_key = $wpdb->prefix . 'user_roles';
add_filter( 'option_' . $role_key, array( &$this, 'log_db_roles' ), 0 );
add_filter( 'option_' . $role_key, array( &$this, 'reinstate_db_roles' ), 50 );
add_filter( 'plugins_loaded', array( &$this, 'processRoleUpdate' ) );
}
function log_db_roles( $passthru_roles ) {
global $wp_roles;
if ( isset($wp_roles) )
$this->log_db_role_objects = $wp_roles->role_objects;
return $passthru_roles;
}
// note: this is only applied when accessing the cme role edit form
function reinstate_db_roles( $passthru_roles = array() ) {
global $wp_roles;
if ( $this->log_db_role_objects ) {
$intersect = array_intersect_key( $wp_roles->role_objects, $this->log_db_role_objects );
foreach( array_keys( $intersect ) as $key ) {
if ( ! empty( $this->log_db_role_objects[$key]->capabilities ) )
$wp_roles->role_objects[$key]->capabilities = $this->log_db_role_objects[$key]->capabilities;
}
}
return $passthru_roles;
}
/**
* Activates the plugin and sets the new capability 'Manage Capabilities'
*
* @return void
*/
protected function pluginActivate ()
{
$this->setAdminCapability();
}
/**
* Updates Capability Manager to a new version
*
* @return void
*/
protected function pluginUpdate ( $version )
{
$backup = get_option($this->ID . '_backup');
if ( false === $backup ) { // No previous backup found. Save it!
global $wpdb;
$roles = get_option($wpdb->prefix . 'user_roles');
update_option($this->ID . '_backup', $roles);
}
}
/**
* Adds admin panel menus. (At plugins loading time. This is before plugins_loaded).
* User needs to have 'manage_capabilities' to access this menus.
* This is set as an action in the parent class constructor.
*
* @hook action admin_menu
* @return void
*/
public function adminMenus ()
{
// First we check if user is administrator and can 'manage_capabilities'.
if ( current_user_can('administrator') && ! current_user_can('manage_capabilities') ) {
$this->setAdminCapability();
}
add_action( 'admin_menu', array( &$this, 'cme_menu' ), 20 );
}
public function cme_menu() {
$cap_name = ( is_super_admin() ) ? 'manage_capabilities' : 'restore_roles';
add_management_page(__('Capability Manager', 'capsman-enhanced'), __('Capability Manager', 'capsman-enhanced'), $cap_name, $this->ID . '-tool', array($this, 'backupTool'));
if ( did_action( 'pp_admin_menu' ) ) { // Put Capabilities link on Permissions menu if Press Permit is active and user has access to it
global $pp_admin;
$menu_caption = ( defined('WPLANG') && WPLANG && ( 'en_EN' != WPLANG ) ) ? __('Capabilities', 'capsman-enhanced') : 'Role Capabilities';
add_submenu_page( $pp_admin->get_menu('options'), __('Capability Manager', 'capsman-enhanced'), $menu_caption, 'manage_capabilities', $this->ID, array($this, 'generalManager') );
} else {
add_users_page( __('Capability Manager', 'capsman-enhanced'), __('Capabilities', 'capsman-enhanced'), 'manage_capabilities', $this->ID, array($this, 'generalManager'));
}
}
/**
* Sets the 'manage_capabilities' cap to the administrator role.
*
* @return void
*/
public function setAdminCapability ()
{
$admin = get_role('administrator');
$admin->add_cap('manage_capabilities');
}
/**
* Filters roles that can be shown in roles list.
* This is mainly used to prevent an user admin to create other users with
* higher capabilities.
*
* @hook 'editable_roles' filter.
*
* @param $roles List of roles to check.
* @return array Restircted roles list
*/
function filterEditRoles ( $roles )
{
$this->generateNames();
$valid = array_keys($this->roles);
foreach ( $roles as $role => $caps ) {
if ( ! in_array($role, $valid) ) {
unset($roles[$role]);
}
}
return $roles;
}
/**
* Checks if a user can be edited or not by current administrator.
* Returns array('do_not_allow') if user cannot be edited.
*
* @hook 'map_meta_cap' filter
*
* @param array $caps Current user capabilities
* @param string $cap Capability to check
* @param int $user_id Current user ID
* @param array $args For our purpose, we receive edited user id at $args[0]
* @return array Allowed capabilities.
*/
function filterUserEdit ( $caps, $cap, $user_id, $args )
{
if ( ! in_array( $cap, array( 'edit_user', 'delete_user', 'promote_user', 'remove_user' ) ) || ( ! isset($args[0]) ) || $user_id == (int) $args[0] ) {
return $caps;
}
$user = new WP_User( (int) $args[0] );
$this->generateNames();
if ( defined( 'CME_LEGACY_USER_EDIT_FILTER' ) && CME_LEGACY_USER_EDIT_FILTER ) {
$valid = array_keys($this->roles);
foreach ( $user->roles as $role ) {
if ( ! in_array($role, $valid) ) {
$caps = array('do_not_allow');
break;
}
}
} else {
global $wp_roles;
foreach ( $user->roles as $role ) {
$r = get_role( $role );
$level = ak_caps2level($r->capabilities);
if ( ( ! $level ) && ( 'administrator' == $role ) )
$level = 10;
if ( $level > $this->max_level ) {
$caps = array('do_not_allow');
break;
}
}
}
return $caps;
}
function processRoleUpdate() {
$this->current = get_option('default_role'); // By default we manage the default role.
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && ( ! empty($_REQUEST['SaveRole']) || ! empty($_REQUEST['AddCap']) ) ) {
if ( ! current_user_can('manage_capabilities') && ! current_user_can('administrator') ) {
// TODO: Implement exceptions.
wp_die('<strong>' .__('What do you think you\'re doing?!?', 'capsman-enhanced') . '</strong>');
}
//$this->current = get_option('default_role'); // By default we manage the default role.
check_admin_referer('capsman-general-manager');
$this->processAdminGeneral();
}
}
/**
* Manages global settings admin.
*
* @hook add_submenu_page
* @return void
*/
function generalManager () {
if ( ! current_user_can('manage_capabilities') && ! current_user_can('administrator') ) {
// TODO: Implement exceptions.
wp_die('<strong>' .__('What do you think you\'re doing?!?', 'capsman-enhanced') . '</strong>');
}
if ( 'POST' == $_SERVER['REQUEST_METHOD'] ) {
if ( empty($_REQUEST['SaveRole']) && empty($_REQUEST['AddCap']) ) {
check_admin_referer('capsman-general-manager');
$this->processAdminGeneral();
} elseif ( ! empty($_REQUEST['SaveRole']) ) {
ak_admin_notify( $this->message ); // moved update operation to earlier action to avoid UI refresh issues. But outputting notification there breaks styling.
} elseif ( ! empty($_REQUEST['AddCap']) ) {
ak_admin_notify( $this->message );
}
}
$this->generateNames();
$roles = array_keys($this->roles);
if ( isset($_GET['action']) && 'delete' == $_GET['action']) {
require_once( dirname(__FILE__).'/handler.php' );
$capsman_modify = new CapsmanHandler( $this );
$capsman_modify->adminDeleteRole();
}
if ( ! in_array($this->current, $roles) ) { // Current role has been deleted.
$this->current = array_shift($roles);
}
include ( AK_CMAN_LIB . '/admin.php' );
}
/**
* Processes and saves the changes in the general capabilities form.
*
* @return void
*/
private function processAdminGeneral ()
{
if (! isset($_POST['action']) || 'update' != $_POST['action'] ) {
// TODO: Implement exceptions. This must be a fatal error.
ak_admin_error(__('Bad form Received', 'capsman-enhanced'));
return;
}
$post = stripslashes_deep($_POST);
if ( empty ($post['caps']) ) {
$post['caps'] = array();
}
$this->current = $post['current'];
// Select a new role.
if ( ! empty($post['LoadRole']) ) {
$this->current = $post['role'];
} else {
require_once( dirname(__FILE__).'/handler.php' );
$capsman_modify = new CapsmanHandler( $this );
$capsman_modify->processAdminGeneral( $post );
}
}
/**
* Callback function to create names.
* Replaces underscores by spaces and uppercases the first letter.
*
* @access private
* @param string $cap Capability name.
* @return string The generated name.
*/
function _capNamesCB ( $cap )
{
$cap = str_replace('_', ' ', $cap);
//$cap = ucfirst($cap);
return $cap;
}
/**
* Generates an array with the system capability names.
* The key is the capability and the value the created screen name.
*
* @uses self::_capNamesCB()
* @return void
*/
function generateSysNames ()
{
$this->max_level = 10;
$this->roles = ak_get_roles(true);
$caps = array();
foreach ( array_keys($this->roles) as $role ) {
$role_caps = get_role($role);
$caps = array_merge( $caps, (array) $role_caps->capabilities ); // user reported PHP 5.3.3 error without array cast
}
$keys = array_keys($caps);
$names = array_map(array($this, '_capNamesCB'), $keys);
$this->capabilities = array_combine($keys, $names);
asort($this->capabilities);
}
/**
* Generates an array with the user capability names.
* If user has 'administrator' role, system roles are generated.
* The key is the capability and the value the created screen name.
* A user cannot manage more capabilities that has himself (Except for administrators).
*
* @uses self::_capNamesCB()
* @return void
*/
function generateNames ()
{
if ( current_user_can('administrator') || ( is_multisite() && is_super_admin() ) ) {
$this->generateSysNames();
} else {
global $user_ID;
$user = new WP_User($user_ID);
$this->max_level = ak_caps2level($user->allcaps);
$keys = array_keys($user->allcaps);
$names = array_map(array($this, '_capNamesCB'), $keys);
$this->capabilities = ( $keys ) ? array_combine($keys, $names) : array();
$roles = ak_get_roles(true);
unset($roles['administrator']);
if ( ( defined( 'CME_LEGACY_USER_EDIT_FILTER' ) && CME_LEGACY_USER_EDIT_FILTER ) || ( ! empty( $_REQUEST['page'] ) && 'capsman' == $_REQUEST['page'] ) ) {
foreach ( $user->roles as $role ) { // Unset the roles from capability list.
unset ( $this->capabilities[$role] );
unset ( $roles[$role]); // User cannot manage his roles.
}
}
asort($this->capabilities);
foreach ( array_keys($roles) as $role ) {
$r = get_role($role);
$level = ak_caps2level($r->capabilities);
if ( $level > $this->max_level ) {
unset($roles[$role]);
}
}
$this->roles = $roles;
}
}
/**
* Manages backup, restore and resset roles and capabilities
*
* @hook add_management_page
* @return void
*/
function backupTool ()
{
if ( ! current_user_can('restore_roles') && ! is_super_admin() ) {
// TODO: Implement exceptions.
wp_die('<strong>' .__('What do you think you\'re doing?!?', 'capsman-enhanced') . '</strong>');
}
if ( 'POST' == $_SERVER['REQUEST_METHOD'] ) {
require_once( dirname(__FILE__).'/backup-handler.php' );
$cme_backup_handler = new Capsman_BackupHandler( $this );
$cme_backup_handler->processBackupTool();
}
if ( isset($_GET['action']) && 'reset-defaults' == $_GET['action']) {
require_once( dirname(__FILE__).'/backup-handler.php' );
$cme_backup_handler = new Capsman_BackupHandler( $this );
$cme_backup_handler->backupToolReset();
}
include ( AK_CMAN_LIB . '/backup.php' );
}
}

View File

@@ -0,0 +1,75 @@
<?php
add_action( 'wpmu_new_blog', '_cme_new_blog' );
function _cme_new_blog( $new_blog_id ) {
if ( $autocreate_roles = get_site_option( 'cme_autocreate_roles' ) ) {
global $wp_roles, $blog_id;
$restore_blog_id = $blog_id;
switch_to_blog( 1 );
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
$main_site_caps = array();
$role_captions = array();
$admin_role = $wp_roles->get_role('administrator');
$main_admin_caps = $admin_role->capabilities;
if ( defined('PP_ACTIVE') )
$main_pp_only = (array) pp_get_option( 'supplemental_role_defs' );
//$pp_only[]= $newrole;
foreach( $autocreate_roles as $role_name ) {
if ( $role = get_role( $role_name ) ) {
$main_site_caps[$role_name] = $role->capabilities;
$role_captions[$role_name] = $wp_roles->role_names[$role_name];
}
}
switch_to_blog($new_blog_id);
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
if ( defined('PP_ACTIVE') ) {
pp_refresh_options();
$blog_pp_only = (array) pp_get_option( 'supplemental_role_defs' );
}
foreach( $main_site_caps as $role_name => $caps ) {
if ( $blog_role = $wp_roles->get_role( $role_name ) ) {
$stored_role_caps = ( ! empty($blog_role->capabilities) && is_array($blog_role->capabilities) ) ? array_intersect( $blog_role->capabilities, array(true, 1) ) : array();
// Find caps to add and remove
$add_caps = array_diff_key($caps, $stored_role_caps);
$del_caps = array_intersect_key( array_diff_key($stored_role_caps, $caps), $main_admin_caps ); // don't mess with caps that are totally unused on main site
// Add new capabilities to role
foreach ( $add_caps as $cap => $grant )
$blog_role->add_cap($cap);
// Remove capabilities from role
foreach ( $del_caps as $cap => $grant)
$blog_role->remove_cap($cap);
} else {
$wp_roles->add_role( $role_name, $role_captions[$role_name], $caps );
}
if ( defined('PP_ACTIVE') ) {
if ( in_array( $role_name, $main_pp_only ) ) {
_cme_pp_default_pattern_role( $role_name );
$blog_pp_only []= $role_name;
} else
array_diff( $blog_pp_only, array( $role_name ) );
}
}
if ( defined('PP_ACTIVE') )
pp_update_option( 'supplemental_role_defs', $blog_pp_only );
switch_to_blog($restore_blog_id);
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
if ( defined('PP_ACTIVE') )
pp_refresh_options();
}
}

View File

@@ -0,0 +1,64 @@
<?php
function _cme_update_pp_usage() {
static $updated;
if ( ! empty($updated) ) { return true; }
if ( ! current_user_can( 'pp_manage_settings' ) )
return false;
if ( ! empty( $_REQUEST['update_filtered_types']) ) {
// update Press Permit "Filtered Post Types". This determines whether type-specific capability definitions are forced
$options = array( 'enabled_post_types', 'enabled_taxonomies' );
foreach( $options as $option_basename ) {
if ( ! isset( $_POST["{$option_basename}-options"] ) )
continue;
$unselected = array();
$value = array();
foreach( $_POST["{$option_basename}-options"] as $key ) {
if ( empty( $_POST["{$option_basename}-$key"] ) )
$unselected[$key] = true;
else
$value[$key] = true;
}
if ( $current = pp_get_option( $option_basename ) ) {
if ( $current = array_diff_key( $current, $unselected ) )
$value = array_merge( $current, $value ); // retain setting for any types which were previously enabled for filtering but are currently not registered
}
$value = stripslashes_deep($value);
pp_update_option( $option_basename, $value );
$updated = true;
}
if ( pp_wp_ver( '3.5' ) ) {
pp_update_option( 'define_create_posts_cap', ! empty($_REQUEST['pp_define_create_posts_cap']) );
}
}
if ( ! empty( $_REQUEST['SaveRole']) ) {
if ( ! empty( $_REQUEST['role'] ) ) {
$pp_only = (array) pp_get_option( 'supplemental_role_defs' );
if ( empty($_REQUEST['pp_only_role']) )
$pp_only = array_diff( $pp_only, array($_REQUEST['role']) );
else
$pp_only[]= $_REQUEST['role'];
pp_update_option( 'supplemental_role_defs', array_unique($pp_only) );
_cme_pp_default_pattern_role( $_REQUEST['role'] );
}
}
if ( $updated ) {
pp_refresh_options();
}
return $updated;
}

View File

@@ -0,0 +1,170 @@
<?php
class Capsman_PP_UI {
function __construct() {
}
function get_metagroup_caps( $default ) {
global $wpdb;
if ( defined( 'PPC_VERSION' ) )
$pp_supplemental_roles = $wpdb->get_col( "SELECT role_name FROM $wpdb->ppc_roles AS r INNER JOIN $wpdb->pp_groups AS g ON g.ID = r.agent_id AND r.agent_type = 'pp_group' WHERE g.metagroup_type = 'wp_role' AND g.metagroup_id = '$default'" );
else
$pp_supplemental_roles = $wpdb->get_col( "SELECT role_name FROM $wpdb->pp_roles AS r INNER JOIN $wpdb->pp_groups AS g ON g.ID = r.group_id AND r.group_type = 'pp_group' AND r.scope = 'site' WHERE g.metagroup_type = 'wp_role' AND g.metagroup_id = '$default'" );
$pp_filtered_types = pp_get_enabled_types('post');
$pp_metagroup_caps = array();
$pp_cap_caster = pp_init_cap_caster();
foreach( $pp_supplemental_roles as $_role_name ) {
$role_specs = explode( ':', $_role_name );
if ( empty($role_specs[2]) || ! in_array( $role_specs[2], $pp_filtered_types ) )
continue;
// add all type-specific caps whose base property cap is included in this pattern role
// i.e. If 'edit_posts' is in the pattern role, grant $type_obj->cap->edit_posts
$pp_metagroup_caps = array_merge( $pp_metagroup_caps, array_fill_keys( $pp_cap_caster->get_typecast_caps( $_role_name, 'site' ), true ) );
}
return $pp_metagroup_caps;
}
function show_capability_hints( $default ) {
if ( pp_get_option('display_hints') ) {
$cme_id = 'capsman';
echo '<ul class="ul-disc" style="margin-top:10px">';
if ( defined( 'PPCE_VERSION' ) || ! defined( 'PPC_VERSION' ) || in_array( $default, array( 'subscriber', 'contributor', 'author', 'editor' ) ) ) {
echo '<li>';
if ( defined( 'PPCE_VERSION' ) || ! defined( 'PPC_VERSION' ) ) {
if ( pp_get_option( 'advanced_options' ) )
$parenthetical = ' (' . sprintf( __( 'see %1$sRole Usage%2$s: "Pattern Roles"', 'capsman-enhanced' ), "<a href='" . admin_url('admin.php?page=pp-role-usage') . "'>", '</a>' ) . ')';
else
$parenthetical = ' (' . sprintf( __( 'activate %1$sAdvanced settings%2$s, see Role Usage', 'capsman-enhanced' ), "<a href='" . admin_url('admin.php?page=pp-settings&pp_tab=advanced') . "'>", '</a>' ). ')';
} else
$parenthetical = '';
if ( defined( 'PPC_VERSION' ) )
printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permission Groups%s.', $cme_id ), $parenthetical ) ;
else
printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permit Groups%s.', $cme_id ), $parenthetical ) ;
echo '</li>';
}
$status_hint = '';
if ( defined( 'PPC_VERSION' ) )
if ( defined( 'PPS_VERSION' ) )
$status_hint = sprintf( __( 'Capabilities for custom statuses can be manually added here (see Post Statuses > Status > Capability Mapping for applicable names). However, it is usually more convenient to use Permission Groups to assign a supplemental status-specific role.', $cme_id ), "<a href='" . admin_url('?page=pp-role-usage') . "'>", '</a>' ) ;
elseif ( pp_get_option( 'display_extension_hints' ) )
$status_hint = sprintf( __( 'Capabilities for custom statuses can be manually added here. Or activate the PP Custom Post Statuses extension to assign status-specific supplemental roles.', $cme_id ), "<a href='" . admin_url('?page=pp-role-usage') . "'>", '</a>' ) ;
elseif ( defined( 'PP_VERSION' ) )
$status_hint = sprintf( __( 'Capabilities for custom statuses can be manually added to a role here (see Conditions > Status > Capability Mapping for applicable names). However, it is usually more convenient to use Permit Groups to assign a supplemental status-specific role.', $cme_id ), "<a href='" . admin_url('?page=pp-role-usage') . "'>", '</a>' ) ;
if ( $status_hint )
echo "<li>$status_hint</li>";
echo '</ul>';
}
}
function pp_only_roles_ui( $default ) {
$support_pp_only_roles = defined('PPC_VERSION') || version_compare( PP_VERSION, '1.0-beta1.4', '>=');
?>
<?php if ( $support_pp_only_roles && ! in_array( $default, array( /*'subscriber', 'contributor', 'author', 'editor',*/ 'administrator' ) ) ) : ?>
<div style="float:right">
<?php
pp_refresh_options();
$pp_only = (array) pp_get_option( 'supplemental_role_defs' );
$checked = ( in_array( $default, $pp_only ) ) ? 'checked="checked"': '';
?>
<label for="pp_only_role" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"><input type="checkbox" name="pp_only_role" id="pp_only_role" value="1" <?php echo $checked;?>> <?php _e('hidden role', 'capsman-enhanced'); ?> </label>
</div>
<?php endif; ?>
<?php
return $support_pp_only_roles;
}
function pp_types_ui( $defined ) {
if ( current_user_can( 'pp_manage_settings' ) ) :?>
<dl>
<dt><?php _e('Force Type-Specific Capabilities', 'capsman-enhanced'); ?></dt>
<dd style="text-align:center;">
<?php
$caption = __( 'Force unique capability names for:', 'capsman-enhanced' );
echo "<p>$caption</p>";
if ( pp_get_option( 'display_hints' ) ) :?>
<div class="cme-subtext" style="margin-top:0">
<?php _e( '(PP Filtered Post Types, Taxonomies)', 'capsman-enhanced' );?>
</div>
<?php endif;
echo "<table style='width:100%'><tr>";
$unfiltered['type'] = apply_filters( 'pp_unfiltered_post_types', array('forum','topic','reply') ); // bbPress' dynamic role def requires additional code to enforce stored caps
$unfiltered['taxonomy'] = apply_filters( 'pp_unfiltered_taxonomies', array( 'post_status', 'topic-tag' ) ); // avoid confusion with Edit Flow administrative taxonomy
$hidden['type'] = apply_filters( 'pp_hidden_post_types', array() );
$hidden['taxonomy'] = apply_filters( 'pp_hidden_taxonomies', array() );
foreach( array_keys($defined) as $item_type ) {
echo '<td style="width:50%">';
$option_name = ( 'taxonomy' == $item_type ) ? 'enabled_taxonomies' : 'enabled_post_types';
$enabled = pp_get_option( $option_name );
foreach( $defined[$item_type] as $key => $type_obj ) {
if ( ! $key )
continue;
if ( in_array( $key, $unfiltered[$item_type] ) )
continue;
$id = "$option_name-" . $key;
?>
<div style="text-align:left">
<?php if ( ! empty( $hidden[$item_type][$key] ) ) :?>
<input name="<?php echo($id);?>" type="hidden" id="<?php echo($id);?>" value="1" />
<input name="<?php echo("{$option_name}-options[]");?>" type="hidden" value="<?php echo($key)?>" />
<?php else: ?>
<div class="agp-vspaced_input">
<label for="<?php echo($id);?>" title="<?php echo($key);?>">
<input name="<?php echo("{$option_name}-options[]");?>" type="hidden" value="<?php echo($key)?>" />
<input name="<?php echo($id);?>" type="checkbox" id="<?php echo($id);?>" value="1" <?php checked('1', ! empty($enabled[$key]) );?> /> <?php echo($type_obj->label);?>
<?php
echo ('</label></div>');
endif; // displaying checkbox UI
echo '</div>';
}
echo '</td>';
}
?>
</tr>
</table>
<?php if( pp_wp_ver( '3.5' ) ) :
$define_create_posts_cap = pp_get_option( 'define_create_posts_cap' );
?>
<div>
<label for="pp_define_create_posts_cap">
<input name="pp_define_create_posts_cap" type="checkbox" id="pp_define_create_posts_cap" value="1" <?php checked('1', $define_create_posts_cap );?> /> <?php _e('Use create_posts capability');?>
</label>
</div>
<?php endif; ?>
<input type="submit" name="update_filtered_types" value="<?php _e('Update', 'capsman-enhanced') ?>" class="button" />
</dd>
</dl>
<?php endif;
}
}

View File

@@ -0,0 +1,281 @@
msgid ""
msgstr ""
"Project-Id-Version: Capability Manager\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-01-29 15:03+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
"Language-Team: antsar.info <iliamrv@ya.ru>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Language: Belarusian\n"
"X-Poedit-Country: BELARUS\n"
"X-Poedit-SourceCharset: utf-8\n"
#: ../capsman.php:53
msgid "Warning:"
msgstr "Папярэджанне:"
#: ../capsman.php:54
#, php-format
msgid "The active plugin %s is not compatible with your PHP version."
msgstr "Убудова %s не сумяшчальны з вашай версіяй PHP."
#: ../capsman.php:56
#, php-format
msgid "%s is required for this plugin."
msgstr "%s неабходзен лоя ўбудовы."
#: ../includes/admin.php:36
msgid "Roles and Capabilities"
msgstr "Ролі і магчымасці"
#: ../includes/admin.php:45
#, php-format
msgid "Capabilities for %s"
msgstr "Магчымасць для %s"
#: ../includes/admin.php:92
msgid "Level:"
msgstr "Узровень:"
#: ../includes/admin.php:115
#: ../includes/manager.php:319
msgid "Save Changes"
msgstr "Захаваць налады"
#: ../includes/admin.php:117
msgid "Delete this role"
msgstr "Выдаліць гэту ролю"
#: ../includes/admin.php:117
#, php-format
msgid ""
"You are about to delete the %s role.\n"
" 'Cancel' to stop, 'OK' to delete."
msgstr ""
"Вы пра выдаленне ролі %s.\n"
" 'Адмяніць' для прыпынку, 'ОК' для выдалення."
#: ../includes/admin.php:117
msgid "Delete Role"
msgstr "Выдаленне ролі"
#: ../includes/admin.php:128
msgid "Select New Role"
msgstr "Абраць новую ролю"
#: ../includes/admin.php:136
#: ../includes/manager.php:296
msgid "Change"
msgstr "Змяніць"
#: ../includes/admin.php:141
msgid "Create New Role"
msgstr "Стварыць новую ролю"
#: ../includes/admin.php:144
#: ../includes/manager.php:300
msgid "Create"
msgstr "Стварыць"
#: ../includes/admin.php:149
msgid "Copy this role to"
msgstr "Копія гэтай ролі"
#: ../includes/admin.php:152
#: ../includes/manager.php:309
msgid "Copy"
msgstr "Копія"
#: ../includes/admin.php:157
msgid "Add Capability"
msgstr "Дадаць магчымасць"
#: ../includes/admin.php:160
#: ../includes/manager.php:323
msgid "Add to role"
msgstr "Дадаць ролю"
#: ../includes/backup.php:33
msgid "Backup Tool for Capability Manager"
msgstr "Прылада для стварэння рэзервовай копіі для Capability Manager"
#: ../includes/backup.php:42
msgid "Backup and Restore"
msgstr "Рэзервовая копія і аднаўленне"
#: ../includes/backup.php:46
msgid "Select action:"
msgstr "Абраць дзеянне:"
#: ../includes/backup.php:49
msgid "Backup roles and capabilities"
msgstr "Рэзерв. копія роляў і магчымасцяў"
#: ../includes/backup.php:50
msgid "Restore last saved backup"
msgstr "Аднавіць з апошняга захаванага бэкапу"
#: ../includes/backup.php:52
msgid "Do Action"
msgstr "Няма дзеянняў"
#: ../includes/backup.php:60
msgid "Reset WordPress Defaults"
msgstr "Сбростить налады WordPress па змаўчанні"
#: ../includes/backup.php:62
msgid "WARNING:"
msgstr "УВАГА:"
#: ../includes/backup.php:62
msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
msgstr "Скід стандартных роляў і магчымасцяў павінен скінуць налады па змаўчанні пры установвке ў WordPress."
#: ../includes/backup.php:63
msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
msgstr "Калі вы ўсталявалі іншую ўбудову, які дадае новыя ролі ці магчымасці, гэта павінна знікнуць. "
#: ../includes/backup.php:64
msgid "It is recommended to use this only as a last resource!"
msgstr "Гэта рэкамендуецца дя выкарыстанні толькі як последный рэсурс!"
#: ../includes/backup.php:65
msgid "Reset Roles and Capabilities to WordPress defaults"
msgstr "Скінуць ролі і воможности"
#: ../includes/backup.php:65
msgid ""
"You are about to reset Roles and Capabilities to WordPress defaults.\n"
" 'Cancel' to stop, 'OK' to reset."
msgstr ""
"Вы пра скід роляў і магчымасцяў %s.\n"
" 'Адмяніць' для прыпынку, 'ОК' для скіду."
#: ../includes/backup.php:65
msgid "Reset to WordPress defaults"
msgstr "Скінуць налады WordPress"
#: ../includes/manager.php:139
#: ../includes/manager.php:140
msgid "Capability Manager"
msgstr "Capability Manager"
#: ../includes/manager.php:139
msgid "Capabilities"
msgstr "Магчымасці"
#: ../includes/manager.php:220
#: ../includes/manager.php:256
msgid "What do you think you're doing?!?"
msgstr "Вы ведаеце, што робіце?!?"
#: ../includes/manager.php:283
msgid "Bad form Received"
msgstr "Se ha recibido un formulario incorrecto."
#: ../includes/manager.php:302
#: ../includes/manager.php:312
msgid "New role created."
msgstr "Новая роля створана."
#: ../includes/manager.php:305
#: ../includes/manager.php:315
msgid "Error: Failed creating the new role."
msgstr "Памылка: Новая роля не створана."
#: ../includes/manager.php:320
msgid "New capabilities saved."
msgstr "Новыя магчымасці захаваны."
#: ../includes/manager.php:328
msgid "New capability added to role."
msgstr "Новая воможность дададзена да ролі."
#: ../includes/manager.php:330
msgid "Incorrect capability name."
msgstr "Некарэктнае імя магчымасці."
#: ../includes/manager.php:334
msgid "Bad form received."
msgstr "Дрэнная форма адпраўкі."
#: ../includes/manager.php:354
msgid "New backup saved."
msgstr "Новы бэкап захаваны."
#: ../includes/manager.php:360
msgid "Roles and Capabilities restored from last backup."
msgstr "Ролі і магчымасці адноўлены з апошняга бэкапу."
#: ../includes/manager.php:362
msgid "Restore failed. No backup found."
msgstr "Аднаўленне спынена. Не знойдзена бэкапаў. "
#: ../includes/manager.php:384
#, php-format
msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
msgstr "Не выдалена стандартная роля. Вы <a href=\"%s\">павінны спачатку змяніць гэта</a>."
#: ../includes/manager.php:405
#, php-format
msgid "Role has been deleted. %1$d users moved to default role %2$s."
msgstr "Роля была выдалена. %1$d карыстачоў перамешчана ў стандартную ролю %2$s."
#: ../includes/manager.php:419
msgid "Needed function to create default roles not found!"
msgstr "Неабходная функцыя па стварэнні роляў не знойдзена!"
#: ../includes/manager.php:431
msgid "Roles and Capabilities reset to WordPress defaults"
msgstr "Ролі і магчымасці скінуты да стандартных для WordPress "
#: ../includes/manager.php:606
msgid "You cannot remove Manage Capabilities from Administrators"
msgstr "Вы не можаце выдаліць Manage Capabilities праз адміністратараў ."
#~ msgid "The active plugin %s is not compatible with your WordPress version."
#~ msgstr "Актыўная ўбудова %s не сумяшчальны з бягучай версіяй WordPress."
#~ msgid "WordPress %s is required to run this plugin."
#~ msgstr "WordPress %s неабходзен для запуску гэтай убудовы."
#~ msgid "Standard sidebar functions are not present."
#~ msgstr "Стандартныя функцыі бакавой панэлі не прадстаўлены."
#~ msgid "It is required to use the standard sidebar to run %s"
#~ msgstr ""
#~ "Гэта неабходна для выкарыстання стандартнай бакавой панэлі для запуску %s"
#~ msgid "Settings saved."
#~ msgstr "Налады захаваны."
#~ msgid "Plugin Homepage"
#~ msgstr "Хатняя старонка ўбудовы"
#, fuzzy
#~ msgid "Theme Homepage"
#~ msgstr "Хатняя старонка аўтара"
#, fuzzy
#~ msgid "Documentation"
#~ msgstr "Няма дзеянняў"
#~ msgid "Support Forum"
#~ msgstr "Форум падтрымкі"
#~ msgid "Author Homepage"
#~ msgstr "Хатняя старонка аўтара"
#, fuzzy
#~ msgid "Incorrect type of file."
#~ msgstr "Некарэктнае імя магчымасці."
#, fuzzy
#~ msgid "Error in creating %s image from source."
#~ msgstr "Памылка: Новая роля не створана."
#, fuzzy
#~ msgid "Error reading the file."
#~ msgstr "Памылка: Новая роля не створана."
#~ msgid "Help donating"
#~ msgstr "Дапамога праз ахвяраванні"
#~ msgid "Managing %s"
#~ msgstr "Administrando %s"

View File

@@ -0,0 +1,384 @@
msgid ""
msgstr ""
"Project-Id-Version: Capability Manager\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-01-29 15:03+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
"Language-Team: Jordi Canals | http://alkivia.org <devel@jcanals.cat>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Language: Catalan\n"
"X-Poedit-SourceCharset: utf-8\n"
#: ../capsman.php:53
msgid "Warning:"
msgstr "Atenció:"
#: ../capsman.php:54
#, php-format
msgid "The active plugin %s is not compatible with your PHP version."
msgstr "L'extensió activa %s no és compatible amb la teva versió de PHP."
#: ../capsman.php:56
#, php-format
msgid "%s is required for this plugin."
msgstr "Es requereix %s per aquesta extensió."
#: ../includes/admin.php:36
msgid "Roles and Capabilities"
msgstr "Rols i Competències"
#: ../includes/admin.php:45
#, php-format
msgid "Capabilities for %s"
msgstr "Competències per %s"
#: ../includes/admin.php:92
msgid "Level:"
msgstr "Nivell:"
#: ../includes/admin.php:115
#: ../includes/manager.php:319
msgid "Save Changes"
msgstr "Desa els canvis"
#: ../includes/admin.php:117
msgid "Delete this role"
msgstr "Elimina aquest rol"
#: ../includes/admin.php:117
#, php-format
msgid ""
"You are about to delete the %s role.\n"
" 'Cancel' to stop, 'OK' to delete."
msgstr ""
"Estàs apunt d'eliminar el rol %s.\n"
" 'Cancel·la' per sortir, 'D'acord' per eliminar."
#: ../includes/admin.php:117
msgid "Delete Role"
msgstr "Eliminar Rol"
#: ../includes/admin.php:128
msgid "Select New Role"
msgstr "Selecciona un nou Rol"
#: ../includes/admin.php:136
#: ../includes/manager.php:296
msgid "Change"
msgstr "Canvia"
#: ../includes/admin.php:141
msgid "Create New Role"
msgstr "Crear rol nou"
#: ../includes/admin.php:144
#: ../includes/manager.php:300
msgid "Create"
msgstr "Crear"
#: ../includes/admin.php:149
msgid "Copy this role to"
msgstr "Copia aquest rol a"
#: ../includes/admin.php:152
#: ../includes/manager.php:309
msgid "Copy"
msgstr "Copiar"
#: ../includes/admin.php:157
msgid "Add Capability"
msgstr "Afegeix Competència"
#: ../includes/admin.php:160
#: ../includes/manager.php:323
msgid "Add to role"
msgstr "Afegir al rol"
#: ../includes/backup.php:33
msgid "Backup Tool for Capability Manager"
msgstr "Eina de Copies de Seguretat per a Capability Manager"
#: ../includes/backup.php:42
msgid "Backup and Restore"
msgstr "Copia i Restaura"
#: ../includes/backup.php:46
msgid "Select action:"
msgstr "Selecciona una acció:"
#: ../includes/backup.php:49
msgid "Backup roles and capabilities"
msgstr "Desa una copia de rols i competències"
#: ../includes/backup.php:50
msgid "Restore last saved backup"
msgstr "Recupera la darrera còpia de seguretat"
#: ../includes/backup.php:52
msgid "Do Action"
msgstr "Executa l'Acció"
#: ../includes/backup.php:60
msgid "Reset WordPress Defaults"
msgstr "Restaura valors predeterminats de WordPress"
#: ../includes/backup.php:62
msgid "WARNING:"
msgstr "ATENCIÓ:"
#: ../includes/backup.php:62
msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
msgstr "Restaurant els valors predeterminats per a Rols i Competències, els configurarà als valors predeterminats de la instal·lació de WordPress."
#: ../includes/backup.php:63
msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
msgstr "Si has instal·lat alguna extensió que afegeix nous rols o competències, aquests es perdran."
#: ../includes/backup.php:64
msgid "It is recommended to use this only as a last resource!"
msgstr "Es recomana utilitzar aquesta opció només com a últim recurs!"
#: ../includes/backup.php:65
msgid "Reset Roles and Capabilities to WordPress defaults"
msgstr "Restaura Rols i Competències als valors predeterminats de WordPress"
#: ../includes/backup.php:65
msgid ""
"You are about to reset Roles and Capabilities to WordPress defaults.\n"
" 'Cancel' to stop, 'OK' to reset."
msgstr ""
"Estàs apunt de restaurar els valors predeterminats de WordPress per a Rols i Competències.\n"
" 'Cancel·la' per abandonarr, 'D'acord' per restaurar."
#: ../includes/backup.php:65
msgid "Reset to WordPress defaults"
msgstr "Restaura els valors predeterminats de WordPress"
#: ../includes/manager.php:139
#: ../includes/manager.php:140
msgid "Capability Manager"
msgstr "Administrador de Compoetències"
#: ../includes/manager.php:139
msgid "Capabilities"
msgstr "Competències"
#: ../includes/manager.php:220
#: ../includes/manager.php:256
msgid "What do you think you're doing?!?"
msgstr "Que et penses que fas?"
#: ../includes/manager.php:283
msgid "Bad form Received"
msgstr "S'ha rebut un formulari incorrecte."
#: ../includes/manager.php:302
#: ../includes/manager.php:312
msgid "New role created."
msgstr "S'ha creat el nou rol."
#: ../includes/manager.php:305
#: ../includes/manager.php:315
msgid "Error: Failed creating the new role."
msgstr "Error: No s'ha pogut crear el nou rol."
#: ../includes/manager.php:320
msgid "New capabilities saved."
msgstr "S'han desat les noves competències."
#: ../includes/manager.php:328
msgid "New capability added to role."
msgstr "Nova competència afegida al rol."
#: ../includes/manager.php:330
msgid "Incorrect capability name."
msgstr "Nom incorrecte de competència."
#: ../includes/manager.php:334
msgid "Bad form received."
msgstr "S'ha rebut un formulari incorrecte."
#: ../includes/manager.php:354
msgid "New backup saved."
msgstr "S'ha creat la copia de seguretat."
#: ../includes/manager.php:360
msgid "Roles and Capabilities restored from last backup."
msgstr "S'han recuperat els Rols i Competències des de la copia de seguretat."
#: ../includes/manager.php:362
msgid "Restore failed. No backup found."
msgstr "Ha fallat la recuperació. No s'ha trobat cap copia de seguretat."
#: ../includes/manager.php:384
#, php-format
msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
msgstr "No es pot eliminar el rol predeterminat. <a href=\"%s\" Abans has de canviar-lo</a>."
#: ../includes/manager.php:405
#, php-format
msgid "Role has been deleted. %1$d users moved to default role %2$s."
msgstr "El rol ha estat eliminat. S'han mogut %1$d usuaris al rol predeterminat %2$s."
#: ../includes/manager.php:419
msgid "Needed function to create default roles not found!"
msgstr "La funció per crear els rols predeterminats no s'ha trobat!"
#: ../includes/manager.php:431
msgid "Roles and Capabilities reset to WordPress defaults"
msgstr "S'han restaurat Rols i Competències als valors predeterminats de WordPress."
#: ../includes/manager.php:606
msgid "You cannot remove Manage Capabilities from Administrators"
msgstr "No pots eliminar 'Manage Capabilities' dels administradors"
#~ msgid "Option blocked by administrator."
#~ msgstr "Opció desactivada per l'administrador."
#~ msgid "The active plugin %s is not compatible with your WordPress version."
#~ msgstr ""
#~ "L'extensió activa %s no és compatible amb la teva versió de WordPress."
#~ msgid "WordPress %s is required to run this plugin."
#~ msgstr "Aquesta extensió requereix com a mínim WordPress %s."
#~ msgid "Standard sidebar functions are not present."
#~ msgstr "Les funcions de la barra lateral estàndard no es troben presents."
#~ msgid "It is required to use the standard sidebar to run %s"
#~ msgstr "És necessari utilitzar la barra lateral estàndard per executar %s"
#~ msgid "Settings saved."
#~ msgstr "Opcions desades."
#~ msgid "Just Now"
#~ msgstr "Ara mateix"
#~ msgid "1 minute ago"
#~ msgstr "Fa 1 minut"
#~ msgid "1 hour ago"
#~ msgstr "Fa 1 hora"
#~ msgid "Today at %s"
#~ msgstr "Avui a les %s"
#~ msgid "Yesterday at %s"
#~ msgstr "Ahir a les %s"
#~ msgid "Plugin Homepage"
#~ msgstr "Pàgina web de l'extensió"
#~ msgid "Theme Homepage"
#~ msgstr "Pàgina web del tema"
#~ msgid "Documentation"
#~ msgstr "Documentació"
#~ msgid "Support Forum"
#~ msgstr "Forum d'Ajuda"
#~ msgid "Author Homepage"
#~ msgstr "Lloc web de l'autor"
#~ msgid "Donate to project"
#~ msgstr "Fes un donatiu"
#~ msgid "File error. Please try again."
#~ msgstr "Error de fitxer. Si us plau, torneu-ho a provar."
#~ msgid "Local file doesn't exist."
#~ msgstr "El fitxer local no existeix."
#~ msgid "Local file is not readable."
#~ msgstr "El fitxer local no es pot llegir."
#~ msgid ""
#~ "File upload error (the uploaded file exceeds the upload_max_filesize "
#~ "directive in php.ini)."
#~ msgstr ""
#~ "Error de pujada de fitxer (El fitxer pujat excedeix de la directiva "
#~ "upload_max_filesize de php.ini)."
#~ msgid ""
#~ "File upload error (the uploaded file exceeds the MAX_FILE_SIZE directive "
#~ "that was specified in the html form)."
#~ msgstr ""
#~ "Error pujant el fitxer (el fitxer pujat excedeix la directiva "
#~ "MAX_FILE_SIZE que s'ha especificat al formulari HTML)."
#~ msgid "File upload error (the uploaded file was only partially uploaded)."
#~ msgstr "Error pujant el fitxer (El fitxer només s'ha rebut parcialment)."
#~ msgid "File upload error (no file was uploaded)."
#~ msgstr "Error pujant el fitxer (No s'ha rebut cap fitxer)."
#~ msgid "File upload error (missing a temporary folder)."
#~ msgstr "Error pujant el fitxer (manca la carpeta temporal)."
#~ msgid "File upload error (failed to write file to disk)."
#~ msgstr "Error pujant el fitxer (No s'ha pogut escriure al disc)."
#~ msgid "File upload error (file upload stopped by extension)."
#~ msgstr "Error pujant el fitxer (El fitxer s'ha bloquejat per extensió)."
#~ msgid "File upload error (unknown error code)."
#~ msgstr "Error pujant el fitxer (Codi d'error desconegut)."
#~ msgid "File upload error. Please try again."
#~ msgstr ""
#~ "S'ha produït un error pujant el fitxer. Torneu-ho a provar d'aquí una "
#~ "estona."
#~ msgid "File too big."
#~ msgstr "Fitxer massa gran."
#~ msgid "MIME type can't be detected."
#~ msgstr "No es pot detectar el tipus MIME."
#~ msgid "Incorrect type of file."
#~ msgstr "Tipus d'arxiu invàlid"
#~ msgid "Image too wide."
#~ msgstr "Imatge massa ample."
#~ msgid "Image too narrow."
#~ msgstr "Imatge massa estreta."
#~ msgid "Image too high."
#~ msgstr "Imatge massa alta."
#~ msgid "Image too short."
#~ msgstr "Imatge massa baixa."
#~ msgid "Image ratio too high (image too wide)."
#~ msgstr "Ratio d'imatge massa gran (Imatge massa ample)."
#~ msgid "Image ratio too low (image too high)."
#~ msgstr "Ratio d'imatge massa baix (Imatge massa alta)."
#~ msgid "Image has too many pixels."
#~ msgstr "La imatge té massa píxels."
#~ msgid "Image has not enough pixels."
#~ msgstr "La imatge no té prou píxels."
#~ msgid "File not uploaded. Can't carry on a process."
#~ msgstr "No s'ha pujat el fitxer. No s'ha pogut executar el procés."
#~ msgid "%s already exists. Please change the file name."
#~ msgstr "El fitxer %s ja existeix. Si en plau canvieu-ne el nom."
#~ msgid "No correct temp source file. Can't carry on a process."
#~ msgstr "El fitxer temporal no es correcte. No es pot executar el procés."
#~ msgid "No correct uploaded source file. Can't carry on a process."
#~ msgstr "El fitxer original no es correcte. No es pot executar el procés."
#~ msgid "Destination directory can't be created. Can't carry on a process."
#~ msgstr ""
#~ "No es pot crear el directori de destí. No es pot executar el procés."
#~ msgid "Destination directory doesn't exist. Can't carry on a process."
#~ msgstr "El directori de destí no existeix. No es pot executar el procés."
#~ msgid "Destination path is not a directory. Can't carry on a process."
#~ msgstr "La ruta de destí no és un directori. No es pot executar el procés."
#~ msgid ""
#~ "Destination directory can't be made writeable. Can't carry on a process."
#~ msgstr ""
#~ "No es pot canviar a 'escriure' els drets del directori de destí. No es "
#~ "pot executar el procés."
#~ msgid "Destination path is not a writeable. Can't carry on a process."
#~ msgstr ""
#~ "No es pot escriure en el directori de destí. No es pot executar el procés."
#~ msgid "Can't create the temporary file. Can't carry on a process."
#~ msgstr "No es pot crear un fitxer temporal. No es pot executar el procés."
#~ msgid "Source file is not readable. Can't carry on a process."
#~ msgstr "El fitxer d'origen no es pot llegir. No es pot executar el procés."
#~ msgid "No create from %s support."
#~ msgstr "No hi ha funcions per crear des de %s."
#~ msgid "Error in creating %s image from source."
#~ msgstr "Error creant la imatge %s des de l'original."
#~ msgid "Can't read image source. Not an image?."
#~ msgstr "No es pot llegir la imatge original. És una imatge?"
#~ msgid "GD doesn't seem to be present."
#~ msgstr "No sembla que la llibreria GD estigui present."
#~ msgid "No create from %s support, can't read watermark."
#~ msgstr ""
#~ "No hi ha funcions per crear des de %s, no es pot llegir la marca a "
#~ "l'aigua."
#~ msgid "No %s read support, can't create watermark."
#~ msgstr ""
#~ "No hi ha funcions per llegir %s, no es pot crear la marca a l'aigua."
#~ msgid "Unknown image format, can't read watermark."
#~ msgstr "Format d'imatge desconegut, no es pot llegir la marca a l'aigua."
#~ msgid "No %s create support."
#~ msgstr "No hi ha funcions per crear %s."
#~ msgid "No conversion type defined."
#~ msgstr "No s'ha definit cap tipus de conversió."
#~ msgid "Error copying file on the server. copy() failed."
#~ msgstr "Error copiant el fitxer al serivor. copy() ha fallat."
#~ msgid "Error reading the file."
#~ msgstr "Error llegint el fitxer."
#~ msgid "Help donating"
#~ msgstr "Ajuda donant"

View File

@@ -0,0 +1,281 @@
msgid ""
msgstr ""
"Project-Id-Version: Capability Manager\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-01-29 15:03+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
"Language-Team: Alkivia | http://alkivia.org <alkivia@jcanals.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Language: German\n"
"X-Poedit-Country: GERMANY\n"
"X-Poedit-SourceCharset: utf-8\n"
#: ../capsman.php:53
msgid "Warning:"
msgstr "WARNUNG:"
#: ../capsman.php:54
#, php-format
msgid "The active plugin %s is not compatible with your PHP version."
msgstr "Das aktive Plugin %s ist mit der PHP Version nicht kompatibel."
#: ../capsman.php:56
#, php-format
msgid "%s is required for this plugin."
msgstr "%s wird für dieses Plugin benötigt."
#: ../includes/admin.php:36
msgid "Roles and Capabilities"
msgstr "Rollen und Berechtigungen"
#: ../includes/admin.php:45
#, php-format
msgid "Capabilities for %s"
msgstr "Berechtigungen für %s"
#: ../includes/admin.php:92
msgid "Level:"
msgstr "Berechtigungslevel:"
#: ../includes/admin.php:115
#: ../includes/manager.php:319
msgid "Save Changes"
msgstr "Einstellungen speichern"
#: ../includes/admin.php:117
msgid "Delete this role"
msgstr "Diese Rolle löschen"
#: ../includes/admin.php:117
#, php-format
msgid ""
"You are about to delete the %s role.\n"
" 'Cancel' to stop, 'OK' to delete."
msgstr ""
"Sicher dass die Rolle %s gelöscht werden soll?\n"
" 'Abbrechen' um zu stoppen, 'OK' zum löschen."
#: ../includes/admin.php:117
msgid "Delete Role"
msgstr "Rolle löschen"
#: ../includes/admin.php:128
msgid "Select New Role"
msgstr "Neue Rolle auswählen"
#: ../includes/admin.php:136
#: ../includes/manager.php:296
msgid "Change"
msgstr "ändern"
#: ../includes/admin.php:141
msgid "Create New Role"
msgstr "Neue Rolle anlegen "
#: ../includes/admin.php:144
#: ../includes/manager.php:300
msgid "Create"
msgstr "erstellen"
#: ../includes/admin.php:149
msgid "Copy this role to"
msgstr "Diese Rolle kopieren"
#: ../includes/admin.php:152
#: ../includes/manager.php:309
msgid "Copy"
msgstr "kopieren"
#: ../includes/admin.php:157
msgid "Add Capability"
msgstr "Berechtigung hinzufügen"
#: ../includes/admin.php:160
#: ../includes/manager.php:323
msgid "Add to role"
msgstr "zur Rolle hinzufügen"
#: ../includes/backup.php:33
msgid "Backup Tool for Capability Manager"
msgstr "Backup-Tool für den Berechtigungsmanager (Capability Manager)"
#: ../includes/backup.php:42
msgid "Backup and Restore"
msgstr "Sichern und Wiederherstellen"
#: ../includes/backup.php:46
msgid "Select action:"
msgstr "Aktion auswählen"
#: ../includes/backup.php:49
msgid "Backup roles and capabilities"
msgstr "Backup der Rollen und Berechtigungen"
#: ../includes/backup.php:50
msgid "Restore last saved backup"
msgstr "Zuletzt gespeichertes Sicherung wiederherstellen"
#: ../includes/backup.php:52
msgid "Do Action"
msgstr "ausführen"
#: ../includes/backup.php:60
msgid "Reset WordPress Defaults"
msgstr "Wordpress Standardeinstellungen wiederherstellen"
#: ../includes/backup.php:62
msgid "WARNING:"
msgstr "WARNUNG:"
#: ../includes/backup.php:62
msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
msgstr "das Wiederherstellen von Rollen und Berechtigungen erfolgt auf den Wordpress Standard!"
#: ../includes/backup.php:63
msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
msgstr "Einstellungen zu Rollen und Berechtigungen die nicht mit dem Berechtigungs-Manager erstellt wurden, werden gelöscht!"
#: ../includes/backup.php:64
msgid "It is recommended to use this only as a last resource!"
msgstr "Es wird empfohlen, dies als letzte Möglichkeit anzuwenden!"
#: ../includes/backup.php:65
msgid "Reset Roles and Capabilities to WordPress defaults"
msgstr "Rollen und Berechtigungen auf den Wordpress Standard zurücksetzen"
#: ../includes/backup.php:65
msgid ""
"You are about to reset Roles and Capabilities to WordPress defaults.\n"
" 'Cancel' to stop, 'OK' to reset."
msgstr ""
"Du bist dabei die Rollen und Berechtigungen auf den Wordpress Standard zurückzusetzen!\n"
" 'Abbrechen' um dies nicht zu tun, 'OK' um auf Standardwerte zurückzusetzen."
#: ../includes/backup.php:65
msgid "Reset to WordPress defaults"
msgstr "Wordpress Standardwerte wiederherstellen."
#: ../includes/manager.php:139
#: ../includes/manager.php:140
msgid "Capability Manager"
msgstr "Berechtigungs Manager"
#: ../includes/manager.php:139
msgid "Capabilities"
msgstr "Berechtigungen"
#: ../includes/manager.php:220
#: ../includes/manager.php:256
msgid "What do you think you're doing?!?"
msgstr "Was glaubst du, was Du tust?"
#: ../includes/manager.php:283
msgid "Bad form Received"
msgstr "Fehlerhaftes Formular empfangen."
#: ../includes/manager.php:302
#: ../includes/manager.php:312
msgid "New role created."
msgstr "Neue Rolle wurde erstellt."
#: ../includes/manager.php:305
#: ../includes/manager.php:315
msgid "Error: Failed creating the new role."
msgstr "FEHLER: Rolle konnte nicht angelegt werden."
#: ../includes/manager.php:320
msgid "New capabilities saved."
msgstr "Neue Berechtigung gespeichert."
#: ../includes/manager.php:328
msgid "New capability added to role."
msgstr "Neue Berechtigung zur Rolle hinzugefügt."
#: ../includes/manager.php:330
msgid "Incorrect capability name."
msgstr "Berechtigungsname ist nicht zulässig."
#: ../includes/manager.php:334
msgid "Bad form received."
msgstr "Fehlerhaftes Formular empfangen."
#: ../includes/manager.php:354
msgid "New backup saved."
msgstr "Neues Backup wurde erfolgreich gespeichert."
#: ../includes/manager.php:360
msgid "Roles and Capabilities restored from last backup."
msgstr "Rollen und Berechtigungen der letzten Sicherung wiederhergestellt."
#: ../includes/manager.php:362
msgid "Restore failed. No backup found."
msgstr "Wiederherstellen fehlgeschlagen - kein Backup gefunden!"
#: ../includes/manager.php:384
#, php-format
msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
msgstr "Standardrolle (default) konnte nicht gelöscht werden. Zuerst <a href=\"%s\">ändern</a>."
#: ../includes/manager.php:405
#, php-format
msgid "Role has been deleted. %1$d users moved to default role %2$s."
msgstr "Rolle wurde gelöscht. %1$d Benutzer auf Standardrolle (default) gesetzt %2$s."
#: ../includes/manager.php:419
msgid "Needed function to create default roles not found!"
msgstr "Benötigte Funktion zum Erstellen der Standardrolle (default) nicht gefunden!"
#: ../includes/manager.php:431
msgid "Roles and Capabilities reset to WordPress defaults"
msgstr "Rollen und Berechtigungen auf Wordpress Standard zurücksetzen"
#: ../includes/manager.php:606
msgid "You cannot remove Manage Capabilities from Administrators"
msgstr "Administratoren dürfen keine Berechtigungen entzogen werden!"
#~ msgid "The active plugin %s is not compatible with your WordPress version."
#~ msgstr ""
#~ "Das Plugin %s ist zu der aktuellen Wordpressversion nicht kompatibel!"
#~ msgid "WordPress %s is required to run this plugin."
#~ msgstr "WordPress %s wird für dieses Plugin benötigt."
#~ msgid "Standard sidebar functions are not present."
#~ msgstr "Standard Sidebarfunktionen stehen nicht zur Verfügung!"
#~ msgid "It is required to use the standard sidebar to run %s"
#~ msgstr "Standard Sidebaroptionen werden benötigt, to run %s"
#~ msgid "Settings saved."
#~ msgstr "Einstellungen gespeichert"
#~ msgid "Plugin Homepage"
#~ msgstr "Plugin Homepage"
#, fuzzy
#~ msgid "Theme Homepage"
#~ msgstr "Author Homepage"
#, fuzzy
#~ msgid "Documentation"
#~ msgstr "ausführen"
#~ msgid "Support Forum"
#~ msgstr "Support Forum"
#~ msgid "Author Homepage"
#~ msgstr "Author Homepage"
#, fuzzy
#~ msgid "Incorrect type of file."
#~ msgstr "Berechtigungsname ist nicht zulässig."
#, fuzzy
#~ msgid "Error in creating %s image from source."
#~ msgstr "FEHLER: Rolle konnte nicht angelegt werden."
#, fuzzy
#~ msgid "Error reading the file."
#~ msgstr "FEHLER: Rolle konnte nicht angelegt werden."
#~ msgid "Help donating"
#~ msgstr "Spenden"
#~ msgid "Managing %s"
#~ msgstr "Administrando %s"

View File

@@ -0,0 +1,392 @@
msgid ""
msgstr ""
"Project-Id-Version: Capability Manager\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-01-29 15:03+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
"Language-Team: Jordi Canals | http://alkivia.org <devel@jcanals.cat>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Language: Spanish\n"
"X-Poedit-Country: SPAIN\n"
"X-Poedit-SourceCharset: utf-8\n"
#: ../capsman.php:53
msgid "Warning:"
msgstr "Atención:"
#: ../capsman.php:54
#, php-format
msgid "The active plugin %s is not compatible with your PHP version."
msgstr "La extensión activa %s no es compatible con tu versión de PHP."
#: ../capsman.php:56
#, php-format
msgid "%s is required for this plugin."
msgstr "Se require %s para utilizar esta extensión."
#: ../includes/admin.php:36
msgid "Roles and Capabilities"
msgstr "Roles y Permisos"
#: ../includes/admin.php:45
#, php-format
msgid "Capabilities for %s"
msgstr "Permisos para %s"
#: ../includes/admin.php:92
msgid "Level:"
msgstr "Nivel:"
#: ../includes/admin.php:115
#: ../includes/manager.php:319
msgid "Save Changes"
msgstr "Guardar cambios"
#: ../includes/admin.php:117
msgid "Delete this role"
msgstr "Eliminar este rol"
#: ../includes/admin.php:117
#, php-format
msgid ""
"You are about to delete the %s role.\n"
" 'Cancel' to stop, 'OK' to delete."
msgstr ""
"Estás a intentando eliminar el rol %s.\n"
" 'Aceptar' para borrar, 'Cancelar' para salir."
#: ../includes/admin.php:117
msgid "Delete Role"
msgstr "Eliminar Rol"
#: ../includes/admin.php:128
msgid "Select New Role"
msgstr "Seleccionar nuevo Rol"
#: ../includes/admin.php:136
#: ../includes/manager.php:296
msgid "Change"
msgstr "Cambiar"
#: ../includes/admin.php:141
msgid "Create New Role"
msgstr "Crear nuevo Rol"
#: ../includes/admin.php:144
#: ../includes/manager.php:300
msgid "Create"
msgstr "Crear"
#: ../includes/admin.php:149
msgid "Copy this role to"
msgstr "Copiar este rol a"
#: ../includes/admin.php:152
#: ../includes/manager.php:309
msgid "Copy"
msgstr "Copiar"
#: ../includes/admin.php:157
msgid "Add Capability"
msgstr "Añadir Permiso"
#: ../includes/admin.php:160
#: ../includes/manager.php:323
msgid "Add to role"
msgstr "Añadir al rol"
#: ../includes/backup.php:33
msgid "Backup Tool for Capability Manager"
msgstr "Herramienta de copias de seguridad para Capability Manager"
#: ../includes/backup.php:42
msgid "Backup and Restore"
msgstr "Salvar y Recuperar"
#: ../includes/backup.php:46
msgid "Select action:"
msgstr "Selecciona una acción:"
#: ../includes/backup.php:49
msgid "Backup roles and capabilities"
msgstr "Crea una copia de seguridad de roles y permisos"
#: ../includes/backup.php:50
msgid "Restore last saved backup"
msgstr "Recupera la última copia de seguridad"
#: ../includes/backup.php:52
msgid "Do Action"
msgstr "Ejecutar Acción"
#: ../includes/backup.php:60
msgid "Reset WordPress Defaults"
msgstr "Restaurar valores por defecto de WordPress"
#: ../includes/backup.php:62
msgid "WARNING:"
msgstr "ATENCIÓN:"
#: ../includes/backup.php:62
msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
msgstr "Restaurando los Roles y Premisos por defecto, los devolverá al estado por defecto de la instalación de WordPress."
#: ../includes/backup.php:63
msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
msgstr "Si has instalado algún plugin que añade roles o permisos, estos se perderán."
#: ../includes/backup.php:64
msgid "It is recommended to use this only as a last resource!"
msgstr "¡Se recomienda utilitzar esta opción solo como último recurso!"
#: ../includes/backup.php:65
msgid "Reset Roles and Capabilities to WordPress defaults"
msgstr "Restaura Roles y Permisos a los valores por defecto de WordPress"
#: ../includes/backup.php:65
msgid ""
"You are about to reset Roles and Capabilities to WordPress defaults.\n"
" 'Cancel' to stop, 'OK' to reset."
msgstr ""
"Estás a intentando restaurar los valores por defecto de WordPress para Roles y Permisos.\n"
" 'Aceptar' para restaurar, 'Cancelar' para abandonar."
#: ../includes/backup.php:65
msgid "Reset to WordPress defaults"
msgstr "Restaura los valores por defecto de WordPress"
#: ../includes/manager.php:139
#: ../includes/manager.php:140
msgid "Capability Manager"
msgstr "Administrador de Permisos"
#: ../includes/manager.php:139
msgid "Capabilities"
msgstr "Permisos"
#: ../includes/manager.php:220
#: ../includes/manager.php:256
msgid "What do you think you're doing?!?"
msgstr "¿Que piensas que estás haciendo?"
#: ../includes/manager.php:283
msgid "Bad form Received"
msgstr "Se ha recibido un formulario incorrecto."
#: ../includes/manager.php:302
#: ../includes/manager.php:312
msgid "New role created."
msgstr "Se ha creado el nuevo rol."
#: ../includes/manager.php:305
#: ../includes/manager.php:315
msgid "Error: Failed creating the new role."
msgstr "Error: No se ha podido crear el nuevo rol."
#: ../includes/manager.php:320
msgid "New capabilities saved."
msgstr "Se han actualizado los nuevos permisos."
#: ../includes/manager.php:328
msgid "New capability added to role."
msgstr "Nuevos permiso añadido al rol."
#: ../includes/manager.php:330
msgid "Incorrect capability name."
msgstr "Nombre incorrecto de permiso ."
#: ../includes/manager.php:334
msgid "Bad form received."
msgstr "Se ha recibido un formulario incorrecto."
#: ../includes/manager.php:354
msgid "New backup saved."
msgstr "Se ha creado una nueva copia de seguridad."
#: ../includes/manager.php:360
msgid "Roles and Capabilities restored from last backup."
msgstr "Roles y permisos restaurados de la última copia de seguridad."
#: ../includes/manager.php:362
msgid "Restore failed. No backup found."
msgstr "Ha fallado la recuperación. No se encontró ninguna copia de seguridad."
#: ../includes/manager.php:384
#, php-format
msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
msgstr "No se puede eliminar el rol predeterminado. <a href=\"%s\">Debes cambiarlo antes</a>."
#: ../includes/manager.php:405
#, php-format
msgid "Role has been deleted. %1$d users moved to default role %2$s."
msgstr "El rol ha sido eliminado. Se ha asignado el rol predeterminado %2$s a %1$d usuarios."
#: ../includes/manager.php:419
msgid "Needed function to create default roles not found!"
msgstr "¡No se encontró la función necesaria para crear los roles por defecto!"
#: ../includes/manager.php:431
msgid "Roles and Capabilities reset to WordPress defaults"
msgstr "Roles y Permisos restaurados a los valores por defecto de WordPress"
#: ../includes/manager.php:606
msgid "You cannot remove Manage Capabilities from Administrators"
msgstr "No se puede eliminar 'Manage Capabilities' de los administradores."
#~ msgid "Option blocked by administrator."
#~ msgstr "Opción bloqueada por el administrador."
#~ msgid "The active plugin %s is not compatible with your WordPress version."
#~ msgstr ""
#~ "La extensión activa %s no es compatible con tu versión de WordPress."
#~ msgid "WordPress %s is required to run this plugin."
#~ msgstr "Se require WordPress %s para ejecutar esta extensión."
#~ msgid "Standard sidebar functions are not present."
#~ msgstr ""
#~ "No se han encontrado algunas funciones de la barra lateral estándar."
#~ msgid "It is required to use the standard sidebar to run %s"
#~ msgstr "Es preciso utilizar la barra lateral estándar para ejectutar %s"
#~ msgid "Settings saved."
#~ msgstr "Opciones guardadas."
#~ msgid "Just Now"
#~ msgstr "Ahora mismo"
#~ msgid "1 minute ago"
#~ msgstr "Hace 1 minuto"
#~ msgid "1 hour ago"
#~ msgstr "Hace una hora"
#~ msgid "Today at %s"
#~ msgstr "Hoy a las %s"
#~ msgid "Yesterday at %s"
#~ msgstr "Ayer a las %s"
#~ msgid "Plugin Homepage"
#~ msgstr "Página del plugin"
#~ msgid "Theme Homepage"
#~ msgstr "Página del tema"
#~ msgid "Documentation"
#~ msgstr "Documentación"
#~ msgid "Support Forum"
#~ msgstr "Foro de soporte"
#~ msgid "Author Homepage"
#~ msgstr "Página del autor"
#~ msgid "Donate to project"
#~ msgstr "Haz un donativo"
#~ msgid "File error. Please try again."
#~ msgstr "Error de archivo. Por favor, reintentalo de nuevo."
#~ msgid "Local file doesn't exist."
#~ msgstr "El archivo local no existe."
#~ msgid "Local file is not readable."
#~ msgstr "El archivo local no es legible."
#~ msgid ""
#~ "File upload error (the uploaded file exceeds the upload_max_filesize "
#~ "directive in php.ini)."
#~ msgstr ""
#~ "Error de carga de archivo (el archivo cargado excede la directiva "
#~ "UPLOAD_MAX_FILESIZE de PHP)."
#~ msgid ""
#~ "File upload error (the uploaded file exceeds the MAX_FILE_SIZE directive "
#~ "that was specified in the html form)."
#~ msgstr ""
#~ "Error de carga de archivo (el archivo enviado excede la directiva "
#~ "MAX_FILE_SIZE especificada en el formulario)."
#~ msgid "File upload error (the uploaded file was only partially uploaded)."
#~ msgstr ""
#~ "Error de carga de archivo (el archivo sólo se recibió parcialmente)."
#~ msgid "File upload error (no file was uploaded)."
#~ msgstr "Error de carga de archivo (no se recibió archivo)."
#~ msgid "File upload error (missing a temporary folder)."
#~ msgstr "Error de carga de archivo (falta la carpeta temporal)."
#~ msgid "File upload error (failed to write file to disk)."
#~ msgstr "Error de carga de archivo (no se pudo escribir en el disco)."
#~ msgid "File upload error (file upload stopped by extension)."
#~ msgstr ""
#~ "Error de carga de archivo (se ha bloquedao el archivo por extensión)."
#~ msgid "File upload error (unknown error code)."
#~ msgstr "Error de carga de archivo (código de error desconocido)."
#~ msgid "File upload error. Please try again."
#~ msgstr "Error de carga de archivo. Por favor, reinténtalo."
#~ msgid "File too big."
#~ msgstr "Archivo demasiado grande."
#~ msgid "MIME type can't be detected."
#~ msgstr "No se pudo detectar el tipo MIME."
#~ msgid "Incorrect type of file."
#~ msgstr "Tipo de archivo incorrecto."
#~ msgid "Image too wide."
#~ msgstr "Imagen demasiado ancha."
#~ msgid "Image too narrow."
#~ msgstr "Imagen demasiado estrecha."
#~ msgid "Image too high."
#~ msgstr "Imagen demasiado alta."
#~ msgid "Image too short."
#~ msgstr "Imagen demasiado baja."
#~ msgid "Image ratio too high (image too wide)."
#~ msgstr "Ratio de imagen demariado alto (imagen demasiado ancha)."
#~ msgid "Image ratio too low (image too high)."
#~ msgstr "Ratio de imagen demasiado bajo (imagen demasiado alta)."
#~ msgid "Image has too many pixels."
#~ msgstr "La imágen tiene demasiados píxeles."
#~ msgid "Image has not enough pixels."
#~ msgstr "La imagen no tiene suficientes píxeles."
#~ msgid "File not uploaded. Can't carry on a process."
#~ msgstr "No se ha cargado el archivo. No se puede ejecutar el proceso."
#~ msgid "%s already exists. Please change the file name."
#~ msgstr "El archivo %s ya existe. Por favor, cambia el nombre de archivo."
#~ msgid "No correct temp source file. Can't carry on a process."
#~ msgstr "El archivo temporal es incorrecto. No se puede ejecutar el proceso."
#~ msgid "No correct uploaded source file. Can't carry on a process."
#~ msgstr "Archivo original incorrecto. No se puede ejecutar el proceso."
#~ msgid "Destination directory can't be created. Can't carry on a process."
#~ msgstr ""
#~ "No se puede crear el directorio de destino. No se puede realizar el "
#~ "proceso."
#~ msgid "Destination directory doesn't exist. Can't carry on a process."
#~ msgstr ""
#~ "El directorio de destino no existe. No se puede realizar el proceso."
#~ msgid "Destination path is not a directory. Can't carry on a process."
#~ msgstr ""
#~ "La ruta de destino no es un directorio. No se puede realizar el proceso."
#~ msgid ""
#~ "Destination directory can't be made writeable. Can't carry on a process."
#~ msgstr ""
#~ "El directorio de destino no se puede cambiar a escribible. No se puede "
#~ "realizar el proceso."
#~ msgid "Destination path is not a writeable. Can't carry on a process."
#~ msgstr ""
#~ "No se puede escribir en la ruta de destino. No se puede realizar el "
#~ "proceso."
#~ msgid "Can't create the temporary file. Can't carry on a process."
#~ msgstr ""
#~ "No se puede crar un archivo temporal. No se puede ejecutar el proceso."
#~ msgid "Source file is not readable. Can't carry on a process."
#~ msgstr ""
#~ "No se puede leer el archivo original. No se puede ejecutar el proceso."
#~ msgid "No create from %s support."
#~ msgstr "No hay soporte para crear desde %s."
#~ msgid "Error in creating %s image from source."
#~ msgstr "Error creacdo la imagen %s desde el original."
#~ msgid "Can't read image source. Not an image?."
#~ msgstr "No se puede leer la imagen orginal. ¿Es una imagen?"
#~ msgid "GD doesn't seem to be present."
#~ msgstr "No se ha detectado la libreria GD."
#~ msgid "No create from %s support, can't read watermark."
#~ msgstr ""
#~ "No hay soporte para crear desde %s. No se puede leer la marca de agua."
#~ msgid "No %s read support, can't create watermark."
#~ msgstr "No hay soporte para leer %s. No se puede crear la marca de agua."
#~ msgid "Unknown image format, can't read watermark."
#~ msgstr "Formato de imagen desconocido. No se puede leer la marca al agua."
#~ msgid "No %s create support."
#~ msgstr "No hay soporte para crear %s."
#~ msgid "No conversion type defined."
#~ msgstr "No se ha definido el tipo de conversión."
#~ msgid "Error copying file on the server. copy() failed."
#~ msgstr "Error coipiando el archivo en el servidor. Ha fallado copy()."
#~ msgid "Error reading the file."
#~ msgstr "Error leyendo el archivo."
#~ msgid "Help donating"
#~ msgstr "Ayuda donando"
#~ msgid "Managing %s"
#~ msgstr "Administrando %s"

View File

@@ -0,0 +1,281 @@
msgid ""
msgstr ""
"Project-Id-Version: Capability Manager in italiano\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-01-29 15:06+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
"Language-Team: Gianni Diurno | http://gidibao.net/ <gidibao@gmail.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-KeywordsList: __;_e;_n\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-Language: Italian\n"
"X-Poedit-Country: ITALY\n"
"X-Poedit-SearchPath-0: ..\n"
#: ../capsman.php:53
msgid "Warning:"
msgstr "Attenzione:"
#: ../capsman.php:54
#, php-format
msgid "The active plugin %s is not compatible with your PHP version."
msgstr "Il plugin %s non é compatibile con la tua versione PHP."
#: ../capsman.php:56
#, php-format
msgid "%s is required for this plugin."
msgstr "E' necessario %s per l'utilizzo di questo plugin."
#: ../includes/admin.php:36
msgid "Roles and Capabilities"
msgstr "Ruoli e capacità"
#: ../includes/admin.php:45
#, php-format
msgid "Capabilities for %s"
msgstr "Capacità per %s"
#: ../includes/admin.php:92
msgid "Level:"
msgstr "Livello:"
#: ../includes/admin.php:115
#: ../includes/manager.php:319
msgid "Save Changes"
msgstr "Salva le modifiche"
#: ../includes/admin.php:117
msgid "Delete this role"
msgstr "Cancella questo ruolo"
#: ../includes/admin.php:117
#, php-format
msgid ""
"You are about to delete the %s role.\n"
" 'Cancel' to stop, 'OK' to delete."
msgstr ""
"Stai per cancellare il ruolo %s.\n"
" 'Annulla' per fermarti, 'OK' per procedere."
#: ../includes/admin.php:117
msgid "Delete Role"
msgstr "Cancella il ruolo"
#: ../includes/admin.php:128
msgid "Select New Role"
msgstr "Seleziona ruolo"
#: ../includes/admin.php:136
#: ../includes/manager.php:296
msgid "Change"
msgstr "Cambia"
#: ../includes/admin.php:141
msgid "Create New Role"
msgstr "Crea un nuovo ruolo"
#: ../includes/admin.php:144
#: ../includes/manager.php:300
msgid "Create"
msgstr "Crea"
#: ../includes/admin.php:149
msgid "Copy this role to"
msgstr "Copia questo ruolo per"
#: ../includes/admin.php:152
#: ../includes/manager.php:309
msgid "Copy"
msgstr "Copia"
#: ../includes/admin.php:157
msgid "Add Capability"
msgstr "Aggiungi capacità"
#: ../includes/admin.php:160
#: ../includes/manager.php:323
msgid "Add to role"
msgstr "Aggiungi al ruolo"
#: ../includes/backup.php:33
msgid "Backup Tool for Capability Manager"
msgstr "Strumento di backup per Capability Manager"
#: ../includes/backup.php:42
msgid "Backup and Restore"
msgstr "Backup e Ripristino"
#: ../includes/backup.php:46
msgid "Select action:"
msgstr "Seleziona una azione:"
#: ../includes/backup.php:49
msgid "Backup roles and capabilities"
msgstr "Backup ruoli e capacità"
#: ../includes/backup.php:50
msgid "Restore last saved backup"
msgstr "Ripristina all'ultimo backup in memoria"
#: ../includes/backup.php:52
msgid "Do Action"
msgstr "Procedi"
#: ../includes/backup.php:60
msgid "Reset WordPress Defaults"
msgstr "Ripristina ai valori predefiniti di WordPress"
#: ../includes/backup.php:62
msgid "WARNING:"
msgstr "ATTENZIONE:"
#: ../includes/backup.php:62
msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
msgstr "Il ripristino alle predefinite per i Ruoli e le Capacità coinciderà con i valori predefiniti di WordPress."
#: ../includes/backup.php:63
msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
msgstr "I ruoli e le capacità propri di ogni plugin installato saranno persi."
#: ../includes/backup.php:64
msgid "It is recommended to use this only as a last resource!"
msgstr "Da utilizzarsi solamente come ultima risorsa!"
#: ../includes/backup.php:65
msgid "Reset Roles and Capabilities to WordPress defaults"
msgstr "Ripristina i Ruoli e le Capacità ai valori predefiniti di WordPress"
#: ../includes/backup.php:65
msgid ""
"You are about to reset Roles and Capabilities to WordPress defaults.\n"
" 'Cancel' to stop, 'OK' to reset."
msgstr ""
"Stai per ripristinare i Ruoli e le Capacità ai valori predefiniti di WordPress.\n"
" 'Annulla' per fermarti, 'OK' per procedere."
#: ../includes/backup.php:65
msgid "Reset to WordPress defaults"
msgstr "Ripristina ai predefiniti di WordPress"
#: ../includes/manager.php:139
#: ../includes/manager.php:140
msgid "Capability Manager"
msgstr "Gestione capacità"
#: ../includes/manager.php:139
msgid "Capabilities"
msgstr "Capacità"
#: ../includes/manager.php:220
#: ../includes/manager.php:256
msgid "What do you think you're doing?!?"
msgstr "Cosa stai facendo?!?"
#: ../includes/manager.php:283
msgid "Bad form Received"
msgstr "E' stata ricevuta una richiesta errata"
#: ../includes/manager.php:302
#: ../includes/manager.php:312
msgid "New role created."
msgstr "Il nuovo ruolo é stato creato."
#: ../includes/manager.php:305
#: ../includes/manager.php:315
msgid "Error: Failed creating the new role."
msgstr "Errore: non é stato possibile creare il nuovo ruolo."
#: ../includes/manager.php:320
msgid "New capabilities saved."
msgstr "Le nuove capacità sono state salvate."
#: ../includes/manager.php:328
msgid "New capability added to role."
msgstr "La nuova capacità é stata aggiunta al ruolo."
#: ../includes/manager.php:330
msgid "Incorrect capability name."
msgstr "Nome non valido per la capacità."
#: ../includes/manager.php:334
msgid "Bad form received."
msgstr "E' stata ricevuta una richiesta errata."
#: ../includes/manager.php:354
msgid "New backup saved."
msgstr "Il nuovo backup é stato salvato."
#: ../includes/manager.php:360
msgid "Roles and Capabilities restored from last backup."
msgstr "I ruoli e le capacità sono stati ripristinati all'ultimo backup in memoria."
#: ../includes/manager.php:362
msgid "Restore failed. No backup found."
msgstr "Non é stato possibile effettuare il ripristino. Non é stato trovato alcun file di backup."
#: ../includes/manager.php:384
#, php-format
msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
msgstr "Non é possibile cancellare il ruolo predefinito. E' necessario che tu compia questa <a href=\"%s\">modifica</a> prima di procedere."
#: ../includes/manager.php:405
#, php-format
msgid "Role has been deleted. %1$d users moved to default role %2$s."
msgstr "Il ruolo é stato cancellato. Gli utenti %1$d sono stati spostati nel ruolo predefinito a nome %2$s."
#: ../includes/manager.php:419
msgid "Needed function to create default roles not found!"
msgstr "La funzione necessaria per la creazione dei ruoli predefiniti non é stata trovata!"
#: ../includes/manager.php:431
msgid "Roles and Capabilities reset to WordPress defaults"
msgstr "I ruoli e le capacità sono stati ripristinati ai valori predefiniti di WordPress"
#: ../includes/manager.php:606
msgid "You cannot remove Manage Capabilities from Administrators"
msgstr "Non puoi rimuovere la gestione delle capacità per gli amministratori"
#~ msgid "The active plugin %s is not compatible with your WordPress version."
#~ msgstr "Il plugin %s non é compatibile con la tua versione di WordPress."
#~ msgid "WordPress %s is required to run this plugin."
#~ msgstr "Per l'utilizzo del plugin é necessario WordPress %s."
#~ msgid "Standard sidebar functions are not present."
#~ msgstr "Le funzioni standard per la sidebar non sono presenti."
#~ msgid "It is required to use the standard sidebar to run %s"
#~ msgstr "Necessario per l'utilizzo della sidebar standard %s"
#~ msgid "Settings saved."
#~ msgstr "Le impostazioni sono state salvate."
#~ msgid "Plugin Homepage"
#~ msgstr "Homepage del plugin"
#, fuzzy
#~ msgid "Theme Homepage"
#~ msgstr "Homepage autore"
#, fuzzy
#~ msgid "Documentation"
#~ msgstr "Procedi"
#~ msgid "Support Forum"
#~ msgstr "Forum di supporto"
#~ msgid "Author Homepage"
#~ msgstr "Homepage autore"
#, fuzzy
#~ msgid "Incorrect type of file."
#~ msgstr "Nome non valido per la capacità."
#, fuzzy
#~ msgid "Error in creating %s image from source."
#~ msgstr "Errore: non é stato possibile creare il nuovo ruolo."
#, fuzzy
#~ msgid "Error reading the file."
#~ msgstr "Errore: non é stato possibile creare il nuovo ruolo."
#~ msgid "Help donating"
#~ msgstr "Donazioni"

View File

@@ -0,0 +1,281 @@
msgid ""
msgstr ""
"Project-Id-Version: Capability Manager\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-01-29 15:03+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
"Language-Team: Fat Cow <gpl@alkivia.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Language: Russian\n"
"X-Poedit-Country: RUSSIAN FEDERATION\n"
"X-Poedit-SourceCharset: utf-8\n"
#: ../capsman.php:53
msgid "Warning:"
msgstr "Предупреждение:"
#: ../capsman.php:54
#, php-format
msgid "The active plugin %s is not compatible with your PHP version."
msgstr "Плагин %s не совместим с вашей версией PHP."
#: ../capsman.php:56
#, php-format
msgid "%s is required for this plugin."
msgstr "%s необходим лоя плагина."
#: ../includes/admin.php:36
msgid "Roles and Capabilities"
msgstr "Роли и возможности"
#: ../includes/admin.php:45
#, php-format
msgid "Capabilities for %s"
msgstr "Возможность для %s"
#: ../includes/admin.php:92
msgid "Level:"
msgstr "Уровень:"
#: ../includes/admin.php:115
#: ../includes/manager.php:319
msgid "Save Changes"
msgstr "Сохранить настройки"
#: ../includes/admin.php:117
msgid "Delete this role"
msgstr "Удалить эту роль"
#: ../includes/admin.php:117
#, php-format
msgid ""
"You are about to delete the %s role.\n"
" 'Cancel' to stop, 'OK' to delete."
msgstr ""
"Вы об удалении роли %s.\n"
" 'Отменить' для остановки, 'ОК' для удаления."
#: ../includes/admin.php:117
msgid "Delete Role"
msgstr "Удаление роли"
#: ../includes/admin.php:128
msgid "Select New Role"
msgstr "Выбрать новую роль"
#: ../includes/admin.php:136
#: ../includes/manager.php:296
msgid "Change"
msgstr "Изменить"
#: ../includes/admin.php:141
msgid "Create New Role"
msgstr "Создать новую роль"
#: ../includes/admin.php:144
#: ../includes/manager.php:300
msgid "Create"
msgstr "Создать"
#: ../includes/admin.php:149
msgid "Copy this role to"
msgstr "Копия этой роли"
#: ../includes/admin.php:152
#: ../includes/manager.php:309
msgid "Copy"
msgstr "Копия"
#: ../includes/admin.php:157
msgid "Add Capability"
msgstr "Добавить возможность"
#: ../includes/admin.php:160
#: ../includes/manager.php:323
msgid "Add to role"
msgstr "Добавить роль"
#: ../includes/backup.php:33
msgid "Backup Tool for Capability Manager"
msgstr "Инструмент для создания резервной копии для Capability Manager"
#: ../includes/backup.php:42
msgid "Backup and Restore"
msgstr "Резервная копия и восстановление"
#: ../includes/backup.php:46
msgid "Select action:"
msgstr "Выбрать действие:"
#: ../includes/backup.php:49
msgid "Backup roles and capabilities"
msgstr "Резерв. копия ролей и возможностей"
#: ../includes/backup.php:50
msgid "Restore last saved backup"
msgstr "Восстановить из последнего сохраненного бэкапа"
#: ../includes/backup.php:52
msgid "Do Action"
msgstr "Нет действий"
#: ../includes/backup.php:60
msgid "Reset WordPress Defaults"
msgstr "Сбростить настройки WordPress по умолчанию"
#: ../includes/backup.php:62
msgid "WARNING:"
msgstr "ВНИМАНИЕ:"
#: ../includes/backup.php:62
msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
msgstr "Сброс стандартных ролей и возможностей должен сбросить настройки по умолчанию при установвке в WordPress."
#: ../includes/backup.php:63
msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
msgstr "Если вы установили другой плагин, который добавляет новые роли или возможности, это должно исчезнуть. "
#: ../includes/backup.php:64
msgid "It is recommended to use this only as a last resource!"
msgstr "Это рекомендуется дя использования только как последный ресурс!"
#: ../includes/backup.php:65
msgid "Reset Roles and Capabilities to WordPress defaults"
msgstr "Сбросить роли и воможности"
#: ../includes/backup.php:65
msgid ""
"You are about to reset Roles and Capabilities to WordPress defaults.\n"
" 'Cancel' to stop, 'OK' to reset."
msgstr ""
"Вы об сбросе ролей и возможностей %s.\n"
" 'Отменить' для остановки, 'ОК' для сброса."
#: ../includes/backup.php:65
msgid "Reset to WordPress defaults"
msgstr "Сбросить настройки WordPress"
#: ../includes/manager.php:139
#: ../includes/manager.php:140
msgid "Capability Manager"
msgstr "Capability Manager"
#: ../includes/manager.php:139
msgid "Capabilities"
msgstr "Возможности"
#: ../includes/manager.php:220
#: ../includes/manager.php:256
msgid "What do you think you're doing?!?"
msgstr "Вы знаете, что делаете?!?"
#: ../includes/manager.php:283
msgid "Bad form Received"
msgstr "Se ha recibido un formulario incorrecto."
#: ../includes/manager.php:302
#: ../includes/manager.php:312
msgid "New role created."
msgstr "Новая роль создана."
#: ../includes/manager.php:305
#: ../includes/manager.php:315
msgid "Error: Failed creating the new role."
msgstr "Ошибка: Новая роль не создана."
#: ../includes/manager.php:320
msgid "New capabilities saved."
msgstr "Новые возможности сохранены."
#: ../includes/manager.php:328
msgid "New capability added to role."
msgstr "Новая воможность добавлена к роли."
#: ../includes/manager.php:330
msgid "Incorrect capability name."
msgstr "Некорректное имя возможности."
#: ../includes/manager.php:334
msgid "Bad form received."
msgstr "Плохая форма отправки."
#: ../includes/manager.php:354
msgid "New backup saved."
msgstr "Новый бэкап сохранен."
#: ../includes/manager.php:360
msgid "Roles and Capabilities restored from last backup."
msgstr "Роли и возможности восстановлены с последнего бэкапа."
#: ../includes/manager.php:362
msgid "Restore failed. No backup found."
msgstr "Восстановление остановлено. Не найдено бэкапов. "
#: ../includes/manager.php:384
#, php-format
msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
msgstr "Не удалена стандартная роль. Вы <a href=\"%s\">должны сначала изменить это</a>."
#: ../includes/manager.php:405
#, php-format
msgid "Role has been deleted. %1$d users moved to default role %2$s."
msgstr "Роль была удалена. %1$d пользователей перемещена в стандартную роль %2$s."
#: ../includes/manager.php:419
msgid "Needed function to create default roles not found!"
msgstr "Необходимая функция по созданию ролей не найдена!"
#: ../includes/manager.php:431
msgid "Roles and Capabilities reset to WordPress defaults"
msgstr "Роли и возможности сброшены к стандартным для WordPress "
#: ../includes/manager.php:606
msgid "You cannot remove Manage Capabilities from Administrators"
msgstr "Вы не можете удалить Manage Capabilities через администраторов ."
#~ msgid "The active plugin %s is not compatible with your WordPress version."
#~ msgstr "Активный плагин %s не совместим с текущей версией WordPress."
#~ msgid "WordPress %s is required to run this plugin."
#~ msgstr "WordPress %s необходим для запуска этого плагина."
#~ msgid "Standard sidebar functions are not present."
#~ msgstr "Стандартные функции боковой панели не представлены."
#~ msgid "It is required to use the standard sidebar to run %s"
#~ msgstr ""
#~ "Это необходимо для использования стандартной боковой панели для запуска %s"
#~ msgid "Settings saved."
#~ msgstr "Настройки сохранены."
#~ msgid "Plugin Homepage"
#~ msgstr "Домашняя страница плагина"
#, fuzzy
#~ msgid "Theme Homepage"
#~ msgstr "Домашняя страница автора"
#, fuzzy
#~ msgid "Documentation"
#~ msgstr "Нет действий"
#~ msgid "Support Forum"
#~ msgstr "Форум поддержки"
#~ msgid "Author Homepage"
#~ msgstr "Домашняя страница автора"
#, fuzzy
#~ msgid "Incorrect type of file."
#~ msgstr "Некорректное имя возможности."
#, fuzzy
#~ msgid "Error in creating %s image from source."
#~ msgstr "Ошибка: Новая роль не создана."
#, fuzzy
#~ msgid "Error reading the file."
#~ msgstr "Ошибка: Новая роль не создана."
#~ msgid "Help donating"
#~ msgstr "Помощь через пожертвования"
#~ msgid "Managing %s"
#~ msgstr "Administrando %s"

View File

@@ -0,0 +1,240 @@
msgid ""
msgstr ""
"Project-Id-Version: Capability Manager\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-01-29 15:03+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Jens Wedin <me@jenswedin.com>\n"
"Language-Team: Jordi Canals | http://alkivia.org <devel@jcanals.cat>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_c;_x:2c,1\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ..\n"
#: ../capsman.php:53
msgid "Warning:"
msgstr "Varning:"
#: ../capsman.php:54
#, php-format
msgid "The active plugin %s is not compatible with your PHP version."
msgstr "Det aktuella pluginet % är inte kompatibelt med din version av PHP."
#: ../capsman.php:56
#, php-format
msgid "%s is required for this plugin."
msgstr "%s krävs för detta plugin."
#: ../includes/admin.php:36
msgid "Roles and Capabilities"
msgstr "Roller och behörigheter"
#: ../includes/admin.php:45
#, php-format
msgid "Capabilities for %s"
msgstr "Behörighet för %s"
#: ../includes/admin.php:92
msgid "Level:"
msgstr "Nivå:"
#: ../includes/admin.php:115
#: ../includes/manager.php:319
msgid "Save Changes"
msgstr "Spara ändringar"
#: ../includes/admin.php:117
msgid "Delete this role"
msgstr "Ta bort roll"
#: ../includes/admin.php:117
#, php-format
msgid ""
"You are about to delete the %s role.\n"
" 'Cancel' to stop, 'OK' to delete."
msgstr ""
"Du håller på att ta bort %s rollen.\n"
"'Avbryt' för att stoppa, 'OK' för att ta bort."
#: ../includes/admin.php:117
msgid "Delete Role"
msgstr "Ta bort roll"
#: ../includes/admin.php:128
msgid "Select New Role"
msgstr "Välj ny roll"
#: ../includes/admin.php:136
#: ../includes/manager.php:296
msgid "Change"
msgstr "Ändra"
#: ../includes/admin.php:141
msgid "Create New Role"
msgstr "Skapa ny roll"
#: ../includes/admin.php:144
#: ../includes/manager.php:300
msgid "Create"
msgstr "Skapa"
#: ../includes/admin.php:149
msgid "Copy this role to"
msgstr "Kopiera rollen till"
#: ../includes/admin.php:152
#: ../includes/manager.php:309
msgid "Copy"
msgstr "Kopiera"
#: ../includes/admin.php:157
msgid "Add Capability"
msgstr "Lägg till behörigheter"
#: ../includes/admin.php:160
#: ../includes/manager.php:323
msgid "Add to role"
msgstr "Lägg till, till roll"
#: ../includes/backup.php:33
msgid "Backup Tool for Capability Manager"
msgstr "Säkerhetetskopiering för Capability Manager"
#: ../includes/backup.php:42
msgid "Backup and Restore"
msgstr "Säkerhetskopiera och Återställ"
#: ../includes/backup.php:46
msgid "Select action:"
msgstr "Välj alternativ:"
#: ../includes/backup.php:49
msgid "Backup roles and capabilities"
msgstr "Återställ roller och behörigheter"
#: ../includes/backup.php:50
msgid "Restore last saved backup"
msgstr "Återställ senaste versionen säkerhetskopian"
#: ../includes/backup.php:52
msgid "Do Action"
msgstr "Gör"
#: ../includes/backup.php:60
msgid "Reset WordPress Defaults"
msgstr "Återställ WordPress standardvärden"
#: ../includes/backup.php:62
msgid "WARNING:"
msgstr "VARNING:"
#: ../includes/backup.php:62
msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
msgstr "Att återställa standardvärderna för roller och och behörigheter kommer att återställa dem till WordPress standardvärden."
#: ../includes/backup.php:63
msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
msgstr "Om du har installerat något plugin som lägger till nya roller och behörigheter kommer dessa att försvinna."
#: ../includes/backup.php:64
msgid "It is recommended to use this only as a last resource!"
msgstr "Det är rekommenderat att använda detta som en sista utväg! "
#: ../includes/backup.php:65
msgid "Reset Roles and Capabilities to WordPress defaults"
msgstr "Återställ roller och behörigheter till Wordpress standardvärden"
#: ../includes/backup.php:65
msgid ""
"You are about to reset Roles and Capabilities to WordPress defaults.\n"
" 'Cancel' to stop, 'OK' to reset."
msgstr ""
"Du håller på att återställa roller och behörigheter till WordPress standardvärden.\n"
"'Avbryt' för att stoppa, 'OK' för att återställa."
#: ../includes/backup.php:65
msgid "Reset to WordPress defaults"
msgstr "Återställ till WordPress standardvärden"
#: ../includes/manager.php:139
#: ../includes/manager.php:140
msgid "Capability Manager"
msgstr "Ändra behörighet"
#: ../includes/manager.php:139
msgid "Capabilities"
msgstr "Behörigheter"
#: ../includes/manager.php:220
#: ../includes/manager.php:256
msgid "What do you think you're doing?!?"
msgstr "Vad tror du håller på med?!?"
#: ../includes/manager.php:283
msgid "Bad form Received"
msgstr "Ett felande formulär har skickats"
#: ../includes/manager.php:302
#: ../includes/manager.php:312
msgid "New role created."
msgstr "Ny roll har skapats"
#: ../includes/manager.php:305
#: ../includes/manager.php:315
msgid "Error: Failed creating the new role."
msgstr "Fel: Det gick inte att skapa en ny roll."
#: ../includes/manager.php:320
msgid "New capabilities saved."
msgstr "Nya behörigheter har skapats."
#: ../includes/manager.php:328
msgid "New capability added to role."
msgstr "Nu behörighet har skapats."
#: ../includes/manager.php:330
msgid "Incorrect capability name."
msgstr "Fel på namnet för behörigheten"
#: ../includes/manager.php:334
msgid "Bad form received."
msgstr "Felande formulär har skickats."
#: ../includes/manager.php:354
msgid "New backup saved."
msgstr "Ny säkerhetskopiering har sparats."
#: ../includes/manager.php:360
msgid "Roles and Capabilities restored from last backup."
msgstr "Roller och behörigheter har återskapats från senaste säkerhetskopian."
#: ../includes/manager.php:362
msgid "Restore failed. No backup found."
msgstr "Återställningen misslyckades. Ingen säkerhetskopia hittades."
#: ../includes/manager.php:384
#, php-format
msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
msgstr "Kan inte ta bort standard rollen. Du <a href=\"%s\">måste ändra den först</a>."
#: ../includes/manager.php:405
#, php-format
msgid "Role has been deleted. %1$d users moved to default role %2$s."
msgstr "Rollen har tagits bort. %1$d användare har flyttats till standardrollen %2$s."
#: ../includes/manager.php:419
msgid "Needed function to create default roles not found!"
msgstr "En viss funktion saknas för att skapa en standardroll."
#: ../includes/manager.php:431
msgid "Roles and Capabilities reset to WordPress defaults"
msgstr "Roller och behörigheter har återställts till WordPress standardvärden"
#: ../includes/manager.php:606
msgid "You cannot remove Manage Capabilities from Administrators"
msgstr "Du kan inte ta bort 'Ändra rättigheter' för Administratörer"

View File

@@ -0,0 +1,654 @@
msgid ""
msgstr ""
"Project-Id-Version: Capability Manager Enhanced\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-04-21 17:04-0500\n"
"PO-Revision-Date: 2015-04-21 17:05-0500\n"
"Last-Translator: Kevin Behrens <kevin@agapetry.net>\n"
"Language-Team: Agapetry Creations LLC <kevin@agapetry.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: __;_e;_c;__ngettext;_n;pp_po_trigger;_x\n"
"X-Poedit-Basepath: E:\\www\\wp42\\wp-content\\plugins\\capability-manager-enhanced\n"
"X-Poedit-Language: English\n"
"X-Poedit-Country: UNITED STATES\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-SearchPath-0: E:\\www\\wp42\\wp-content\\plugins\\capability-manager-enhanced\n"
"X-Poedit-SearchPath-1: E:\\www\\wp42\\wp-content\\plugins\\capability-manager-enhanced\\includes\n"
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/capsman-enhanced.php:40
msgid "<strong>Error:</strong> Capability Manager Extended cannot function because another copy of Capability Manager is active."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/capsman-enhanced.php:58
msgid "Warning:"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/capsman-enhanced.php:59
#, php-format
msgid "The active plugin %s is not compatible with your PHP version."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/capsman-enhanced.php:61
#, php-format
msgid "%s is required for this plugin."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/capsman-enhanced.php:115
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/manager.php:177
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/manager.php:186
msgid "Capabilities"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/capsman-enhanced.php:116
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/capsman-enhanced.php:120
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/capsman-enhanced.php:125
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/manager.php:177
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/manager.php:181
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/manager.php:187
msgid "Capability Manager"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/capsman-enhanced.php:125
msgid "Role Capabilities"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/framework/classes/abstract/plugin.php:224
msgid "Explicity negate this capability by storing as disabled"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/framework/classes/abstract/plugin.php:225
msgid "Explicitly negate these capabilities by storing as disabled"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/framework/classes/abstract/plugin.php:226
msgid "Post type registration does not define this capability distinctly"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/framework/classes/abstract/plugin.php:227
msgid "This capability is explicitly negated. Click to add/remove normally."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/framework/classes/abstract/plugin.php:228
msgid "Add or remove this capability from the WordPress role"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/framework/classes/abstract/plugin.php:229
msgid "Add or remove capability from the role normally"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/framework/lib/formating.php:40
msgid "Settings saved."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/framework/lib/themes-agapetry.php:9
msgid "Plugin Homepage"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/framework/lib/themes-agapetry.php:10
msgid "Documentation"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/framework/lib/themes-agapetry.php:11
msgid "Support Forum"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/framework/lib/themes-agapetry.php:12
msgid "Author Homepage"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/framework/lib/themes-agapetry.php:13
msgid "Help donating"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/framework/lib/themes-agapetry.php:23
#, php-format
msgid "Capability Manager Enhanced %s"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/framework/lib/themes-agapetry.php:24
msgid "Copyright 2010 Jordi Canals"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/framework/lib/themes-agapetry.php:27
#, php-format
msgid "Modifications &copy; Copyright %1$s %2$s"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:50
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:50
msgid "Roles and Capabilities"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:59
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:59
#, php-format
msgid "Capabilities for %s"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:62
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:62
msgid "View and modify capabilities WordPress associates with each role. Changes <strong>remain in the database</strong> even if you deactivate this plugin."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:74
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:74
msgid "To further customize editing or viewing access, consider stepping up to <a href='#pp-more'>Press Permit</a>."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:105
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:105
msgid "Automatically define type-specific capabilities for your custom post types and taxonomies"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:109
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:109
msgid "Assign standard WP roles supplementally for a specific post type"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:113
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:113
msgid "Assign custom WP roles supplementally for a specific post type <em>(Pro)</em>"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:117
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:117
msgid "Customize reading permissions per-category or per-post"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:121
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:121
msgid "Customize editing permissions per-category or per-post <em>(Pro)</em>"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:125
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:125
msgid "Custom Post Visibility statuses, fully implemented throughout wp-admin <em>(Pro)</em>"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:129
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:129
msgid "Custom Moderation statuses for access-controlled, multi-step publishing workflow <em>(Pro)</em>"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:133
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:133
msgid "Regulate permissions for Edit Flow post statuses <em>(Pro)</em>"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:137
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:137
msgid "Customize the moderated editing of published content with Revisionary or Post Forking <em>(Pro)</em>"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:141
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:141
msgid "Grant Spectator, Participant or Moderator access to specific bbPress forums <em>(Pro)</em>"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:145
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:145
msgid "Grant supplemental content permissions to a BuddyPress group <em>(Pro)</em>"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:149
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:149
msgid "WPML integration to mirror permissions to translations <em>(Pro)</em>"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:153
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:153
msgid "Member support forum"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:159
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:159
#, php-format
msgid "%1$sgrab%2$s %3$s"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:159
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:159
#, php-format
msgid "%s (free install)"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:161
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:161
#, php-format
msgid "%1$sbuy%2$s %3$s"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:161
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:161
#, php-format
msgid "%s info/purchase"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:243
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:243
msgid "&nbsp;"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:244
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:244
msgid "Reading"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:245
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:245
msgid "Editing Capabilities"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:246
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:246
msgid "Deletion Capabilities"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:254
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:254
msgid "can read posts which are currently published with private visibility"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:255
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:255
msgid "has basic editing capability (but may need other capabilities based on post status and ownership)"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:256
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:256
msgid "can edit posts which were created by other users"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:257
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:257
msgid "can edit posts which are currently published"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:258
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:258
msgid "can edit posts which are currently published with private visibility"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:259
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:259
msgid "can make a post publicly visible"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:260
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:260
msgid "has basic deletion capability (but may need other capabilities based on post status and ownership)"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:261
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:261
msgid "can delete posts which were created by other users"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:262
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:262
msgid "can delete posts which are currently published"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:263
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:263
msgid "can delete posts which are currently published with private visibility"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:362
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:454
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:543
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:362
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:454
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:543
#, php-format
msgid "%s: assigned by Permission Group"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:431
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:431
msgid "Other WordPress Core Capabilities"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:492
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:608
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:492
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:608
msgid "check/uncheck all"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:492
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:608
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:492
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:608
msgid "negate all (storing as disabled capabilities)"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:492
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:608
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:492
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:608
msgid "negate none (add/remove all capabilities normally)"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:499
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:499
msgid "Additional Capabilities"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:599
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:599
msgid "Level:"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:617
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:617
msgid "Note: Underscores replace spaces in stored capability name (\"edit users\" => \"edit_users\")."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:633
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:633
msgid "Save Changes"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:636
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:636
msgid "Delete this role"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:636
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:636
#, php-format
msgid ""
"You are about to delete the %s role.\n"
" 'Cancel' to stop, 'OK' to delete."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:636
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:636
msgid "Delete Role"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:649
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:649
msgid "Select New Role"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:657
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:657
msgid "Change"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:662
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:662
msgid "Create New Role"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:665
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:665
msgid "Name of new role"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:668
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:684
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/pp-ui.php:86
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:668
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:684
msgid "Make role available for supplemental assignment to Permission Groups only"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:668
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:684
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:668
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:684
msgid "hidden"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:672
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:672
msgid "Create"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:678
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:678
msgid "Copy this role to"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:681
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:681
msgid "Name of copied role"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:688
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:688
msgid "Copy"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:694
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:694
msgid "Add Capability"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:696
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:696
msgid "capability name"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:697
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:697
msgid "Add to role"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:725
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:725
msgid "Create this role definition in new (future) sites"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:725
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:725
msgid "include in new sites"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:728
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:728
msgid "Copy / update this role definition to all sites now"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/admin.php:728
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced\includes/admin.php:728
msgid "sync role to all sites now"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup-handler.php:9
msgid "You do not have permission to restore roles."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup-handler.php:32
msgid "New backup saved."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup-handler.php:38
msgid "Roles and Capabilities restored from last backup."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup-handler.php:40
msgid "Restore failed. No backup found."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup-handler.php:59
msgid "Needed function to create default roles not found!"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup-handler.php:72
msgid "Roles and Capabilities reset to WordPress defaults"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup.php:33
msgid "Backup Tool for Capability Manager"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup.php:42
msgid "Backup and Restore"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup.php:46
msgid "Select action:"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup.php:49
msgid "Backup roles and capabilities"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup.php:50
msgid "Restore last saved backup"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup.php:52
msgid "Do Action"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup.php:60
msgid "Reset WordPress Defaults"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup.php:62
msgid "WARNING:"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup.php:62
msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup.php:65
msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup.php:66
msgid "It is recommended to use this only as a last resource!"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup.php:67
msgid "Reset Roles and Capabilities to WordPress defaults"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup.php:67
msgid ""
"You are about to reset Roles and Capabilities to WordPress defaults.\n"
" 'Cancel' to stop, 'OK' to reset."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/backup.php:67
msgid "Reset to WordPress defaults"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/handler.php:16
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/handler.php:29
msgid "New role created."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/handler.php:22
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/handler.php:35
msgid "Error: Failed creating the new role."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/handler.php:74
msgid "New capability added to role."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/handler.php:88
msgid "Incorrect capability name."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/handler.php:93
msgid "Capability settings saved."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/handler.php:95
msgid "Error saving capability settings."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/handler.php:99
msgid "Bad form received."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/handler.php:211
msgid "You cannot remove Manage Capabilities from Administrators"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/handler.php:313
#, php-format
msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/handler.php:358
#, php-format
msgid "Role has been deleted. %1$d users moved to default role %2$s."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/manager.php:263
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/manager.php:282
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/manager.php:438
msgid "What do you think you're doing?!?"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/manager.php:321
msgid "Bad form Received"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/pp-ui.php:44
#, php-format
msgid "see %1$sRole Usage%2$s: \"Pattern Roles\""
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/pp-ui.php:46
#, php-format
msgid "activate %1$sAdvanced settings%2$s, see Role Usage"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/pp-ui.php:51
#, php-format
msgid "\"Posts\" capabilities selected here also define type-specific role assignment for Permission Groups%s."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/pp-ui.php:53
#, php-format
msgid "\"Posts\" capabilities selected here also define type-specific role assignment for Permit Groups%s."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/pp-ui.php:61
msgid "Capabilities for custom statuses can be manually added here (see Post Statuses > Status > Capability Mapping for applicable names). However, it is usually more convenient to use Permission Groups to assign a supplemental status-specific role."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/pp-ui.php:63
msgid "Capabilities for custom statuses can be manually added here. Or activate the PP Custom Post Statuses extension to assign status-specific supplemental roles."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/pp-ui.php:66
msgid "Capabilities for custom statuses can be manually added to a role here (see Conditions > Status > Capability Mapping for applicable names). However, it is usually more convenient to use Permit Groups to assign a supplemental status-specific role."
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/pp-ui.php:86
msgid "hidden role"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/pp-ui.php:96
msgid "Force Type-Specific Capabilities"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/pp-ui.php:99
msgid "Force unique capability names for:"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/pp-ui.php:104
msgid "(PP Filtered Post Types, Taxonomies)"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/pp-ui.php:159
msgid "Use create_posts capability"
msgstr ""
#: E:\www\wp42\wp-content\plugins\capability-manager-enhanced/includes/pp-ui.php:164
msgid "Update"
msgstr ""

View File

@@ -0,0 +1,610 @@
# Copyright (C) 2015 Capability Manager Enhanced
# This file is distributed under the same license as the Capability Manager Enhanced package.
msgid ""
msgstr ""
"Project-Id-Version: Capability Manager Enhanced 1.5.3\n"
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/capability-manager-"
"enhanced\n"
"POT-Creation-Date: 2015-06-04 10:53:10+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
#: capsman-enhanced.php:40
msgid ""
"<strong>Error:</strong> Capability Manager Extended cannot function because "
"another copy of Capability Manager is active."
msgstr ""
#: capsman-enhanced.php:58
msgid "Warning:"
msgstr ""
#: capsman-enhanced.php:59
msgid "The active plugin %s is not compatible with your PHP version."
msgstr ""
#: capsman-enhanced.php:61
msgid "%s is required for this plugin."
msgstr ""
#: capsman-enhanced.php:115 includes/manager.php:177 includes/manager.php:186
msgid "Capabilities"
msgstr ""
#: capsman-enhanced.php:116 capsman-enhanced.php:120 capsman-enhanced.php:125
#: includes/manager.php:177 includes/manager.php:181 includes/manager.php:187
msgid "Capability Manager"
msgstr ""
#: capsman-enhanced.php:125
msgid "Role Capabilities"
msgstr ""
#: framework/classes/abstract/plugin.php:224
msgid "Explicity negate this capability by storing as disabled"
msgstr ""
#: framework/classes/abstract/plugin.php:225
msgid "Explicitly negate these capabilities by storing as disabled"
msgstr ""
#: framework/classes/abstract/plugin.php:226
msgid "Post type registration does not define this capability distinctly"
msgstr ""
#: framework/classes/abstract/plugin.php:227
msgid "This capability is explicitly negated. Click to add/remove normally."
msgstr ""
#: framework/classes/abstract/plugin.php:228
msgid "Add or remove this capability from the WordPress role"
msgstr ""
#: framework/classes/abstract/plugin.php:229
msgid "Add or remove capability from the role normally"
msgstr ""
#: framework/lib/formating.php:40
msgid "Settings saved."
msgstr ""
#: framework/lib/themes-agapetry.php:9
msgid "Plugin Homepage"
msgstr ""
#: framework/lib/themes-agapetry.php:10
msgid "Documentation"
msgstr ""
#: framework/lib/themes-agapetry.php:11
msgid "Support Forum"
msgstr ""
#: framework/lib/themes-agapetry.php:12
msgid "Author Homepage"
msgstr ""
#: framework/lib/themes-agapetry.php:13
msgid "Help donating"
msgstr ""
#: framework/lib/themes-agapetry.php:23
msgid "Capability Manager Enhanced %s"
msgstr ""
#: framework/lib/themes-agapetry.php:24
msgid "Copyright 2010 Jordi Canals"
msgstr ""
#: framework/lib/themes-agapetry.php:27
msgid "Modifications &copy; Copyright %1$s %2$s"
msgstr ""
#: includes/admin.php:50
msgid "Roles and Capabilities"
msgstr ""
#: includes/admin.php:59
msgid "Capabilities for %s"
msgstr ""
#: includes/admin.php:62
msgid ""
"View and modify capabilities WordPress associates with each role. Changes "
"<strong>remain in the database</strong> even if you deactivate this plugin."
msgstr ""
#: includes/admin.php:74
msgid ""
"To further customize editing or viewing access, consider stepping up to <a "
"href='#pp-more'>Press Permit</a>."
msgstr ""
#: includes/admin.php:105
msgid ""
"Automatically define type-specific capabilities for your custom post types "
"and taxonomies"
msgstr ""
#: includes/admin.php:109
msgid "Assign standard WP roles supplementally for a specific post type"
msgstr ""
#: includes/admin.php:113
msgid ""
"Assign custom WP roles supplementally for a specific post type <em>(Pro)</em>"
msgstr ""
#: includes/admin.php:117
msgid "Customize reading permissions per-category or per-post"
msgstr ""
#: includes/admin.php:121
msgid "Customize editing permissions per-category or per-post <em>(Pro)</em>"
msgstr ""
#: includes/admin.php:125
msgid ""
"Custom Post Visibility statuses, fully implemented throughout wp-admin <em>"
"(Pro)</em>"
msgstr ""
#: includes/admin.php:129
msgid ""
"Custom Moderation statuses for access-controlled, multi-step publishing "
"workflow <em>(Pro)</em>"
msgstr ""
#: includes/admin.php:133
msgid "Regulate permissions for Edit Flow post statuses <em>(Pro)</em>"
msgstr ""
#: includes/admin.php:137
msgid ""
"Customize the moderated editing of published content with Revisionary or "
"Post Forking <em>(Pro)</em>"
msgstr ""
#: includes/admin.php:141
msgid ""
"Grant Spectator, Participant or Moderator access to specific bbPress forums "
"<em>(Pro)</em>"
msgstr ""
#: includes/admin.php:145
msgid ""
"Grant supplemental content permissions to a BuddyPress group <em>(Pro)</em>"
msgstr ""
#: includes/admin.php:149
msgid "WPML integration to mirror permissions to translations <em>(Pro)</em>"
msgstr ""
#: includes/admin.php:153
msgid "Member support forum"
msgstr ""
#: includes/admin.php:159
msgid "%1$sgrab%2$s %3$s"
msgstr ""
#: includes/admin.php:159
msgid "%s (free install)"
msgstr ""
#: includes/admin.php:161
msgid "%1$sbuy%2$s %3$s"
msgstr ""
#: includes/admin.php:161
msgid "%s info/purchase"
msgstr ""
#: includes/admin.php:243
msgid "&nbsp;"
msgstr ""
#: includes/admin.php:244
msgid "Reading"
msgstr ""
#: includes/admin.php:245
msgid "Editing Capabilities"
msgstr ""
#: includes/admin.php:246
msgid "Deletion Capabilities"
msgstr ""
#: includes/admin.php:254
msgid "can read posts which are currently published with private visibility"
msgstr ""
#: includes/admin.php:255
msgid ""
"has basic editing capability (but may need other capabilities based on post "
"status and ownership)"
msgstr ""
#: includes/admin.php:256
msgid "can edit posts which were created by other users"
msgstr ""
#: includes/admin.php:257
msgid "can edit posts which are currently published"
msgstr ""
#: includes/admin.php:258
msgid "can edit posts which are currently published with private visibility"
msgstr ""
#: includes/admin.php:259
msgid "can make a post publicly visible"
msgstr ""
#: includes/admin.php:260
msgid ""
"has basic deletion capability (but may need other capabilities based on post "
"status and ownership)"
msgstr ""
#: includes/admin.php:261
msgid "can delete posts which were created by other users"
msgstr ""
#: includes/admin.php:262
msgid "can delete posts which are currently published"
msgstr ""
#: includes/admin.php:263
msgid "can delete posts which are currently published with private visibility"
msgstr ""
#: includes/admin.php:362 includes/admin.php:454 includes/admin.php:543
msgid "%s: assigned by Permission Group"
msgstr ""
#: includes/admin.php:431
msgid "Other WordPress Core Capabilities"
msgstr ""
#: includes/admin.php:492 includes/admin.php:608
msgid "check/uncheck all"
msgstr ""
#: includes/admin.php:492 includes/admin.php:608
msgid "negate all (storing as disabled capabilities)"
msgstr ""
#: includes/admin.php:492 includes/admin.php:608
msgid "negate none (add/remove all capabilities normally)"
msgstr ""
#: includes/admin.php:499
msgid "Additional Capabilities"
msgstr ""
#: includes/admin.php:599
msgid "Level:"
msgstr ""
#: includes/admin.php:617
msgid ""
"Note: Underscores replace spaces in stored capability name (\"edit users\" "
"=> \"edit_users\")."
msgstr ""
#: includes/admin.php:633
msgid "Save Changes"
msgstr ""
#: includes/admin.php:636
msgid "Delete this role"
msgstr ""
#: includes/admin.php:636
msgid ""
"You are about to delete the %s role.\n"
" 'Cancel' to stop, 'OK' to delete."
msgstr ""
#: includes/admin.php:636
msgid "Delete Role"
msgstr ""
#: includes/admin.php:649
msgid "Select New Role"
msgstr ""
#: includes/admin.php:657
msgid "Change"
msgstr ""
#: includes/admin.php:662
msgid "Create New Role"
msgstr ""
#: includes/admin.php:665
msgid "Name of new role"
msgstr ""
#: includes/admin.php:668 includes/admin.php:684 includes/pp-ui.php:86
msgid ""
"Make role available for supplemental assignment to Permission Groups only"
msgstr ""
#: includes/admin.php:668 includes/admin.php:684
msgid "hidden"
msgstr ""
#: includes/admin.php:672
msgid "Create"
msgstr ""
#: includes/admin.php:678
msgid "Copy this role to"
msgstr ""
#: includes/admin.php:681
msgid "Name of copied role"
msgstr ""
#: includes/admin.php:688
msgid "Copy"
msgstr ""
#: includes/admin.php:694
msgid "Add Capability"
msgstr ""
#: includes/admin.php:696
msgid "capability name"
msgstr ""
#: includes/admin.php:697
msgid "Add to role"
msgstr ""
#: includes/admin.php:725
msgid "Create this role definition in new (future) sites"
msgstr ""
#: includes/admin.php:725
msgid "include in new sites"
msgstr ""
#: includes/admin.php:728
msgid "Copy / update this role definition to all sites now"
msgstr ""
#: includes/admin.php:728
msgid "sync role to all sites now"
msgstr ""
#: includes/backup-handler.php:9
msgid "You do not have permission to restore roles."
msgstr ""
#: includes/backup-handler.php:32
msgid "New backup saved."
msgstr ""
#: includes/backup-handler.php:38
msgid "Roles and Capabilities restored from last backup."
msgstr ""
#: includes/backup-handler.php:40
msgid "Restore failed. No backup found."
msgstr ""
#: includes/backup-handler.php:59
msgid "Needed function to create default roles not found!"
msgstr ""
#: includes/backup-handler.php:72
msgid "Roles and Capabilities reset to WordPress defaults"
msgstr ""
#: includes/backup.php:33
msgid "Backup Tool for Capability Manager"
msgstr ""
#: includes/backup.php:42
msgid "Backup and Restore"
msgstr ""
#: includes/backup.php:46
msgid "Select action:"
msgstr ""
#: includes/backup.php:49
msgid "Backup roles and capabilities"
msgstr ""
#: includes/backup.php:50
msgid "Restore last saved backup"
msgstr ""
#: includes/backup.php:52
msgid "Do Action"
msgstr ""
#: includes/backup.php:60
msgid "Reset WordPress Defaults"
msgstr ""
#: includes/backup.php:62
msgid "WARNING:"
msgstr ""
#: includes/backup.php:62
msgid ""
"Reseting default Roles and Capabilities will set them to the WordPress "
"install defaults."
msgstr ""
#: includes/backup.php:65
msgid ""
"If you have installed any plugin that adds new roles or capabilities, these "
"will be lost."
msgstr ""
#: includes/backup.php:66
msgid "It is recommended to use this only as a last resource!"
msgstr ""
#: includes/backup.php:67
msgid "Reset Roles and Capabilities to WordPress defaults"
msgstr ""
#: includes/backup.php:67
msgid ""
"You are about to reset Roles and Capabilities to WordPress defaults.\n"
" 'Cancel' to stop, 'OK' to reset."
msgstr ""
#: includes/backup.php:67
msgid "Reset to WordPress defaults"
msgstr ""
#: includes/handler.php:16 includes/handler.php:29
msgid "New role created."
msgstr ""
#: includes/handler.php:22 includes/handler.php:35
msgid "Error: Failed creating the new role."
msgstr ""
#: includes/handler.php:74
msgid "New capability added to role."
msgstr ""
#: includes/handler.php:88
msgid "Incorrect capability name."
msgstr ""
#: includes/handler.php:93
msgid "Capability settings saved."
msgstr ""
#: includes/handler.php:95
msgid "Error saving capability settings."
msgstr ""
#: includes/handler.php:99
msgid "Bad form received."
msgstr ""
#: includes/handler.php:211
msgid "You cannot remove Manage Capabilities from Administrators"
msgstr ""
#: includes/handler.php:313
msgid ""
"Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
msgstr ""
#: includes/handler.php:358
msgid "Role has been deleted. %1$d users moved to default role %2$s."
msgstr ""
#: includes/manager.php:263 includes/manager.php:282 includes/manager.php:438
msgid "What do you think you're doing?!?"
msgstr ""
#: includes/manager.php:321
msgid "Bad form Received"
msgstr ""
#: includes/pp-ui.php:44
msgid "see %1$sRole Usage%2$s: \"Pattern Roles\""
msgstr ""
#: includes/pp-ui.php:46
msgid "activate %1$sAdvanced settings%2$s, see Role Usage"
msgstr ""
#: includes/pp-ui.php:51
msgid ""
"\"Posts\" capabilities selected here also define type-specific role "
"assignment for Permission Groups%s."
msgstr ""
#: includes/pp-ui.php:53
msgid ""
"\"Posts\" capabilities selected here also define type-specific role "
"assignment for Permit Groups%s."
msgstr ""
#: includes/pp-ui.php:61
msgid ""
"Capabilities for custom statuses can be manually added here (see Post "
"Statuses > Status > Capability Mapping for applicable names). However, it is "
"usually more convenient to use Permission Groups to assign a supplemental "
"status-specific role."
msgstr ""
#: includes/pp-ui.php:63
msgid ""
"Capabilities for custom statuses can be manually added here. Or activate the "
"PP Custom Post Statuses extension to assign status-specific supplemental "
"roles."
msgstr ""
#: includes/pp-ui.php:66
msgid ""
"Capabilities for custom statuses can be manually added to a role here (see "
"Conditions > Status > Capability Mapping for applicable names). However, it "
"is usually more convenient to use Permit Groups to assign a supplemental "
"status-specific role."
msgstr ""
#: includes/pp-ui.php:86
msgid "hidden role"
msgstr ""
#: includes/pp-ui.php:96
msgid "Force Type-Specific Capabilities"
msgstr ""
#: includes/pp-ui.php:99
msgid "Force unique capability names for:"
msgstr ""
#: includes/pp-ui.php:104
msgid "(PP Filtered Post Types, Taxonomies)"
msgstr ""
#: includes/pp-ui.php:159
msgid "Use create_posts capability"
msgstr ""
#: includes/pp-ui.php:164
msgid "Update"
msgstr ""
#. Plugin Name of the plugin/theme
msgid "Capability Manager Enhanced"
msgstr ""
#. Plugin URI of the plugin/theme
msgid "http://presspermit.com/capability-manager"
msgstr ""
#. Description of the plugin/theme
msgid ""
"Manage WordPress role definitions, per-site or network-wide. Organizes post "
"capabilities by post type and operation."
msgstr ""
#. Author of the plugin/theme
msgid "Jordi Canals, Kevin Behrens"
msgstr ""
#. Author URI of the plugin/theme
msgid "http://agapetry.net"
msgstr ""

View File

@@ -0,0 +1,276 @@
=== Capability Manager Enhanced===
Contributors: txanny, kevinB
Donate Link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=JWZVFUDLLYQBA
Tags: roles, capabilities, manager, editor, rights, role, capability, types, taxonomies, network, multisite, default
Requires at least: 3.1
Tested up to: 4.9.5
Stable tag: 1.5.8
A simple way to manage WordPress roles and capabilities.
== Description ==
Capability Manager Enhanced provides a simple way to manage WordPress role definitions (Subscriber, Editor, etc.). View or change the capabilities of any role, add new roles, copy existing roles into new ones, and add new capabilities to existing roles. Now supports capability negation and role networking.
= Features: =
* Create roles
* Manage role capabilities
* Supports negation: set any capability to granted, not granted, or blocked
* Copy any role all network sites
* Mark any role for auto-copy to future network sites
* Backup and restore Roles and Capabilities to revert your last changes.
* Revert Roles and Capabilities to WordPress defaults.
Role management can also be delegated:
* Only users with 'manage_capabilities' can manage them. This capability is created at install time and assigned to Administrators.
* Administrator role cannot be deleted.
* Non-administrators can only manage roles or users with same or lower capabilities.
Enhanced and supported by <a href="http://agapetry.net">Kevin Behrens</a> since July 2012. The original Capability Manager author, Jordi Canals, has not updated the plugin since early 2010. Since he was unreachable by web or email, I decided to take on the project myself.
The main change from the original plugin is an improved UI which organizes capabilities:
* by post type
* by operation (read/edit/delete)
* by origin (WP core or plugin)
Capability Manager Enhanced also adds <a href="http://wordpress.org/plugins/press-permit-core">Press Permit</a> plugin integration:
* easily specify which post types require type-specific capability definitions
* show capabilities which Press Permit adds to the role by supplemental type-specific role assignment
= Languages included: =
* English
* Catalan
* Spanish
* Belorussian *by <a href="http://antsar.info/" rel="nofollow">Ilyuha</a>*
* German *by <a href="http://great-solution.de/" rel="nofollow">Carsten Tauber</a>*
* Italian *by <a href="http://gidibao.net" rel="nofollow">Gianni Diurno</a>*
* Russian *by <a href="http://www.fatcow.com" rel="nofollow">Marcis Gasuns</a>*
* Swedish *by <a href="http://jenswedin.com/" rel="nofollow">Jens Wedin</a>
* POT file for easy translation to other languages included.
== Installation ==
= System Requirements =
* **Requires PHP 5.2**. Older versions of PHP are obsolete and expose your site to security risks.
* Verify the plugin is compatible with your WordPress Version. If not, plugin will not load.
= Installing the plugin =
1. Unzip the plugin archive.
1. Upload the plugin's folder to the WordPress plugins directory.
1. Activate the plugin through the 'Plugins' menu in WordPress.
1. Manage the capabilities on the 'Capabilities' page on Users menu.
1. Enjoy your plugin!
== Screenshots ==
1. Users Menu.
2. View or Modify capabilities for a role.
3. Network: copy role to existing or future sites.
4. Actions on roles.
5. Permissions Menu (Press Permit integration).
6. View or Modify capabilities for a role (with Press Permit Pro).
7. Force type-specific capabilities (Press Permit integration).
8. Backup/Restore tool.
== Frequently Asked Questions ==
= How can I grant capabilities for a custom post type =
The custom post type must be defined to impose type-specific capability requirements. This is normally done by setting the "capability type" property equal to the post type name.
= I have configured a role to edit a custom post type. Why do the users still see "You are not allowed the edit this post?" when they try to save/submit a new post? =
Probably because your custom post type definition not having map_meta_cap set true. If you are calling register_post_type manually, just add this property to the options array. Unfortunately, none of the free CPT plugins deal with this important detail.
= Even after I added capabilities, WordPress is not working the way I want =
Keep in mind that this plugin's purpose is to conveniently view and modify the capabilities array stored for each WordPress role. It is not responsible for the implementation of those capabilities by the WordPress core or other plugins.
= Where can I find more information about this plugin, usage and support ? =
* If you need help, <a href="http://wordpress.org/tags/capsman-enhanced">ask in the Support forum</a>. If your issue pertains to the enforcement of assigned capabilities, I am not the primary support avenue. In many cases, I will offer a suggestion, but please don't give me negative feedback for not providing free consulting.
== License ==
Copyright 2009, 2010 Jordi Canals
Copyright 2013-2018, Kevin Behrens
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
== Changelog ==
= 1.5.8 =
* Fixed : PHP warning for deprecated function WP_Roles::reinit
* Change : Don't allow non-Administrator to edit Administrators, even if Administrator role level is set to 0
= 1.5.7 =
* Change : Revert menu captions to previous behavior ("Permissions > Role Capabilities" if Press Permit Core is active, otherwise "Users > Capabilities")
= 1.5.6 =
* Fixed : Correct some irregularities in CME admin menu item display
= 1.5.5 =
* Fixed : User editing was improperly blocked in some cases
= 1.5.4 =
* Fixed : Non-administrators' user editing capabilities were blocked if Press Permit Core was also active
* Fixed : Non-administrators could not edit other users with their role (define constant CME_LEGACY_USER_EDIT_FILTER to retain previous behavior)
* Fixed : Non-administrators could not assign their role to other users (define constant CME_LEGACY_USER_EDIT_FILTER to retain previous behavior)
* Lang : Changed text domain for language pack conformance
= 1.5.3 =
* Fixed : On single-site installations, non-Administrators with delete_users capability could give new users an Administrator role (since 1.5.2)
* Fixed : Deletion of a third party plugin role could cause users to be demoted to Subscriber inappropriately
* Compat : Press Permit Core - Permission Group refresh was not triggered if Press Permit Core is inactive when CME deletes a role definition
* Compat : Support third party display of available capabilities via capsman_get_capabilities or members_get_capabilities filter
* Change : If user_level of Administrator role was cleared, non-Administrators with user editing capabilities could create/edit/delete Administrators. Administrator role is now implicitly treated as level 10.
* Fixed : CSS caused formatting issues around wp-admin Update button on some installations
* Perf : Don't output wp-admin CSS on non-CME screens
* Lang : Fixed erroneous text_domain argument for numerous strings
* Lang : Updated .pot and .po files
= 1.5.2 =
* Fixed : Network Super Administrators without an Administrator role on a particular site could not assign an Administrator role to other users of that site
= 1.5.1 =
* Fixed : Non-administrators with user editing capabilities could give new users a role with a higher level than their own (including Administrator)
= 1.5 =
* Feature : Support negative capabilities (storage to wp_roles array with false value)
* Feature : Multisite - Copy a role definition to all current sites on a network
* Feature : Multisite - Copy a role definition to new (future) sites on a network
* Feature : Backup / Restore tool requires "restore_roles" capability or super admin status
* Fixed : Role reset to WP defaults did not work, caused a PHP error / white screen
* Change : Clarified English captions on Backup Tool screen
* Fixed : Term deletion capability was not included in taxonomies grid even if defined
* Fixed : jQuery notices for deprecated methods on Edit Role screen
* Compat : Press Permit - if a role is marked as hidden, also default it for use by PP Pro as a Pattern Role (when PP Collaborative Editing is activated and Advanced Settings enabled)
* Change : Press Permit promotional message includes link to display further info
= 1.4.10 =
* Perf : Eliminated unused framework code (reduced typical wp-admin memory usage by 0.6 MB)
* Fixed : Failure to save capability changes, on some versions of PHP
* Compat : Press Permit - PHP Warning on role save
* Compat : Press Permit - PHP Warning on "Force Type-Specific Capabilities" settings update
* Compat : Press Permit - "supplemental only" option stored redundant entries
* Compat : Press Permit - green background around capabilities which
* Compat : Press Permit - PHP Warning on "Force Type-Specific Capabilities" settings update
* Maint : Stop using $GLOBALS superglobal
* Change : Reduced download size by moving screenshots to assets folder of project folder
= 1.4.9 =
* Fixed : Role capabilities were not updated / refreshed properly on multisite installations
* Feature : If create_posts capabilities are defined, organize checkboxes into a column alongside edit_posts
* Feature : "Use create_posts capability" checkbox in sidebar auto-defines create_posts capabilities (requires Press Permit)
* Compat : bbPress + Press Permit - Modified bbPress role capabilities were not redisplayed following save, required reload
* Compat : bbPress + Press Permit - Adding a capability via the "Add Cap" textbox caused the checkbox to be available but not selected
* Compat : Press Permit - "supplemental only" option was always enabled for newly created and copied roles, regardless of checkbox setting near Create/Copy button
= 1.4.8 =
* Compat : bbPress + Press Permit - "Add Capability" form failed when used on a bbPress role, caused creation of an invalid role
= 1.4.7 =
* Compat : Press Permit - flagging of roles as "supplemental assignment only" was not saved
= 1.4.6 =
* Compat : bbPress 2.2 (supports customization of dynamic forum role capabilities)
* Compat : Press Permit + bbPress - customized role capabilities were not properly maintained on bbPress activation / deactivation, in some scenarios
* Fixed : Role update and copy failed if currently stored capability array is corrupted
= 1.4.5 =
* Fixed : Capabilities were needlessly re-saved on role load
* Fixed : Capability labels in "Other WordPress" section did not toggle checkbox selection
* Press Permit integration: If capability is granted by the role's Permit Group, highlight it as green with a descriptive caption title, but leave checkbox enabled for display/editing of role defintion setting (previous behavior caused capability to be stripped out of WP role definition under some PP configurations)
= 1.4.4 =
* Fixed : On translated sites, roles could not be edited
* Fixed : Menu item change to "Role Capabilities" broke existing translations
= 1.4.3 =
* Fixed : Separate checkbox was displayed for cap->edit_published_posts even if it was defined to the be same as cap->edit_posts
* Press Permit integration: automatically store a backup copy of each role's last saved capability set so they can be reinstated if necessary (currently for bbPress)
= 1.4.2 =
* Language: updated .pot file
* Press Permit integration: roles can be marked for supplemental assignment only (and suppressed from WP role assignment dropdown, requires PP 1.0-beta1.4)
= 1.4.1 =
* https compatibility: use content_url(), plugins_url()
* Press Permit integration: if role definitions are reset to WP defaults, also repopulate PP capabilities (pp_manage_settings, etc.)
= 1.4 =
* Organized capabilities UI by post type and operation
* Editing UI separates WP core capabilities and 3rd party capabilities
* Clarified sidebar captions
* Don't allow a non-Administrator to add or remove a capability they don't have
* Fixed : PHP Warnings for unchecked capabilities
* Press Permit integration: externally (dis)enable Post Types, Taxonomies for PP filtering (which forces type-specific capability definitions)
* Show capabilities which Press Permit adds to the role by supplemental type-specific role assignment
* Reduce memory usage by loading framework and plugin code only when needed
= 1.3.2 =
* Added Swedish translation.
= 1.3.1 =
* Fixed a bug where administrators could not create or manage other administrators.
= 1.3 =
* Cannot edit users with more capabilities than current user.
* Cannot assign to users a role with more capabilities than current user.
* Solved an incompatibility with Chameleon theme.
* Migrated to the new Alkivia Framework.
* Changed license to GPL version 2.
= 1.2.5 =
* Tested up to WP 2.9.1.
= 1.2.4 =
* Added Italian translation.
= 1.2.3 =
* Added German and Belorussian translations.
= 1.2.2 =
* Added Russian translation.
= 1.2.1 =
* Coding Standards.
* Corrected internal links.
* Updated Framework.
= 1.2 =
* Added backup/restore tool.
= 1.1 =
* Role deletion added.
= 1.0.1 =
* Some code improvements.
* Updated Alkivia Framework.
= 1.0 =
* First public version.
== Upgrade Notice ==
= 1.5.1 =
Fixed : Non-administrators with user editing capabilities could add new Administrators
= 1.3.2 =
Only Swedish translation.
= 1.3.1 =
Bug fixes.
= 1.3 =
Improved security esiting users. You can now create real user managers.

View File

@@ -0,0 +1,5 @@
{
"name" : "wp-api/basic-auth",
"description" : "Basic Authentication handler for the JSON API, used for development and debugging purposes",
"type" : "wordpress-plugin"
}

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,8 @@
.git/
.gitignore
.travis.yml
readme.md
tests/
_inc/lib/icalendar-reader.php
modules/shortcodes/upcoming-events.php
modules/widgets/upcoming-events.php

View File

@@ -0,0 +1,23 @@
<?php
/**
* Placeholder to load 3rd party plugin tweaks until a legit system
* is architected
*/
require_once( JETPACK__PLUGIN_DIR . '3rd-party/buddypress.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/wpml.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/bitly.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/bbpress.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/woocommerce.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/domain-mapping.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/qtranslate-x.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/vaultpress.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/beaverbuilder.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/debug-bar.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/class.jetpack-modules-overrides.php' );
// We can't load this conditionally since polldaddy add the call in class constuctor.
require_once( JETPACK__PLUGIN_DIR . '3rd-party/polldaddy.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/woocommerce-services.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/class.jetpack-amp-support.php' );

View File

@@ -0,0 +1,50 @@
<?php
add_action( 'init', 'jetpack_bbpress_compat', 11 ); // Priority 11 needed to ensure sharing_display is loaded.
/**
* Adds Jetpack + bbPress Compatibility filters.
*
* @author Brandon Kraft
* @since 3.7.1
*/
function jetpack_bbpress_compat() {
if ( function_exists( 'sharing_display' ) ) {
add_filter( 'bbp_get_topic_content', 'sharing_display', 19 );
add_action( 'bbp_template_after_single_forum', 'jetpack_sharing_bbpress' );
add_action( 'bbp_template_after_single_topic', 'jetpack_sharing_bbpress' );
}
/**
* Enable Markdown support for bbpress post types.
*
* @author Brandon Kraft
* @since 6.0.0
*/
if ( function_exists( 'bbp_get_topic_post_type' ) ) {
add_post_type_support( bbp_get_topic_post_type(), 'wpcom-markdown' );
add_post_type_support( bbp_get_reply_post_type(), 'wpcom-markdown' );
add_post_type_support( bbp_get_forum_post_type(), 'wpcom-markdown' );
}
/**
* Use Photon for all images in Topics and replies.
*
* @since 4.9.0
*/
if ( class_exists( 'Jetpack_Photon' ) && Jetpack::is_module_active( 'photon' ) ) {
add_filter( 'bbp_get_topic_content', array( 'Jetpack_Photon', 'filter_the_content' ), 999999 );
add_filter( 'bbp_get_reply_content', array( 'Jetpack_Photon', 'filter_the_content' ), 999999 );
}
}
/**
* Display Jetpack "Sharing" buttons on bbPress 2.x forums/ topics/ lead topics/ replies.
*
* Determination if the sharing buttons should display on the post type is handled within sharing_display().
*
* @author David Decker
* @since 3.7.0
*/
function jetpack_sharing_bbpress() {
sharing_display( null, true );
}

View File

@@ -0,0 +1,20 @@
<?php
/**
* Beaverbuilder Compatibility.
*/
class Jetpack_BeaverBuilderCompat {
function __construct() {
add_action( 'init', array( $this, 'beaverbuilder_refresh' ) );
}
/**
* If masterbar module is active force BeaverBuilder to refresh when publishing a layout.
*/
function beaverbuilder_refresh() {
if ( Jetpack::is_module_active( 'masterbar' ) ) {
add_filter( 'fl_builder_should_refresh_on_publish', '__return_true' );
}
}
}
new Jetpack_BeaverBuilderCompat();

View File

@@ -0,0 +1,34 @@
<?php
/*
* Fixes issues with the Official Bitly for WordPress
* https://wordpress.org/plugins/bitly/
*/
if( class_exists( 'Bitly' ) ) {
if( isset( $GLOBALS['bitly'] ) ) {
if ( method_exists( $GLOBALS['bitly'], 'og_tags' ) ) {
remove_action( 'wp_head', array( $GLOBALS['bitly'], 'og_tags' ) );
}
add_action( 'wp_head', 'jetpack_bitly_og_tag', 100 );
}
}
/**
* jetpack_bitly_og_tag
*
* @return null
*/
function jetpack_bitly_og_tag() {
if( has_filter( 'wp_head', 'jetpack_og_tags') === false ) {
// Add the bitly part again back if we don't have any jetpack_og_tags added
if ( method_exists( $GLOBALS['bitly'], 'og_tags' ) ) {
$GLOBALS['bitly']->og_tags();
}
} elseif ( isset( $GLOBALS['posts'] ) && $GLOBALS['posts'][0]->ID > 0 ) {
printf( "<meta property=\"bitly:url\" content=\"%s\" /> \n", esc_attr( $GLOBALS['bitly']->get_bitly_link_for_post_id( $GLOBALS['posts'][0]->ID ) ) );
}
}

View File

@@ -0,0 +1,9 @@
<?php
add_filter( 'bp_core_pre_avatar_handle_upload', 'blobphoto' );
function blobphoto( $bool ) {
add_filter( 'jetpack_photon_skip_image', '__return_true' );
return $bool;
}

View File

@@ -0,0 +1,351 @@
<?php
/**
* Manages compatibility with the amp-wp plugin
*
* @see https://github.com/Automattic/amp-wp
*/
class Jetpack_AMP_Support {
static function init() {
if ( ! self::is_amp_request() ) {
return;
}
// enable stats
if ( Jetpack::is_module_active( 'stats' ) ) {
add_action( 'amp_post_template_footer', array( 'Jetpack_AMP_Support', 'add_stats_pixel' ) );
}
// carousel
add_filter( 'jp_carousel_maybe_disable', '__return_true' );
// sharing
add_filter( 'sharing_enqueue_scripts', '__return_false' );
add_filter( 'jetpack_sharing_counts', '__return_false' );
add_filter( 'sharing_js', '__return_false' );
add_filter( 'jetpack_sharing_display_markup', array( 'Jetpack_AMP_Support', 'render_sharing_html' ), 10, 2 );
// disable lazy images
add_filter( 'lazyload_is_enabled', '__return_false' );
// disable imploding CSS
add_filter( 'jetpack_implode_frontend_css', '__return_false' );
// enforce freedom mode for videopress
add_filter( 'videopress_shortcode_options', array( 'Jetpack_AMP_Support', 'videopress_enable_freedom_mode' ) );
// include Jetpack og tags when rendering native AMP head
add_action( 'amp_post_template_head', array( 'Jetpack_AMP_Support', 'amp_post_jetpack_og_tags' ) );
// Post rendering changes for legacy AMP
add_action( 'pre_amp_render_post', array( 'Jetpack_AMP_Support', 'amp_disable_the_content_filters' ) );
// Add post template metadata for legacy AMP
add_filter( 'amp_post_template_metadata', array( 'Jetpack_AMP_Support', 'amp_post_template_metadata' ), 10, 2 );
}
static function admin_init() {
// disable Likes metabox for post editor if AMP canonical disabled
add_filter( 'post_flair_disable', array( 'Jetpack_AMP_Support', 'is_amp_canonical' ), 99 );
}
static function init_filter_jetpack_widgets() {
if ( ! self::is_amp_request() ) {
return;
}
// widgets
add_filter( 'jetpack_widgets_to_include', array( 'Jetpack_AMP_Support', 'filter_available_widgets' ) );
}
static function is_amp_canonical() {
return function_exists( 'amp_is_canonical' ) && amp_is_canonical();
}
static function is_amp_request() {
// can't use is_amp_endpoint() since it's not ready early enough in init.
// is_amp_endpoint() implementation calls is_feed, which bails with a notice if plugins_loaded isn't finished
// "Conditional query tags do not work before the query is run"
$is_amp_request =
defined( 'AMP__VERSION' )
&&
! is_admin() // this is necessary so that modules can still be enabled/disabled/configured as per normal via Jetpack admin
&&
function_exists( 'amp_is_canonical' ) // this is really just testing if the plugin exists
&&
(
amp_is_canonical()
||
isset( $_GET[ amp_get_slug() ] )
||
( version_compare( AMP__VERSION, '1.0', '<' ) && self::has_amp_suffix() ) // after AMP 1.0, the amp suffix will no longer be supported
);
/**
* Returns true if the current request should return valid AMP content.
*
* @since 6.2.0
*
* @param boolean $is_amp_request Is this request supposed to return valid AMP content?
*/
return apply_filters( 'jetpack_is_amp_request', $is_amp_request );
}
static function has_amp_suffix() {
$request_path = wp_parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );
return $request_path && preg_match( '#/amp/?$#i', $request_path );
}
static function filter_available_widgets( $widgets ) {
if ( self::is_amp_request() ) {
$widgets = array_filter( $widgets, array( 'Jetpack_AMP_Support', 'is_supported_widget' ) );
}
return $widgets;
}
static function is_supported_widget( $widget_path ) {
return substr( $widget_path, -14 ) !== '/milestone.php';
}
static function amp_disable_the_content_filters() {
if ( defined( 'WPCOM') && WPCOM ) {
add_filter( 'videopress_show_2015_player', '__return_true' );
add_filter( 'protected_embeds_use_form_post', '__return_false' );
remove_filter( 'the_title', 'widont' );
}
remove_filter( 'pre_kses', array( 'Filter_Embedded_HTML_Objects', 'filter' ), 11 );
remove_filter( 'pre_kses', array( 'Filter_Embedded_HTML_Objects', 'maybe_create_links' ), 100 );
}
/**
* Add Jetpack stats pixel.
*
* @since 6.2.1
*/
static function add_stats_pixel() {
if ( ! has_action( 'wp_footer', 'stats_footer' ) ) {
return;
}
stats_render_amp_footer( stats_build_view_data() );
}
/**
* Add publisher and image metadata to legacy AMP post.
*
* @since 6.2.0
*
* @param array $metadata Metadata array.
* @param WP_Post $post Post.
* @return array Modified metadata array.
*/
static function amp_post_template_metadata( $metadata, $post ) {
if ( isset( $metadata['publisher'] ) && ! isset( $metadata['publisher']['logo'] ) ) {
$metadata = self::add_site_icon_to_metadata( $metadata );
}
if ( ! isset( $metadata['image'] ) ) {
$metadata = self::add_image_to_metadata( $metadata, $post );
}
return $metadata;
}
/**
* Add blavatar to legacy AMP post metadata.
*
* @since 6.2.0
*
* @param array $metadata Metadata.
* @return array Metadata.
*/
static function add_site_icon_to_metadata( $metadata ) {
$size = 60;
if ( function_exists( 'blavatar_domain' ) ) {
$metadata['publisher']['logo'] = array(
'@type' => 'ImageObject',
'url' => blavatar_url( blavatar_domain( site_url() ), 'img', $size, self::staticize_subdomain( 'https://wordpress.com/i/favicons/apple-touch-icon-60x60.png' ) ),
'width' => $size,
'height' => $size,
);
} else if ( $site_icon_url = Jetpack_Sync_Functions::site_icon_url( $size ) ) {
$metadata['publisher']['logo'] = array(
'@type' => 'ImageObject',
'url' => $site_icon_url,
'width' => $size,
'height' => $size,
);
}
return $metadata;
}
/**
* Add image to legacy AMP post metadata.
*
* @since 6.2.0
*
* @param array $metadata Metadata.
* @param WP_Post $post Post.
* @return array Metadata.
*/
static function add_image_to_metadata( $metadata, $post ) {
$image = Jetpack_PostImages::get_image( $post->ID, array(
'fallback_to_avatars' => true,
'avatar_size' => 200,
// AMP already attempts these.
'from_thumbnail' => false,
'from_attachment' => false,
) );
if ( empty( $image ) ) {
return self::add_fallback_image_to_metadata( $metadata );
}
if ( ! isset( $image['src_width'] ) ) {
$dimensions = self::extract_image_dimensions_from_getimagesize( array(
$image['src'] => false,
) );
if ( false !== $dimensions[ $image['src'] ] ) {
$image['src_width'] = $dimensions['width'];
$image['src_height'] = $dimensions['height'];
}
}
$metadata['image'] = array(
'@type' => 'ImageObject',
'url' => $image['src'],
'width' => $image['src_width'],
'height' => $image['src_height'],
);
return $metadata;
}
/**
* Add fallback image to legacy AMP post metadata.
*
* @since 6.2.0
*
* @param array $metadata Metadata.
* @return array Metadata.
*/
static function add_fallback_image_to_metadata( $metadata ) {
/** This filter is documented in functions.opengraph.php */
$default_image = apply_filters( 'jetpack_open_graph_image_default', 'https://wordpress.com/i/blank.jpg' );
$metadata['image'] = array(
'@type' => 'ImageObject',
'url' => self::staticize_subdomain( $default_image ),
'width' => 200,
'height' => 200,
);
return $metadata;
}
static function staticize_subdomain( $domain ) {
// deal with WPCOM vs Jetpack
if ( function_exists( 'staticize_subdomain' ) ) {
return staticize_subdomain( $domain );
} else {
return Jetpack::staticize_subdomain( $domain );
}
}
/**
* Extract image dimensions via wpcom/imagesize, only on WPCOM
*
* @since 6.2.0
*
* @param array $dimensions Dimensions.
* @return array Dimensions.
*/
static function extract_image_dimensions_from_getimagesize( $dimensions ) {
if ( ! ( defined('WPCOM') && WPCOM && function_exists( 'require_lib' ) ) ) {
return $dimensions;
}
require_lib( 'wpcom/imagesize' );
foreach ( $dimensions as $url => $value ) {
if ( is_array( $value ) ) {
continue;
}
$result = wpcom_getimagesize( $url );
if ( is_array( $result ) ) {
$dimensions[ $url ] = array(
'width' => $result[0],
'height' => $result[1],
);
}
}
return $dimensions;
}
static function amp_post_jetpack_og_tags() {
Jetpack::init()->check_open_graph();
if ( function_exists( 'jetpack_og_tags' ) ) {
jetpack_og_tags();
}
}
static function videopress_enable_freedom_mode( $options ) {
$options['freedom'] = true;
return $options;
}
static function render_sharing_html( $markup, $sharing_enabled ) {
remove_action( 'wp_footer', 'sharing_add_footer' );
if ( empty( $sharing_enabled ) ) {
return $markup;
}
$supported_services = array(
'facebook' => array(
/** This filter is documented in modules/sharedaddy/sharing-sources.php */
'data-param-app_id' => apply_filters( 'jetpack_sharing_facebook_app_id', '249643311490' ),
),
'twitter' => array(),
'pinterest' => array(),
'whatsapp' => array(),
'google-plus-1' => array(
'type' => 'gplus',
),
'tumblr' => array(),
'linkedin' => array(),
);
$sharing_links = array();
foreach ( $sharing_enabled['visible'] as $id => $service ) {
if ( ! isset( $supported_services[ $id ] ) ) {
$sharing_links[] = "<!-- not supported: $id -->";
continue;
}
$args = array_merge(
array(
'type' => $id,
),
$supported_services[ $id ]
);
$sharing_link = '<amp-social-share';
foreach ( $args as $key => $value ) {
$sharing_link .= sprintf( ' %s="%s"', sanitize_key( $key ), esc_attr( $value ) );
}
$sharing_link .= '></amp-social-share>';
$sharing_links[] = $sharing_link;
}
return preg_replace( '#(?<=<div class="sd-content">).+?(?=</div>)#s', implode( '', $sharing_links ), $markup );
}
}
add_action( 'init', array( 'Jetpack_AMP_Support', 'init' ), 1 );
add_action( 'admin_init', array( 'Jetpack_AMP_Support', 'admin_init' ), 1 );
// this is necessary since for better or worse Jetpack modules and widget files are loaded during plugins_loaded, which means we must
// take the opportunity to intercept initialisation before that point, either by adding explicit detection into the module,
// or preventing it from loading in the first place (better for performance)
add_action( 'plugins_loaded', array( 'Jetpack_AMP_Support', 'init_filter_jetpack_widgets' ), 1 );

View File

@@ -0,0 +1,143 @@
<?php
/**
* Provides methods for dealing with module overrides.
*
* @since 5.9.0
*/
class Jetpack_Modules_Overrides {
/**
* Used to cache module overrides so that we minimize how many times we appy the
* option_jetpack_active_modules filter.
*
* @var null|array
*/
private $overrides = null;
/**
* Clears the $overrides member used for caching.
*
* Since get_overrides() can be passed a falsey value to skip caching, this is probably
* most useful for clearing cache between tests.
*
* @return void
*/
public function clear_cache() {
$this->overrides = null;
}
/**
* Returns true if there is a filter on the jetpack_active_modules option.
*
* @return bool Whether there is a filter on the jetpack_active_modules option.
*/
public function do_overrides_exist() {
return (bool) ( has_filter( 'option_jetpack_active_modules' ) || has_filter( 'jetpack_active_modules' ) );
}
/**
* Gets the override for a given module.
*
* @param string $module_slug The module's slug.
* @param boolean $use_cache Whether or not cached overrides should be used.
*
* @return bool|string False if no override for module. 'active' or 'inactive' if there is an override.
*/
public function get_module_override( $module_slug, $use_cache = true ) {
$overrides = $this->get_overrides( $use_cache );
if ( ! isset( $overrides[ $module_slug ] ) ) {
return false;
}
return $overrides[ $module_slug ];
}
/**
* Returns an array of module overrides where the key is the module slug and the value
* is true if the module is forced on and false if the module is forced off.
*
* @param bool $use_cache Whether or not cached overrides should be used.
*
* @return array The array of module overrides.
*/
public function get_overrides( $use_cache = true ) {
if ( $use_cache && ! is_null( $this->overrides ) ) {
return $this->overrides;
}
if ( ! $this->do_overrides_exist() ) {
return array();
}
$available_modules = Jetpack::get_available_modules();
/**
* First, let's get all modules that have been forced on.
*/
/** This filter is documented in wp-includes/option.php */
$filtered = apply_filters( 'option_jetpack_active_modules', array() );
/** This filter is documented in class.jetpack.php */
$filtered = apply_filters( 'jetpack_active_modules', $filtered );
$forced_on = array_diff( $filtered, array() );
/**
* Second, let's get all modules forced off.
*/
/** This filter is documented in wp-includes/option.php */
$filtered = apply_filters( 'option_jetpack_active_modules', $available_modules );
/** This filter is documented in class.jetpack.php */
$filtered = apply_filters( 'jetpack_active_modules', $filtered );
$forced_off = array_diff( $available_modules, $filtered );
/**
* Last, build the return value.
*/
$return_value = array();
foreach ( $forced_on as $on ) {
$return_value[ $on ] = 'active';
}
foreach ( $forced_off as $off ) {
$return_value[ $off ] = 'inactive';
}
$this->overrides = $return_value;
return $return_value;
}
/**
* A reference to an instance of this class.
*
* @var Jetpack_Modules_Overrides
*/
private static $instance = null;
/**
* Returns the singleton instance of Jetpack_Modules_Overrides
*
* @return Jetpack_Modules_Overrides
*/
public static function instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new Jetpack_Modules_Overrides();
}
return self::$instance;
}
/**
* Private construct to enforce singleton.
*/
private function __construct() {
}
}
Jetpack_Modules_Overrides::instance();

View File

@@ -0,0 +1,19 @@
<?php
/**
* Checks if the search module is active, and if so, will initialize the singleton instance
* of Jetpack_Search_Debug_Bar and add it to the array of debug bar panels.
*
* @param array $panels The array of debug bar panels.
* @return array $panel The array of debug bar panels with our added panel.
*/
function init_jetpack_search_debug_bar( $panels ) {
if ( ! Jetpack::is_module_active( 'search' ) ) {
return $panels;
}
require_once dirname( __FILE__ ) . '/debug-bar/class.jetpack-search-debug-bar.php';
$panels[] = Jetpack_Search_Debug_Bar::instance();
return $panels;
}
add_filter( 'debug_bar_panels', 'init_jetpack_search_debug_bar' );

View File

@@ -0,0 +1,154 @@
<?php
/**
* Singleton class instantiated by Jetpack_Searc_Debug_Bar::instance() that handles
* rendering the Jetpack Search debug bar menu item and panel.
*/
class Jetpack_Search_Debug_Bar extends Debug_Bar_Panel {
/**
* Holds singleton instance
*
* @var Jetpack_Search_Debug_Bar
*/
protected static $instance = null;
/**
* The title to use in the debug bar navigation
*
* @var string
*/
public $title;
/**
* Constructor
*/
public function __construct() {
$this->title( esc_html__( 'Jetpack Search', 'jetpack' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
}
/**
* Returns the singleton instance of Jetpack_Search_Debug_Bar
*
* @return Jetpack_Search_Debug_Bar
*/
public static function instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new Jetpack_Search_Debug_Bar();
}
return self::$instance;
}
/**
* Enqueues styles for our panel in the debug bar
*
* @return void
*/
public function enqueue_scripts() {
wp_enqueue_style(
'jetpack-search-debug-bar',
plugins_url( '3rd-party/debug-bar/debug-bar.css', JETPACK__PLUGIN_FILE )
);
wp_enqueue_script(
'jetpack-search-debug-bar',
plugins_url( '3rd-party/debug-bar/debug-bar.js', JETPACK__PLUGIN_FILE ),
array( 'jquery' )
);
}
/**
* Should the Jetpack Search Debug Bar show?
*
* Since we've previously done a check for the search module being activated, let's just return true.
* Later on, we can update this to only show when `is_search()` is true.
*
* @return boolean
*/
public function is_visible() {
return true;
}
/**
* Renders the panel content
*
* @return void
*/
public function render() {
if ( ! class_exists( 'Jetpack_Search' ) ) {
return;
}
$jetpack_search = Jetpack_Search::instance();
$last_query_info = $jetpack_search->get_last_query_info();
// If not empty, let's reshuffle the order of some things.
if ( ! empty( $last_query_info ) ) {
$args = $last_query_info['args'];
$response = $last_query_info['response'];
$response_code = $last_query_info['response_code'];
unset( $last_query_info['args'] );
unset( $last_query_info['response'] );
unset( $last_query_info['response_code'] );
if ( is_null( $last_query_info['es_time'] ) ) {
$last_query_info['es_time'] = esc_html_x(
'cache hit',
'displayed in search results when results are cached',
'jetpack'
);
}
$temp = array_merge(
array( 'response_code' => $response_code ),
array( 'args' => $args ),
$last_query_info,
array( 'response' => $response )
);
$last_query_info = $temp;
}
?>
<div class="jetpack-search-debug-bar">
<h2><?php esc_html_e( 'Last query information:', 'jetpack' ); ?></h2>
<?php if ( empty( $last_query_info ) ) : ?>
<?php echo esc_html_x( 'None', 'Text displayed when there is no information', 'jetpack' ); ?>
<?php
else :
foreach ( $last_query_info as $key => $info ) :
?>
<h3><?php echo esc_html( $key ); ?></h3>
<?php
if ( 'response' !== $key && 'args' !== $key ) :
?>
<pre><?php print_r( esc_html( $info ) ); ?></pre>
<?php
else :
$this->render_json_toggle( $info );
endif;
?>
<?php
endforeach;
endif;
?>
</div><!-- Closes .jetpack-search-debug-bar -->
<?php
}
/**
* Responsible for rendering the HTML necessary for the JSON toggle
*
* @param array $value The resonse from the API as an array.
* @return void
*/
public function render_json_toggle( $value ) {
?>
<div class="json-toggle-wrap">
<pre class="json"><?php echo wp_json_encode( $value ); ?></pre>
<span class="pretty toggle"><?php echo esc_html_x( 'Pretty', 'label for formatting JSON', 'jetpack' ); ?></span>
<span class="ugly toggle"><?php echo esc_html_x( 'Minify', 'label for formatting JSON', 'jetpack' ); ?></span>
</div>
<?php
}
}

View File

@@ -0,0 +1,56 @@
.jetpack-search-debug-bar h2,
.qm-debug-bar-output .jetpack-search-debug-bar h2 {
float: none !important;
padding: 0 !important;
text-align: left !important;
}
.qm-debug-bar-output .jetpack-search-debug-bar h2 {
margin-top: 1em !important;
}
.qm-debug-bar-output .jetpack-search-debug-bar h2:first-child {
margin-top: .5em !important;
}
.debug-menu-target h3 {
padding-top: 0
}
.jetpack-search-debug-output-toggle .print-r {
display: none;
}
.json-toggle-wrap {
position: relative;
}
.json-toggle-wrap .toggle {
position: absolute;
bottom: 10px;
right: 10px;
background: #fff;
border: 1px solid #000;
cursor: pointer;
padding: 2px 4px;
}
.json-toggle-wrap .ugly {
display: none;
}
.json-toggle-wrap.pretty .pretty {
display: none;
}
.json-toggle-wrap.pretty .ugly {
display: inline;
}
.jetpack-search-debug-bar pre {
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}

View File

@@ -0,0 +1,22 @@
/* global jQuery, JSON */
( function( $ ) {
$( document ).ready( function() {
$( '.jetpack-search-debug-bar .json-toggle-wrap .toggle' ).click( function() {
var t = $( this ),
wrap = t.closest( '.json-toggle-wrap' ),
pre = wrap.find( 'pre' ),
content = pre.text(),
isPretty = wrap.hasClass( 'pretty' );
if ( ! isPretty ) {
pre.text( JSON.stringify( JSON.parse( content ), null, 2 ) );
} else {
content.replace( '\t', '' ).replace( '\n', '' ).replace( ' ', '' );
pre.text( JSON.stringify( JSON.parse( content ) ) );
}
wrap.toggleClass( 'pretty' );
} );
} );
} )( jQuery );

View File

@@ -0,0 +1,113 @@
<?php
/**
* Class Jetpack_3rd_Party_Domain_Mapping
*
* This class contains methods that are used to provide compatibility between Jetpack sync and domain mapping plugins.
*/
class Jetpack_3rd_Party_Domain_Mapping {
/**
* @var Jetpack_3rd_Party_Domain_Mapping
**/
private static $instance = null;
/**
* An array of methods that are used to hook the Jetpack sync filters for home_url and site_url to a mapping plugin.
*
* @var array
*/
static $test_methods = array(
'hook_wordpress_mu_domain_mapping',
'hook_wpmu_dev_domain_mapping'
);
static function init() {
if ( is_null( self::$instance ) ) {
self::$instance = new Jetpack_3rd_Party_Domain_Mapping;
}
return self::$instance;
}
private function __construct() {
add_action( 'plugins_loaded', array( $this, 'attempt_to_hook_domain_mapping_plugins' ) );
}
/**
* This function is called on the plugins_loaded action and will loop through the $test_methods
* to try and hook a domain mapping plugin to the Jetpack sync filters for the home_url and site_url callables.
*/
function attempt_to_hook_domain_mapping_plugins() {
if ( ! Jetpack_Constants::is_defined( 'SUNRISE' ) ) {
return;
}
$hooked = false;
$count = count( self::$test_methods );
for ( $i = 0; $i < $count && ! $hooked; $i++ ) {
$hooked = call_user_func( array( $this, self::$test_methods[ $i ] ) );
}
}
/**
* This method will test for a constant and function that are known to be used with Donncha's WordPress MU
* Domain Mapping plugin. If conditions are met, we hook the domain_mapping_siteurl() function to Jetpack sync
* filters for home_url and site_url callables.
*
* @return bool
*/
function hook_wordpress_mu_domain_mapping() {
if ( ! Jetpack_Constants::is_defined( 'SUNRISE_LOADED' ) || ! $this->function_exists( 'domain_mapping_siteurl' ) ) {
return false;
}
add_filter( 'jetpack_sync_home_url', 'domain_mapping_siteurl' );
add_filter( 'jetpack_sync_site_url', 'domain_mapping_siteurl' );
return true;
}
/**
* This method will test for a class and method known to be used in WPMU Dev's domain mapping plugin. If the
* method exists, then we'll hook the swap_to_mapped_url() to our Jetpack sync filters for home_url and site_url.
*
* @return bool
*/
function hook_wpmu_dev_domain_mapping() {
if ( ! $this->class_exists( 'domain_map' ) || ! $this->method_exists( 'domain_map', 'utils' ) ) {
return false;
}
$utils = $this->get_domain_mapping_utils_instance();
add_filter( 'jetpack_sync_home_url', array( $utils, 'swap_to_mapped_url' ) );
add_filter( 'jetpack_sync_site_url', array( $utils, 'swap_to_mapped_url' ) );
return true;
}
/*
* Utility Methods
*
* These methods are very minimal, and in most cases, simply pass on arguments. Why create them you ask?
* So that we can test.
*/
public function method_exists( $class, $method ) {
return method_exists( $class, $method );
}
public function class_exists( $class ) {
return class_exists( $class );
}
public function function_exists( $function ) {
return function_exists( $function );
}
public function get_domain_mapping_utils_instance() {
return domain_map::utils();
}
}
Jetpack_3rd_Party_Domain_Mapping::init();

View File

@@ -0,0 +1,7 @@
<?php
class Jetpack_Sync {
static function sync_options() {
_deprecated_function( __METHOD__, 'jetpack-4.2', 'jetpack_options_whitelist filter' );
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* Prevent qTranslate X from redirecting REST calls.
*
* @since 5.3
*
* @param string $url_lang Language URL to redirect to.
* @param string $url_orig Original URL.
* @param array $url_info Pieces of original URL.
*
* @return bool
*/
function jetpack_no_qtranslate_rest_url_redirect( $url_lang, $url_orig, $url_info ) {
if ( false !== strpos( $url_info['wp-path'], 'wp-json/jetpack' ) ) {
return false;
}
return $url_lang;
}
add_filter( 'qtranslate_language_detect_redirect', 'jetpack_no_qtranslate_rest_url_redirect', 10, 3 );

View File

@@ -0,0 +1,42 @@
<?php
/**
* Notify user that VaultPress has been disabled. Hide VaultPress notice that requested attention.
*
* @since 5.8
*/
function jetpack_vaultpress_rewind_enabled_notice() {
// The deactivation is performed here because there may be pages that admin_init runs on,
// such as admin_ajax, that could deactivate the plugin without showing this notification.
deactivate_plugins( 'vaultpress/vaultpress.php' );
// Remove WP core notice that says that the plugin was activated.
if ( isset( $_GET['activate'] ) ) {
unset( $_GET['activate'] );
}
?>
<div class="notice notice-success vp-deactivated">
<h2 style="margin-bottom: 0.25em;"><?php _e( 'Jetpack is now handling your backups.', 'jetpack' ); ?></h2>
<p><?php _e( 'VaultPress is no longer needed and has been deactivated.', 'jetpack' ); ?></p>
</div>
<style>#vp-notice{display:none;}</style>
<?php
}
/**
* If Rewind is enabled, remove its entry in sidebar, deactivate VaultPress, and show a notification.
*
* @since 5.8
*/
function jetpack_vaultpress_rewind_check() {
if ( Jetpack::is_active() &&
Jetpack::is_plugin_active( 'vaultpress/vaultpress.php' ) &&
Jetpack::is_rewind_enabled()
) {
remove_submenu_page( 'jetpack', 'vaultpress' );
add_action( 'admin_notices', 'jetpack_vaultpress_rewind_enabled_notice' );
}
}
add_action( 'admin_init', 'jetpack_vaultpress_rewind_check', 11 );

View File

@@ -0,0 +1,133 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class WC_Services_Installer {
/**
* @var Jetpack
**/
private $jetpack;
/**
* @var WC_Services_Installer
**/
private static $instance = null;
static function init() {
if ( is_null( self::$instance ) ) {
self::$instance = new WC_Services_Installer();
}
return self::$instance;
}
public function __construct() {
$this->jetpack = Jetpack::init();
add_action( 'admin_init', array( $this, 'add_error_notice' ) );
add_action( 'admin_init', array( $this, 'try_install' ) );
}
/**
* Verify the intent to install WooCommerce Services, and kick off installation.
*/
public function try_install() {
if ( ! isset( $_GET['wc-services-action'] ) ) {
return;
}
check_admin_referer( 'wc-services-install' );
$result = false;
switch ( $_GET['wc-services-action'] ) {
case 'install':
if ( current_user_can( 'install_plugins' ) ) {
$this->jetpack->stat( 'jitm', 'wooservices-install-' . JETPACK__VERSION );
$result = $this->install();
if ( $result ) {
$result = $this->activate();
}
}
break;
case 'activate':
if ( current_user_can( 'activate_plugins' ) ) {
$this->jetpack->stat( 'jitm', 'wooservices-activate-' . JETPACK__VERSION );
$result = $this->activate();
}
break;
}
$redirect = isset( $_GET['redirect'] ) ? admin_url( $_GET['redirect'] ) : wp_get_referer();
if ( $result ) {
$this->jetpack->stat( 'jitm', 'wooservices-activated-' . JETPACK__VERSION );
} else {
$redirect = add_query_arg( 'wc-services-install-error', true, $redirect );
}
wp_safe_redirect( $redirect );
exit;
}
/**
* Set up installation error admin notice.
*/
public function add_error_notice() {
if ( ! empty( $_GET['wc-services-install-error'] ) ) {
add_action( 'admin_notices', array( $this, 'error_notice' ) );
}
}
/**
* Notify the user that the installation of WooCommerce Services failed.
*/
public function error_notice() {
?>
<div class="notice notice-error is-dismissible">
<p><?php _e( 'There was an error installing WooCommerce Services.', 'jetpack' ); ?></p>
</div>
<?php
}
/**
* Download and install the WooCommerce Services plugin.
*
* @return bool result of installation
*/
private function install() {
include_once( ABSPATH . '/wp-admin/includes/admin.php' );
include_once( ABSPATH . '/wp-admin/includes/plugin-install.php' );
include_once( ABSPATH . '/wp-admin/includes/plugin.php' );
include_once( ABSPATH . '/wp-admin/includes/class-wp-upgrader.php' );
include_once( ABSPATH . '/wp-admin/includes/class-plugin-upgrader.php' );
$api = plugins_api( 'plugin_information', array( 'slug' => 'woocommerce-services' ) );
if ( is_wp_error( $api ) ) {
return false;
}
$upgrader = new Plugin_Upgrader( new Automatic_Upgrader_Skin() );
$result = $upgrader->install( $api->download_link );
return true === $result;
}
/**
* Activate the WooCommerce Services plugin.
*
* @return bool result of activation
*/
private function activate() {
$result = activate_plugin( 'woocommerce-services/woocommerce-services.php' );
// activate_plugin() returns null on success
return is_null( $result );
}
}
WC_Services_Installer::init();

View File

@@ -0,0 +1,95 @@
<?php
/**
* This file contains compatibility functions for WooCommerce to improve Jetpack feature support.
*/
add_action( 'woocommerce_init', 'jetpack_woocommerce_integration' );
function jetpack_woocommerce_integration() {
/**
* Double check WooCommerce exists - unlikely to fail due to the hook being used but better safe than sorry.
*/
if ( ! class_exists( 'WooCommerce' ) ) {
return;
}
add_action( 'woocommerce_share', 'jetpack_woocommerce_social_share_icons', 10 );
/**
* Wrap in function exists check since this requires WooCommerce 3.3+.
*/
if ( function_exists( 'wc_get_default_products_per_row' ) ) {
add_filter( 'infinite_scroll_render_callbacks', 'jetpack_woocommerce_infinite_scroll_render_callback', 10 );
add_action( 'wp_enqueue_scripts', 'jetpack_woocommerce_infinite_scroll_style', 10 );
}
}
/*
* Make sure the social sharing icons show up under the product's short description
*/
function jetpack_woocommerce_social_share_icons() {
if ( function_exists( 'sharing_display' ) ) {
remove_filter( 'the_content', 'sharing_display', 19 );
remove_filter( 'the_excerpt', 'sharing_display', 19 );
echo sharing_display();
}
}
/**
* Remove sharing display from account, cart, and checkout pages in WooCommerce.
*/
function jetpack_woocommerce_remove_share() {
/**
* Double check WooCommerce exists - unlikely to fail due to the hook being used but better safe than sorry.
*/
if ( ! class_exists( 'WooCommerce' ) ) {
return;
}
if ( is_cart() || is_checkout() || is_account_page() ) {
remove_filter( 'the_content', 'sharing_display', 19 );
if ( class_exists( 'Jetpack_Likes' ) ) {
remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );
}
}
}
add_action( 'loop_start', 'jetpack_woocommerce_remove_share' );
/**
* Add a callback for WooCommerce product rendering in infinite scroll.
*
* @param array $callbacks
* @return array
*/
function jetpack_woocommerce_infinite_scroll_render_callback( $callbacks ) {
$callbacks[] = 'jetpack_woocommerce_infinite_scroll_render';
return $callbacks;
}
/**
* Add a default renderer for WooCommerce products within infinite scroll.
*/
function jetpack_woocommerce_infinite_scroll_render() {
if ( ! is_shop() && ! is_product_taxonomy() && ! is_product_category() && ! is_product_tag() ) {
return;
}
woocommerce_product_loop_start();
while ( have_posts() ) {
the_post();
wc_get_template_part( 'content', 'product' );
}
woocommerce_product_loop_end();
}
/**
* Basic styling when infinite scroll is active only.
*/
function jetpack_woocommerce_infinite_scroll_style() {
$custom_css = "
.infinite-scroll .woocommerce-pagination {
display: none;
}";
wp_add_inline_style( 'woocommerce-layout', $custom_css );
}

View File

@@ -0,0 +1,62 @@
<?php
/**
* Only load these if WPML plugin is installed and active.
*/
/**
* Load routines only if WPML is loaded.
*
* @since 4.4.0
*/
function wpml_jetpack_init() {
add_action( 'jetpack_widget_get_top_posts', 'wpml_jetpack_widget_get_top_posts', 10, 3 );
add_filter( 'grunion_contact_form_field_html', 'grunion_contact_form_field_html_filter', 10, 3 );
}
add_action( 'wpml_loaded', 'wpml_jetpack_init' );
/**
* Filter the Top Posts and Pages by language.
*
* @param array $posts Array of the most popular posts.
* @param array $post_ids Array of Post IDs.
* @param string $count Number of Top Posts we want to display.
*
* @return array
*/
function wpml_jetpack_widget_get_top_posts( $posts, $post_ids, $count ) {
global $sitepress;
foreach ( $posts as $k => $post ) {
$lang_information = wpml_get_language_information( $post['post_id'] );
if ( ! is_wp_error( $lang_information ) ) {
$post_language = substr( $lang_information['locale'], 0, 2 );
if ( $post_language !== $sitepress->get_current_language() ) {
unset( $posts[ $k ] );
}
}
}
return $posts;
}
/**
* Filter the HTML of the Contact Form and output the one requested by language.
*
* @param string $r Contact Form HTML output.
* @param string $field_label Field label.
* @param int|null $id Post ID.
*
* @return string
*/
function grunion_contact_form_field_html_filter( $r, $field_label, $id ){
global $sitepress;
if ( function_exists( 'icl_translate' ) ) {
if ( $sitepress->get_current_language() !== $sitepress->get_default_language() ) {
$label_translation = icl_translate( 'jetpack ', $field_label . '_label', $field_label );
$r = str_replace( $field_label, $label_translation, $r );
}
}
return $r;
}

View File

@@ -0,0 +1,28 @@
# Contributor Code of Conduct
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
* Other unethical or unprofessional conduct
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by emailing a project maintainer via [this contact form](https://developer.wordpress.com/contact/?g21-subject=Code%20of%20Conduct), with a subject that includes `Code of Conduct`. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident.
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.3.0, available at [http://contributor-covenant.org/version/1/3/0/][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/3/0/

View File

@@ -0,0 +1,19 @@
var keyboardNavigation = false,
keyboardNavigationKeycodes = [ 9, 32, 37, 38, 39, 40 ]; // keyCodes for tab, space, left, up, right, down respectively
document.addEventListener( 'keydown', function( event ) {
if ( keyboardNavigation ) {
return;
}
if ( keyboardNavigationKeycodes.indexOf( event.keyCode ) !== -1 ) {
keyboardNavigation = true;
document.documentElement.classList.add( 'accessible-focus' );
}
} );
document.addEventListener( 'mouseup', function() {
if ( ! keyboardNavigation ) {
return;
}
keyboardNavigation = false;
document.documentElement.classList.remove( 'accessible-focus' );
} );

View File

@@ -0,0 +1,2 @@
/* Do not modify this file directly. It is compiled from other files. */
var keyboardNavigation=!1,keyboardNavigationKeycodes=[9,32,37,38,39,40];document.addEventListener("keydown",function(e){keyboardNavigation||-1!==keyboardNavigationKeycodes.indexOf(e.keyCode)&&(keyboardNavigation=!0,document.documentElement.classList.add("accessible-focus"))}),document.addEventListener("mouseup",function(){keyboardNavigation&&(keyboardNavigation=!1,document.documentElement.classList.remove("accessible-focus"))});

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
/* Do not modify this file directly. It is compiled from other files. */
/* jshint devel: true, onevar: false */
/* global tinyMCE, AtD_restore_if_proofreading, AtD_check, AtD_unbind_proofreader_listeners,
AtD, AtD_bind_proofreader_listeners, AtD_check_when
*/
function AtD_submit_check(t){AtD_proofread_click_count>0||(t.stopImmediatePropagation(),t.preventDefault(),"undefined"!=typeof tinyMCE&&tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden()?tinyMCE.activeEditor.execCommand("mceWritingImprovementTool",AtD_submit_check_callback):(AtD_restore_if_proofreading(),AtD_check(AtD_submit_check_callback)))}function AtD_submit_check_callback(t){if(t=Number(t||0),AtD_unbind_proofreader_listeners(),0===t||1<AtD_proofread_click_count)AtD_update_post();else if(-1===t)alert(AtD.getLang("message_server_error","There was a problem communicating with the Proofreading service. Try again in one minute.")),AtD_update_post();else{var e,i=jQuery("#original_post_status").val();e="publish"===i?AtD.getLang("dialog_confirm_post_publish","The proofreader has suggestions for this post. Are you sure you want to publish it?\n\nPress OK to publish your post, or Cancel to view the suggestions and edit your post."):AtD.getLang("dialog_confirm_post_update","The proofreader has suggestions for this post. Are you sure you want to update it?\n\nPress OK to update your post, or Cancel to view the suggestions and edit your post."),confirm(e)?AtD_update_post():(AtD_bind_proofreader_listeners(),AtD_kill_autoproofread()),jQuery("#publish").removeClass("button-primary-disabled"),jQuery("#ajax-loading").hide()}}function AtD_kill_autoproofread(){jQuery("#publish").unbind("click.AtD_submit_check")}function AtD_update_post(){"undefined"!=typeof tinyMCE&&tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden()||AtD_restore_if_proofreading(),jQuery("#publish").unbind("click.AtD_submit_check").click()}var AtD_proofread_click_count=0;jQuery(document).ready(function(t){var e=t("#original_post_status").val();"undefined"!=typeof AtD_check_when&&t("#content").length&&("publish"!==e&&AtD_check_when.onpublish||("publish"===e||"schedule"===e)&&AtD_check_when.onupdate)&&t("#publish").bind("click.AtD_submit_check",AtD_submit_check)});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
/* Do not modify this file directly. It is compiled from other files. */
jQuery(document).ready(function(t){var n="https://public-api.wordpress.com/rest/v1",e=[];!function(){t(".comment-like-count").each(function(){var n=t(this).attr("data-blog-id"),o=t(this).attr("data-comment-id");e.push("/sites/"+n+"/comments/"+o+"/likes")}),t.ajax({type:"GET",url:n+"/batch",dataType:"jsonp",data:"urls[]="+e.map(encodeURIComponent).join("&urls[]="),success:function(n){for(var e in n)if(!n[e].error_data){var o=e.split("/"),a=o[4],i=n[e].found;if(i<1)return;t("#comment-like-count-"+a).find(".like-count").hide().text(i).fadeIn()}},error:function(){}})}()});

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
/* Do not modify this file directly. It is compiled from other files. */
/* global ajaxurl */
jQuery(function(e){function n(c,t){e.post(ajaxurl,{action:"grunion_recheck_queue",offset:c,limit:t},function(e){e.processed<t?window.location.reload():n(c+t,t)})}e(document).on("click","#jetpack-check-feedback-spam:not(.button-disabled)",function(c){c.preventDefault(),e("#jetpack-check-feedback-spam:not(.button-disabled)").addClass("button-disabled"),e(".jetpack-check-feedback-spam-spinner").addClass("spinner").show(),n(0,100)})});

View File

@@ -0,0 +1,2 @@
/* Do not modify this file directly. It is compiled from other files. */
jQuery(function(t){t(".contact-form input.jp-contact-form-date").datepicker()});

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
/* Do not modify this file directly. It is compiled from other files. */
/* global grunionEditorView, tinymce */
!function(){tinymce.create("tinymce.plugins.grunion_form",{init:function(n){n.addButton("grunion",{title:grunionEditorView.labels.tinymce_label,cmd:"grunion_add_form",icon:"grunion"}),n.addCommand("grunion_add_form",function(){grunionEditorView.default_form?n.execCommand("mceInsertContent",0,"[contact-form]"+grunionEditorView.default_form+"[/contact-form]"):n.execCommand("mceInsertContent",0,"[contact-form /]")})},createControl:function(){return null},getInfo:function(){return{longname:"Grunion Contact Form",author:"Automattic",version:"1"}}}),tinymce.PluginManager.add("grunion_form",tinymce.plugins.grunion_form)}();

View File

@@ -0,0 +1,4 @@
/* Do not modify this file directly. It is compiled from other files. */
// Originally based on https://raw.githubusercontent.com/xwp/wp-custom-scss-demo/master/custom-scss-demo-preview.js
/* globals jpCustomizerCssPreview */
!function(e,s){e.settingPreviewHandlers?e.settingPreviewHandlers.custom_css=function(){}:parent.console.warn("Missing core patch that adds support for settingPreviewHandlers"),e.selectiveRefresh.partialConstructor.custom_css=e.selectiveRefresh.Partial.extend({refresh:function(){var t,r,c=this,n=e("jetpack_custom_css[preprocessor]").get();return jpCustomizerCssPreview.preprocessors.hasOwnProperty(n)?e.selectiveRefresh.Partial.prototype.refresh.call(c):(t=new s.Deferred,r=e("custom_css["+e.settings.theme.stylesheet+"]"),_.each(c.placements(),function(e){e.container.text(r.get())}),t.resolve(),t.promise())}})}(wp.customize,jQuery);

View File

@@ -0,0 +1,2 @@
/* Do not modify this file directly. It is compiled from other files. */
!function(s,t){function n(s){var n=t.control.value(s);return n?n.container:null}s(document).ready(function(){var e=n("jetpack_css_mode_control");e&&e.prepend('<span class="customize-control-title">'+window._jp_css_settings.l10n.mode+"</span>");var i=n("jetpack_mobile_css_control");i&&i.prepend('<span class="customize-control-title">'+window._jp_css_settings.l10n.mobile+"</span>");var o=n("wpcom_custom_css_content_width_control");o&&(o.append('<span class="description">'+window._jp_css_settings.l10n.contentWidth+"<span>"),o.find("input").after("<span>px</span>")),s("<div />",{id:"css-help-links",class:"css-help"}).appendTo(n("custom_css")),s("<a />",{id:"help-link",target:"_blank",href:window._jp_css_settings.cssHelpUrl,text:window._jp_css_settings.l10n.css_help_title}).prependTo("#css-help-links"),window._jp_css_settings.areThereCssRevisions&&s("<a />",{id:"revisions-link",target:"_blank",href:window._jp_css_settings.revisionsUrl,text:window._jp_css_settings.l10n.revisions}).prependTo("#css-help-links"),t("jetpack_custom_css[preprocessor]",function(s){s.bind(function(s){var n={default:"text/css",less:"text/x-less",sass:"text/x-scss"},e="text/css";void 0!==n[s]&&(e=n[s]),t.control("custom_css").deferred.codemirror.done(function(s){s.setOption("mode",e),"text/css"===e?s.setOption("lint",!0):s.setOption("lint",!1)})})})})}(jQuery,this.wp.customize);

View File

@@ -0,0 +1,2 @@
/* Do not modify this file directly. It is compiled from other files. */
!function(t,s,i){i.controlConstructor.jetpackCss=i.Control.extend({modes:{default:"text/css",less:"text/x-less",sass:"text/x-scss"},_updating:!1,ready:function(){this.opts=window._jp_css_settings,this.$input=s("<textarea />",{name:this.setting.id,class:"for-codemirror hidden"}).val(this.setting()),this.container.append(this.$input),i(this.setting.id,_.bind(function(t){var s=new i.Element(this.$input);this.elements=[s],s.sync(t),s.set(t())},this)),this.opts.useRichEditor?this.initCodeMirror():this.$input.removeClass("hidden"),i.bind("ready",_.bind(this.addLabels,this))},initCodeMirror:function(){this.editor=window.CodeMirror.fromTextArea(this.$input.get(0),{mode:this.getMode(),lineNumbers:!0,tabSize:2,indentWithTabs:!0,lineWrapping:!0}),this.addListeners()},addListeners:function(){var t=!1;s("#accordion-section-custom_css > .accordion-section-title").click(_.bind(_.debounce(this.editor.refresh,250),this.editor)),this.editor.on("focus",function(t){t.refresh()}),this.editor.on("change",_.bind(function(s){this._updating=!0,this.$input.val(s.getValue()).trigger("change"),this._updating=!1,t||(window.ga&&window.ga("send","event","Customizer","Typed Custom CSS"),t=!0)},this)),this.editor.on("focus",function(){window.ga&&window.ga("send","event","Customizer","Focused CSS Editor")}),this.setting.bind("change",_.bind(this.externalChange,this))},getMode:function(){var t=i("jetpack_custom_css[preprocessor]")();return""!==t&&this.modes[t]||(t="default"),this.modes[t]},externalChange:function(){this._updating||this.editor.setValue(this.setting())},refresh:function(t){"accordion-section-custom_css"===t&&setTimeout(_.bind(function(){this.editor.refresh()},this),300)},addLabels:function(){this.addTitle("jetpack_css_mode_control",this.opts.l10n.mode),this.addTitle("jetpack_mobile_css_control",this.opts.l10n.mobile),this.addDesc("wpcom_custom_css_content_width_control",this.opts.l10n.contentWidth);var t=this._getControl("wpcom_custom_css_content_width_control");t&&t.find("input").after("<span>px</span>"),s("<div />",{id:"css-help-links",class:"css-help"}).appendTo(this.container),s("<a />",{id:"help-link",target:"_blank",href:this.opts.cssHelpUrl,text:this.opts.l10n.css_help_title}).prependTo("#css-help-links"),this.opts.areThereCssRevisions&&s("<a />",{id:"revisions-link",target:"_blank",href:this.opts.revisionsUrl,text:this.opts.l10n.revisions}).prependTo("#css-help-links")},addTitle:function(t,s){var i=this._getControl(t);i&&i.prepend('<span class="customize-control-title">'+s+"<span>")},addDesc:function(t,s){var i=this._getControl(t);i&&i.append('<span class="description">'+s+"<span>")},_getControl:function(t){var s=i.control.value(t);return s?s.container:null}})}(this.wp,jQuery,this.wp.customize);

View File

@@ -0,0 +1,4 @@
/* Do not modify this file directly. It is compiled from other files. */
/* jshint onevar: false, smarttabs: true */
/* global postboxes, addLoadEvent */
!function(e){var s,o,c,t;c=function(){s.height(o.height()-s.offset().top-250)},t=function(){s=e("#safecss"),o=e(window),postboxes.add_postbox_toggles("editcss"),c(),e("#safecssform").on("click","#preview",function(e){e.preventDefault(),document.forms.safecssform.target="csspreview",document.forms.safecssform.action.value="preview",document.forms.safecssform.submit(),document.forms.safecssform.target="",document.forms.safecssform.action.value="save"})},window.onresize=c,addLoadEvent(t)}(jQuery),jQuery(function(e){e(".edit-preprocessor").bind("click",function(s){s.preventDefault(),e("#preprocessor-select").slideDown(),e(this).hide()}),e(".cancel-preprocessor").bind("click",function(s){s.preventDefault(),e("#preprocessor-select").slideUp(function(){e(".edit-preprocessor").show(),e("#preprocessor_choices").val(e("#custom_css_preprocessor").val())})}),e(".save-preprocessor").bind("click",function(s){s.preventDefault(),e("#preprocessor-select").slideUp(),e("#preprocessor-display").text(e("#preprocessor_choices option:selected").text()),e("#custom_css_preprocessor").val(e("#preprocessor_choices").val()).change(),e(".edit-preprocessor").show()}),e(".edit-css-mode").bind("click",function(s){s.preventDefault(),e("#css-mode-select").slideDown(),e(this).hide()}),e(".cancel-css-mode").bind("click",function(s){s.preventDefault(),e("#css-mode-select").slideUp(function(){e(".edit-css-mode").show(),e("input[name=add_to_existing_display][value="+e("#add_to_existing").val()+"]").attr("checked",!0)})}),e(".save-css-mode").bind("click",function(s){s.preventDefault(),e("#css-mode-select").slideUp(),e("#css-mode-display").text("true"==e("input[name=add_to_existing_display]:checked").val()?"Add-on":"Replacement"),e("#add_to_existing").val(e("input[name=add_to_existing_display]:checked").val()),e(".edit-css-mode").show()})});

View File

@@ -0,0 +1,3 @@
/* Do not modify this file directly. It is compiled from other files. */
/* jshint onevar: false, smarttabs: true */
!function(t){var e={modes:{default:"text/css",less:"text/x-less",sass:"text/x-scss"},init:function(){this.$textarea=t("#safecss"),this.editor=window.CodeMirror.fromTextArea(this.$textarea.get(0),{mode:this.getMode(),lineNumbers:!0,tabSize:2,indentWithTabs:!0,lineWrapping:!0}),this.setEditorHeight()},addListeners:function(){t(window).on("resize",_.bind(_.debounce(this.setEditorHeight,100),this)),this.editor.on("change",_.bind(function(t){this.$textarea.val(t.getValue())},this)),t("#preprocessor_choices").change(_.bind(function(){this.editor.setOption("mode",this.getMode())},this))},setEditorHeight:function(){var e=t("html").height()-t(this.editor.getWrapperElement()).offset().top;this.editor.setSize(null,e)},getMode:function(){var e=t("#preprocessor_choices").val();return""!==e&&this.modes[e]||(e="default"),this.modes[e]}};t(document).ready(_.bind(e.init,e))}(jQuery);

View File

@@ -0,0 +1,4 @@
/* Do not modify this file directly. It is compiled from other files. */
/* jshint onevar: false, smarttabs: true, devel: true */
/* global Jetpack_Comics_Options */
jQuery(function(o){var e={init:function(){o(document).on("dragover.jetpack-comics","body, #jetpack-comic-drop-zone",this.onDragOver),o(document).on("dragleave.jetpack-comics","body, #jetpack-comic-drop-zone",this.onDragLeave),o(document).on("drop.jetpack-comics","body, #jetpack-comic-drop-zone",this.onDrop),o("body").append(o('<div id="jetpack-comic-drop-zone"><p class="dragging" /><p class="uploading" /></div>')),o("#jetpack-comic-drop-zone").find(".dragging").text(Jetpack_Comics_Options.labels.dragging).end().find(".uploading").text(Jetpack_Comics_Options.labels.uploading).prepend(o('<span class="spinner"/>')),"FileReader"in window&&"File"in window||(o("#jetpack-comic-drop-zone .dragging").text(Jetpack_Comics_Options.labels.unsupported),o(document).off("drop.jetpack-comics").on("drop.jetpack-comics","body, #jetpack-comic-drop-zone",this.onDragLeave))},filterImageFiles:function(o){for(var e=[],n=0,a=o.length;n<a;n++)o[n].type.match(/^image\//i)&&e.push(o[n]);return e},dragTimeout:null,onDragOver:function(n){n.preventDefault(),clearTimeout(e.dragTimeout),o("body").addClass("dragging")},onDragLeave:function(){clearTimeout(e.dragTimeout),e.dragTimeout=setTimeout(function(){o("body").removeClass("dragging")},100)},onDrop:function(n){n.preventDefault(),n.stopPropagation(),n.originalEvent.stopPropagation(),n.originalEvent.preventDefault();var a=e.filterImageFiles(n.originalEvent.dataTransfer.files);if(o("body").removeClass("dragging"),0===a.length)return void alert(Jetpack_Comics_Options.labels.invalidUpload);o("body").addClass("uploading");for(var i=new FormData,t=0,r=a.length;t<r;t++)i.append("image_"+t,a[t]);o("#jetpack-comic-drop-zone .uploading .spinner").spin(),o.ajax({url:Jetpack_Comics_Options.writeURL+"&nonce="+Jetpack_Comics_Options.nonce,data:i,processData:!1,contentType:!1,type:"POST",dataType:"json",xhrFields:{withCredentials:!0}}).done(function(e){o("#jetpack-comic-drop-zone .uploading").text(Jetpack_Comics_Options.labels.processing),"url"in e?document.location.href=e.url:"error"in e&&(alert(e.error),o("body").removeClass("uploading"))}).fail(function(){alert(Jetpack_Comics_Options.labels.error)})}};e.init()});

View File

@@ -0,0 +1,3 @@
/* Do not modify this file directly. It is compiled from other files. */
/* jshint onevar: false, smarttabs: true */
!function(t){var n,a,e;e={init:function(){var i,o,r=this;return this.on("keypress.manyItemsTable",function(t){13===t.which&&(t.preventDefault(),"function"==typeof FormData&&e.submitRow.apply(r),e.addRow.apply(r))}).on("focus.manyItemsTable",":input",function(){r.data("currentRow",t(this).parents("tr:first"))}),i=this.find("tbody:last"),o=i.find("tr:first").clone(),this.data("form",this.parents("form:first")),this.data("tbody",i),this.data("row",o),this.data("currentRow",o),n=t("#nova-menu-tax"),a=t("#_wpnonce"),this},destroy:function(){return this.off(".manyItemsTable"),this},submitRow:function(){var e,i,o,r;return e=this.data("currentRow"),i=e.find(":input"),o=this.data("form").find(":input").not(i).attr("disabled",!0).end(),r=new FormData(this.data("form").get(0)),r.append("ajax","1"),r.append("nova_menu_tax",n.val()),r.append("_wpnonce",a.val()),o.attr("disabled",!1),t.ajax({url:"",type:"POST",data:r,processData:!1,contentType:!1}).complete(function(t){e.html(t.responseText)}),i.attr("disabled",!0),this},addRow:function(){var t=this.data("row").clone();return t.appendTo(this.data("tbody")),t.find(":input:first").focus(),this}},t.fn.manyItemsTable=function(n){return e[n]?e[n].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof n&&n?(t.error("Method "+n+" does not exist on jQuery.manyItemsTable"),this):e.init.apply(this,arguments)},t.fn.clickAddRow=function(){var n=this.find("tbody:last"),a=n.find("tr:first").clone();t(a).find("input, textarea").val(""),t(a).appendTo(n)}}(jQuery),jQuery(".many-items-table").one("focus",":input",function(t){jQuery(t.delegateTarget).manyItemsTable()}),jQuery(".many-items-table").on("click","a.nova-new-row",function(t){jQuery(t.delegateTarget).clickAddRow()});

View File

@@ -0,0 +1,3 @@
/* Do not modify this file directly. It is compiled from other files. */
/* jshint onevar: false, smarttabs: true, devel: true */
!function(c){var n={inputs:null,popInputs:null,initialize:function(){n.popInputs=c("#nova_menuchecklist-pop").find(":checkbox"),n.inputs=c("#nova_menuchecklist").find(":checkbox").change(n.checkOne).change(n.syncPop),n.isChecked()||n.checkFirst(),n.syncPop()},syncPop:function(){n.popInputs.each(function(){var n=c(this);n.prop("checked",c("#in-nova_menu-"+n.val()).is(":checked"))})},isChecked:function(){return n.inputs.is(":checked")},checkFirst:function(){n.inputs.first().prop("checked",!0)},checkOne:function(){return c(this).is(":checked")?n.inputs.not(this).prop("checked",!1):c(this).closest("#nova_menuchecklist").find(":checked").length>0?c(this).prop("checked",!1):n.checkFirst()}};c(n.initialize)}(jQuery);

View File

@@ -0,0 +1,4 @@
/* Do not modify this file directly. It is compiled from other files. */
/* jshint onevar: false, smarttabs: true */
/* global _novaDragDrop */
!function(n){function e(){u=n("#the-list"),t(),o(),a(),i()}function t(){u.sortable({cancel:".no-items",stop:function(n,e){if(e.item.is(":first-child"))return u.sortable("cancel");r()}})}function r(){u.find(".menu-label-row").each(function(){var e=n(this).data("term_id");n(this).nextUntil(".menu-label-row").each(function(t){var r=n(this);r.find(".menu-order-value").val(t),r.find(".nova-menu-term").val(e)})})}function a(){n(".tablenav").prepend('<input type="submit" class="button-primary button-reorder alignright" value="'+_novaDragDrop.reorder+'" name="'+_novaDragDrop.reorderName+'" />')}function o(){n("#posts-filter").append('<input type="hidden" name="'+_novaDragDrop.nonceName+'" value="'+_novaDragDrop.nonce+'" />')}function i(){n("#posts-filter").attr("method","post")}var u;n(document).ready(e)}(jQuery);

View File

@@ -0,0 +1,3 @@
/* Do not modify this file directly. It is compiled from other files. */
/* global FB, jpfbembed */
!function(e){var n=function(){var e,n;"undefined"!=typeof FB&&FB.XFBML?FB.XFBML.parse():(e=document.createElement("div"),e.id="fb-root",document.getElementsByTagName("body")[0].appendChild(e),n="//connect.facebook.net/"+jpfbembed.locale+"/sdk.js#xfbml=1",jpfbembed.appid&&(n+="&appId="+jpfbembed.appid),n+="&version=v2.3",jQuery.getScript(n))};e.fbAsyncInit=function(){FB.init({appId:jpfbembed.appid,version:"v2.3"}),FB.XFBML.parse()},"undefined"!=typeof infiniteScroll&&jQuery(document.body).on("post-load",n),n()}(this);

View File

@@ -0,0 +1,5 @@
/* Do not modify this file directly. It is compiled from other files. */
/**
* Jetpack Gallery Settings
*/
!function(e){var t=wp.media;t.view.Settings.Gallery=t.view.Settings.Gallery.extend({render:function(){var a=this.$el;return t.view.Settings.prototype.render.apply(this,arguments),a.append(t.template("jetpack-gallery-settings")),t.gallery.defaults.type="default",this.update.apply(this,["type"]),a.find("select[name=type]").on("change",function(){var t=a.find("select[name=columns]").closest("label.setting");"default"===e(this).val()||"thumbnails"===e(this).val()?t.show():t.hide()}).change(),this}})}(jQuery);

View File

@@ -0,0 +1,3 @@
/* Do not modify this file directly. It is compiled from other files. */
/* global idcL10n, jQuery, analytics, history, wpCookies */
!function(e){function i(){u.prop("disabled",!0)}function c(){u.prop("disabled",!1)}function n(){v.hide(),s("confirm_safe_mode");var n=p+"jetpack/v4/identity-crisis/confirm-safe-mode";i(),e.ajax({method:"POST",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",d)},url:n,data:{},success:function(){l.hide(),h.removeClass("hide"),window.location.search&&1===window.location.search.indexOf("page=jetpack")&&window.location.reload()},error:function(e){g="confirm",r(e),c()}})}function t(){v.hide(),s("migrate");var n=p+"jetpack/v4/identity-crisis/migrate";i(),e.ajax({method:"POST",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",d)},url:n,data:{},success:function(){l.hide(),e("body").hasClass("toplevel_page_jetpack")&&window.location.reload(!0)},error:function(e){g="migrate",r(e),c()}})}function o(){v.hide(),s("fix_connection"),l.addClass("jp-idc-show-second-step")}function a(){v.hide(),s("start_fresh");var n=p+"jetpack/v4/identity-crisis/start-fresh";i(),e.ajax({method:"POST",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",d)},url:n,data:{},success:function(e){window.location=e+"&from=idc-notice"},error:function(e){g="start-fresh",r(e),c()}})}function r(i){var c=e(".jp-idc-error__desc");i&&i.responseJSON&&i.responseJSON.message?c.html(i.responseJSON.message):c.html(""),v.css("display","flex")}function s(e,i){void 0!==i&&"object"==typeof i||(i={}),e&&e.length&&"undefined"!=typeof analytics&&analytics.tracks&&analytics.mc&&(e=e.replace(/-/g,"_"),e=0!==e.indexOf("jetpack_idc_")?"jetpack_idc_"+e:e,analytics.tracks.recordEvent(e,i),e=e.replace("jetpack_idc_",""),e=e.replace(/_/g,"-"),analytics.mc.bumpStat("jetpack-idc",e))}var d=idcL10n.nonce,f=idcL10n.currentUrl,p=idcL10n.apiRoot,l=e(".jp-idc-notice"),u=e(".jp-idc-notice .dops-button"),m=idcL10n.tracksUserData,_=idcL10n.tracksEventData,h=e("#wp-admin-bar-jetpack-idc"),j=e("#jp-idc-confirm-safe-mode-action"),k=e("#jp-idc-fix-connection-action"),w=e("#jp-idc-migrate-action"),y=e("#jp-idc-reconnect-site-action"),v=e(".jp-idc-error__notice"),g=!1;"undefined"!=typeof analytics&&analytics.initialize(m.userid,m.username),_.isAdmin?s("notice_view"):s("non_admin_notice_view",{page:_.currentScreen}),function(e){e=void 0!==e&&e,window.location.search&&-1!==window.location.search.indexOf("jetpack_idc_clear_confirmation")&&(s("clear_confirmation_clicked"),history&&history.pushState?history.pushState({},"",f):e&&(window.location.href=f))}(),l.on("click",".notice-dismiss",function(){var e="https:"===window.location.protocol;wpCookies.set("jetpack_idc_dismiss_notice","1",604800,!1,!1,e),s("non_admin_notice_dismiss",{page:_.currentScreen})}),l.on("click","#jp-idc-error__action",function(){switch(v.hide(),g){case"confirm":n();break;case"start-fresh":a();break;case"migrate":t();break;default:return}}),j.on("click",n),k.on("click",o),y.on("click",a),w.on("click",t)}(jQuery);

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More